add .ssh/config to dotfiles

also fix the install script
This commit is contained in:
2026-03-25 23:04:52 +01:00
parent c1ddc1dd93
commit 7e655fa1bb
9 changed files with 10 additions and 6 deletions

9
dotfiles/.ssh/config Normal file
View 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

View File

@@ -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"