mirror of
https://github.com/ryantm/agenix.git
synced 2024-11-22 01:30:48 +03:00
Revert "Revert "contrib: add direct tests for agenix ""
This reverts commit 08dc5068e6
.
This commit is contained in:
parent
457669db42
commit
bc24f2e510
2 changed files with 46 additions and 24 deletions
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
|
@ -9,7 +9,9 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: cachix/install-nix-action@v22
|
- uses: cachix/install-nix-action@v22
|
||||||
with:
|
with:
|
||||||
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"
|
extra_nix_config: |
|
||||||
|
system-features = nixos-test recursive-nix benchmark big-parallel kvm
|
||||||
|
extra-experimental-features = recursive-nix nix-command flakes
|
||||||
- run: nix build
|
- run: nix build
|
||||||
- run: nix build .#doc
|
- run: nix build .#doc
|
||||||
- run: nix fmt . -- --check
|
- run: nix fmt . -- --check
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
substituteAll,
|
substituteAll,
|
||||||
ageBin ? "${age}/bin/age",
|
ageBin ? "${age}/bin/age",
|
||||||
shellcheck,
|
shellcheck,
|
||||||
}:
|
}: let
|
||||||
|
bin = "${placeholder "out"}/bin/agenix";
|
||||||
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "agenix";
|
pname = "agenix";
|
||||||
version = "0.15.0";
|
version = "0.15.0";
|
||||||
|
@ -22,15 +24,33 @@ stdenv.mkDerivation rec {
|
||||||
src = ./agenix.sh;
|
src = ./agenix.sh;
|
||||||
};
|
};
|
||||||
dontUnpack = true;
|
dontUnpack = true;
|
||||||
|
doInstallCheck = true;
|
||||||
|
installCheckInputs = [shellcheck];
|
||||||
|
postInstallCheck = ''
|
||||||
|
shellcheck ${bin}
|
||||||
|
${bin} -h | grep ${version}
|
||||||
|
|
||||||
doCheck = true;
|
mkdir -p /tmp/home/.ssh
|
||||||
checkInputs = [shellcheck];
|
cp -r "${../example}" /tmp/home/secrets
|
||||||
postCheck = ''
|
chmod -R u+rw /tmp/home/secrets
|
||||||
shellcheck $src
|
export HOME=/tmp/home
|
||||||
|
(
|
||||||
|
umask u=rw,g=r,o=r
|
||||||
|
cp ${../example_keys/user1.pub} $HOME/.ssh/id_ed25519.pub
|
||||||
|
chown $UID $HOME/.ssh/id_ed25519.pub
|
||||||
|
)
|
||||||
|
(
|
||||||
|
umask u=rw,g=,o=
|
||||||
|
cp ${../example_keys/user1} $HOME/.ssh/id_ed25519
|
||||||
|
chown $UID $HOME/.ssh/id_ed25519
|
||||||
|
)
|
||||||
|
|
||||||
|
cd /tmp/home/secrets
|
||||||
|
test $(${bin} -d secret1.age) = "hello"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
install -D $src ${placeholder "out"}/bin/agenix
|
install -D $src ${bin}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta.description = "age-encrypted secrets for NixOS";
|
meta.description = "age-encrypted secrets for NixOS";
|
||||||
|
|
Loading…
Reference in a new issue