From 6d78ee1a97a5f3ca4be6b1fc4d9c6d8325330dcf Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 2 Jul 2023 20:56:42 +0200 Subject: [PATCH] update mainUser concept --- nixos/components/mainUser.nix | 17 ++++++++++++++++- nixos/modules/programs/browser.nix | 3 ++- nixos/modules/programs/steam.nix | 5 ++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/nixos/components/mainUser.nix b/nixos/components/mainUser.nix index 32926a3..eccd90b 100644 --- a/nixos/components/mainUser.nix +++ b/nixos/components/mainUser.nix @@ -57,7 +57,6 @@ in config = mkIf cfg.enable { - users = { mutableUsers = true; @@ -79,5 +78,21 @@ in }; }; + + home-manager.users.mainUser.home.file.".mainUser" = { + enable = true; + text = builtins.toJSON ( + { + mainUser = config.users.users.mainUser.name; + normalUser = mapAttrs (_: value: value.name) + (filterAttrs (_: value: value.isNormalUser) + config.users.users); + systemUser = mapAttrs (_: value: value.name) + (filterAttrs (_: value: value.isSystemUser) + config.users.users); + } + ); + }; + }; } diff --git a/nixos/modules/programs/browser.nix b/nixos/modules/programs/browser.nix index 2f9dc13..50c71d2 100644 --- a/nixos/modules/programs/browser.nix +++ b/nixos/modules/programs/browser.nix @@ -253,7 +253,8 @@ in createHome = true; initialPassword = "${name}-browser"; shell = pkgs.bashInteractive; - isNormalUser = true; + isNormalUser = false; + isSystemUser = true; group = "users"; # enable video usage extraGroups = [ "audio" "pipewire" ] ++ (if config.gpu then [ "video" ] else [ ]); diff --git a/nixos/modules/programs/steam.nix b/nixos/modules/programs/steam.nix index 62caa9c..14d5efe 100644 --- a/nixos/modules/programs/steam.nix +++ b/nixos/modules/programs/steam.nix @@ -29,11 +29,14 @@ in ]; users.users.steam = { - isNormalUser = true; + isNormalUser = false; + isSystemUser = true; home = "/home/steam"; createHome = true; extraGroups = [ "audio" "input" "video" "pipewire" ]; + group = "steam"; }; + users.groups.steam = { }; # for steam # ---------