From 30045ddd0ffb0c20842ea16eeab72c1dadd3beb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Thu, 20 Nov 2025 14:39:29 +0800 Subject: [PATCH] chore(devshell): Use deploy-rs from nixpkgs for binary caching --- flake.nix | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 334f73c..e50b3be 100644 --- a/flake.nix +++ b/flake.nix @@ -63,7 +63,6 @@ self, nixpkgs, sops-nix, - deploy-rs, ... }@inputs: let @@ -78,6 +77,23 @@ ./configuration/hardware-specific/vm.nix ]; }; + + # deploy-rs unfortunately uses an `import nixpkgs`, and its + # library functions depend on an instantiated nixpkgs, so we + # can't get around multi-nixpkgs-eval. + deploy-rs = + (import nixpkgs { + inherit system; + overlays = [ + inputs.deploy-rs.overlays.default + (_: prev: { + deploy-rs = { + inherit (nixpkgs.legacyPackages.${system}) deploy-rs; + inherit (prev.deploy-rs) lib; + }; + }) + ]; + }).deploy-rs; in { ################## @@ -105,7 +121,7 @@ profiles.system = { user = "root"; - path = deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.hetzner-1; + path = deploy-rs.lib.activate.nixos self.nixosConfigurations.hetzner-1; }; sshUser = "tlater"; @@ -159,7 +175,7 @@ packages = nixpkgs.lib.attrValues { inherit (sops-nix.packages.${system}) sops-import-keys-hook sops-init-gpg-key; - inherit (deploy-rs.packages.${system}) default; + inherit (deploy-rs) deploy-rs; }; };