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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,7 @@
{ lib, ... }:
{
imports = [
./profiles
./programs
./services
./settings
@ -9,12 +10,5 @@
./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";
}

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 = [
./devices