1 Commits

Author SHA1 Message Date
9a7e600e7b Include agenix module and package directly
All checks were successful
CI / build:cross (pull_request) Successful in 6s
CI / build:all (pull_request) Successful in 17s
Avoids adding an extra flake input only to fetch a single module and
package.
2025-10-13 15:07:37 +02:00
4 changed files with 28 additions and 5 deletions

View File

@@ -1,3 +1,8 @@
{ pkgs, ... }:
{
imports = [ ../../module/agenix.nix ];
# Add agenix to system packages
environment.systemPackages = [ pkgs.agenix ];
}

View File

@@ -297,9 +297,6 @@ in
};
};
# Add agenix to system packages
environment.systemPackages = [ pkgs.agenix ];
# Create a new directory full of secrets for symlinking (this helps
# ensure removed secrets are actually removed, or at least become
# invalid symlinks).

View File

@@ -27,7 +27,6 @@ stdenv.mkDerivation rec {
doInstallCheck = true;
installCheckInputs = [ shellcheck ];
postInstallCheck = ''
set -x
shellcheck ${bin}
${bin} -h | grep ${version}
@@ -57,7 +56,6 @@ stdenv.mkDerivation rec {
cd $HOME/secrets
test $(${bin} -d secret1.age) = "hello"
set +x
'';
installPhase = ''

23
pkgs/agenix/update.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
set -e
# All operations are done relative to root
GITROOT=$(git rev-parse --show-toplevel)
cd "$GITROOT"
REVISION=${1:-main}
TMPCLONE=$(mktemp -d)
trap "rm -rf ${TMPCLONE}" EXIT
git clone https://github.com/ryantm/agenix.git --revision="$REVISION" "$TMPCLONE" --depth=1
cp "${TMPCLONE}/pkgs/agenix.sh" pkgs/agenix/agenix.sh
cp "${TMPCLONE}/pkgs/agenix.nix" pkgs/agenix/default.nix
sed -i 's#../example#./example#' pkgs/agenix/default.nix
cp "${TMPCLONE}/example/"* pkgs/agenix/example/
cp "${TMPCLONE}/example_keys/"* pkgs/agenix/example_keys/
cp "${TMPCLONE}/modules/age.nix" m/module/agenix.nix