feat: implement hybrid declarative state with automatic Nix sync
Some checks failed
Check / eval-and-lint (push) Has been cancelled

This commit is contained in:
Bernardo Magri
2026-05-31 20:09:12 +01:00
parent 624023c1d5
commit dc3346bc55
18 changed files with 182 additions and 48 deletions

View File

@@ -88,35 +88,44 @@ in
wallpaper = lib.mkOption {
type = lib.types.str;
default = schema.home.wallpaper;
description = "System wallpaper path.";
description = ''
System wallpaper path. This is the declarative source of truth.
Changing this and running `nomarchy-env-update` (or a system
rebuild) will update the background.
'';
};
panelPosition = lib.mkOption {
type = lib.types.enum [ "top" "bottom" ];
default = schema.home.panelPosition;
description = "Waybar panel position.";
description = ''
Waybar panel position. This is the declarative source of truth.
Changing this and running `nomarchy-env-update` (or a system
rebuild) will update the UI.
'';
};
hyprland = {
gaps_in = lib.mkOption {
type = lib.types.int;
default = schema.home.hyprland.gaps_in;
description = "Inner gaps for Hyprland.";
description = "Inner gaps for Hyprland. Driven by the declarative state.";
};
gaps_out = lib.mkOption {
type = lib.types.int;
default = schema.home.hyprland.gaps_out;
description = "Outer gaps for Hyprland.";
description = "Outer gaps for Hyprland. Driven by the declarative state.";
};
border_size = lib.mkOption {
type = lib.types.int;
default = schema.home.hyprland.border_size;
description = "Border size for Hyprland.";
description = "Border size for Hyprland. Driven by the declarative state.";
};
scale = lib.mkOption {
type = lib.types.str;
default = schema.home.hyprland.scale;
description = ''
Default monitor scale. Use "auto" to let Hyprland decide,
or a numeric string like "1", "1.25", "1.5", "2".
or a numeric string like "1", "1.25", "1.5", "2". Driven
by the declarative state.
'';
};
};

View File

@@ -21,8 +21,7 @@ else
notify-send -u low " Stop locking computer when idle"
fi
TMP_JSON=$(mktemp)
jq --argjson val "$NEW_VALUE" '.idle = $val' "$STATE_FILE" > "$TMP_JSON" && mv "$TMP_JSON" "$STATE_FILE"
nomarchy-state-write idle "$NEW_VALUE" --type bool
echo "Idle state set to $NEW_VALUE. Environment will be fully updated on next rebuild."