summaryrefslogtreecommitdiff
path: root/pkgs/setup-manager
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/setup-manager')
-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.