From 995153a29f39a87a04ac22cd899f6e658bc44051 Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Thu, 11 Jan 2024 12:57:31 +0100 Subject: [PATCH] Revert "Revert "fix: avoid endlessly compiling deploy-rs"" This reverts commit 5ab157f0d5dccb8995864815dfdd3ac2c6630cba. --- lib/deploy.nix | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/deploy.nix b/lib/deploy.nix index 5e9f6418..9a2f7a53 100644 --- a/lib/deploy.nix +++ b/lib/deploy.nix @@ -1,11 +1,23 @@ /* - * The contents of this file are adapted from digga - * https://github.com/divnix/digga - * - * Licensed under the MIT license - */ - -{ lib, inputs }: let +* The contents of this file are adapted from digga +* https://github.com/divnix/digga +* +* Licensed under the MIT license +*/ +{ + 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 +65,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; }; } )