diff --git a/hosts/MaxNixosLaptop/configuration.nix b/hosts/MaxNixosLaptop/configuration.nix index 1394424..0eaba9e 100644 --- a/hosts/MaxNixosLaptop/configuration.nix +++ b/hosts/MaxNixosLaptop/configuration.nix @@ -22,19 +22,6 @@ }; # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.max = { - isNormalUser = true; - description = "Max Känner"; - extraGroups = ["networkmanager" "wheel" "libvirtd" "dialout"]; - shell = pkgs.zsh; - }; - - home-manager = { - extraSpecialArgs = {inherit inputs;}; - users = { - "max" = import ./home.nix; - }; - }; # List packages installed in system profile. To search, run: # $ nix search wget diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index eb6615e..baf0549 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -2,6 +2,8 @@ lib, config, system, + pkgs, + inputs, ... }: let cfg = config.myConfig; @@ -21,25 +23,39 @@ in { }; config.myConfig = lib.mkIf cfg.enable { - bootloader.enable = true; - locale.enable = true; - rebuild.enable = true; - cache.enable = true; - autoUpdate.enable = true; - podman.enable = true; - qemu.enable = true; - qemu.kvm = lib.mkIf (system == "x86_64-linux") true; - network.enable = true; + myConfig = { + bootloader.enable = true; + locale.enable = true; + rebuild.enable = true; + cache.enable = true; + autoUpdate.enable = true; + podman.enable = true; + qemu.enable = true; + qemu.kvm = lib.mkIf (system == "x86_64-linux") true; + network.enable = true; - greetd.enable = lib.mkIf cfg.desktop true; - sway.enable = lib.mkIf cfg.desktop true; - music.enable = lib.mkIf cfg.desktop true; - cups.enable = lib.mkIf cfg.desktop true; - wifi.tray = lib.mkIf cfg.desktop true; + greetd.enable = lib.mkIf cfg.desktop true; + sway.enable = lib.mkIf cfg.desktop true; + music.enable = lib.mkIf cfg.desktop true; + cups.enable = lib.mkIf cfg.desktop true; + wifi.tray = lib.mkIf cfg.desktop true; - sway.laptop = lib.mkIf cfg.laptop true; - wifi.enable = lib.mkIf cfg.laptop true; - touch.enable = lib.mkIf cfg.laptop true; - bluetooth.enable = lib.mkIf cfg.laptop true; + sway.laptop = lib.mkIf cfg.laptop true; + wifi.enable = lib.mkIf cfg.laptop true; + touch.enable = lib.mkIf cfg.laptop true; + bluetooth.enable = lib.mkIf cfg.laptop true; + }; + + users.users.${cfg.user} = { + isNormalUser = true; + description = "Max Känner"; + extraGroups = ["wheel" "dialout"]; + shell = pkgs.zsh; + }; + + home-manager = { + extraSpecialArgs = {inherit inputs;}; + users.${cfg.user} = import ./home.nix; + }; }; } diff --git a/modules/nixos/network.nix b/modules/nixos/network.nix index 48941d8..ec8b4a3 100644 --- a/modules/nixos/network.nix +++ b/modules/nixos/network.nix @@ -20,5 +20,7 @@ in { hostName = cfg.hostName; firewall.enable = false; }; + + users.users.${cfg.user}.extraGroups = ["networkmanager"]; }; } diff --git a/modules/nixos/qemu.nix b/modules/nixos/qemu.nix index 5a40060..fe32c22 100644 --- a/modules/nixos/qemu.nix +++ b/modules/nixos/qemu.nix @@ -35,5 +35,6 @@ in { }; }; boot.binfmt.emulatedSystems = ["aarch64-linux"]; + users.users.${cfg.user}.extraGroups = ["libvirtd"]; }; }