From 9d18586e046fb395efe3fa55cff6a5079aeb7117 Mon Sep 17 00:00:00 2001 From: schererleander Date: Wed, 30 Jul 2025 23:53:36 +0200 Subject: feat: pass username to modules --- hosts/desktop/configuration.nix | 8 ++++---- hosts/macbook/configuration.nix | 6 +++--- hosts/macbook/home.nix | 6 +++--- hosts/vps/configuration.nix | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'hosts') diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index 0165a04..de83b42 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, username, ... }: { @@ -43,7 +43,7 @@ console.keyMap = "de"; # User - users.users.leander = { + users.users.${username} = { isNormalUser = true; extraGroups = [ "networkmanager" @@ -62,8 +62,8 @@ programs.dconf.enable = true; - users.users.leander.shell = pkgs.zsh; - users.users.leander.ignoreShellProgramCheck = true; + users.users.${username}.shell = pkgs.zsh; + users.users.${username}.ignoreShellProgramCheck = true; nix.settings.experimental-features = [ "nix-command" diff --git a/hosts/macbook/configuration.nix b/hosts/macbook/configuration.nix index 867ca40..b7ee965 100644 --- a/hosts/macbook/configuration.nix +++ b/hosts/macbook/configuration.nix @@ -1,9 +1,9 @@ -{ ... }: +{ username, ... }: { - users.users.schererleander.home = "/Users/schererleander"; + users.users.${username}.home = "/Users/${username}"; - system.primaryUser = "schererleander"; + system.primaryUser = username; system.defaults = { dock = { autohide = true; diff --git a/hosts/macbook/home.nix b/hosts/macbook/home.nix index 297811e..bde968e 100644 --- a/hosts/macbook/home.nix +++ b/hosts/macbook/home.nix @@ -1,12 +1,12 @@ -{ pkgs, ... }: +{ pkgs, username, ... }: { imports = [ ../../modules/home-manager ]; - home.username = "schererleander"; - home.homeDirectory = "/Users/schererleander"; + home.username = username; + home.homeDirectory = "/Users/${username}"; home.packages = with pkgs; [ htop diff --git a/hosts/vps/configuration.nix b/hosts/vps/configuration.nix index 7a928a9..3811615 100644 --- a/hosts/vps/configuration.nix +++ b/hosts/vps/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, username, ... }: { imports = [ @@ -17,7 +17,7 @@ users.users.root.hashedPassword = "!"; users.mutableUsers = false; - users.users.administrator = { + users.users.${username} = { isNormalUser = true; hashedPassword = "$6$KBblJguEyfEmuWnU$Xf0QqPVacA2qvnzZRpnSE2cmh0kNnMgtVhCrMEDI76buNzuzkuDY6EnO7jPjQlEnoczx6ZPAl2pK.SxezbVa.."; extraGroups = [ "wheel" ]; -- cgit v1.3.1