From b403a0791ba73728228ae7490aa17481d1191cf7 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sat, 27 May 2023 15:38:32 +0200 Subject: [PATCH] Add a command to check the system derivation actually changed --- shell.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shell.nix b/shell.nix index eba4d3f..ca02796 100644 --- a/shell.nix +++ b/shell.nix @@ -1,9 +1,17 @@ { pkgs ? import { } }: +let + nix-refactor = pkgs.writeShellScriptBin "nix-refactor" '' + origin=$(${pkgs.coreutils-full}/bin/readlink /run/current-system) + result=$(${pkgs.lib.getExe pkgs.nixos-rebuild} build && ${pkgs.coreutils-full}/bin/readlink result) + ${pkgs.diffutils}/bin/diff -q <(echo "$origin" ) <(echo "$result") + ''; +in pkgs.mkShell { name = "nixosbuildshell"; nativeBuildInputs = with pkgs; [ git nixFlakes + nix-refactor python3 python310Packages.autopep8 python310Packages.black @@ -19,3 +27,4 @@ pkgs.mkShell { ''}/bin:$PATH ''; } +