1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2024-12-15 17:50:51 +00:00

Merge pull request #2 from Mic92/ci2

This commit is contained in:
Jörg Thalheim 2020-07-12 22:21:03 +01:00 committed by GitHub
commit c1b0458b23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 37 additions and 5 deletions

5
.buildkite/pipeline.yml Normal file
View file

@ -0,0 +1,5 @@
steps:
- name: "NixOS tests (unstable)"
command: "nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixpkgs-unstable.tar.gz -A sops-install-secrets.tests"
- name: "NixOS tests (20.03)"
command: "nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixpkgs-unstable.tar.gz -A sops-install-secrets.tests"

View file

@ -20,9 +20,13 @@ jobs:
- name: Setup cachix - name: Setup cachix
uses: cachix/cachix-action@v6 uses: cachix/cachix-action@v6
with: with:
name: ${{ matrix.cachixName }} name: mic92
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- name: Show nixpkgs version - name: Show nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version' run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- name: Build nix packages - name: Build nix packages
run: nix run nixpkgs.nix-build-uncached -c nix-build-uncached default.nix run: nix run nixpkgs.nix-build-uncached -c nix-build-uncached default.nix
- name: Add keys group (needed for go tests)
run: sudo groupadd keys
- name: Run go tests
run: nix-shell --run "sudo unshare --mount --fork go test ./pkgs/sops-install-secrets"

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Jörg Thalheim
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -1,6 +1,6 @@
{ pkgs ? import <nixpkgs> {} }: let { pkgs ? import <nixpkgs> {} }: let
vendorSha256 = "sha256-O0z+oEffOOZa/bn2gV9onLVbPBHsNDH2yq1CZPi8w58="; vendorSha256 = "sha256-O0z+oEffOOZa/bn2gV9onLVbPBHsNDH2yq1CZPi8w58=";
in { in rec {
sops-init-gpg-key = pkgs.callPackage ./pkgs/sops-init-gpg-key {}; sops-init-gpg-key = pkgs.callPackage ./pkgs/sops-init-gpg-key {};
sops-install-secrets = pkgs.callPackage ./pkgs/sops-install-secrets { sops-install-secrets = pkgs.callPackage ./pkgs/sops-install-secrets {
inherit vendorSha256; inherit vendorSha256;

View file

@ -5,7 +5,7 @@ with lib;
let let
cfg = config.sops; cfg = config.sops;
users = config.users.users; users = config.users.users;
sops-install-secrets = pkgs.callPackage ../../pkgs/sops-install-secrets {}; sops-install-secrets = (pkgs.callPackage ../.. {}).sops-install-secrets;
secretType = types.submodule ({ config, ... }: { secretType = types.submodule ({ config, ... }: {
options = { options = {
name = mkOption { name = mkOption {

View file

@ -1,4 +1,4 @@
{ buildGoModule, path, pkgs, vendorSha256 }: { stdenv, buildGoModule, path, pkgs, vendorSha256 }:
buildGoModule { buildGoModule {
pname = "sops-install-secrets"; pname = "sops-install-secrets";
version = "0.0.1"; version = "0.0.1";

View file

@ -1,6 +1,7 @@
{ makeTest ? import <nixpkgs/nixos/tests/make-test-python.nix>, pkgs ? import <nixpkgs> }: { makeTest ? import <nixpkgs/nixos/tests/make-test-python.nix>, pkgs ? import <nixpkgs> }:
{ {
ssh-keys = makeTest { ssh-keys = makeTest {
name = "sops-ssh-keys";
nodes.server = { ... }: { nodes.server = { ... }: {
imports = [ ../../modules/sops ]; imports = [ ../../modules/sops ];
services.openssh.enable = true; services.openssh.enable = true;
@ -21,7 +22,8 @@
inherit pkgs; inherit pkgs;
}; };
gpg-keys = makeTest { pgp-keys = makeTest {
name = "sops-pgp-keys";
nodes.server = { pkgs, lib, ... }: { nodes.server = { pkgs, lib, ... }: {
imports = [ ../../modules/sops ]; imports = [ ../../modules/sops ];
sops.gnupgHome = "/run/gpghome"; sops.gnupgHome = "/run/gpghome";