From ec6bc915041fac09f799a98532bce85346bc34e2 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Wed, 24 Jan 2024 17:37:15 -0600 Subject: [PATCH] add basic time reporter --- modules/nix.nix | 3 ++- styx | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/nix.nix b/modules/nix.nix index efba567..a30d389 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,5 +1,5 @@ { - input, + inputs, pkgs, ... }: { @@ -19,6 +19,7 @@ environment.systemPackages = with pkgs; [ nix-output-monitor alejandra + inputs.self.packages.${pkgs.system}.styx ]; nix.settings = { diff --git a/styx b/styx index 5847710..75d8fd7 100755 --- a/styx +++ b/styx @@ -69,11 +69,19 @@ dry() { nix build "$FLAKE_PATH#nixosConfigurations.$(hostname).config.system.build.toplevel" --dry-run } + cache() { + start=$(date +%s) + cachix watch-exec daylin \ -- \ nix build "$FLAKE_PATH#nixosConfigurations.${HOSTNAME}.config.system.build.toplevel" \ --print-build-logs + + end=$(date +%s) + runtime=$(date -d@$((end-start)) +'%M minutes, %S seconds') + + echo "Built host: ${HOSTNAME} in ${runtime} seconds" >> "$GITHUB_OUTPUT_SUMMARY" }