Add a command to check the system derivation actually changed

This commit is contained in:
Andreas Zweili 2023-05-27 15:38:32 +02:00
parent 7327f4fa5a
commit b403a0791b
1 changed files with 9 additions and 0 deletions

View File

@ -1,9 +1,17 @@
{ pkgs ? import <nixpkgs> { } }:
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
'';
}