feat: add nixosModule template
This commit is contained in:
parent
c15c551b90
commit
91ea0edf43
2 changed files with 25 additions and 0 deletions
|
@ -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
23
nixosModules/default.nix
Normal 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 ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue