From 3bcdd33b5a2d3eb03d5b5b527b407b8759078337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Yule=20B=C3=A4dorf?= Date: Wed, 22 May 2024 22:51:30 +0200 Subject: [PATCH] deploy: use system from host configuration --- lib/deploy.nix | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/deploy.nix b/lib/deploy.nix index 0cdb0eb4..27453bdb 100644 --- a/lib/deploy.nix +++ b/lib/deploy.nix @@ -7,21 +7,6 @@ { lib, inputs }: let - # https://github.com/serokell/deploy-rs#overall-usage - system = "aarch64-linux"; - pkgs = import inputs.nixpkgs { inherit system; }; - deployPkgs = import inputs.nixpkgs { - inherit system; - overlays = [ - inputs.deploy-rs.overlay - (self: super: { - deploy-rs = { - inherit (pkgs) deploy-rs; - lib = super.deploy-rs.lib; - }; - }) - ]; - }; getFqdn = c: let @@ -66,7 +51,21 @@ in */ lib.recursiveUpdate (lib.mapAttrs (_: c: { hostname = getFqdn c; - profiles.system = { + profiles.system = let + system = c.pkgs.system; + + # Unmodified nixpkgs + pkgs = import inputs.nixpkgs { inherit system; }; + + # nixpkgs with deploy-rs overlay but force the nixpkgs package + deployPkgs = import inputs.nixpkgs { + inherit system; + overlays = [ + inputs.deploy-rs.overlay # or deploy-rs.overlays.default + (self: super: { deploy-rs = { inherit (pkgs) deploy-rs; lib = super.deploy-rs.lib; }; }) + ]; + }; + in { user = "root"; path = deployPkgs.deploy-rs.lib.activate.nixos c; };