options: init
This commit is contained in:
parent
e1e94504e4
commit
f33525f565
4 changed files with 28 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ let
|
|||
}) paths
|
||||
);
|
||||
in {
|
||||
options = ./options.nix;
|
||||
services = mkAttrsFromPaths [
|
||||
./services/jellyfin.nix
|
||||
./services/nginx.nix
|
||||
|
|
|
|||
18
modules/options.nix
Normal file
18
modules/options.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ config, lib, ... }: {
|
||||
options.me = {
|
||||
environment = lib.mkOption {
|
||||
type = lib.types.enum [ "desktop" "laptop" "headless" ];
|
||||
default = "desktop";
|
||||
};
|
||||
|
||||
fprint = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
gui = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.me.environment != "headless";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
{ config, enableGUI, inputs, modules, overlays, ... }: {
|
||||
{ config, inputs, modules, ... }: {
|
||||
imports = [ modules.options ];
|
||||
|
||||
environment.etc = {
|
||||
"machine-id".source = "/persist/machine-id";
|
||||
"ssh/ssh_host_rsa_key".source = "/persist/ssh_host_rsa_key";
|
||||
|
|
|
|||
|
|
@ -9,5 +9,11 @@
|
|||
inherit enableGUI inputs modules;
|
||||
sysConfig = config;
|
||||
};
|
||||
sharedModules = [
|
||||
{
|
||||
imports = [ modules.options ];
|
||||
config.me = config.me;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue