From 3c9f9c9fc7af02231bd0c0baf51d8a84147515a5 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 28 Oct 2023 14:25:41 +0200 Subject: [PATCH] fix: use deploy-rs overlay to force usage of nixpkgs --- flake.nix | 2 ++ lib/deploy.nix | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 8bf23e9..ff62be1 100644 --- a/flake.nix +++ b/flake.nix @@ -91,6 +91,8 @@ }; }; + checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib; + nixosModules = { # Common nixos/nix-darwin configuration shared between Linux and macOS. common = { pkgs, ... }: { diff --git a/lib/deploy.nix b/lib/deploy.nix index 5e9f641..2ed7eae 100644 --- a/lib/deploy.nix +++ b/lib/deploy.nix @@ -6,6 +6,16 @@ */ { lib, inputs }: let + # https://github.com/serokell/deploy-rs#overall-usage + system = "x86_64-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 net = c.config.networking; fqdn = @@ -53,7 +63,7 @@ in { hostname = getFqdn c; profiles.system = { user = "root"; - path = inputs.deploy-rs.lib.${c.pkgs.stdenv.hostPlatform.system}.activate.nixos c; + path = deployPkgs.deploy-rs.lib.activate.nixos c; }; } )