modules: manually import the modules

This allows for an easier separation of the private modules compared to
the old `importModules` function. It is also easier to use.
This commit is contained in:
Gabriel Arazas 2023-07-14 13:14:14 +08:00
parent 246586c25c
commit d524444ae0
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
4 changed files with 65 additions and 4 deletions

View File

@ -222,7 +222,10 @@
home-manager.useUserPackages = lib.mkDefault true; home-manager.useUserPackages = lib.mkDefault true;
home-manager.useGlobalPkgs = lib.mkDefault true; home-manager.useGlobalPkgs = lib.mkDefault true;
home-manager.sharedModules = home-manager.sharedModules =
lib.modulesToList (lib.filesToAttr ./modules/home-manager) (import ./modules/home-manager {
inherit lib;
isInternal = true;
})
++ [ userSharedConfig ]; ++ [ userSharedConfig ];
home-manager.extraSpecialArgs = extraArgs; home-manager.extraSpecialArgs = extraArgs;

View File

@ -14,7 +14,7 @@ in
specialArgs = extraArgs; specialArgs = extraArgs;
modules = modules =
# Append with our custom NixOS modules from the modules folder. # 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. # Our own modules.
++ extraModules; ++ extraModules;
@ -28,7 +28,7 @@ in
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
modules = modules =
# Importing our custom home-manager 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. # Plus our own.
++ extraModules; ++ extraModules;
@ -41,7 +41,7 @@ in
specialArgs = extraArgs; specialArgs = extraArgs;
modules = modules =
# Import all of the NixOS modules. # Import all of the NixOS modules.
(lib.modulesToList (lib.filesToAttr ../modules/nixos)) (import ../modules/nixos { inherit lib; isInternal = true; })
# Our own modules. # Our own modules.
++ extraModules; ++ extraModules;

View File

@ -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)

32
modules/nixos/default.nix Normal file
View File

@ -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)