Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
70e3e79
begin rewriting options
42willow Jun 12, 2026
3cb4da8
move some stuff around
42willow Jun 12, 2026
f72edd7
modularise options
42willow Jun 12, 2026
dc3e2ab
more adjustments
42willow Jun 13, 2026
a6c1d40
format
42willow Jun 13, 2026
406d3ad
avoid repeated keys
42willow Jun 13, 2026
70b2f4c
deadnix
42willow Jun 13, 2026
6d25e60
Merge branch 'main' into restructure-config
42willow Jun 14, 2026
88da712
attempt to fix up options
42willow Jun 14, 2026
942e40b
fix infinite recursion
42willow Jun 14, 2026
c2f61f9
format
42willow Jun 14, 2026
bb39da4
try fix infinite recursion
42willow Jun 14, 2026
e4e5e36
fix syncthing option
42willow Jun 14, 2026
7525327
undo change
42willow Jun 14, 2026
d755970
change profile settings
42willow Jun 14, 2026
d0c5aee
revert: autogen docs
42willow Jun 14, 2026
a8f3815
fix old options
42willow Jun 14, 2026
67e373c
fix more old stuff
42willow Jun 14, 2026
99ae80f
oops cura doesn't exist
42willow Jun 14, 2026
8be7bdd
fix hostname capitalisation
42willow Jun 14, 2026
a2857e1
forgot to include chromium option
42willow Jun 14, 2026
0979696
fix up some oopsies
42willow Jun 14, 2026
0b8407a
remove non existent category
42willow Jun 14, 2026
87eb425
trigger ci
42willow Jun 14, 2026
0c0fb24
trigger ci
42willow Jun 14, 2026
50784c3
trigger ci
42willow Jun 14, 2026
8cadccf
trigger ci
42willow Jun 14, 2026
10b7aca
ci: use aarch64-linux for anemone
42willow Jun 14, 2026
c1bc17f
trigger ci
42willow Jun 14, 2026
60641b5
Merge branch 'main' into restructure-config
42willow Jun 14, 2026
1d61fe1
Merge branch 'main' into restructure-config
42willow Jun 14, 2026
2798fa7
ci: check: use arm runner for anemone
42willow Jun 14, 2026
31d3c9a
hosts: starling: use desktop profile
42willow Jun 14, 2026
8fe0bdc
Merge branch 'main' into restructure-config
42willow Jun 14, 2026
8ad0dc0
Merge branch 'main' into restructure-config
42willow Jun 14, 2026
f677d77
profile base config
42willow Jun 15, 2026
9b1ba5b
disable backups by default
42willow Jun 15, 2026
ac74d8b
enable privacy category by default
42willow Jun 15, 2026
821667f
enable devtools for desktop
42willow Jun 15, 2026
030846e
remove hyprland again
42willow Jun 15, 2026
7c13b20
Merge branch 'main' into restructure-config
42willow Jun 15, 2026
5aafaf7
try minimise diff
42willow Jun 15, 2026
5fa90a0
additional changes that i need to undo later on
42willow Jun 15, 2026
393ae6a
revert: "additional changes that i need to undo later on"
42willow Jun 15, 2026
d797dae
lib: mkProgramOption
42willow Jun 16, 2026
ff89d17
anemone: disable programs
42willow Jun 16, 2026
a1fc95b
lib: mkProgramsOptions tree walker
42willow Jun 19, 2026
a783356
Merge branch 'main' into restructure-config
42willow Jun 19, 2026
aa929fd
move shell option
42willow Jun 19, 2026
79a9d43
fix oopsies from merge
42willow Jun 19, 2026
d689e95
do things
42willow Jun 19, 2026
a12b697
fix incorrect option
42willow Jun 19, 2026
514cd05
fix oopsy again
42willow Jun 19, 2026
f1abd43
ci: replace magic-nix-cache with hestia
42willow Jun 20, 2026
a3b42f9
Merge branch 'main' into restructure-config
42willow Jun 20, 2026
a4c1aea
Merge branch 'main' into restructure-config
42willow Jun 20, 2026
c8e83eb
some optional logging and comments
42willow Jun 20, 2026
725d509
improve variable names
42willow Jun 20, 2026
3818864
some thingies that i need to fix
42willow Jun 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
nixpkgs,
...
} @ inputs: let
mkNixosSystem = name: hostPath:
mkNixosSystem = _name: hostPath:
nixos-stable.lib.nixosSystem {
modules = [
hostPath
Expand All @@ -18,7 +18,7 @@
specialArgs = {inherit self inputs;};
};

mkDarwinSystem = name: hostPath:
mkDarwinSystem = _name: hostPath:
nix-darwin.lib.darwinSystem {
modules = [
hostPath
Expand Down
23 changes: 5 additions & 18 deletions hosts/anemone/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,11 @@

disabledModules = ["profiles/base.nix"];

settings = {
programs = {
enable = false;
cli.enable = true;
tui.enable = true;
categories = {
enable = false;
core.enable = true;
};
};
system = {
hostName = "anemone";
services = {
enable = false;
networking.enable = true;
};
};
desktop.enable = false;
profile = "server";
nest = {
system.hostName = "anemone";
services.enable = false;
programs.enable = false;
};

services.openssh = {
Expand Down
55 changes: 31 additions & 24 deletions hosts/earthy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
"${self}/modules/nixos"
];

settings = {
system = {
hostName = "earthy";
services.sync.enable = true;
profile = "desktop";
nest = {
system.hostName = "earthy";
services = {
syncthing.enable = true;
selfhost = {
mpd.enable = true;
};
};
};

services.openssh = {
enable = true;
settings = {
PermitRootLogin = "yes";
programs = {
terminal.emulator.alacritty.enable = true;
};
};

Expand All @@ -34,21 +34,28 @@
in ["${automount_opts},credentials=${config.age.secrets.samba.path}"];
};

# tlp
services.tlp = {
enable = true;
settings = {
CPU_ENERGY_PERF_POLICY_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power";
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
WIFI_PWR_ON_AC = "off"; # default: off
WIFI_PWR_ON_BAT = "off"; # default: on todo)) trying to resolve samba frozen unit session slice issue
services = {
tlp = {
enable = true;
settings = {
CPU_ENERGY_PERF_POLICY_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power";
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
WIFI_PWR_ON_AC = "off"; # default: off
WIFI_PWR_ON_BAT = "off"; # default: on todo)) trying to resolve samba frozen unit session slice issue
};
};
};

# fwupd
services.fwupd = {
enable = true;
openssh = {
enable = true;
settings = {
PermitRootLogin = "yes";
};
};

fwupd = {
enable = true;
};
};
}
8 changes: 5 additions & 3 deletions hosts/starling/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
config,
...
}: let
cfg = config.settings;
cfg = config.nest;
in {
imports = [
"${self}/modules/darwin"
Expand All @@ -16,7 +16,8 @@ in {
hostName = "starling";
};

settings = {
profile = "desktop";
nest = {
system = {
user = let
home = "/Users/${cfg.system.user.name}";
Expand All @@ -30,8 +31,9 @@ in {
group = "staff";
flakeDir = "${home}/Documents/git/flake";
};
services.sync.enable = true;
};
services.syncthing.enable = true; # TODO enable syncthing (disabled in module) - requires disabling syncthing network which is flagged
programs.terminal.emulator.alacritty.enable = true;
};

nix = {
Expand Down
6 changes: 4 additions & 2 deletions modules/darwin/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{config, ...}: let
inherit (config.settings.system) user;
inherit (config.nest.system) user;
in {
imports = [
../shared
./desktop
./home
./homebrew.nix
./nix
./services

../shared
../lib
];

users.users.${user.name}.home = user.home;
Expand Down
10 changes: 5 additions & 5 deletions modules/darwin/desktop/aerospace.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
enable = false;

settings = {
gaps = {
outer.left = 8;
outer.bottom = 8;
outer.top = 8;
outer.right = 8;
gaps.outer = {
left = 8;
bottom = 8;
top = 8;
right = 8;
};
mode.main.binding =
{
Expand Down
2 changes: 1 addition & 1 deletion modules/darwin/home/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{config, ...}: let
inherit (config.settings.system) user;
inherit (config.nest.system) user;
in {
home-manager.users.${user.name} = {
imports = [
Expand Down
2 changes: 1 addition & 1 deletion modules/darwin/home/glide-wm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
osConfig,
...
}: let
inherit (osConfig.settings.system.user) flakeDir;
inherit (osConfig.nest.system.user) flakeDir;
mkLink = config.lib.file.mkOutOfStoreSymlink;
settingsFile = mkLink "${flakeDir}/modules/darwin/home/glide.toml";
in {
Expand Down
89 changes: 89 additions & 0 deletions modules/lib/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
config,
lib,
...
}: let
inherit (lib) mkEnableOption toUpper getAttrFromPath concatStringsSep optionalString;

traceLogs = true;
trace = msg: x:
if traceLogs
then builtins.trace msg x
else x;
in {
_module.args.lib' = {
# __functor allows a description to be optionally attached
# e.g. lib'.programType.cli "description" or lib'.programType.cli
programType = let
base = type: {
programType = type;
description = null;
__functor = self: description: self // {inherit description;};
};
in {
cli = base "cli";
gui = base "gui";
};

# group constructor (so the tree walker knows its a group)
mkProgramGroup = name: children: {inherit name children;};

mkProgramOptions = tree: let
# resolve a list-path against the final merged config
# e.g. ["nest" "programs" "shell" "git" "enable"]
get = path: getAttrFromPath path config;

# walk the tree recursively
#
# treePath:
# relative path from tree root
# grows on every decent (groups + plain attrsets)
# e.g. ["terminal" "tools"]
#
# parentEnablePaths:
# paths of every parent group enable
# grows on group nodes (mkProgramGroup)
# e.g. [["nest" "programs" "terminal" "tools" "enable"]]
#
# plain attrsets don't add parentEnablePaths, but treePath still advances
walk = treePath: parentEnablePaths:
builtins.mapAttrs (
name: value:
if value ? programType
# leaf node (program)
then let
typ = value.programType;
desc = value.description or "${toUpper typ} program ${name}";
default =
config.nest.programs.enable # global master
&& config.nest.programs.${typ} # type (e.g. nest.programs.cli)
&& builtins.all (x: x) (map get parentEnablePaths); # all parent groups enabled
defaultText =
"nest.programs.enable and nest.programs.${typ}"
+ optionalString (parentEnablePaths != [])
(" and " + concatStringsSep " and " (map (concatStringsSep ".") parentEnablePaths));
in
trace "PROGRAM: name=${name}, treePath=[${concatStringsSep "," treePath}], parentEnablePaths=[${concatStringsSep "; " (map (concatStringsSep ".") parentEnablePaths)}], default=${builtins.toString default}"
{enable = mkEnableOption desc // {inherit default defaultText;};}
// builtins.removeAttrs value ["programType" "description" "__functor"]
# group node
else if value ? children
then let
fullPath = treePath ++ [name]; # e.g. ["terminal" "tools" "ripgrep"]
ancestorPath = ["nest" "programs"] ++ fullPath ++ ["enable"];
in
trace "GROUP: name=${value.name}, fullPath=[${concatStringsSep "," fullPath}], ancestorPath=[${concatStringsSep "," ancestorPath}]"
{enable = mkEnableOption value.name;}
// walk fullPath (parentEnablePaths ++ [ancestorPath]) (value.children)
# plain attrset (structural grouping without option)
else if builtins.isAttrs value
then
trace "ATTRSET: name=${name}, treePath=[${concatStringsSep "," treePath}] recursing"
(walk (treePath ++ [name]) parentEnablePaths value)
# pass through unchanged
else trace "VALUE: name=${name} (non-attrs, passing through)" value
);
in
walk [] [] tree;
};
}
11 changes: 9 additions & 2 deletions modules/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
config,
...
}: let
inherit (config.settings.system) user;
inherit (config.nest.system) user;

keys = [
"${self}/keys/anemone.pub"
Expand All @@ -22,13 +22,20 @@ in {
./themes

../shared
../lib
];

users.users.${user.name} = {
inherit (user) home;
isNormalUser = true;
extraGroups = ["networkmanager" "wheel" "dialout"];
shell = pkgs.zsh;
shell =
if user.shell == "zsh"
then pkgs.zsh
else if user.shell == "nushell"
then pkgs.nushell
else pkgs.bash;

initialHashedPassword = "";
openssh.authorizedKeys.keyFiles = keys;
};
Expand Down
4 changes: 2 additions & 2 deletions modules/nixos/desktop/niri.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
lib,
...
}: let
cfg = config.settings.desktop.niri;
cfg = config.nest.desktop;
in {
imports = [inputs.niri.nixosModules.niri];

config = lib.mkIf cfg.enable {
config = lib.mkIf (cfg.enable && cfg.niri.enable) {
niri-flake.cache.enable = true;
nixpkgs.overlays = [inputs.niri.overlays.niri];

Expand Down
2 changes: 1 addition & 1 deletion modules/nixos/home/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{config, ...}: let
inherit (config.settings.system) user;
inherit (config.nest.system) user;
in {
home-manager.users.${user.name} = {
imports = [
Expand Down
4 changes: 2 additions & 2 deletions modules/nixos/home/desktop/niri/binds.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
osConfig,
...
}: let
cfg = osConfig.settings.desktop.niri;
cfg = osConfig.nest.desktop;
wpctl = lib.getExe' pkgs.wireplumber "wpctl";
in {
config = lib.mkIf cfg.enable {
config = lib.mkIf (cfg.enable && cfg.niri.enable) {
programs.niri.settings.binds =
{
# ==== Actions ====
Expand Down
4 changes: 2 additions & 2 deletions modules/nixos/home/desktop/niri/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
lib,
...
}: let
cfg = osConfig.settings.desktop.niri;
cfg = osConfig.nest.desktop;
in {
imports = [
./binds.nix
];

config = lib.mkIf cfg.enable {
config = lib.mkIf (cfg.enable && cfg.niri.enable) {
programs.niri.settings = {
animations.enable = true;
prefer-no-csd = true;
Expand Down
Loading