diff --git a/flake.nix b/flake.nix index b57530a..27c617a 100755 --- a/flake.nix +++ b/flake.nix @@ -125,54 +125,73 @@ primaryUser = "serenity"; # used for admin purposes #flakePath = "/home/${primaryUser}/SerenityOS/"; # for v1.0.0 release - #flakePath = "~/flakes/nixdots/"; # current path - #disksPath = "~/Disks/"; + flakePath = "/home/${primaryUser}/flakes/nixdots/"; # current path + disksPath = "/home/${primaryUser}/Disks/"; in { ## Installer for easy nuke-n-paves packages.x86_64-linux = { - install-iso = nixos-generators.nixosGenerate { + iso = nixos-generators.nixosGenerate { system = "x86_64-linux"; - modules = [ ./hosts/iso ]; format = "install-iso"; - specialArgs = { inherit inputs outputs; }; + specialArgs = { + inherit inputs outputs; + inherit flakePath disksPath; + inherit primaryUser; + }; + modules = [ + sops-nix.nixosModules.sops + musnix.nixosModules.musnix + disko.nixosModules.disko + ./hosts/iso + ]; }; }; ## Available through 'nixos-rebuild --flake /path/to/flake/directory#yourhostname' nixosConfigurations = { - ## Desktop + ## Desktop - primary config hades = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs outputs; + inherit flakePath disksPath; inherit primaryUser; }; modules = [ + sops-nix.nixosModules.sops musnix.nixosModules.musnix disko.nixosModules.disko - sops-nix.nixosModules.sops ./hosts/hades ]; }; ## Home server orcus = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs outputs; }; + specialArgs = { + inherit inputs outputs; + inherit flakePath disksPath; + inherit primaryUser; + }; modules = [ - disko.nixosModules.disko sops-nix.nixosModules.sops + disko.nixosModules.disko ./hosts/orcus ]; }; ## Laptop persephone = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs outputs; }; + specialArgs = { + inherit inputs outputs; + inherit flakePath disksPath; + inherit primaryUser; + }; modules = [ - disko.nixosModules.disko sops-nix.nixosModules.sops + musnix.nixosModules.musnix + disko.nixosModules.disko ./hosts/persephone ]; }; diff --git a/home/scripts/automount/default.nix b/home/scripts/automount/default.nix index be39666..00ce6c6 100755 --- a/home/scripts/automount/default.nix +++ b/home/scripts/automount/default.nix @@ -2,7 +2,7 @@ ## https://nix-community.github.io/home-manager/options.xhtml#opt-home.file ## https://nix-community.github.io/home-manager/options.xhtml#opt-home.activation -{ ... }: +{ disksPath, ... }: { @@ -15,7 +15,8 @@ ## Path to automount disks to "Disks" = { - source = ../automount/Disks; + source = ./Disks; + target = "${disksPath}"; recursive = true; }; ## (current) Flake path diff --git a/home/users/default.nix b/home/users/default.nix index 0498fbb..11f0e99 100755 --- a/home/users/default.nix +++ b/home/users/default.nix @@ -1,14 +1,12 @@ -{ inputs, outputs, pkgs, ... }: +{ inputs, outputs, pkgs, flakePath, disksPath, primaryUser, ... }: { - imports = [ - inputs.home-manager.nixosModules.default - ]; + imports = [ inputs.home-manager.nixosModules.default ]; users.users = { ## Define users like this - serenity = { + ${primaryUser} = { description = "Serenity Amalgam"; isNormalUser = true; extraGroups = [ "wheel" "networkmanager" "gamemode" "audio" ]; @@ -24,7 +22,11 @@ ## Enables verbose output on activation verbose = true; ## This line passes in specialArgs from flake.nix - extraSpecialArgs = { inherit inputs outputs; }; + extraSpecialArgs = { + inherit inputs outputs; + inherit primaryUser; + inherit flakePath disksPath; + }; ## This line ensures all packages declared follow the ## same nix-channel we declared in the flake.nix useGlobalPkgs = true; @@ -33,12 +35,12 @@ users = { ## Also make sure to include a user definition here - serenity = { + ${primaryUser} = { ## This is where the user configs/packages are imported - imports = [ ./u-serenity.nix ]; + imports = [ ./u-${primaryUser}.nix ]; home = { - username = "serenity"; - homeDirectory = "/home/serenity"; + username = "${primaryUser}"; + homeDirectory = "/home/${primaryUser}"; }; };