make user option

This commit is contained in:
Max Känner 2024-12-28 23:04:14 +01:00
parent b780a2d51e
commit f699955913
3 changed files with 9 additions and 2 deletions

View File

@ -11,6 +11,13 @@ in {
enable = lib.mkEnableOption "my custom config"; enable = lib.mkEnableOption "my custom config";
desktop = lib.mkEnableOption "custom config with desktop support"; desktop = lib.mkEnableOption "custom config with desktop support";
laptop = lib.mkEnableOption "extra stuff for laptops like wifi"; laptop = lib.mkEnableOption "extra stuff for laptops like wifi";
user = lib.mkOption {
default = "max";
example = "foo";
description = "The main user working on this machine";
type = lib.types.nonEmptyStr;
readOnly = true;
};
}; };
config.myConfig = lib.mkIf cfg.enable { config.myConfig = lib.mkIf cfg.enable {

View File

@ -14,7 +14,7 @@ in {
enable = true; enable = true;
rtcqs.enable = true; rtcqs.enable = true;
}; };
users.users.max.extraGroups = ["audio"]; users.users.${config.myConfig.user}.extraGroups = ["audio"];
services.pipewire = { services.pipewire = {
enable = true; enable = true;

View File

@ -38,7 +38,7 @@ in {
}; };
# make brightness keys work # make brightness keys work
users.users.max.extraGroups = ["video" "input"]; users.users.${config.myConfig.user}.extraGroups = ["video" "input"];
programs.light.enable = lib.mkIf cfg.laptop true; programs.light.enable = lib.mkIf cfg.laptop true;
# make swaylock work # make swaylock work