options: init

This commit is contained in:
LavaDesu 2025-03-23 11:52:43 +11:00
parent e1e94504e4
commit f33525f565
Signed by: cilly
GPG key ID: 6500251E087653C9
4 changed files with 28 additions and 1 deletions

View file

@ -14,6 +14,7 @@ let
}) paths
);
in {
options = ./options.nix;
services = mkAttrsFromPaths [
./services/jellyfin.nix
./services/nginx.nix

18
modules/options.nix Normal file
View 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";
};
};
}

View file

@ -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";

View file

@ -9,5 +9,11 @@
inherit enableGUI inputs modules;
sysConfig = config;
};
sharedModules = [
{
imports = [ modules.options ];
config.me = config.me;
}
];
};
}