add .ssh/config to dotfiles
also fix the install script
This commit is contained in:
9
dotfiles/.ssh/config
Normal file
9
dotfiles/.ssh/config
Normal file
@@ -0,0 +1,9 @@
|
||||
Host login.pvv.ntnu.no
|
||||
User frero
|
||||
AddressFamily inet
|
||||
|
||||
Host git.pvv.ntnu.no
|
||||
User gitea
|
||||
AddressFamily inet
|
||||
Port 2222
|
||||
ProxyJump login.pvv.ntnu.no
|
||||
@@ -1,23 +1,18 @@
|
||||
#!/usr/bin/env nu
|
||||
|
||||
let dotfiles = ($env.HOME | path join "nixos-config/dotfiles")
|
||||
let config = ($env.HOME | path join ".config")
|
||||
|
||||
# iterate over all files in dotfiles/
|
||||
glob $"($dotfiles)/**/*" | where ($it | path type) == "file" | each {|file|
|
||||
let rel = ($file | str replace $"($dotfiles)/" "")
|
||||
let target = ($config | path join $rel)
|
||||
let target = ($env.HOME | path join $rel)
|
||||
let target_dir = ($target | path dirname)
|
||||
|
||||
# ensure parent dir exists
|
||||
mkdir $target_dir
|
||||
|
||||
# skip if already correctly symlinked
|
||||
if ($target | path type) == "symlink" {
|
||||
return
|
||||
}
|
||||
|
||||
# back up existing file
|
||||
if ($target | path exists) {
|
||||
print $"backing up ($target) → ($target).bak"
|
||||
mv $target $"($target).bak"
|
||||
|
||||
Reference in New Issue
Block a user