Skip to content

Commit

Permalink
Add flake inputs to closure of systems
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarfmaster committed Sep 4, 2023
1 parent 2fb567a commit 9e46098
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
neovim-nightly,
nixvim,
arkenfox,
}: let
} @ inputs: let
# All overlays to apply
overlays =
self.overlays
Expand Down Expand Up @@ -202,6 +202,7 @@
hosts = import ./hosts {
inherit self lib;
inherit overlays modules;
inputs = builtins.removeAttrs inputs [ "self" ];
};
in {
packages = eachSupportedSystem (system: let
Expand Down
8 changes: 7 additions & 1 deletion hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
self,
overlays,
modules,
inputs,
}: let
inherit (lib) types;
inherit (builtins) attrValues removeAttrs;

host-modules = hostName: let
global = {pkgs, ...}: {
global = {pkgs, lib, ...}: {
profiles.core.enable = lib.mkDefault true;

# Add flake inputs to system closure to prevent garbage collection
environment.etc."flake-inputs".text =
lib.concatStringsSep "\n"
(lib.mapAttrsToList (k: v: "${k} -> ${v}") inputs);

home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules =
Expand Down

0 comments on commit 9e46098

Please sign in to comment.