mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-07 13:32:15 -06:00
chore: init
This commit is contained in:
commit
1b2c1ea359
891 changed files with 37053 additions and 0 deletions
67
profiles/user0/files/misc/justfile.nix
Executable file
67
profiles/user0/files/misc/justfile.nix
Executable file
|
|
@ -0,0 +1,67 @@
|
|||
{
|
||||
flake,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (flake.config.machines) devices;
|
||||
inherit (flake.config.services) instances;
|
||||
|
||||
mars = devices.mars;
|
||||
deimos = devices.deimos;
|
||||
ceres = devices.ceres;
|
||||
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 --sudo --flake ~/Files/Projects/dotfiles#${hostname} --show-trace
|
||||
|
||||
rebuild:
|
||||
nixos-rebuild switch --sudo --flake ~/Files/Projects/dotfiles#${hostname} --show-trace
|
||||
|
||||
rebuild-server:
|
||||
nixos-rebuild switch --flake ~/Files/Projects/dotfiles#${ceres.name} --target-host ${ceres.ip.address0} --sudo --ask-sudo-password
|
||||
|
||||
update:
|
||||
nix flake update --flake ~/Files/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 }
|
||||
|
||||
server:
|
||||
ssh ${ceres.ip.address0}
|
||||
|
||||
serverRemote:
|
||||
ssh ${instances.web.remotehost.address0}
|
||||
|
||||
${deviceLogic.name}:
|
||||
ssh ${deviceLogic.ip.address0}
|
||||
|
||||
vpnoff:
|
||||
sudo systemctl stop wg-quick-Proton-*.service
|
||||
|
||||
${vpnCommands}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue