diff --git a/flake.nix b/flake.nix index 282da3ff..f955c1dd 100644 --- a/flake.nix +++ b/flake.nix @@ -222,7 +222,10 @@ home-manager.useUserPackages = lib.mkDefault true; home-manager.useGlobalPkgs = lib.mkDefault true; home-manager.sharedModules = - lib.modulesToList (lib.filesToAttr ./modules/home-manager) + (import ./modules/home-manager { + inherit lib; + isInternal = true; + }) ++ [ userSharedConfig ]; home-manager.extraSpecialArgs = extraArgs; diff --git a/lib/images.nix b/lib/images.nix index 6bc5f494..6f473f12 100644 --- a/lib/images.nix +++ b/lib/images.nix @@ -14,7 +14,7 @@ in specialArgs = extraArgs; modules = # Append with our custom NixOS modules from the modules folder. - (lib.modulesToList (lib.filesToAttr ../modules/nixos)) + (import ../modules/nixos { inherit lib; isInternal = true; }) # Our own modules. ++ extraModules; @@ -28,7 +28,7 @@ in pkgs = import nixpkgs { inherit system; }; modules = # Importing our custom home-manager modules. - (lib.modulesToList (lib.filesToAttr ../modules/home-manager)) + (import ../modules/home-manager { inherit lib; isInternal = true; }) # Plus our own. ++ extraModules; @@ -41,7 +41,7 @@ in specialArgs = extraArgs; modules = # Import all of the NixOS modules. - (lib.modulesToList (lib.filesToAttr ../modules/nixos)) + (import ../modules/nixos { inherit lib; isInternal = true; }) # Our own modules. ++ extraModules; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix new file mode 100644 index 00000000..7e374e19 --- /dev/null +++ b/modules/home-manager/default.nix @@ -0,0 +1,26 @@ +{ lib + +# Import the private modules +, isInternal ? false +}: + +let + modules = [ + ./files/mutable-files.nix + ./programs/pop-launcher.nix + ./services/archivebox.nix + ./services/bleachbit.nix + ./services/gallery-dl.nix + ./services/plover.nix + ./services/yt-dlp.nix + ]; + privateModules = [ + ./profiles/desktop.nix + ./profiles/dev.nix + ./profiles/editors.nix + ./profiles/i18n.nix + ./profiles/research.nix + ]; +in + modules + ++ (lib.optionals isInternal privateModules) diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 00000000..39145bbf --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,32 @@ +{ lib + +# Include the private modules. +, isInternal ? false +}: + +let + modules = [ + ./programs/cardboard-wm.nix + ./programs/kiwmi.nix + ./programs/pop-launcher.nix + ./programs/wezterm.nix + ./services/archivebox.nix + ./services/gallery-dl.nix + ./services/yt-dlp.nix + ./workflows + ]; + privateModules = [ + ./profiles/archiving.nix + ./profiles/desktop.nix + ./profiles/dev.nix + ./profiles/filesystem.nix + ./profiles/gaming.nix + ./profiles/i18n.nix + ./profiles/server.nix + ./profiles/vpn.nix + ./tasks/backup-archive + ./tasks/multimedia-archive + ]; +in + modules + ++ (lib.optionals isInternal privateModules)