diff --git a/flake.nix b/flake.nix index c90749c3..218f3f8c 100644 --- a/flake.nix +++ b/flake.nix @@ -144,13 +144,18 @@ # Only use imports as minimally as possible with the absolute # requirements of a host. On second thought, only on flakes with # optional NixOS modules. - imports = [ - inputs.home-manager.nixosModules.home-manager - inputs.nur.nixosModules.nur - inputs.sops-nix.nixosModules.sops - inputs.guix-overlay.nixosModules.guix - inputs.disko.nixosModules.disko - ]; + imports = + # Append with our custom NixOS modules from the modules folder. + import ./modules/nixos { inherit lib; isInternal = true; } + + # Then, make the most with the modules from the flake inputs. + ++ [ + inputs.home-manager.nixosModules.home-manager + inputs.nur.nixosModules.nur + inputs.sops-nix.nixosModules.sops + inputs.guix-overlay.nixosModules.guix + inputs.disko.nixosModules.disko + ]; # BOOOOOOOOOOOOO! Somebody give me a tomato! services.xserver.excludePackages = with pkgs; [ xterm ]; @@ -178,12 +183,7 @@ # The global configuration for the home-manager module. home-manager.useUserPackages = lib.mkDefault true; home-manager.useGlobalPkgs = lib.mkDefault true; - home-manager.sharedModules = - (import ./modules/home-manager { - inherit lib; - isInternal = true; - }) - ++ [ userSharedConfig ]; + home-manager.sharedModules = [ userSharedConfig ]; home-manager.extraSpecialArgs = extraArgs; # Enabling some things for sops. @@ -204,10 +204,15 @@ # configurations with `nixpkgs.useGlobalPkgs` set to `true` so avoid # setting nixpkgs-related options here. userSharedConfig = { pkgs, config, lib, ... }: { - imports = [ - inputs.nur.hmModules.nur - inputs.sops-nix.homeManagerModules.sops - ]; + imports = + # Import our own custom modules from here.. + import ./modules/home-manager { inherit lib; isInternal = true; } + + # ...plus a bunch of third-party modules. + ++ [ + inputs.nur.hmModules.nur + inputs.sops-nix.homeManagerModules.sops + ]; # Hardcoding this is not really great especially if you consider using # other locales but its default values are already hardcoded so what diff --git a/lib/images.nix b/lib/images.nix index 916b11bd..70f5bff0 100644 --- a/lib/images.nix +++ b/lib/images.nix @@ -9,12 +9,7 @@ # The system of the NixOS system. inherit system lib; specialArgs = extraArgs; - modules = - # Append with our custom NixOS modules from the modules folder. - (import ../modules/nixos { inherit lib; isInternal = true; }) - - # Our own modules. - ++ extraModules; + modules = extraModules; }; # A wrapper around the home-manager configuration function. @@ -22,12 +17,7 @@ inputs."${home-manager-channel}".lib.homeManagerConfiguration { inherit lib pkgs; extraSpecialArgs = extraArgs; - modules = - # Importing our custom home-manager modules. - (import ../modules/home-manager { inherit lib; isInternal = true; }) - - # Plus our own. - ++ extraModules; + modules = extraModules; }; # A wrapper around the nixos-generators `nixosGenerate` function. @@ -35,12 +25,7 @@ inputs.nixos-generators.nixosGenerate { inherit pkgs system format lib; specialArgs = extraArgs; - modules = - # Import all of the NixOS modules. - (import ../modules/nixos { inherit lib; isInternal = true; }) - - # Our own modules. - ++ extraModules; + modules = extraModules; }; listImagesWithSystems = data: