flake: slight refactor of overlay handling

This commit is contained in:
Jez Cope 2022-01-12 14:39:16 +00:00
parent b657d60cd9
commit caa9b4db8d
1 changed files with 17 additions and 8 deletions

View File

@ -14,10 +14,18 @@
}; };
outputs = { self, nixpkgs, home-manager, nur, emacs-overlay, ... }@inputs: outputs = { self, nixpkgs, home-manager, nur, emacs-overlay, ... }@inputs:
with nixpkgs.lib; { let
nixosConfigurations = genAttrs [ "arianrhod" "gwydion" ] (hostName: inherit (nixpkgs.lib) genAttrs nixosSystem;
system = "x86_64-linux";
hosts = [ "arianrhod" "gwydion" ];
overlay = import ./overlay.nix;
in {
inherit overlay;
nixosConfigurations = genAttrs hosts (hostName:
nixosSystem { nixosSystem {
system = "x86_64-linux"; inherit system;
modules = [ modules = [
./profiles ./profiles
./configuration.nix ./configuration.nix
@ -25,15 +33,16 @@
(./secrets + "/${hostName}.nix") (./secrets + "/${hostName}.nix")
{ {
nixpkgs.overlays = nixpkgs.overlays = [ overlay nur.overlay emacs-overlay.overlay ];
[ (import ./overlay.nix) nur.overlay emacs-overlay.overlay ];
} }
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager = {
home-manager.useUserPackages = true; useGlobalPkgs = true;
home-manager.users.jez = import ./home; useUserPackages = true;
users.jez = import ./home;
};
} }
]; ];
specialArgs = { inherit inputs hostName; }; specialArgs = { inherit inputs hostName; };