summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroutremonde <outremonde@vivaldi.net>2025-06-10 22:51:29 -0400
committeroutremonde <outremonde@vivaldi.net>2025-06-10 22:51:29 -0400
commit66b90b4f429a493f5b9cb4a89bcb14c5b7140fe0 (patch)
tree5823bbd161a3b2ffac0df9a53de9513e1b4f91fc
parentd18013caf60f168031810abc1e676247659ca949 (diff)
changed setup util
Former-commit-id: 4fc07e33f68dc13d971201d1820cf42106ae93ca
-rw-r--r--pkgs/setup-manager/setup.nu9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkgs/setup-manager/setup.nu b/pkgs/setup-manager/setup.nu
index 65d7f34..6a926d7 100644
--- a/pkgs/setup-manager/setup.nu
+++ b/pkgs/setup-manager/setup.nu
@@ -11,6 +11,9 @@
# Settings
let flake_dir = "~/Sync/setup/" | path expand
+let default_sys = hostname
+let default_usr = whoami
+
def "main" [] {}
@@ -24,16 +27,14 @@ def "main sync" [] {}
def "main sync system" [
sys?: string # The name of the system config to syncronize.
] {
- if ($sys == null) {let sys = (hostname)}
- sudo nixos-rebuild switch --flake $"($flake_dir)#($sys)"
+ sudo nixos-rebuild switch --flake $"($flake_dir)#($sys | default $default_sys)"
}
# Syncronize the userland with its config.
def "main sync user" [
usr?: string # The name of the user config to syncronize.
] {
- if ($usr == null) {let usr = (whoami)}
- home-manager switch --flake $"($flake_dir)#($usr)"
+ home-manager switch --flake $"($flake_dir)#($usr | default $default_usr)"
}
# Syncronize both the system and the userland with their configs.