From 5f8f6f02636a593a086ac8da24cee3506fa6af2e Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 4 Jun 2023 14:33:18 +0200 Subject: [PATCH] deploy-rs: use overlay and fix rebuilding --- flake.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index b20eaf0..0185d8e 100644 --- a/flake.nix +++ b/flake.nix @@ -54,9 +54,16 @@ systems = [ "x86_64-linux" "aarch64-linux" ]; - perSystem = { self', inputs', config, pkgs, ... }: { + perSystem = { self', inputs', config, pkgs, system, ... }: { # make pkgs available to all `perSystem` functions - _module.args.pkgs = inputs'.nixpkgs.legacyPackages; + _module.args.pkgs = import inputs.nixpkgs { + inherit system; + # prevent rebuilding deploy-rs everytime when nixpkgs changes + overlays = [ + deploy-rs.overlay + (self: super: { deploy-rs = { inherit (pkgs) deploy-rs; lib = super.deploy-rs.lib; }; }) + ]; + }; # enable pre-commit checks pre-commit.settings = { @@ -82,6 +89,7 @@ }; flake = { + # currently disabled, because this causes rebuilds # checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; deploy = import ./machines/deploy.nix (inputs // {