diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index b0d0400..1a25226 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -11,6 +11,13 @@ in { enable = lib.mkEnableOption "my custom config"; desktop = lib.mkEnableOption "custom config with desktop support"; 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 { diff --git a/modules/nixos/music.nix b/modules/nixos/music.nix index 372218a..95599cc 100644 --- a/modules/nixos/music.nix +++ b/modules/nixos/music.nix @@ -14,7 +14,7 @@ in { enable = true; rtcqs.enable = true; }; - users.users.max.extraGroups = ["audio"]; + users.users.${config.myConfig.user}.extraGroups = ["audio"]; services.pipewire = { enable = true; diff --git a/modules/nixos/sway.nix b/modules/nixos/sway.nix index 9f0048b..6d60448 100644 --- a/modules/nixos/sway.nix +++ b/modules/nixos/sway.nix @@ -38,7 +38,7 @@ in { }; # 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; # make swaylock work