From b19e3cd8603d3e0392b34f8c2f6a9fcf8a227f4b Mon Sep 17 00:00:00 2001 From: uku Date: Tue, 4 Mar 2025 09:48:06 +0100 Subject: [PATCH] feat(justfile): switch away from nh --- flake.nix | 2 +- justfile | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index ca1cc01..f1f80d6 100644 --- a/flake.nix +++ b/flake.nix @@ -30,8 +30,8 @@ packages = with pkgs; [ agenix.packages.${system}.default just - nh nixfmt-rfc-style + nvd statix ]; }; diff --git a/justfile b/justfile index dc7acaa..11e97c0 100644 --- a/justfile +++ b/justfile @@ -5,8 +5,15 @@ check: nix flake check switch *args: - @sudo -v - nh os switch --no-nom --ask . -- --keep-going {{args}} + #!/usr/bin/env bash + set -euxo pipefail + flake=$(nix build ".#nixosConfigurations.$(hostname).config.system.build.toplevel" --print-out-paths --no-link --keep-going) + nvd diff /run/current-system "$flake" + read -p "Activate new configuration? [y/N] " answer + if [[ $answer =~ ^[Yy]$ ]]; then + sudo "$flake/bin/switch-to-configuration" switch + fi + rollback: @sudo -v