diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-06-11 13:57:24 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-06-13 15:01:40 +0530 |
| commit | e6b171f9f1d975ffe34e7a34743b5e92e8593847 (patch) | |
| tree | 32714bba7679b5ece2ebcf9aeb795caeab13468e /build.sh | |
| parent | 2a73a5899124fa15c3962b9bd385ebd415a0ccf9 (diff) | |
| download | homeserver-nixos-config-e6b171f9f1d975ffe34e7a34743b5e92e8593847.tar.gz homeserver-nixos-config-e6b171f9f1d975ffe34e7a34743b5e92e8593847.zip | |
Add service router + nsd server
Diffstat (limited to 'build.sh')
| -rwxr-xr-x | build.sh | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -21,15 +21,23 @@ waittostart() { echo -e "\nReady to connect"; } +copy_in() { copy "$1" "$SSH_TARGET:$2"; } +copy_out() { copy "$SSH_TARGET:$1" "$2"; } + config_sync() { - copy "$SSH_TARGET:~/nixos/flake.lock" .; - copy . "$SSH_TARGET:~/nixos"; + copy_out '~/nixos/flake.lock' .; + copy_in . '~/nixos'; } rebuild() { run_ssh sudo nixos-rebuild switch --flake 'path:/home/bacchus/nixos#bacchus'; } +update_system() { + run_ssh nix flake update --flake 'path:/home/bacchus/nixos'; + rebuild; +} + restart() { run_ssh sudo systemctl reboot; } chaincmds() { @@ -41,7 +49,7 @@ chaincmds() { gen_test_dash() { nix eval --impure \ - --expr 'import ./modules/dashboard/dashboard-template.nix { title = "Dashboard"; links = [{ title = "Google"; url = "https://google.com"; key = "g"; } { title = "DuckDuckGo"; url = "https://duckduckgo.com"; key = "d"; color = "#4c82cf"; }]; }' \ + --expr 'import ./modules/dashboard/dashboard-template.nix { title = "Dashboard"; links = [{ title = "Google"; url = "https://google.com"; altUrl = "http://foobar.com"; key = "g"; } { title = "DuckDuckGo"; url = "https://duckduckgo.com"; key = "d"; color = "#4c82cf"; } { title = "Google"; url = "https://google.com"; altUrl = "http://foobar.com"; key = "g"; } { title = "Google"; url = "https://google.com"; altUrl = "http://foobar.com"; key = "g"; }]; }' \ | jq -r > index.ignore.html } open_test_dash() { brave "file://$PWD/index.ignore.html"; } @@ -51,6 +59,7 @@ case "$cmd" in sync) config_sync ;; run) run_ssh "$@" ;; build) rebuild ;; + update) update_system ;; restart) restart && sleep 3 && waittostart ;; wait) waittostart ;; clean) run_ssh sudo nix-collect-garbage -d ;; @@ -59,6 +68,8 @@ case "$cmd" in test-dash) gen_test_dash ;; open-test-dash) open_test_dash ;; dash) brave "http://$HOME_HOST" ;; + copy_in) copy_in "$@" ;; + copy_out) copy_out "$@" ;; _) chaincmds "$@" ;; *) echo "Invalid cmd: $cmd" && exit 1 ;; esac |
