From e9b13d99836c5ccfaf8b878fd02d7f94c51e407b Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 18 Oct 2026 18:06:26 +0200 Subject: modularized the setup more --- flake.nix | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index b456354..9295725 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,7 @@ } @ inputs: let mkHost = { hostname, + username, system ? "x86_64-linux", modules ? [], }: @@ -45,6 +46,11 @@ { networking.hostName = hostname; nixpkgs.overlays = [ ocnix.overlays.default ]; + users.users.${username} = { + isNormalUser = true; + extraGroups = [ "networkmanager" "wheel" ]; + packages = [ ]; + }; } ocnix.nixosModules.opencode home-manager.nixosModules.home-manager @@ -53,8 +59,10 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.backupFileExtension = "backup"; - home-manager.extraSpecialArgs = { inherit inputs; }; - home-manager.users.phos = import ./home-manager/home.nix; + home-manager.extraSpecialArgs = { + inherit inputs hostname username; + }; + home-manager.users.${username} = import ./home-manager/home.nix; } ] ++ modules; @@ -65,6 +73,7 @@ nixosConfigurations = { phosphophyllite = mkHost { hostname = "phosphophyllite"; + username = "phos"; modules = [ ./hosts/phosphophyllite ]; @@ -73,6 +82,7 @@ # Add your laptop here when ready. # laptop-hostname = mkHost { # hostname = "laptop-hostname"; + # username = "dia"; # modules = [ ./hosts/laptop ]; # }; }; @@ -84,7 +94,11 @@ "phos@phosphophyllite" = home-manager.lib.homeManagerConfiguration { # Home-manager requires 'pkgs' instance pkgs = nixpkgs.legacyPackages.x86_64-linux; # FIXME replace x86_64-linux with your architecture - extraSpecialArgs = {inherit inputs;}; + extraSpecialArgs = { + inherit inputs; + hostname = "phosphophyllite"; + username = "phos"; + }; # > Our main home-manager configuration file < modules = [./home-manager/home.nix]; }; -- cgit v1.2.3