From 7b6426de96aa5592169ac7956328b0e7b9f3b60b Mon Sep 17 00:00:00 2001 From: Christian Harke Date: Fri, 15 Dec 2023 16:02:55 +0100 Subject: [PATCH] Add `gamer` to available home-manager users --- nixos/base/default.nix | 2 +- nixos/base/users/gamer.nix | 18 ++++++++++++++++++ nixos/roles/steambox/default.nix | 18 ++++++------------ 3 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 nixos/base/users/gamer.nix diff --git a/nixos/base/default.nix b/nixos/base/default.nix index fe6296b0..966cc9ea 100644 --- a/nixos/base/default.nix +++ b/nixos/base/default.nix @@ -6,7 +6,7 @@ let cfg = config.custom.base; - availableUsers = [ "christian" "demo" ]; + availableUsers = [ "christian" "demo" "gamer" ]; importUserModule = u: let isEnabled = any (x: x == u) cfg.users; diff --git a/nixos/base/users/gamer.nix b/nixos/base/users/gamer.nix new file mode 100644 index 00000000..5c86ac25 --- /dev/null +++ b/nixos/base/users/gamer.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + username = "gamer"; + +in + +{ + users.users."${username}" = { + name = username; + isNormalUser = true; + uid = 1001; + password = ""; + }; +} diff --git a/nixos/roles/steambox/default.nix b/nixos/roles/steambox/default.nix index 4ee480d2..349eb139 100644 --- a/nixos/roles/steambox/default.nix +++ b/nixos/roles/steambox/default.nix @@ -20,9 +20,12 @@ in }; config = mkIf cfg.enable { - custom.roles = { - gaming.enable = true; - sound.enable = true; + custom = { + base.users = [ "gamer" ]; + roles = { + gaming.enable = true; + sound.enable = true; + }; }; environment.systemPackages = with pkgs; [ @@ -55,14 +58,5 @@ in }; }; }; - - users = { - users = { - gamer = { - password = ""; - isNormalUser = true; - }; - }; - }; }; }