dotfiles/profiles/user0/files/misc/justfile.nix

61 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2025-06-26 02:15:04 -05:00
{
flake,
config,
lib,
...
}:
let
inherit (flake.config.machines) devices;
inherit (flake.config.services) instances;
mars = devices.mars;
deimos = devices.deimos;
hostname = config.networking.hostName;
deviceLogic = if hostname == mars.name then deimos else mars;
vpnServers = [
"CA363"
"CA220"
"CA358"
"CA627"
];
vpnCommands = lib.concatStrings (
lib.imap0 (i: server: ''
vpn${toString i}:
sudo systemctl start wg-quick-Proton-${server}.service
'') vpnServers
);
in
{
text = ''
rebuildBoot:
nixos-rebuild boot --use-remote-sudo --flake ~/Files/Projects/dotfiles#${hostname} --show-trace
rebuild:
nixos-rebuild switch --use-remote-sudo --flake ~/Files/Projects/dotfiles#${hostname} --show-trace
update:
nix flake update --flake ~/Files/Projects/dotfiles
elm:
cd ~/Files/Projects/website/frontend ; elm-land server
server:
ssh ${devices.ceres.ip.address0}
serverRemote:
ssh ${instances.web.remotehost.address0}
${deviceLogic.name}:
ssh ${deviceLogic.ip.address0}
vpnoff:
sudo systemctl stop wg-quick-Proton-*.service
${vpnCommands}
'';
}