dotfiles/profiles/user0/files/misc/justfile.nix
2025-11-11 22:56:46 -06:00

73 lines
2 KiB
Nix
Executable file

{
flake,
config,
lib,
...
}:
let
inherit (flake.config.machines) devices;
inherit (flake.config.services) instances;
mars = devices.mars;
deimos = devices.deimos;
ceres = devices.ceres;
eris = devices.eris;
hostname = config.networking.hostName;
in
{
text =
let
lamdaIP = "192.168.50.131";
in
''
rebuildBoot:
nixos-rebuild boot --sudo --flake ~/projects/dotfiles#${hostname} --show-trace
rebuild:
nixos-rebuild switch --sudo --flake ~/projects/dotfiles#${hostname} --show-trace
rebuild-ceres:
nixos-rebuild switch --flake ~/projects/dotfiles#${ceres.name} --target-host ${ceres.ip.address0} --sudo --ask-sudo-password --show-trace
rebuild-eris:
nixos-rebuild switch --flake ~/projects/dotfiles#${eris.name} --target-host ${eris.ip.address0} --sudo --ask-sudo-password --show-trace
rebuild-mars:
nixos-rebuild switch --flake ~/projects/dotfiles#${mars.name} --target-host ${mars.ip.address0} --sudo --ask-sudo-password --show-trace
rebuild-deimos:
nixos-rebuild switch --flake ~/projects/dotfiles#${deimos.name} --target-host ${deimos.ip.address0} --sudo --ask-sudo-password --show-trace
rebuild-lamda:
nixos-rebuild switch --flake ~/projects/lamdagibson#lamdagibson --target-host denise@${lamdaIP} --sudo --ask-sudo-password --show-trace
update:
nix flake update --flake ~/projects/dotfiles
remove-redundant:
ls **/*.hs | each { |file| hlint --refactor --refactor-options="--inplace" $file.name }
remove-imports:
ls **/*.hs | each { |file| ormolu --mode inplace $file.name }
ceres:
ssh ${ceres.ip.address0}
eris:
ssh ${eris.ip.address0}
deimos:
ssh ${deimos.ip.address0}
lamda:
ssh denise@${lamdaIP}
serverRemote:
ssh ${instances.web.remotehost.address0}
forgejo:
ssh root@${instances.forgejo.interface.ip}
'';
}