flake: factorize shared modules

This commit is contained in:
Antoine Martin 2021-08-25 21:56:42 +02:00
parent 9bb834587d
commit e4775f4611

View file

@ -74,6 +74,10 @@
}; };
}) })
]; ];
sharedModules = [
home-manager.nixosModule
{ nixpkgs.overlays = shared_overlays; }
] ++ (nixpkgs.lib.attrValues self.nixosModules);
in { in {
poseidon = nixpkgs.lib.nixosSystem rec { poseidon = nixpkgs.lib.nixosSystem rec {
@ -81,11 +85,6 @@
modules = [ modules = [
./poseidon.nix ./poseidon.nix
self.nixosModules.nix-path
home-manager.nixosModule
self.nixosModules.home
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: { (self: super: {
@ -100,9 +99,9 @@
python3 = self.fastPython3; python3 = self.fastPython3;
}; };
}) })
] ++ shared_overlays;
}
]; ];
}
] ++ sharedModules;
}; };
boreal = nixpkgs.lib.nixosSystem rec { boreal = nixpkgs.lib.nixosSystem rec {
@ -110,11 +109,6 @@
modules = [ modules = [
./boreal.nix ./boreal.nix
self.nixosModules.nix-path
home-manager.nixosModule
self.nixosModules.home
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
inputs.emacs-overlay.overlay inputs.emacs-overlay.overlay
@ -125,9 +119,9 @@
# (self: super: { # (self: super: {
# stdenv = super.impureUseNativeOptimizations super.stdenv; # stdenv = super.impureUseNativeOptimizations super.stdenv;
# }) # })
] ++ shared_overlays;
}
]; ];
}
] ++ sharedModules;
}; };
zephyrus = nixpkgs.lib.nixosSystem rec { zephyrus = nixpkgs.lib.nixosSystem rec {
@ -139,17 +133,12 @@
inputs.nixos-hardware.nixosModules.common-pc-laptop inputs.nixos-hardware.nixosModules.common-pc-laptop
inputs.nixos-hardware.nixosModules.common-pc-ssd inputs.nixos-hardware.nixosModules.common-pc-ssd
self.nixosModules.nix-path
home-manager.nixosModule
self.nixosModules.home
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
inputs.emacs-overlay.overlay inputs.emacs-overlay.overlay
] ++ shared_overlays;
}
]; ];
}
] ++ sharedModules;
}; };
}; };