Something went wrong. Try again.
my over complex system configurations
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207flake := env('FLAKE', justfile_directory())
# rebuild is also set as a var so you can add --set to change it if you need torebuild := if os() == "macos" { "sudo darwin-rebuild" } else { "nixos-rebuild" }system-args := if os() == "macos" { "" } else { "--elevate run0 --no-reexec" }
[private]default: @just --list --unsorted
# rebuild group
[group('rebuild')][no-exit-message][private]builder goal *args: #!/usr/bin/env bash set -euo pipefail {{ rebuild }} {{ goal }} \ --flake {{ flake }} \ {{ system-args }} \ {{ args }}
[group('rebuild')][no-exit-message][private]deployer host goal *args: #!/usr/bin/env bash set -euo pipefail just builder {{ goal }} --target-host ssh-ng://{{ host }} --use-substitutes {{ args }} lethe record {{ host }}
# deploy by switching the new system configuration[group('rebuild')][no-exit-message]deploy host *args: (deployer host "switch" args) lethe diff {{ host }}
# preview a deploy without switching[group('rebuild')][no-exit-message]deploy-dry host *args: just builder dry-activate --target-host ssh-ng://{{ host }} --use-substitutes {{ args }}
# deploy by setting the boot configuration[group('rebuild')][no-exit-message]deploy-boot host *args: (deployer host "boot" args) lethe diff {{ host }}
[group('rebuild')][no-exit-message][private]deployer-all goal: #!/usr/bin/env bash set -euo pipefail
just deployer minerva {{ goal }} just deployer freyja {{ goal }} just deployer skadi {{ goal }} just deployer isis {{ goal }}
lethe diff minerva lethe diff freyja lethe diff skadi lethe diff isis
# deploy to all hosts by switching[group('rebuild')][no-exit-message]deploy-all: (deployer-all "switch")
# deploy to all hosts by setting boot[group('rebuild')][no-exit-message]deploy-all-boot: (deployer-all "boot")
# rebuild the boot[group('rebuild')][no-exit-message]boot *args: (builder "boot" args) lethe diff $(hostname)
# test what happens when you switch[group('rebuild')][no-exit-message]test *args: (builder "test" args)
# switch the new system configuration[group('rebuild')][no-exit-message]switch *args: #!/usr/bin/env bash set -euo pipefail just builder switch {{ args }} lethe record lethe diff $(hostname)
[group('rebuild')][macos][no-exit-message]provision host: sudo nix run github:LnL7/nix-darwin -- switch --flake {{ flake }}#{{ host }} sudo -i nix-env --uninstall lix # we need to remove the none declarative install of lix
# package group# build the package, you must specify the package you want to build
# build the iso image, you must specify the image you want to build[group('package')][no-exit-message]iso image: nix build {{ flake }}#nixosConfigurations.{{ image }}.config.system.build.isoImage
# build the tarball, you must specify the host you want to build[group('package')][no-exit-message]tar host: sudo nix run {{ flake }}#nixosConfigurations.{{ host }}.config.system.build.tarballBuilder
# dev group
# check the flake for errors[group('dev')][no-exit-message]check *args: nix flake check --option allow-import-from-derivation false {{ args }}
[group('dev')][no-exit-message]repl-host host=`hostname`: nix repl .#nixosConfigurations.{{ host }}
# update a set of given inputs[group('dev')][no-exit-message]update *input: nix flake update {{ input }} \ --refresh \ --commit-lock-file \ --commit-lockfile-summary "flake.lock: update {{ if input == "" { "all inputs" } else { input } }}" \ --flake {{ flake }}
# update the pinned brew and vicinae sources[group('dev')][no-exit-message]update-pins *targets: nix run {{ flake }}#update-pins -- {{ targets }}
# build & serve the docs locally[group('dev')][no-exit-message]serve: nix run {{ flake }}#docs.serve
# push to the mirrors[group('dev')][no-exit-message]push-mirrors: git push git@gitlab.com:isabelroses/dotfiles.git git push --mirror ssh://git@codeberg.org/isabel/dotfiles.git
# rotate all secrets[group('dev')][no-exit-message]roate-secrets: find secrets/ -name "*.yaml" | xargs -I {} sops rotate -i {}
# update the secret keys[group('dev')][no-exit-message]update-secrets: find secrets/ -name "*.yaml" | xargs -I {} sops updatekeys -y {}
# utils group
alias fix := repair
# verify the integrity of the nix store[group('utils')][no-exit-message]verify *args: nix-store --verify {{ args }}
# repairs the nix store from any breakages it may have[group('utils')][no-exit-message]repair: (verify "--check-contents --repair")
# clean the nix store and optimise it[group('utils')][no-exit-message]clean: nix-collect-garbage --delete-older-than 3d nix store optimise
# run izshell from the repo with hot reload, in place of the packaged one[group('utils')][no-exit-message]shell-dev: #!/usr/bin/env bash set -euo pipefail systemctl --user stop izshell trap 'systemctl --user start izshell' EXIT IZSHELL_DIR={{ flake }}/modules/flake/packages/izshell/shell izshell