feat: add nixosModule template

This commit is contained in:
Mohammad Rafiq 2025-04-22 10:01:20 +08:00
parent c15c551b90
commit 91ea0edf43
No known key found for this signature in database
2 changed files with 25 additions and 0 deletions

View file

@ -2,6 +2,7 @@
{
imports =
[
../nixosModules
../configs/boot.nix
../configs/nix-config.nix
../configs/security.nix
@ -13,4 +14,5 @@
++ lib.optionals (type == "graphical") [
../configs/graphical.nix
];
nixosModules.enable = true;
}

23
nixosModules/default.nix Normal file
View file

@ -0,0 +1,23 @@
{
config,
lib,
pkgs,
...
}:
let
moduleName = "nixosModules";
cfg = config."${moduleName}";
in
{
imports = [
# The rest
];
options = {
"${moduleName}".enable = lib.mkEnableOption "Enable ${moduleName}.";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ micro ];
};
}