mirror of
https://github.com/Mic92/sops-nix.git
synced 2025-03-05 16:17:47 +00:00
move all nix expressions to pkgs
This commit is contained in:
parent
0c20c6257b
commit
150afcb240
6 changed files with 48 additions and 34 deletions
40
default.nix
40
default.nix
|
@ -16,42 +16,18 @@ in rec {
|
||||||
inherit (pkgs) ssh-to-pgp;
|
inherit (pkgs) ssh-to-pgp;
|
||||||
|
|
||||||
# used in the CI only
|
# used in the CI only
|
||||||
sops-pgp-hook-test = pkgs.buildGoModule {
|
sops-pgp-hook-test = pkgs.callPackage ./pkgs/sops-pgp-hook-test.nix {
|
||||||
name = "sops-pgp-hook-test";
|
|
||||||
src = ./.;
|
|
||||||
inherit vendorSha256;
|
inherit vendorSha256;
|
||||||
buildPhase = ''
|
|
||||||
go test -c ./pkgs/sops-pgp-hook
|
|
||||||
install -D sops-pgp-hook.test $out/bin/sops-pgp-hook.test
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
unit-tests = pkgs.callPackage ./unit-tests.nix {};
|
unit-tests = pkgs.callPackage ./pkgs/unit-tests.nix {};
|
||||||
} // (pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
|
} // (pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
|
||||||
inherit sops-install-secrets;
|
inherit sops-install-secrets;
|
||||||
|
|
||||||
lint = sops-install-secrets.overrideAttrs (old: {
|
lint = pkgs.callPackage ./pkgs/lint.nix {
|
||||||
name = "golangci-lint";
|
inherit sops-install-secrets;
|
||||||
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.golangci-lint ];
|
};
|
||||||
buildPhase = ''
|
|
||||||
HOME=$TMPDIR golangci-lint run --timeout 360s
|
|
||||||
'';
|
|
||||||
doCheck = false;
|
|
||||||
installPhase = ''
|
|
||||||
touch $out $unittest
|
|
||||||
'';
|
|
||||||
fixupPhase = ":";
|
|
||||||
});
|
|
||||||
|
|
||||||
cross-build = sops-install-secrets.overrideAttrs (old: {
|
cross-build = pkgs.callPackage ./pkgs/cross-build.nix {
|
||||||
name = "cross-build";
|
inherit sops-install-secrets;
|
||||||
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.gox ];
|
};
|
||||||
buildPhase = ''
|
|
||||||
(cd pkgs/sops-install-secrets && gox -os linux)
|
|
||||||
'';
|
|
||||||
doCheck = false;
|
|
||||||
installPhase = ''
|
|
||||||
touch $out $unittest
|
|
||||||
'';
|
|
||||||
fixupPhase = ":";
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
nixpkgs.legacyPackages.${system}.callPackage ./shell.nix {}
|
nixpkgs.legacyPackages.${system}.callPackage ./shell.nix {}
|
||||||
);
|
);
|
||||||
devShells = forAllSystems (system: {
|
devShells = forAllSystems (system: {
|
||||||
unit-tests = nixpkgs.legacyPackages.${system}.callPackage ./unit-tests.nix {};
|
unit-tests = nixpkgs.legacyPackages.${system}.callPackage ./pkgs/unit-tests.nix {};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
14
pkgs/cross-build.nix
Normal file
14
pkgs/cross-build.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{ sops-install-secrets, gox }:
|
||||||
|
|
||||||
|
sops-install-secrets.overrideAttrs (old: {
|
||||||
|
name = "cross-build";
|
||||||
|
nativeBuildInputs = old.nativeBuildInputs ++ [ gox ];
|
||||||
|
buildPhase = ''
|
||||||
|
(cd pkgs/sops-install-secrets && gox -os linux)
|
||||||
|
'';
|
||||||
|
doCheck = false;
|
||||||
|
installPhase = ''
|
||||||
|
touch $out $unittest
|
||||||
|
'';
|
||||||
|
fixupPhase = ":";
|
||||||
|
})
|
13
pkgs/lint.nix
Normal file
13
pkgs/lint.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ sops-install-secrets, golangci-lint }:
|
||||||
|
sops-install-secrets.overrideAttrs (old: {
|
||||||
|
name = "golangci-lint";
|
||||||
|
nativeBuildInputs = old.nativeBuildInputs ++ [ golangci-lint ];
|
||||||
|
buildPhase = ''
|
||||||
|
HOME=$TMPDIR golangci-lint run --timeout 360s
|
||||||
|
'';
|
||||||
|
doCheck = false;
|
||||||
|
installPhase = ''
|
||||||
|
touch $out $unittest
|
||||||
|
'';
|
||||||
|
fixupPhase = ":";
|
||||||
|
})
|
11
pkgs/sops-pgp-hook-test.nix
Normal file
11
pkgs/sops-pgp-hook-test.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{ buildGoModule, vendorSha256 }:
|
||||||
|
|
||||||
|
buildGoModule {
|
||||||
|
name = "sops-pgp-hook-test";
|
||||||
|
src = ../.;
|
||||||
|
inherit vendorSha256;
|
||||||
|
buildPhase = ''
|
||||||
|
go test -c ./pkgs/sops-pgp-hook
|
||||||
|
install -D sops-pgp-hook.test $out/bin/sops-pgp-hook.test
|
||||||
|
'';
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{ pkgs ? import <nixpkgs> {}
|
{ pkgs ? import <nixpkgs> {}
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
sopsPkgs = import ./. { inherit pkgs; };
|
sopsPkgs = import ../. { inherit pkgs; };
|
||||||
in pkgs.stdenv.mkDerivation {
|
in pkgs.stdenv.mkDerivation {
|
||||||
name = "env";
|
name = "env";
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
Loading…
Add table
Reference in a new issue