Reduce redundancy in flake.nix, add new hm profile for desktops

This commit is contained in:
Bun 2025-05-11 00:01:07 -04:00
parent 20707d250e
commit 2d9dcf079a
7 changed files with 64 additions and 48 deletions

36
flake.lock generated
View file

@ -64,11 +64,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1746411114, "lastModified": 1746729224,
"narHash": "sha256-mLlkVX1kKbAa/Ns5u26wDYw4YW4ziMFM21fhtRmfirU=", "narHash": "sha256-9R4sOLAK1w3Bq54H3XOJogdc7a6C2bLLmatOQ+5pf5w=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "b5d1320ebc2f34dbea4655f95167f55e2130cdb3", "rev": "85555d27ded84604ad6657ecca255a03fd878607",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -287,11 +287,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1746158343, "lastModified": 1746681524,
"narHash": "sha256-i/1os9oEq0m/Da4FTdSqKUdI4+wzrvoDTuk1/dHSVDc=", "narHash": "sha256-c5kDVFh+vVfQSEXdVIudFRzPH3LO8j2ImgsBeo8v+Eo=",
"owner": "Jovian-Experiments", "owner": "Jovian-Experiments",
"repo": "Jovian-NixOS", "repo": "Jovian-NixOS",
"rev": "8b45a8efb2829adf2996b51965ada1e4620631ac", "rev": "14eb8f7d2b0cca74691db620292037bdb813ceb7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -358,11 +358,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1746324578, "lastModified": 1746842210,
"narHash": "sha256-VUSIQ2W1Q3YgGvX3M4jPwIi3iIApdPHabhdrVjVgnwE=", "narHash": "sha256-bGJ3q4BEJEEz9MNo2QwXgQULmSUItxn52lMQLNImZ+w=",
"owner": "Infinidoge", "owner": "Infinidoge",
"repo": "nix-minecraft", "repo": "nix-minecraft",
"rev": "9e7fd83ba3b25b6f03561a5b7f8ea74b70296816", "rev": "9acdd362e10b50cb36234544b5b80b3d0372456d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -464,11 +464,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1746568792, "lastModified": 1746906291,
"narHash": "sha256-e3QkOhtYJUlMLGCVUmQWULtVDokSJqud0VmPZoRj4s0=", "narHash": "sha256-dX85SDSt4h7281Dkox9NnTPjCIDs5JxkJQB9Czd7ajc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "29d16321b0f48ad0d24c3eaf5656adfaaf99d19e", "rev": "7c77c4255a4cda029257090a72806dbd48ea14e3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -547,11 +547,11 @@
}, },
"stable": { "stable": {
"locked": { "locked": {
"lastModified": 1746422338, "lastModified": 1746557022,
"narHash": "sha256-NTtKOTLQv6dPfRe00OGSywg37A1FYqldS6xiNmqBUYc=", "narHash": "sha256-QkNoyEf6TbaTW5UZYX0OkwIJ/ZMeKSSoOMnSDPQuol0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5b35d248e9206c1f3baf8de6a7683fee126364aa", "rev": "1d3aeb5a193b9ff13f63f4d9cc169fb88129f860",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -628,11 +628,11 @@
}, },
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1746461020, "lastModified": 1746663147,
"narHash": "sha256-7+pG1I9jvxNlmln4YgnlW4o+w0TZX24k688mibiFDUE=", "narHash": "sha256-Ua0drDHawlzNqJnclTJGf87dBmaO/tn7iZ+TCkTRpRc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3730d8a308f94996a9ba7c7138ede69c1b9ac4ae", "rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -51,29 +51,37 @@
inputs.flake-utils.lib.eachDefaultSystemPassThrough (system: inputs.flake-utils.lib.eachDefaultSystemPassThrough (system:
with inputs; let with inputs; let
mkNix = modules: channel: channel.lib.nixosSystem { mkNix = name: channel: channel.lib.nixosSystem {
inherit modules; modules = [ (./hosts + "/${name}") ];
specialArgs = inputs; specialArgs = inputs;
}; };
mkHome = modules: channel: hm.lib.homeManagerConfiguration { mkHome = channel: modules: hm.lib.homeManagerConfiguration {
inherit modules; inherit modules;
pkgs = channel.legacyPackages.${system};
extraSpecialArgs = inputs; extraSpecialArgs = inputs;
pkgs = builtins.getAttr system channel.legacyPackages;
};
hostChannels = {
tower = stable;
intuos = stable;
jupiter = unstable;
redmond = stable;
midas = stable;
kitty = stable;
prophet = stable;
}; };
in { in {
nixosConfigurations = { nixosConfigurations = builtins.mapAttrs (name: channel: mkNix name channel) hostChannels;
tower = mkNix [ ./hosts/tower ] stable;
intuos = mkNix [ ./hosts/intuos ] stable; homeConfigurations = {
jupiter = mkNix [ ./hosts/jupiter ] unstable; default = mkHome stable [ ./modules/home ];
redmond = mkNix [ ./hosts/redmond ] stable; full = mkHome stable [
./modules/home
midas = mkNix [ ./hosts/midas ] stable; { home.guifull.enable = true; }
kitty = mkNix [ ./hosts/kitty ] stable; ];
prophet = mkNix [ ./hosts/prophet ] stable;
}; };
homeConfigurations.bun = mkHome [ ./modules/home ] stable;
} }
); );
} }

View file

@ -1,9 +1,7 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
home-manager.users."${config.sysusers.main}".home = { home-manager.users."${config.sysusers.main}".home = {
desktop.enable = true; guifull.enable = true;
gaming.enable = true;
production.enable = true;
school.enable = true; school.enable = true;
enableNixpkgsReleaseCheck = false; enableNixpkgsReleaseCheck = false;
stateVersion = lib.mkForce config.system.stateVersion; stateVersion = lib.mkForce config.system.stateVersion;

View file

@ -1,9 +1,7 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
home-manager.users."${config.sysusers.main}".home = { home-manager.users."${config.sysusers.main}".home = {
desktop.enable = true; guifull.enable = true;
gaming.enable = true;
production.enable = true;
stateVersion = lib.mkForce config.system.stateVersion; stateVersion = lib.mkForce config.system.stateVersion;
}; };
} }

View file

@ -1,6 +1,7 @@
{ lib, ... }: { lib, ... }:
{ {
imports = [ imports = [
./profiles
./programs ./programs
./services ./services
./settings ./settings
@ -9,12 +10,5 @@
./wms ./wms
]; ];
options.home = with lib; {
desktop.enable = mkEnableOption "Desktop programs and services";
gaming.enable = mkEnableOption "Gaming apps and programs";
production.enable = mkEnableOption "Apps for visual productivity";
school.enable = mkEnableOption "Apps for school and college";
};
config.home.stateVersion = "24.11"; config.home.stateVersion = "24.11";
} }

View file

@ -0,0 +1,18 @@
{ config, lib, ... }:
{
options.home = with lib; {
guifull.enable = mkEnableOption "Enable most other GUI profiles";
desktop.enable = mkEnableOption "Desktop programs and services";
gaming.enable = mkEnableOption "Gaming apps and programs";
production.enable = mkEnableOption "Apps for visual productivity";
school.enable = mkEnableOption "Apps for school and college";
};
config.home = lib.mkIf config.home.guifull.enable {
desktop.enable = true;
gaming.enable = true;
production.enable = true;
};
}

View file

@ -1,4 +1,4 @@
{ lib, ... }: { config, lib, ... }:
{ {
imports = [ imports = [
./devices ./devices