From 58c554469cf7bbb27b02f7378c6058ea0ffa59b3 Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 24 Apr 2025 15:03:27 +0300 Subject: [PATCH] fix: use replaceVars instead of substituteAll The latter is deprecated in latest nixpkgs. Also, update inputs to non-ancient versions. --- flake.lock | 18 +++++++++--------- pkgs/agenix.nix | 5 ++--- test/install_ssh_host_keys_darwin.nix | 10 +++++----- test/integration_darwin.nix | 4 ++-- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/flake.lock b/flake.lock index 5d6236c..a1253f9 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1700795494, - "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "lastModified": 1744478979, + "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "rev": "43975d782b418ebf4969e9ccba82466728c2851b", "type": "github" }, "original": { @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1703113217, - "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "lastModified": 1745494811, + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", "owner": "nix-community", "repo": "home-manager", - "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", "type": "github" }, "original": { @@ -43,11 +43,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1703013332, - "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", + "lastModified": 1745391562, + "narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6", + "rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7", "type": "github" }, "original": { diff --git a/pkgs/agenix.nix b/pkgs/agenix.nix index e51a5c6..7ce1177 100644 --- a/pkgs/agenix.nix +++ b/pkgs/agenix.nix @@ -6,7 +6,7 @@ nix, mktemp, diffutils, - substituteAll, + replaceVars, ageBin ? "${age}/bin/age", shellcheck, }: let @@ -15,13 +15,12 @@ in stdenv.mkDerivation rec { pname = "agenix"; version = "0.15.0"; - src = substituteAll { + src = replaceVars ./agenix.sh { inherit ageBin version; jqBin = "${jq}/bin/jq"; nixInstantiate = "${nix}/bin/nix-instantiate"; mktempBin = "${mktemp}/bin/mktemp"; diffBin = "${diffutils}/bin/diff"; - src = ./agenix.sh; }; dontUnpack = true; doInstallCheck = true; diff --git a/test/install_ssh_host_keys_darwin.nix b/test/install_ssh_host_keys_darwin.nix index c826fa8..62f395a 100644 --- a/test/install_ssh_host_keys_darwin.nix +++ b/test/install_ssh_host_keys_darwin.nix @@ -8,10 +8,10 @@ sudo chmod 600 /etc/ssh/ssh_host_ed25519_key echo "Installing user SSH host key" - mkdir -p $HOME/.ssh - cp ${../example_keys/user1.pub} $HOME/.ssh/id_ed25519.pub - cp ${../example_keys/user1} $HOME/.ssh/id_ed25519 - chmod 644 $HOME/.ssh/id_ed25519.pub - chmod 600 $HOME/.ssh/id_ed25519 + mkdir -p "$HOME/.ssh" + cp ${../example_keys/user1.pub} "$HOME/.ssh/id_ed25519.pub" + cp ${../example_keys/user1} "$HOME/.ssh/id_ed25519" + chmod 644 "$HOME/.ssh/id_ed25519.pub" + chmod 600 "$HOME/.ssh/id_ed25519" ''; } diff --git a/test/integration_darwin.nix b/test/integration_darwin.nix index f309667..d49b77d 100644 --- a/test/integration_darwin.nix +++ b/test/integration_darwin.nix @@ -17,12 +17,12 @@ in { ../modules/age.nix ]; - services.nix-daemon.enable = true; - age = { identityPaths = options.age.identityPaths.default ++ ["/etc/ssh/this_key_wont_exist"]; secrets.system-secret.file = ../example/secret1.age; }; environment.systemPackages = [testScript]; + + system.stateVersion = 6; }