diff --git a/aspects/common/users.nix b/aspects/common/users.nix deleted file mode 100644 index e911663..0000000 --- a/aspects/common/users.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ ... }: -{ - flake.modules.nixos.common-users = { pkgs, ... }: { - users.users = { - user = { - isNormalUser = true; - shell = pkgs.fish; - extraGroups = [ - "networkmanager" - "wheel" - ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICQPkAyy+Du9Omc2WtnUF2TV8jFAF4H6mJi2D4IZ1nzg user@himalia" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO3Y0PVpGfJHonqDS7qoCFhqzUvqGq9I9sax+F9e/5cs user@io" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA1v3+q3EaruiiStWjubEJWvtejam/r41uoOpCdwJtLL user@rotterdam" - ]; - hashedPassword = "$6$Pj7v/CpstyuWQQV0$cNujVDhfMBdwlGVEnnd8t71.kZPixbo0u25cd.874iaqLTH4V5fa1f98V5zGapjQCz5JyZmsR94xi00sUrntT0"; - }; - root = { - shell = pkgs.fish; - hashedPassword = "!"; - }; - }; - }; -} diff --git a/aspects/hosts/alexandria.nix b/aspects/hosts/alexandria.nix index 28a367d..83304b1 100644 --- a/aspects/hosts/alexandria.nix +++ b/aspects/hosts/alexandria.nix @@ -6,7 +6,12 @@ modules = [ inputs.agenix.nixosModules.default { networking.hostName = "alexandria"; } - { nixpkgs.overlays = [ inputs.agenix.overlays.default inputs.self.overlays.default ]; } + { + nixpkgs.overlays = [ + inputs.agenix.overlays.default + inputs.self.overlays.default + ]; + } # Common aspects (always included) inputs.self.modules.nixos.common-boot @@ -19,7 +24,10 @@ inputs.self.modules.nixos.common-security inputs.self.modules.nixos.common-services inputs.self.modules.nixos.common-tailscale - inputs.self.modules.nixos.common-users + + # User aspects + inputs.self.modules.nixos.user + inputs.self.modules.nixos.root # Server aspects inputs.self.modules.nixos.server-boot diff --git a/aspects/hosts/io.nix b/aspects/hosts/io.nix index 1d7f15a..6e5b237 100644 --- a/aspects/hosts/io.nix +++ b/aspects/hosts/io.nix @@ -6,7 +6,12 @@ modules = [ inputs.agenix.nixosModules.default { networking.hostName = "io"; } - { nixpkgs.overlays = [ inputs.agenix.overlays.default inputs.self.overlays.default ]; } + { + nixpkgs.overlays = [ + inputs.agenix.overlays.default + inputs.self.overlays.default + ]; + } # Common aspects (always included) inputs.self.modules.nixos.common-boot @@ -19,7 +24,10 @@ inputs.self.modules.nixos.common-security inputs.self.modules.nixos.common-services inputs.self.modules.nixos.common-tailscale - inputs.self.modules.nixos.common-users + + # User aspects + inputs.self.modules.nixos.user + inputs.self.modules.nixos.root # Desktop aspects inputs.self.modules.nixos.desktop-boot diff --git a/aspects/hosts/rotterdam.nix b/aspects/hosts/rotterdam.nix index e9d3f18..76ffbb0 100644 --- a/aspects/hosts/rotterdam.nix +++ b/aspects/hosts/rotterdam.nix @@ -6,7 +6,12 @@ modules = [ inputs.agenix.nixosModules.default { networking.hostName = "rotterdam"; } - { nixpkgs.overlays = [ inputs.agenix.overlays.default inputs.self.overlays.default ]; } + { + nixpkgs.overlays = [ + inputs.agenix.overlays.default + inputs.self.overlays.default + ]; + } # Common aspects (always included) inputs.self.modules.nixos.common-boot @@ -19,7 +24,10 @@ inputs.self.modules.nixos.common-security inputs.self.modules.nixos.common-services inputs.self.modules.nixos.common-tailscale - inputs.self.modules.nixos.common-users + + # User aspects + inputs.self.modules.nixos.user + inputs.self.modules.nixos.root # Desktop aspects inputs.self.modules.nixos.desktop-boot diff --git a/aspects/hosts/trantor.nix b/aspects/hosts/trantor.nix index 646cc73..c43c6f2 100644 --- a/aspects/hosts/trantor.nix +++ b/aspects/hosts/trantor.nix @@ -6,7 +6,12 @@ modules = [ inputs.agenix.nixosModules.default { networking.hostName = "trantor"; } - { nixpkgs.overlays = [ inputs.agenix.overlays.default inputs.self.overlays.default ]; } + { + nixpkgs.overlays = [ + inputs.agenix.overlays.default + inputs.self.overlays.default + ]; + } # Common aspects (always included) inputs.self.modules.nixos.common-boot @@ -19,7 +24,10 @@ inputs.self.modules.nixos.common-security inputs.self.modules.nixos.common-services inputs.self.modules.nixos.common-tailscale - inputs.self.modules.nixos.common-users + + # User aspects + inputs.self.modules.nixos.user + inputs.self.modules.nixos.root # Server aspects inputs.self.modules.nixos.server-boot diff --git a/aspects/users/root.nix b/aspects/users/root.nix new file mode 100644 index 0000000..18b70eb --- /dev/null +++ b/aspects/users/root.nix @@ -0,0 +1,12 @@ +{ ... }: + +{ + flake.modules.nixos.root = + { pkgs, ... }: + { + users.root = { + shell = pkgs.fish; + hashedPassword = "!"; + }; + }; +} diff --git a/aspects/users/user.nix b/aspects/users/user.nix index 5130abf..050b1a5 100644 --- a/aspects/users/user.nix +++ b/aspects/users/user.nix @@ -1,91 +1,118 @@ -# aspects/users/user.nix { inputs, ... }: + { - flake.homeConfigurations = { - "user@rotterdam" = inputs.home-manager.lib.homeManagerConfiguration { - pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { inherit inputs; hostname = "rotterdam"; }; - modules = [ - { nixpkgs.overlays = [ inputs.self.overlays.default ]; } + flake = { + modules.nixos.user = + { pkgs, ... }: + { + users.users.user = { + isNormalUser = true; + shell = pkgs.fish; + extraGroups = [ + "networkmanager" + "wheel" + ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICQPkAyy+Du9Omc2WtnUF2TV8jFAF4H6mJi2D4IZ1nzg user@himalia" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO3Y0PVpGfJHonqDS7qoCFhqzUvqGq9I9sax+F9e/5cs user@io" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA1v3+q3EaruiiStWjubEJWvtejam/r41uoOpCdwJtLL user@rotterdam" + ]; + hashedPassword = "$6$Pj7v/CpstyuWQQV0$cNujVDhfMBdwlGVEnnd8t71.kZPixbo0u25cd.874iaqLTH4V5fa1f98V5zGapjQCz5JyZmsR94xi00sUrntT0"; + }; + }; - # CLI aspects (common module included) - inputs.self.modules.homeManager.cli-base - inputs.self.modules.homeManager.cli-btop - inputs.self.modules.homeManager.cli-comma - inputs.self.modules.homeManager.cli-direnv - inputs.self.modules.homeManager.cli-helix - inputs.self.modules.homeManager.cli-starship - inputs.self.modules.homeManager.cli-tmux + homeConfigurations = { + "user@rotterdam" = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { + inherit inputs; + hostname = "rotterdam"; + }; + modules = [ + { nixpkgs.overlays = [ inputs.self.overlays.default ]; } - # Shell - inputs.self.modules.homeManager.shell-fish - inputs.self.modules.homeManager.shell-bash + # CLI aspects (common module included) + inputs.self.modules.homeManager.cli-base + inputs.self.modules.homeManager.cli-btop + inputs.self.modules.homeManager.cli-comma + inputs.self.modules.homeManager.cli-direnv + inputs.self.modules.homeManager.cli-helix + inputs.self.modules.homeManager.cli-starship + inputs.self.modules.homeManager.cli-tmux - # Desktop - inputs.self.modules.homeManager.desktop-desktop - inputs.self.modules.homeManager.desktop-niri + # Shell + inputs.self.modules.homeManager.shell-fish + inputs.self.modules.homeManager.shell-bash - # Gaming - inputs.self.modules.homeManager.gaming-mangohud + # Desktop + inputs.self.modules.homeManager.desktop-desktop + inputs.self.modules.homeManager.desktop-niri - # Programs - inputs.self.modules.homeManager.programs-media # for obs-studio + # Gaming + inputs.self.modules.homeManager.gaming-mangohud - # Stylix - inputs.self.modules.homeManager.stylix + # Programs + inputs.self.modules.homeManager.programs-media # for obs-studio - # User-specific (from _user/) - ./_user/git.nix + # Stylix + inputs.self.modules.homeManager.stylix - # Home configuration - { - home = { - username = "user"; - homeDirectory = "/home/user"; - stateVersion = "22.05"; - }; - } - ]; - }; + # User-specific (from _user/) + ./_user/git.nix - "user@io" = inputs.home-manager.lib.homeManagerConfiguration { - pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = { inherit inputs; hostname = "io"; }; - modules = [ - { nixpkgs.overlays = [ inputs.self.overlays.default ]; } + # Home configuration + { + home = { + username = "user"; + homeDirectory = "/home/user"; + stateVersion = "22.05"; + }; + } + ]; + }; - # CLI aspects (common module included) - inputs.self.modules.homeManager.cli-base - inputs.self.modules.homeManager.cli-btop - inputs.self.modules.homeManager.cli-comma - inputs.self.modules.homeManager.cli-direnv - inputs.self.modules.homeManager.cli-helix - inputs.self.modules.homeManager.cli-starship - inputs.self.modules.homeManager.cli-tmux + "user@io" = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { + inherit inputs; + hostname = "io"; + }; + modules = [ + { nixpkgs.overlays = [ inputs.self.overlays.default ]; } - # Shell - inputs.self.modules.homeManager.shell-fish - inputs.self.modules.homeManager.shell-bash + # CLI aspects (common module included) + inputs.self.modules.homeManager.cli-base + inputs.self.modules.homeManager.cli-btop + inputs.self.modules.homeManager.cli-comma + inputs.self.modules.homeManager.cli-direnv + inputs.self.modules.homeManager.cli-helix + inputs.self.modules.homeManager.cli-starship + inputs.self.modules.homeManager.cli-tmux - # Desktop - inputs.self.modules.homeManager.desktop-desktop - inputs.self.modules.homeManager.desktop-niri + # Shell + inputs.self.modules.homeManager.shell-fish + inputs.self.modules.homeManager.shell-bash - # Stylix - inputs.self.modules.homeManager.stylix + # Desktop + inputs.self.modules.homeManager.desktop-desktop + inputs.self.modules.homeManager.desktop-niri - # User-specific (from _user/) - ./_user/git.nix + # Stylix + inputs.self.modules.homeManager.stylix - # Home configuration - { - home = { - username = "user"; - homeDirectory = "/home/user"; - stateVersion = "22.05"; - }; - } - ]; + # User-specific (from _user/) + ./_user/git.nix + + # Home configuration + { + home = { + username = "user"; + homeDirectory = "/home/user"; + stateVersion = "22.05"; + }; + } + ]; + }; }; }; }