21 lines
478 B
Nix
21 lines
478 B
Nix
{pkgs, ...}: {
|
|
home-manager.users.buffet = {
|
|
home.packages = [
|
|
(pkgs.writeScriptBin "nrb" ''
|
|
#!/usr/bin/env bash
|
|
|
|
[[ $UID == 0 ]] || {
|
|
echo need to run as root
|
|
exit 1
|
|
}
|
|
|
|
nixos-rebuild build --flake . || exit 1
|
|
diff="$(${pkgs.nvd}/bin/nvd diff /run/current-system result)"
|
|
rm result
|
|
nixos-rebuild switch --flake .
|
|
echo '***'
|
|
printf '%s\n' "$diff"
|
|
'')
|
|
];
|
|
};
|
|
}
|