Skip to content

Commit 39a0d86

Browse files
stackptrclaude
andauthored
feat(hosts): add lightweight option for package management (#345)
* feat(hosts): add lightweight option to replace hostname-based package checks Replace hardcoded hostname checks (zeta, spore) with a declarative lightweight option in host definitions. This allows hosts to opt-out of heavy packages (development tools, containers, javascript, graphite, jujutsu, file utilities, media tools) independently of their hostname, making the configuration more explicit and extensible. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * feat(home): enable AI packages on all hosts Move development.ai.enable out of the lightweight-gated block so lightweight hosts (zeta, spore) also get AI packages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 925479d commit 39a0d86

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎flake.nix‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
hostname = "zeta";
9191
system = "aarch64-linux";
9292
username = "mu";
93+
lightweight = true;
9394
};
9495
glyph = mkNixosHost {
9596
hostname = "glyph";
@@ -100,6 +101,7 @@
100101
hostname = "spore";
101102
system = "x86_64-linux";
102103
username = "mu";
104+
lightweight = true;
103105
};
104106
};
105107

‎home/default.nix‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
config,
33
pkgs,
44
lib,
5-
hostname,
5+
lightweight,
66
...
77
}: {
88
imports = [
@@ -16,6 +16,7 @@
1616

1717
rc = lib.mkMerge [
1818
{
19+
development.ai.enable = true;
1920
editor.enable = true;
2021
git.enable = true;
2122
ssh.enable = true;
@@ -26,9 +27,8 @@
2627
};
2728
}
2829

29-
(lib.mkIf (hostname != "spore" && hostname != "zeta") {
30+
(lib.mkIf (!lightweight) {
3031
development = {
31-
ai.enable = true;
3232
containers.enable = true;
3333
javascript.enable = true;
3434
};

‎lib/hosts.nix‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ inputs @ {
2323
hostname,
2424
system,
2525
showBatteryStatus,
26+
lightweight ? false,
2627
}: let
2728
pkgs-stable = import nixpkgs-stable {inherit system;};
2829
hostHomePath = ./../hosts/${hostname}/home.nix;
@@ -44,14 +45,15 @@ inputs @ {
4445
++ nixpkgs.lib.optionals (hostHomeConfig != null) [hostHomeConfig];
4546
};
4647
home-manager.extraSpecialArgs = {
47-
inherit hostname llm-profile pkgs-stable showBatteryStatus;
48+
inherit hostname lightweight llm-profile pkgs-stable showBatteryStatus;
4849
};
4950
};
5051

5152
mkNixosHost = {
5253
hostname,
5354
system,
5455
username,
56+
lightweight ? false,
5557
}:
5658
nixpkgs.lib.nixosSystem {
5759
inherit system;
@@ -68,7 +70,7 @@ inputs @ {
6870
agenix.nixosModules.default
6971
home-manager.nixosModules.home-manager
7072
(mkHomeManager {
71-
inherit username hostname system;
73+
inherit username hostname system lightweight;
7274
showBatteryStatus = false;
7375
})
7476
{
@@ -82,6 +84,7 @@ inputs @ {
8284
mkDarwinHost = {
8385
hostname,
8486
username,
87+
lightweight ? false,
8588
}: let
8689
system = "aarch64-darwin";
8790
in
@@ -99,7 +102,7 @@ inputs @ {
99102
./../hosts/${hostname}
100103
home-manager.darwinModules.home-manager
101104
(mkHomeManager {
102-
inherit username hostname system;
105+
inherit username hostname system lightweight;
103106
showBatteryStatus = true;
104107
})
105108
{

0 commit comments

Comments
 (0)