This commit is contained in:
serenity-F 2024-12-26 21:13:21 +10:00
parent 80dbb77a3a
commit 3b7618e9af
3 changed files with 45 additions and 23 deletions

View file

@ -125,54 +125,73 @@
primaryUser = "serenity"; # used for admin purposes primaryUser = "serenity"; # used for admin purposes
#flakePath = "/home/${primaryUser}/SerenityOS/"; # for v1.0.0 release #flakePath = "/home/${primaryUser}/SerenityOS/"; # for v1.0.0 release
#flakePath = "~/flakes/nixdots/"; # current path flakePath = "/home/${primaryUser}/flakes/nixdots/"; # current path
#disksPath = "~/Disks/"; disksPath = "/home/${primaryUser}/Disks/";
in { in {
## Installer for easy nuke-n-paves ## Installer for easy nuke-n-paves
packages.x86_64-linux = { packages.x86_64-linux = {
install-iso = nixos-generators.nixosGenerate { iso = nixos-generators.nixosGenerate {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ ./hosts/iso ];
format = "install-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 <switch> --flake /path/to/flake/directory#yourhostname' ## Available through 'nixos-rebuild <switch> --flake /path/to/flake/directory#yourhostname'
nixosConfigurations = { nixosConfigurations = {
## Desktop ## Desktop - primary config
hades = nixpkgs.lib.nixosSystem { hades = nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
inherit inputs outputs; inherit inputs outputs;
inherit flakePath disksPath;
inherit primaryUser; inherit primaryUser;
}; };
modules = [ modules = [
sops-nix.nixosModules.sops
musnix.nixosModules.musnix musnix.nixosModules.musnix
disko.nixosModules.disko disko.nixosModules.disko
sops-nix.nixosModules.sops
./hosts/hades ./hosts/hades
]; ];
}; };
## Home server ## Home server
orcus = nixpkgs.lib.nixosSystem { orcus = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; }; specialArgs = {
inherit inputs outputs;
inherit flakePath disksPath;
inherit primaryUser;
};
modules = [ modules = [
disko.nixosModules.disko
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
disko.nixosModules.disko
./hosts/orcus ./hosts/orcus
]; ];
}; };
## Laptop ## Laptop
persephone = nixpkgs.lib.nixosSystem { persephone = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; }; specialArgs = {
inherit inputs outputs;
inherit flakePath disksPath;
inherit primaryUser;
};
modules = [ modules = [
disko.nixosModules.disko
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
musnix.nixosModules.musnix
disko.nixosModules.disko
./hosts/persephone ./hosts/persephone
]; ];
}; };

View file

@ -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.file
## https://nix-community.github.io/home-manager/options.xhtml#opt-home.activation ## https://nix-community.github.io/home-manager/options.xhtml#opt-home.activation
{ ... }: { disksPath, ... }:
{ {
@ -15,7 +15,8 @@
## Path to automount disks to ## Path to automount disks to
"Disks" = { "Disks" = {
source = ../automount/Disks; source = ./Disks;
target = "${disksPath}";
recursive = true; recursive = true;
}; };
## (current) Flake path ## (current) Flake path

View file

@ -1,14 +1,12 @@
{ inputs, outputs, pkgs, ... }: { inputs, outputs, pkgs, flakePath, disksPath, primaryUser, ... }:
{ {
imports = [ imports = [ inputs.home-manager.nixosModules.default ];
inputs.home-manager.nixosModules.default
];
users.users = { users.users = {
## Define users like this ## Define users like this
serenity = { ${primaryUser} = {
description = "Serenity Amalgam"; description = "Serenity Amalgam";
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "gamemode" "audio" ]; extraGroups = [ "wheel" "networkmanager" "gamemode" "audio" ];
@ -24,7 +22,11 @@
## Enables verbose output on activation ## Enables verbose output on activation
verbose = true; verbose = true;
## This line passes in specialArgs from flake.nix ## 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 ## This line ensures all packages declared follow the
## same nix-channel we declared in the flake.nix ## same nix-channel we declared in the flake.nix
useGlobalPkgs = true; useGlobalPkgs = true;
@ -33,12 +35,12 @@
users = { users = {
## Also make sure to include a user definition here ## Also make sure to include a user definition here
serenity = { ${primaryUser} = {
## This is where the user configs/packages are imported ## This is where the user configs/packages are imported
imports = [ ./u-serenity.nix ]; imports = [ ./u-${primaryUser}.nix ];
home = { home = {
username = "serenity"; username = "${primaryUser}";
homeDirectory = "/home/serenity"; homeDirectory = "/home/${primaryUser}";
}; };
}; };