diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83aea05..2fa6d39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,7 +83,9 @@ jobs: - name: Check evaluation run: nix flake show - name: Build nix packages - run: nix run nixpkgs#nix-fast-build -- --skip-cached --flake ".#checks.$(nix eval --raw --impure --expr builtins.currentSystem)" -j 1 --eval-workers 1 --no-nom --cachix-cache toyvo --option accept-flake-config true + run: | + nix run nixpkgs#cachix -- watch-store toyvo & + nix build --print-build-logs ".#checks.$(nix eval --raw --impure --expr builtins.currentSystem).all" --option accept-flake-config true env: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Report check to PR branch diff --git a/AGENTS.md b/AGENTS.md index c7e3781..8dddc54 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -57,7 +57,7 @@ nh darwin switch ~/nixcfg home-manager switch --flake .# ``` -**No Traditional Tests**: This repo has no unit tests. Validation is via `nix flake show` (evaluation check) and building outputs. CI uses `nix-fast-build` for all checks. +**No Traditional Tests**: This repo has no unit tests. Validation is via `nix flake show` (evaluation check) and building outputs. CI builds the aggregate `checks..all` derivation with a single `nix build` (cachix `watch-store` pushes results). ## Code Style Guidelines diff --git a/configurations/nixos/nas/configuration.nix b/configurations/nixos/nas/configuration.nix index 04bc683..773b821 100644 --- a/configurations/nixos/nas/configuration.nix +++ b/configurations/nixos/nas/configuration.nix @@ -610,4 +610,5 @@ in toyvo ]; }; + zramSwap.enable = true; } diff --git a/configurations/nixos/router/configure-technitium.py b/configurations/nixos/router/configure-technitium.py old mode 100644 new mode 100755 diff --git a/flake.nix b/flake.nix index f25ae9d..deb139c 100644 --- a/flake.nix +++ b/flake.nix @@ -382,7 +382,13 @@ // lib.mapAttrs' (n: lib.nameValuePair "devShells-${n}") ( lib.filterAttrs (n: v: self.lib.isCacheable v) self'.devShells ) - // (deploy-rs-checks.${system} or { }); + // (deploy-rs-checks.${system} or { }) + // { + # Aggregate of every check. Excludes itself by name to avoid infinite recursion. + all = pkgs.runCommand "checks-all" { + buildInputs = builtins.attrValues (builtins.removeAttrs config.checks [ "all" ]); + } "touch $out"; + }; }; } ); diff --git a/modules/home/programs/jujutsu.nix b/modules/home/programs/jujutsu.nix index 94950ec..591a1cb 100644 --- a/modules/home/programs/jujutsu.nix +++ b/modules/home/programs/jujutsu.nix @@ -38,79 +38,80 @@ in }; }; - config = - lib.mkIf cfg.enable { - programs.jujutsu.settings.aliases = { - f = [ - "git" - "fetch" - "--all-remotes" - ]; - fetch = [ - "git" - "fetch" - "--all-remotes" - ]; - rbm = [ - "util" - "exec" - "--" - "bash" - "-c" - ''jj git fetch --all-remotes && jj rebase "$@" -d main@origin'' - "" - ]; - ai-describe = lib.mkIf cfg.aiDescribe.enable [ - "util" - "exec" - "--" - "bash" - "-c" - '' - if [ -n "$1" ]; then - CHANGE_ID="$1" - else - CHANGE_ID="@" - fi - # Parse extra context flags - EXTRA_CONTEXT="" - shift 2>/dev/null || true - while [ $# -gt 0 ]; do - case "$1" in - -C) - if [ -n "$2" ]; then - EXTRA_CONTEXT="Add context: $2" - shift 2 - else - shift - fi - ;; - *) + config = lib.mkIf cfg.enable { + programs.jujutsu.settings.aliases = { + f = [ + "git" + "fetch" + "--all-remotes" + ]; + fetch = [ + "git" + "fetch" + "--all-remotes" + ]; + rbm = [ + "util" + "exec" + "--" + "bash" + "-c" + ''jj git fetch --all-remotes && jj rebase "$@" -d main@origin'' + "" + ]; + ai-describe = lib.mkIf cfg.aiDescribe.enable [ + "util" + "exec" + "--" + "bash" + "-c" + '' + if [ -n "$1" ]; then + CHANGE_ID="$1" + else + CHANGE_ID="@" + fi + # Parse extra context flags + EXTRA_CONTEXT="" + shift 2>/dev/null || true + while [ $# -gt 0 ]; do + case "$1" in + -C) + if [ -n "$2" ]; then + EXTRA_CONTEXT="Add context: $2" + shift 2 + else shift - ;; - esac - done - DIFF_OUTPUT=$(jj diff -r "$CHANGE_ID" --no-pager 2>/dev/null) - if [ -z "$DIFF_OUTPUT" ]; then - echo "Error: No diff found for change $CHANGE_ID" >&2 - exit 1 - fi - PI_ARGS="${if cfg.aiDescribe.provider != null then ''--provider "${cfg.aiDescribe.provider}"'' else ""} ${if cfg.aiDescribe.model != null then ''--model "${cfg.aiDescribe.model}"'' else ""}" - FULL_PROMPT=${lib.escapeShellArg cfg.aiDescribe.prompt} - if [ -n "$EXTRA_CONTEXT" ]; then - FULL_PROMPT="''${EXTRA_CONTEXT}\\n\\n$FULL_PROMPT" - fi - MESSAGE=$(pi -p --no-session --mode json $PI_ARGS "$FULL_PROMPT\\n\\n$DIFF_OUTPUT" | jq -r 'select(.type == "message_end" and .message.role == "assistant") | .message.content[0].text' 2>/dev/null | head -c 500) - # Clean up whitespace - MESSAGE=$(echo "$MESSAGE" | tr -d '\\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') - if [ -z "$MESSAGE" ]; then - echo "Error: Failed to generate commit message" >&2 - exit 1 - fi - jj describe -r "$CHANGE_ID" -m "$MESSAGE" - '' - "" - ]; - }; + fi + ;; + *) + shift + ;; + esac + done + DIFF_OUTPUT=$(jj diff -r "$CHANGE_ID" --no-pager 2>/dev/null) + if [ -z "$DIFF_OUTPUT" ]; then + echo "Error: No diff found for change $CHANGE_ID" >&2 + exit 1 + fi + PI_ARGS="${ + if cfg.aiDescribe.provider != null then ''--provider "${cfg.aiDescribe.provider}"'' else "" + } ${if cfg.aiDescribe.model != null then ''--model "${cfg.aiDescribe.model}"'' else ""}" + FULL_PROMPT=${lib.escapeShellArg cfg.aiDescribe.prompt} + if [ -n "$EXTRA_CONTEXT" ]; then + FULL_PROMPT="''${EXTRA_CONTEXT}\\n\\n$FULL_PROMPT" + fi + MESSAGE=$(pi -p --no-session --mode json $PI_ARGS "$FULL_PROMPT\\n\\n$DIFF_OUTPUT" | jq -r 'select(.type == "message_end" and .message.role == "assistant") | .message.content[0].text' 2>/dev/null | head -c 500) + # Clean up whitespace + MESSAGE=$(echo "$MESSAGE" | tr -d '\\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') + if [ -z "$MESSAGE" ]; then + echo "Error: Failed to generate commit message" >&2 + exit 1 + fi + jj describe -r "$CHANGE_ID" -m "$MESSAGE" + '' + "" + ]; }; + }; } diff --git a/modules/nixos/containers/immich.nix b/modules/nixos/containers/immich.nix index 59f103b..b164ae2 100644 --- a/modules/nixos/containers/immich.nix +++ b/modules/nixos/containers/immich.nix @@ -110,6 +110,11 @@ in networking.firewall.allowedTCPPorts = [ cfg.ports.immich ]; + networking.nameservers = [ + homelab.router.ip + ]; + networking.defaultGateway = cfg.hostAddress; + system.stateVersion = "26.11"; }; }; diff --git a/pkgs/network-inventory/inventory.py b/pkgs/network-inventory/inventory.py old mode 100644 new mode 100755 diff --git a/pkgs/network-inventory/setup.py b/pkgs/network-inventory/setup.py old mode 100644 new mode 100755 diff --git a/pkgs/pre-push/default.nix b/pkgs/pre-push/default.nix index eff4d82..9eab2f1 100644 --- a/pkgs/pre-push/default.nix +++ b/pkgs/pre-push/default.nix @@ -3,7 +3,7 @@ writeShellScriptBin "pre-push" '' echo "Check evaluation" nix flake show echo "Build nix packages" - nix run nixpkgs#nix-fast-build -- --skip-cached --flake ".#checks.$(nix eval --raw --impure --expr builtins.currentSystem)" -j 1 --eval-workers 1 + nix build --print-build-logs ".#checks.$(nix eval --raw --impure --expr builtins.currentSystem).all" echo "Check evaluation" NIX_PAGER=cat nix-env -f . -qa \* --meta --xml \ --allowed-uris https://static.rust-lang.org \ diff --git a/pkgs/technitium-exporter/exporter.py b/pkgs/technitium-exporter/exporter.py old mode 100644 new mode 100755 diff --git a/pkgs/technitium-exporter/setup.py b/pkgs/technitium-exporter/setup.py old mode 100644 new mode 100755