mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-07 05:27:13 -06:00
feat: added midnight miner
This commit is contained in:
parent
009ad1223a
commit
585f5a99a9
5 changed files with 71 additions and 65 deletions
|
|
@ -4,70 +4,63 @@
|
|||
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;
|
||||
|
||||
dotPath = "~/projects/dotfiles";
|
||||
mkLocalRebuild = type: ''
|
||||
rebuild-${type}:
|
||||
nixos-rebuild boot --sudo --flake ${dotPath}#${hostname} --show-trace
|
||||
'';
|
||||
mkRemoteRebuild = name: ip: ''
|
||||
rebuild-${name}:
|
||||
nixos-rebuild switch --flake ${dotPath}#${name} --target-host ${ip} --sudo --ask-sudo-password --show-trace
|
||||
'';
|
||||
mkSshCommands = name: ip: ''
|
||||
${name}:
|
||||
ssh ${ip}
|
||||
'';
|
||||
mkMicrVMSshCommands = name: ssh: ''
|
||||
${name}:
|
||||
ssh -p ${ssh} root@localhost
|
||||
'';
|
||||
systemRecords =
|
||||
command:
|
||||
lib.concatStrings [
|
||||
(command devices.ceres.name devices.ceres.ip.address0)
|
||||
(command devices.eris.name devices.eris.ip.address0)
|
||||
(command devices.mars.name devices.deimosmars.ip.address0)
|
||||
(command devices.deimos.name devices.deimos.ip.address0)
|
||||
(command devices.phobos.name devices.phobos.ip.address0)
|
||||
(command devices.lamdagibson.name devices.lamdagibson.ip.address0)
|
||||
];
|
||||
instanceRecords =
|
||||
command:
|
||||
lib.concatStrings [
|
||||
(command instances.vaultwarden.name instances.vaultwarden.interface.ssh)
|
||||
(command instances.jellyfin.name instances.jellyfin.interface.ssh)
|
||||
(command instances.firefly-iii.name instances.firefly-iii.interface.ssh)
|
||||
(command instances.forgejo.name instances.forgejo.interface.ssh)
|
||||
(command instances.mastodon.name instances.mastodon.interface.ssh)
|
||||
];
|
||||
typeLabels =
|
||||
type:
|
||||
lib.concatStrings [
|
||||
"switch"
|
||||
"build"
|
||||
"boot"
|
||||
];
|
||||
localRebuild = typeLabels mkLocalRebuild;
|
||||
remoteRebuild = systemRecords mkRemoteRebuild;
|
||||
sshCommand = systemRecords mkSshCommands;
|
||||
microVMSshCommand = instanceRecords mkMicrVMSshCommands;
|
||||
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}
|
||||
'';
|
||||
text = ''
|
||||
${localRebuild}
|
||||
${remoteRebuild}
|
||||
${sshCommand}
|
||||
${microVMSshCommand}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue