From d7e2c0a9246bf897411493fd7837b81fbc9b6b1f Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sun, 14 Aug 2022 19:35:15 -0400 Subject: [PATCH] Switching from hardcoded username. Will this ever change? No like likely, but I do think that this is the correct way to do this. --- flake.nix | 5 +++- modules/applications/1password.nix | 9 +++--- modules/applications/blueman.nix | 7 +++-- modules/applications/dunst.nix | 7 +++-- modules/applications/emacs.nix | 7 +++-- modules/applications/firefox/default.nix | 7 +++-- modules/applications/firefox/tridactyl.nix | 7 +++-- modules/applications/gammastep.nix | 7 +++-- modules/applications/gnome-common.nix | 7 +++-- modules/applications/i3/i3.nix | 9 +++--- modules/applications/i3/polybar.nix | 7 +++-- modules/applications/i3/rofi.nix | 7 +++-- modules/applications/kdeconnect.nix | 7 +++-- modules/applications/kitty.nix | 7 +++-- modules/applications/media.nix | 7 +++-- modules/applications/nextcloud.nix | 7 +++-- modules/applications/spotify.nix | 7 +++-- modules/applications/zathura.nix | 7 +++-- modules/applications/zeal.nix | 7 +++-- modules/lang/bash.nix | 7 +++-- modules/lang/golang.nix | 7 +++-- modules/lang/javascript.nix | 7 +++-- modules/system/gtk.nix | 7 +++-- modules/system/homemanager.nix | 32 ++++++++-------------- modules/system/ssh.nix | 7 +++-- modules/system/users.nix | 12 ++++++-- modules/system/xdg.nix | 4 +-- modules/system/yubikey.nix | 16 ++++++----- profiles/laptop.nix | 4 +-- 29 files changed, 132 insertions(+), 106 deletions(-) diff --git a/flake.nix b/flake.nix index 83a6433..4a74a9f 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,10 @@ channelsConfig = { allowUnfree = true; }; sharedOverlays = [ nur.overlay (import ./pkgs) emacs-overlay.overlay ]; hostDefaults = { - specialArgs = { inherit home-manager nixos-hardware; }; + specialArgs = { + inherit home-manager nixos-hardware; + user = { name = "james"; description = "James Patrick"; }; + }; modules = mapModulesRec' ./modules import; system = "x86_64-linux"; }; diff --git a/modules/applications/1password.nix b/modules/applications/1password.nix index b3235cc..23c1983 100644 --- a/modules/applications/1password.nix +++ b/modules/applications/1password.nix @@ -1,9 +1,10 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.onepassword; graphical = config.my.graphical; enable = (this.gui.enable || this.cli.enable); -in with lib; { +in +with lib; { options = { my.application.onepassword.gui.enable = mkOption { default = graphical.enable; @@ -17,10 +18,10 @@ in with lib; { config = mkIf enable (mkMerge [ (mkIf this.cli.enable { - home-manager.users.james.home.packages = with pkgs; [ _1password ]; + home-manager.users."${user.name}".home.packages = with pkgs; [ _1password ]; }) (mkIf this.gui.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { home.packages = with pkgs; [ _1password-gui ]; }; systemd.user.services._1password = { diff --git a/modules/applications/blueman.nix b/modules/applications/blueman.nix index 4db4193..a8298fb 100644 --- a/modules/applications/blueman.nix +++ b/modules/applications/blueman.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.blueman; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.application.blueman.enable = mkOption { default = graphical.enable; @@ -12,7 +13,7 @@ in with lib; { config = mkIf this.enable { hardware.bluetooth.enable = true; - home-manager.users.james = { home.packages = with pkgs; [ blueman ]; }; + home-manager.users."${user.name}" = { home.packages = with pkgs; [ blueman ]; }; fileSystems."var/lib/bluetooth" = { device = "/persist/var/lib/bluetooth"; options = [ "bind" "noauto" "x-systemd.automount" ]; diff --git a/modules/applications/dunst.nix b/modules/applications/dunst.nix index 03a2569..101fb49 100644 --- a/modules/applications/dunst.nix +++ b/modules/applications/dunst.nix @@ -1,9 +1,10 @@ -{ options, config, lib, pkgs, ... }: +{ options, config, lib, pkgs, user, ... }: let this = config.my.application.dunst; i3 = config.my.application.i3; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.application.dunst.enable = mkOption { default = i3.enable; @@ -12,7 +13,7 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { systemd.user.startServices = true; services.dunst.enable = true; home.packages = with pkgs; [ libnotify ]; diff --git a/modules/applications/emacs.nix b/modules/applications/emacs.nix index 5029e19..cc9286a 100644 --- a/modules/applications/emacs.nix +++ b/modules/applications/emacs.nix @@ -1,10 +1,11 @@ -{ inputs, config, lib, pkgs, ... }: +{ inputs, config, lib, pkgs, user, ... }: # TODO Still need the following dependecies # - Language tools (grammer) let this = config.my.application.emacs; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.application.emacs.enable = mkOption { default = graphical.enable; @@ -14,7 +15,7 @@ in with lib; { config = mkIf this.enable { nixpkgs.overlays = [ inputs.emacs-overlay.overlay ]; - home-manager.users.james = { + home-manager.users."${user.name}" = { programs.emacs = { package = pkgs.emacs28NativeComp; enable = true; diff --git a/modules/applications/firefox/default.nix b/modules/applications/firefox/default.nix index b167796..7c37d55 100644 --- a/modules/applications/firefox/default.nix +++ b/modules/applications/firefox/default.nix @@ -1,8 +1,9 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, user, ... }: let cfg = config.my.application.firefox; graphical = config.my.graphical; -in with lib; { +in +with lib; { options.my.application.firefox = { enable = mkOption { default = graphical.enable; @@ -18,7 +19,7 @@ in with lib; { config = mkIf cfg.enable { environment.sessionVariables = { MOZ_USE_XINPUT2 = "1"; }; - home-manager.users.james = { + home-manager.users."${user.name}" = { programs.firefox = { enable = true; package = cfg.pkg; diff --git a/modules/applications/firefox/tridactyl.nix b/modules/applications/firefox/tridactyl.nix index 810b60a..0a87b21 100644 --- a/modules/applications/firefox/tridactyl.nix +++ b/modules/applications/firefox/tridactyl.nix @@ -1,8 +1,9 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, user, ... }: let this = config.my.application.firefox.tridactyl; firefox = config.my.application.firefox; -in with lib; { +in +with lib; { options = { my.application.firefox.tridactyl.enable = mkOption { default = firefox.enable; @@ -14,7 +15,7 @@ in with lib; { config = mkIf this.enable { # firefox.pkg = # pkgs.firefox.override { this = { enableTridactylNative = true; }; }; - home-manager.users.james = { + home-manager.users."${user.name}" = { programs.firefox = { extensions = with pkgs.nur.repos.rycee.firefox-addons; [ tridactyl ]; }; diff --git a/modules/applications/gammastep.nix b/modules/applications/gammastep.nix index 1fabcc1..3b6a78f 100644 --- a/modules/applications/gammastep.nix +++ b/modules/applications/gammastep.nix @@ -1,8 +1,9 @@ -{ options, config, lib, pkgs, ... }: +{ options, config, lib, pkgs, user, ... }: let this = config.my.application.gammastep; i3 = config.my.application.i3; -in with lib; { +in +with lib; { options = { my.application.gammastep.enable = mkOption { default = i3.enable; @@ -11,7 +12,7 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { services.gammastep = { enable = true; provider = "geoclue2"; diff --git a/modules/applications/gnome-common.nix b/modules/applications/gnome-common.nix index a93a913..687461d 100644 --- a/modules/applications/gnome-common.nix +++ b/modules/applications/gnome-common.nix @@ -1,13 +1,14 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let graphical = config.my.graphical; power = config.my.system.power; keyring = config.my.system.keyring; -in with lib; { +in +with lib; { config = mkIf graphical.enable { services.gvfs.enable = true; - home-manager.users.james = { + home-manager.users."${user.name}" = { home.packages = with pkgs.gnome; [ cheese diff --git a/modules/applications/i3/i3.nix b/modules/applications/i3/i3.nix index 0b938a8..2d958da 100644 --- a/modules/applications/i3/i3.nix +++ b/modules/applications/i3/i3.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.i3; graphical = config.my.graphical; @@ -8,7 +8,8 @@ let sha256 = "sha256-dErBslKRBTLKbTTUanIPDwX8CcMJ0Kpi3oof0oXlHys="; }; -in with lib; { +in +with lib; { options = { my.application.i3.enable = mkOption { default = graphical.enable; @@ -55,7 +56,7 @@ in with lib; { }; }; - home-manager.users.james = { + home-manager.users."${user.name}" = { xsession.windowManager.i3 = { enable = true; package = pkgs.i3-gaps; @@ -170,6 +171,6 @@ in with lib; { }; }; - users.users.james.extraGroups = [ "video" "audio" ]; + users.users."${user.name}".extraGroups = [ "video" "audio" ]; }; } diff --git a/modules/applications/i3/polybar.nix b/modules/applications/i3/polybar.nix index 34eabd0..46ea2b3 100644 --- a/modules/applications/i3/polybar.nix +++ b/modules/applications/i3/polybar.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.i3.polybar; i3 = config.my.application.i3; @@ -11,7 +11,8 @@ let primary = "#F0C674"; secondary = "#8ABEB7"; }; -in with lib; { +in +with lib; { options = { my.application.i3.polybar.enable = mkOption { default = i3.enable; @@ -20,7 +21,7 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { services.polybar = { enable = true; script = "polybar"; diff --git a/modules/applications/i3/rofi.nix b/modules/applications/i3/rofi.nix index e087feb..2ed772f 100644 --- a/modules/applications/i3/rofi.nix +++ b/modules/applications/i3/rofi.nix @@ -1,9 +1,10 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.i3.rofi; i3 = config.my.application.i3; -in with lib; { +in +with lib; { options = { my.application.i3.rofi.enable = mkOption { default = i3.enable; @@ -12,7 +13,7 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { home.packages = with pkgs; [ rofi-systemd rofi-power-menu ]; programs.rofi = { enable = true; diff --git a/modules/applications/kdeconnect.nix b/modules/applications/kdeconnect.nix index 686c84c..e346095 100644 --- a/modules/applications/kdeconnect.nix +++ b/modules/applications/kdeconnect.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.kdeconnect; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.application.kdeconnect.enable = mkOption { default = graphical.enable; @@ -11,7 +12,7 @@ in with lib; { }; config = mkIf this.enable { - # home-manager.users.james = { + # home-manager.users."${user.name}" = { # services.kdeconnect = { # indicator = true; # enable = true; diff --git a/modules/applications/kitty.nix b/modules/applications/kitty.nix index 1b532f8..2626e83 100644 --- a/modules/applications/kitty.nix +++ b/modules/applications/kitty.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.kitty; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.application.kitty.enable = mkOption { default = graphical.enable; @@ -11,7 +12,7 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { home.packages = with pkgs; [ kitty ]; programs.kitty = { enable = true; diff --git a/modules/applications/media.nix b/modules/applications/media.nix index b71d054..3b21612 100644 --- a/modules/applications/media.nix +++ b/modules/applications/media.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.media; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.application.media.enable = mkOption { default = graphical.enable; @@ -11,7 +12,7 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { programs.mpv = { enable = true; scripts = with pkgs.mpvScripts; [ mpris thumbnail ]; diff --git a/modules/applications/nextcloud.nix b/modules/applications/nextcloud.nix index 6b5232f..0109ffe 100644 --- a/modules/applications/nextcloud.nix +++ b/modules/applications/nextcloud.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.nextcloud; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.application.nextcloud.enable = mkOption { default = graphical.enable; @@ -11,7 +12,7 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { home.packages = with pkgs; [ nextcloud-client ]; }; diff --git a/modules/applications/spotify.nix b/modules/applications/spotify.nix index 4a033e6..276d2de 100644 --- a/modules/applications/spotify.nix +++ b/modules/applications/spotify.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.spotify; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.application.spotify.enable = mkOption { default = graphical.enable; @@ -11,7 +12,7 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { home.packages = with pkgs; [ spotify ]; }; + home-manager.users."${user.name}" = { home.packages = with pkgs; [ spotify ]; }; # Local discovery - https://nixos.wiki/wiki/Spotify networking.firewall.allowedTCPPorts = [ 57621 ]; diff --git a/modules/applications/zathura.nix b/modules/applications/zathura.nix index 67779cd..1b59a8c 100644 --- a/modules/applications/zathura.nix +++ b/modules/applications/zathura.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.zathura; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.application.zathura.enable = mkOption { default = graphical.enable; @@ -11,6 +12,6 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { programs.zathura = { enable = true; }; }; + home-manager.users."${user.name}" = { programs.zathura = { enable = true; }; }; }; } diff --git a/modules/applications/zeal.nix b/modules/applications/zeal.nix index de51164..ed1ffba 100644 --- a/modules/applications/zeal.nix +++ b/modules/applications/zeal.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.application.zeal; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.application.zeal.enable = mkOption { default = graphical.enable; @@ -11,6 +12,6 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james.home.packages = with pkgs; [ zeal ]; + home-manager.users."${user.name}".home.packages = with pkgs; [ zeal ]; }; } diff --git a/modules/lang/bash.nix b/modules/lang/bash.nix index 2e607e8..be55294 100644 --- a/modules/lang/bash.nix +++ b/modules/lang/bash.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.lang.bash; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.lang.bash.enable = mkOption { default = graphical.enable; @@ -11,7 +12,7 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { home.packages = with pkgs; [ nodePackages.bash-language-server shellcheck diff --git a/modules/lang/golang.nix b/modules/lang/golang.nix index 6cae8de..d3e1fbb 100644 --- a/modules/lang/golang.nix +++ b/modules/lang/golang.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.lang.golang; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.lang.golang.enable = mkOption { default = graphical.enable; @@ -11,7 +12,7 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { programs.go = { enable = true; goPath = ".local/go"; diff --git a/modules/lang/javascript.nix b/modules/lang/javascript.nix index 44abeff..3bd70d5 100644 --- a/modules/lang/javascript.nix +++ b/modules/lang/javascript.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.lang.bash; graphical = config.my.graphical; -in with lib; { +in +with lib; { options = { my.lang.javascript.enable = mkOption { default = graphical.enable; @@ -11,7 +12,7 @@ in with lib; { }; config = mkIf this.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { home.packages = with pkgs; [ nodePackages.npm nodePackages.vue-cli diff --git a/modules/system/gtk.nix b/modules/system/gtk.nix index 3192e21..af7ab63 100644 --- a/modules/system/gtk.nix +++ b/modules/system/gtk.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let graphical = config.my.graphical; -in with lib; { +in +with lib; { config = mkIf graphical.enable { - home-manager.users.james = { + home-manager.users."${user.name}" = { home.packages = with pkgs; [ dracula-theme kora-icon-theme ]; home.sessionVariables = { GTK_THEME = "Dracula"; }; systemd.user.sessionVariables = { GTK_THEME = "Dracula"; }; diff --git a/modules/system/homemanager.nix b/modules/system/homemanager.nix index cc54211..894a0e3 100644 --- a/modules/system/homemanager.nix +++ b/modules/system/homemanager.nix @@ -1,24 +1,16 @@ -{ config, home-manager, lib, pkgs, ... }: { +{ config, home-manager, lib, pkgs, user, ... }: { imports = [ home-manager.nixosModules.home-manager ]; - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.james = { - # Home Manager needs a bit of information about you and the - # paths it should manage. - home.username = "james"; - home.homeDirectory = "/home/james"; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users."${user.name}" = { + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "21.11"; - # This value determines the Home Manager release that your - # configuration is compatible with. This helps avoid breakage - # when a new Home Manager release introduces backwards - # incompatible changes. - # - # You can update Home Manager without changing this value. See - # the Home Manager release notes for a list of state version - # changes in each release. - home.stateVersion = "21.11"; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + }; }; } diff --git a/modules/system/ssh.nix b/modules/system/ssh.nix index 0676a99..a3bd1b6 100644 --- a/modules/system/ssh.nix +++ b/modules/system/ssh.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: #with lib.my; with lib; let @@ -7,7 +7,8 @@ let url = "https://github.com/jamesepatrick.keys"; sha256 = "sha256-alm6KRFca4VjzTyVEg+j1s0uKaSfvV76o3sgYNAisSA="; }; -in { +in +{ options.my = { system.ssh.enable = mkOption { default = true; @@ -23,6 +24,6 @@ in { passwordAuthentication = false; }; - users.users.james.openssh.authorizedKeys.keyFiles = [ publicKey ]; + users.users."${user.name}".openssh.authorizedKeys.keyFiles = [ publicKey ]; }; } diff --git a/modules/system/users.nix b/modules/system/users.nix index b13a11c..02dc632 100644 --- a/modules/system/users.nix +++ b/modules/system/users.nix @@ -1,13 +1,19 @@ # Define a user account. Don't forget to set a password with ‘passwd’. -{ config, lib, pkgs, ... }: { +{ config, lib, pkgs, user, ... }: { users.users = { root.initialPassword = "noreallychangemenow"; - james = { - description = "James Patrick"; + + "${user.name}" = { + description = "${user.description}"; extraGroups = [ "wheel" "systemd-journal" ]; initialPassword = "nixos"; isNormalUser = true; shell = pkgs.zsh; }; }; + + home-manager.users."${user.name}".home = { + username = "${user.name}"; + homeDirectory = "/home/${user.name}"; + }; } diff --git a/modules/system/xdg.nix b/modules/system/xdg.nix index c0088ab..a45d7a5 100644 --- a/modules/system/xdg.nix +++ b/modules/system/xdg.nix @@ -1,5 +1,5 @@ -{ config, pkgs, ... }: { - home-manager.users.james = { +{ config, pkgs, user, ... }: { + home-manager.users."${user.name}" = { home.packages = with pkgs; [ xdg-utils xdg-launch ]; xdg.enable = true; }; diff --git a/modules/system/yubikey.nix b/modules/system/yubikey.nix index 7884b32..5f40fb0 100644 --- a/modules/system/yubikey.nix +++ b/modules/system/yubikey.nix @@ -1,8 +1,9 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, user, ... }: let this = config.my.system.yubikey; graphical = config.my.graphical; -in with lib; { +in +with lib; { options.my.system.yubikey.enable = mkEnableOption "Yubikey"; config = mkIf this.enable { @@ -35,7 +36,7 @@ in with lib; { [ yubioath-desktop pinentry-curses ] ++ optionals (graphical.enable) [ pinentry-gnome ]; - home-manager.users.james.home = { + home-manager.users."${user.name}".home = { packages = with pkgs; [ yubikey-manager yubikey-personalization ] ++ optionals (graphical.enable) [ @@ -43,10 +44,11 @@ in with lib; { yubikey-personalization-gui ]; file.".gnupg/gpg-agent.config" = { - text = if graphical.enable then - "pinentry-program ${pkgs.pinentry-gnome}/bin/pinentry" - else - "pinentry-program ${pkgs.pinentry-curses}/bin/pinentry"; + text = + if graphical.enable then + "pinentry-program ${pkgs.pinentry-gnome}/bin/pinentry" + else + "pinentry-program ${pkgs.pinentry-curses}/bin/pinentry"; }; }; }; diff --git a/profiles/laptop.nix b/profiles/laptop.nix index 3503682..54b2703 100644 --- a/profiles/laptop.nix +++ b/profiles/laptop.nix @@ -1,6 +1,6 @@ -{ config, lib, pkgs, ... }: { +{ config, lib, pkgs, user, ... }: { imports = [ ./graphical.nix ]; my.system.boot.enable = true; networking.networkmanager.enable = true; - users.users.james.extraGroups = [ "networkmanager" ]; + users.users."${user.name}".extraGroups = [ "networkmanager" ]; }