rice/users/buffet/nvd.nix
buffet b912daedcd
All checks were successful
/ check (push) Successful in 4m22s
feat: make nrb fetch from remote by default
2024-05-20 12:06:16 +02:00

23 lines
619 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
}
flake="''${1:-https://buffets.kitchen/kitchen/rice/archive/main.tar.gz}"
nixos-rebuild build --flake "$flake" --option tarball-ttl 0|| exit 1
diff="$(${pkgs.nvd}/bin/nvd diff /run/current-system result)"
rm result
nixos-rebuild switch --flake "$flake" --option tarball-ttl 0
echo '***'
printf '%s\n' "$diff"
'')
];
};
}