2024-01-07 12:54:43 +01:00
|
|
|
{ pkgs, config, ... }:
|
|
|
|
let
|
|
|
|
ulf = pkgs.writers.writePython3 "update-local-flakes" {
|
|
|
|
} (builtins.readFile ./update-local-flakes.py);
|
|
|
|
in
|
|
|
|
{
|
|
|
|
home.packages = [
|
|
|
|
(pkgs.writeShellApplication {
|
|
|
|
name = "rb";
|
|
|
|
text = ''
|
|
|
|
verb="switch"
|
|
|
|
if [ "$#" -ge 1 ]
|
|
|
|
then
|
|
|
|
verb="$1"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
nixos_flake="/etc/nixos/flake.nix"
|
|
|
|
if [ -f "$nixos_flake" ]
|
|
|
|
then
|
|
|
|
sudo ${ulf} "$nixos_flake"
|
2024-05-08 12:56:05 +02:00
|
|
|
# ${pkgs.nix-output-monitor}/bin/nom build "$(dirname "$nixos_flake")#nixosConfigurations.$HOSTNAME.config.system.build.toplevel"
|
2024-01-07 12:54:43 +01:00
|
|
|
if [ "$verb" = "switch" ] || [ "$verb" = "test" ]
|
|
|
|
then
|
|
|
|
sudo nixos-rebuild "$verb" --specialisation ${config.frogeye.polarity} "$@"
|
|
|
|
else
|
|
|
|
sudo nixos-rebuild "$verb" "$@"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
hm_flake="${config.xdg.configHome}/home-manager/flake.nix"
|
|
|
|
if [ -f "$hm_flake" ]
|
|
|
|
then
|
|
|
|
${ulf} "$hm_flake"
|
|
|
|
home-manager "$verb" "$@"
|
|
|
|
fi
|
2024-01-16 22:39:29 +01:00
|
|
|
nod_flake="${config.xdg.configHome}/nix-on-droid/flake.nix"
|
|
|
|
if [ -f "$nod_flake" ]
|
|
|
|
then
|
|
|
|
${ulf} "$nod_flake"
|
|
|
|
nix-on-droid "$verb" --flake "$(dirname "$nod_flake")" "$@"
|
|
|
|
fi
|
2024-01-07 12:54:43 +01:00
|
|
|
'';
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|
2024-05-08 12:56:05 +02:00
|
|
|
# TODO make it a flake application, optional nom (is slow), test then boot, flags to confirm each, nvd diff here
|