Include agenix module and package directly #198

Manually merged
rarias merged 1 commits from remove-agenix-input into master 2025-10-14 09:40:00 +02:00
Owner

Avoids adding an extra flake input only to fetch a single module and package.

hut% nix flake metadata
Resolved URL:  git+file:///home/Computational/rarias/jungle
Locked URL:    git+file:///home/Computational/rarias/jungle?ref=refs/heads/remove-agenix-input&rev=1198be4e05fcdbe74b9e4a3e8d5dbb7583a8fa61
Path:          /nix/store/952nql546i7z3gxfvv4gkylvcvxlszpa-source
Revision:      1198be4e05fcdbe74b9e4a3e8d5dbb7583a8fa61
Revisions:     1484
Last modified: 2025-10-13 13:58:07
Fingerprint:   9986138091b504b7bb3ff20a4946d33c0e2811776a33c8ebe2c0c8ddab9e219d
Inputs:
└───nixpkgs: github:NixOS/nixpkgs/dfcd5b901dbab46c9c6e80b265648481aafb01f8?narHash=sha256-Kt1UIPi7kZqkSc5HVj6UY5YLHHEzPBkgpNUByuyxtlw%3D (2025-07-13 19:49:22)

The only changes from upstream is that the agenix module includes the agenix binary in system packages. Not sure why they don't include the path explictly in the activation script, so I left it as-is.

Avoids adding an extra flake input only to fetch a single module and package. ``` hut% nix flake metadata Resolved URL: git+file:///home/Computational/rarias/jungle Locked URL: git+file:///home/Computational/rarias/jungle?ref=refs/heads/remove-agenix-input&rev=1198be4e05fcdbe74b9e4a3e8d5dbb7583a8fa61 Path: /nix/store/952nql546i7z3gxfvv4gkylvcvxlszpa-source Revision: 1198be4e05fcdbe74b9e4a3e8d5dbb7583a8fa61 Revisions: 1484 Last modified: 2025-10-13 13:58:07 Fingerprint: 9986138091b504b7bb3ff20a4946d33c0e2811776a33c8ebe2c0c8ddab9e219d Inputs: └───nixpkgs: github:NixOS/nixpkgs/dfcd5b901dbab46c9c6e80b265648481aafb01f8?narHash=sha256-Kt1UIPi7kZqkSc5HVj6UY5YLHHEzPBkgpNUByuyxtlw%3D (2025-07-13 19:49:22) ``` The only changes from upstream is that the agenix module includes the agenix binary in system packages. Not sure why they don't include the path explictly in the activation script, so I left it as-is.
rarias added 1 commit 2025-10-13 14:01:10 +02:00
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 10m38s
1198be4e05
Avoids adding an extra flake input only to fetch a single module and
package.
rarias requested review from abonerib 2025-10-13 14:07:54 +02:00
abonerib reviewed 2025-10-13 14:53:28 +02:00
@@ -0,0 +298,4 @@
};
# Add agenix to system packages
environment.systemPackages = [ pkgs.agenix ];
Collaborator

Since this is not in upstream age, maybe we can put it back in common/base/agenix?

I reproduced the results with this script and all seems to match current agenix main (9edb1787864c4f59ae5074ad498b6272b3ec308d) except the systemPackages line:

#!/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

Maybe we can add the script somewhere in case we need to update agenix.

Since this is not in upstream age, maybe we can put it back in `common/base/agenix`? I reproduced the results with this script and all seems to match current agenix main (9edb1787864c4f59ae5074ad498b6272b3ec308d) except the systemPackages line: ```sh #!/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 ``` Maybe we can add the script somewhere in case we need to update agenix.
rarias marked this conversation as resolved
rarias force-pushed remove-agenix-input from 1198be4e05 to 9a7e600e7b 2025-10-13 15:09:06 +02:00 Compare
abonerib approved these changes 2025-10-13 15:13:57 +02:00
rarias force-pushed remove-agenix-input from 9a7e600e7b to e3e07cada7 2025-10-13 15:20:29 +02:00 Compare
rarias force-pushed remove-agenix-input from e3e07cada7 to 4261d327c6 2025-10-14 09:38:01 +02:00 Compare
rarias manually merged commit 4261d327c6 into master 2025-10-14 09:40:00 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rarias/jungle#198