Home

dotnix @main - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
tree log patch
move nushell files to autoload
Signature
-----BEGIN SSH SIGNATURE----- U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgBTEvCQk6VqUAdN2RuH6bj1dNkY oOpbPWj+jw4ua1B1cAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5 AAAAQNeSQdm5bi+hjeZN9JuZJ9ZZn+IuQzWv1HPM9ktZysW/c/Zf4H1GEw9P8yrzfUgjGr j4PaKKD7seH2FNLe4wLAU= -----END SSH SIGNATURE-----
jolheiser <git@jolheiser.com>
2 days ago
25 changed files, 521 additions(+), 495 deletions(-)
home/nogui/jj.nixhome/nogui/nushell.nixhome/nogui/nushell/autoload/clone.nuhome/nogui/nushell/autoload/comma.nuhome/nogui/nushell/autoload/dev.nuhome/nogui/nushell/autoload/fg.nuhome/nogui/nushell/autoload/git-bug.nuhome/nogui/nushell/autoload/gomodsri.nuhome/nogui/nushell/autoload/httpstatus.nuhome/nogui/nushell/autoload/jolheiser.nuhome/nogui/nushell/autoload/miniserve.nuhome/nogui/nushell/autoload/mkcd.nuhome/nogui/nushell/autoload/nato.nuhome/nogui/nushell/autoload/ssh.nuhome/nogui/nushell/autoload/tangled.nuhome/nogui/nushell/autoload/tmp.nuhome/nogui/nushell/clone.nuhome/nogui/nushell/config.nuhome/nogui/nushell/git-bug.nuhome/nogui/nushell/jolheiser.nuhome/nogui/nushell/miniserve.nuhome/nogui/nushell/autoload/ohmyposh.nuhome/nogui/nushell/ssh.nuhome/nogui/nushell/tangled.nuhome/nogui/oh-my-posh.nix
M home/nogui/jj.nix -> home/nogui/jj.nix
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
diff --git a/home/nogui/jj.nix b/home/nogui/jj.nix
index b77e6e987dd88e9e4e60e1472185b0ae492af8a9..16a3cee72d79ae11c39750f43ebed9b0c9e32f36 100644
--- a/home/nogui/jj.nix
+++ b/home/nogui/jj.nix
@@ -16,7 +16,7 @@           "$right"
         ];
         editor = "hx";
         paginate = "never";
-        default-command = "log";
+        default-command = "status";
       };
       templates.git_push_bookmark = ''"change/" ++ change_id.short()'';
       signing = {
M home/nogui/nushell.nix -> home/nogui/nushell.nix
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff --git a/home/nogui/nushell.nix b/home/nogui/nushell.nix
index d3d25c351bc6b61b922bb4453f7a2f07af281e26..50cea0aff93c601f564b17e22ff5b2003101227a 100644
--- a/home/nogui/nushell.nix
+++ b/home/nogui/nushell.nix
@@ -37,13 +37,19 @@       $env.NIXOS_OZONE_WL = "1"
       $env.NIX_PATH = "nixpkgs=${inputs.nixpkgs-unstable}"
     '';
   };
-  xdg.configFile = {
-    "nushell/jolheiser.nu".source = ./nushell/jolheiser.nu;
-    "nushell/ssh.nu".source = ./nushell/ssh.nu;
-    "nushell/miniserve.nu".source = ./nushell/miniserve.nu;
-    "nushell/clone.nu".source = ./nushell/clone.nu;
-    "nushell/git-bug.nu".source = ./nushell/git-bug.nu;
-    "nushell/ohmyposh.nu".source = ./nushell/ohmyposh.nu;
-    "nushell/tangled.nu".source = ./nushell/tangled.nu;
-  };
+  # Individually symlink all ./nushell scripts to ~/.config/nushell/autoload
+  xdg.configFile =
+    let
+      src = ./nushell/autoload;
+      files = builtins.attrNames (builtins.readDir src);
+      configFiles = builtins.listToAttrs (
+        map (file: {
+          name = "nushell/autoload/${file}";
+          value = {
+            source = src + "/${file}";
+          };
+        }) files
+      );
+    in
+    configFiles;
 }
I home/nogui/nushell/autoload/clone.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
diff --git a/home/nogui/nushell/autoload/clone.nu b/home/nogui/nushell/autoload/clone.nu
new file mode 100644
index 0000000000000000000000000000000000000000..e161ecb931336591f7932e5c8b33a5e48685efcd
--- /dev/null
+++ b/home/nogui/nushell/autoload/clone.nu
@@ -0,0 +1,33 @@
+module clone {
+  def "forge types" [] {
+    ["github", "gitea", "jojodev", "codeberg"]
+  }
+  
+  export def main [
+    repo: string # Repo name
+    --forge (-f) = "github": string@"forge types" # Forge type (github, gitea, jojodev, codeberg)
+    --owner (-o): string # Owner (default: current dir name)
+  ] {
+    mut id = 'gh'
+    if $forge == 'gitea' {
+      $id = 'gt'
+    } else if $forge == 'jojodev' {
+      $id = 'jj'
+    } else if $forge == 'codeberg' {
+      $id = 'cb'
+    }
+    mut namespace = ($env.PWD | path basename)
+    if $owner != '' {
+      $namespace = $owner
+    }
+    let origin = $'ssh:($id):jolheiser/($repo).git'
+    let upstream = $'($id):($namespace)/($repo).git'
+    ^git clone $origin
+    cd $repo
+    if $namespace != 'jolheiser' {
+      ^git remote add upstream $upstream
+      ^git fetch upstream
+    }
+  }
+}
+use clone *
I home/nogui/nushell/autoload/comma.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/home/nogui/nushell/autoload/comma.nu b/home/nogui/nushell/autoload/comma.nu
new file mode 100644
index 0000000000000000000000000000000000000000..68cf4f997be6dbbe127266d5230bf5faae4e1964
--- /dev/null
+++ b/home/nogui/nushell/autoload/comma.nu
@@ -0,0 +1,14 @@
+module comma {
+  # Run a command if known, otherwise run it with nix
+  export def , [
+      cmd: string     # The command to run
+      ...args: string # Command arguments; all flags MUST be quoted
+    ] {
+    if (not (which $cmd | is-empty)) {
+      ^$cmd ...$args
+      return
+    }
+    ^nix run $"nixpkgs#($cmd)" -- ...$args
+  }
+}
+use comma *
I home/nogui/nushell/autoload/dev.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
diff --git a/home/nogui/nushell/autoload/dev.nu b/home/nogui/nushell/autoload/dev.nu
new file mode 100644
index 0000000000000000000000000000000000000000..b331e67ee1d78a702ad4bcc6e7fa07b584ba9fae
--- /dev/null
+++ b/home/nogui/nushell/autoload/dev.nu
@@ -0,0 +1,9 @@
+module dev {
+  export def main [
+    --port (-p) = 8080: int # Port
+  ] {
+    print $"Listening on http://localhost:($port)"
+    ^ssh -N -T -R $"3389:localhost:($port)" dragonwell
+  }
+}
+use dev *
I home/nogui/nushell/autoload/fg.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
diff --git a/home/nogui/nushell/autoload/fg.nu b/home/nogui/nushell/autoload/fg.nu
new file mode 100644
index 0000000000000000000000000000000000000000..bfaf3775f98274913e576b44d20811e6a8bf96f4
--- /dev/null
+++ b/home/nogui/nushell/autoload/fg.nu
@@ -0,0 +1,7 @@
+module fg {
+  export def main [args ...string] {
+    ^rg --ignore-case --color=always --line-number --no-heading $args 
+    | ^fzf --ansi --color 'hl:-1:underline,hl+:-1:underline:reverse' --delimiter ':' --preview "bat --color=always {1} --theme='ctp-mocha' --highlight-line {2}" --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' --bind $"enter:become\(($env.EDITOR) +{2} {1}\)"
+  }
+}
+use fg *
I home/nogui/nushell/autoload/git-bug.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
diff --git a/home/nogui/nushell/autoload/git-bug.nu b/home/nogui/nushell/autoload/git-bug.nu
new file mode 100644
index 0000000000000000000000000000000000000000..ceed7af175e073714fd8dad4e657aa6872ec5506
--- /dev/null
+++ b/home/nogui/nushell/autoload/git-bug.nu
@@ -0,0 +1,77 @@
+module git-bug {
+  export def "git bug init" [] {
+    git bug pull
+    let id = ^git-bug user -f json | from json | where name == 'jolheiser' | get --optional human_id.0
+    if ($id | is-not-empty) {
+      ^git-bug user adopt $id
+    } else {
+      ^git-bug user new --name 'jolheiser' --email 'git@jolheiser.com' --avatar 'https://www.libravatar.org/avatar/cc498b605dee7b6fb9e6422332691bb4'
+    }
+  }
+  
+  export def "git bug pull" [] {
+    ^git fetch origin refs/bugs/*:refs/bugs/* refs/identities/*:refs/identities/*
+    ^rm -rf $"(^git rev-parse --git-dir)/git-bug"
+  }
+  
+  export def "git bug push" [] {
+    ^git push origin refs/bugs/*:refs/bugs/* refs/identities/*:refs/identities/*
+  }
+  
+  def "bug-id" [] {
+    ^git-bug bug --format json | from json | each {|bug| { value: $bug.human_id, description: $bug.title }}
+  }
+  
+  export extern "git bug bug status" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "git bug bug status open" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "git bug bug status close" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "git bug bug rm" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "gitbug bug comment" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "git bug bug comment new" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "git bug bug label" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "git bug bug label new" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "git bug bug label rm" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "git bug bug select" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "git bug bug show" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "git bug bug title" [
+    bug_id: string@bug-id
+  ]
+  
+  export extern "git bug bug title edit" [
+    bug_id: string@bug-id
+  ]
+}
+use git-bug *
I home/nogui/nushell/autoload/gomodsri.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
diff --git a/home/nogui/nushell/autoload/gomodsri.nu b/home/nogui/nushell/autoload/gomodsri.nu
new file mode 100644
index 0000000000000000000000000000000000000000..40663524a6ebe784ae2a618d4c1fea187e73b732
--- /dev/null
+++ b/home/nogui/nushell/autoload/gomodsri.nu
@@ -0,0 +1,11 @@
+module gomodsri {
+  export def main [] {
+    let tmp = (mktemp -d)
+    go mod vendor -o $tmp
+    let sri = (go run tailscale.com/cmd/nardump@latest --sri $tmp)
+    $sri | save -f go.mod.sri
+    rm -rf $tmp
+    echo 'nixpkgs.lib.fileContents ./go.mod.sri'
+  }
+}
+use gomodsri *
I home/nogui/nushell/autoload/httpstatus.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
diff --git a/home/nogui/nushell/autoload/httpstatus.nu b/home/nogui/nushell/autoload/httpstatus.nu
new file mode 100644
index 0000000000000000000000000000000000000000..7f3a4f71d79f243e043017ec2f2605ffb44a80b0
--- /dev/null
+++ b/home/nogui/nushell/autoload/httpstatus.nu
@@ -0,0 +1,75 @@
+module httpstatus {
+  # Print out all HTTP statuses, or a specific one for a given code
+  export def main [
+    code?: int # HTTP status code
+  ]: nothing -> string {
+    let s = {
+      "100": "Continue",
+      "101": "Switching Protocols",
+      "102": "Processing",
+      "200": "OK",
+      "201": "Created",
+      "202": "Accepted",
+      "203": "Non-Authoritative Information",
+      "204": "No Content",
+      "205": "Reset Content",
+      "206": "Partial Content",
+      "207": "Multi-Status",
+      "208": "Already Reported",
+      "300": "Multiple Choices",
+      "301": "Moved Permanently",
+      "302": "Found",
+      "303": "See Other",
+      "304": "Not Modified",
+      "305": "Use Proxy",
+      "307": "Temporary Redirect",
+      "400": "Bad Request",
+      "401": "Unauthorized",
+      "402": "Payment Required",
+      "403": "Forbidden",
+      "404": "Not Found",
+      "405": "Method Not Allowed",
+      "406": "Not Acceptable",
+      "407": "Proxy Authentication Required",
+      "408": "Request Timeout",
+      "409": "Conflict",
+      "410": "Gone",
+      "411": "Length Required",
+      "412": "Precondition Failed",
+      "413": "Request Entity Too Large",
+      "414": "Request-URI Too Large",
+      "415": "Unsupported Media Type",
+      "416": "Request Range Not Satisfiable",
+      "417": "Expectation Failed",
+      "418": "I'm a teapot",
+      "420": "Blaze it",
+      "422": "Unprocessable Entity",
+      "423": "Locked",
+      "424": "Failed Dependency",
+      "425": "No code",
+      "426": "Upgrade Required",
+      "428": "Precondition Required",
+      "429": "Too Many Requests",
+      "431": "Request Header Fields Too Large",
+      "449": "Retry with",
+      "500": "Internal Server Error",
+      "501": "Not Implemented",
+      "502": "Bad Gateway",
+      "503": "Service Unavailable",
+      "504": "Gateway Timeout",
+      "505": "HTTP Version Not Supported",
+      "506": "Variant Also Negotiates",
+      "507": "Insufficient Storage",
+      "509": "Bandwidth Limit Exceeded",
+      "510": "Not Extended",
+      "511": "Network Authentication Required",
+    }
+  
+    if $code != null {
+      $s | get $"($code)"
+    } else {
+      $s | items {|key, value| echo $"($key) ($value)"} | to text
+    }
+  }
+}
+use httpstatus *
I home/nogui/nushell/autoload/jolheiser.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
diff --git a/home/nogui/nushell/autoload/jolheiser.nu b/home/nogui/nushell/autoload/jolheiser.nu
new file mode 100644
index 0000000000000000000000000000000000000000..9912faa3e1db1dade5a02dc735fae51c0ce2a283
--- /dev/null
+++ b/home/nogui/nushell/autoload/jolheiser.nu
@@ -0,0 +1,12 @@
+module jolheiser {
+  export alias cat = bat
+  export alias find = fd
+  export alias df = duf
+  export alias du = dust -b -d 1
+  export alias ll = eza -al
+}
+
+$env.EDITOR = 'hx'
+$env.SSH_AUTH_SOCK = '/run/user/1000/ssh-agent'
+
+use jolheiser *
I home/nogui/nushell/autoload/miniserve.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff --git a/home/nogui/nushell/autoload/miniserve.nu b/home/nogui/nushell/autoload/miniserve.nu
new file mode 100644
index 0000000000000000000000000000000000000000..101750c75741afadcde150e186b79b330de29270
--- /dev/null
+++ b/home/nogui/nushell/autoload/miniserve.nu
@@ -0,0 +1,41 @@
+module miniserve {
+  export def serve [
+    path: path         # The path to serve 
+    --dir (-d): string # The base dir in miniserve for the path
+    --public (-p)      # Send to http://pubserve (via http://privserve) rather than http://files
+    --verbose (-v)     # Print uploads
+  ] {
+    let endpoint = if $public { "http://privserve" } else { "http://files" }
+    let url = if $public { "http://pubserve.serval-vibes.ts.net" } else { "http://files" }
+    let upload = $"($endpoint)/upload"
+    let baseName = $path | path basename
+    let cleanDir = if $dir != null { $"($dir | str trim --char '/')" } else { "" }
+    # When uploading, "" is invalid. It must either be "/" or relative "foo/bar/"
+    let uploadDir = $"($cleanDir)/"
+    let serveDir = if $cleanDir != "" { $uploadDir } else { "" }
+    if ($path | path type) == "dir" {
+      let prefix = $path | path expand
+      let baseDir = [$cleanDir, ($prefix | path basename | str trim --char '/')] | path join
+      glob -F $"($prefix)/**" | each {|g| 
+        let b = $g | str replace $prefix "" | str trim --left --char '/'
+        let d = [$baseDir, $b] | path join
+        if $verbose { print $"Creating dir ($d)" }
+        ^curl -F $"mkdir=($d)" $"($upload)?path=/" | complete
+      }
+      glob -D $"($prefix)/**" | each {|g| 
+        let f = $g | str replace $prefix "" | str trim --left --char '/'
+        let t = [$baseDir, $f] | path join
+        let p = $t | path dirname
+        if $verbose { print $"Uploading ($g) to ($t)" }
+        ^curl -F $"path=@($g)" $"($upload)?path=($p)" | complete
+      }
+    } else {
+      if $verbose { print $"Creating dir ($uploadDir)" }
+      ^curl -F $"mkdir=($uploadDir)" $"($upload)?path=/" | complete
+      if $verbose { print $"Uploading ($path | path expand) to ($serveDir)($baseName)" }
+      ^curl -F $"path=@($path)" $"($upload)?path=($uploadDir)" | complete
+    }
+    $"($url)/($serveDir)($baseName)"
+  }
+}
+use miniserve *
I home/nogui/nushell/autoload/mkcd.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
diff --git a/home/nogui/nushell/autoload/mkcd.nu b/home/nogui/nushell/autoload/mkcd.nu
new file mode 100644
index 0000000000000000000000000000000000000000..8a54e74b45bd106cc085a3e57d0c6a943d7e0bb5
--- /dev/null
+++ b/home/nogui/nushell/autoload/mkcd.nu
@@ -0,0 +1,10 @@
+module mkcd {
+  # Make a directory and cd in to it
+  export def --env main [
+    dir: path # The directory to create
+  ]: nothing -> nothing {
+    mkdir $dir
+    cd $dir
+  }
+}
+use mkcd *
I home/nogui/nushell/autoload/nato.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff --git a/home/nogui/nushell/autoload/nato.nu b/home/nogui/nushell/autoload/nato.nu
new file mode 100644
index 0000000000000000000000000000000000000000..e9eed86b4d90582fb47fdc1fee3723136b127b0b
--- /dev/null
+++ b/home/nogui/nushell/autoload/nato.nu
@@ -0,0 +1,54 @@
+module nato {
+  # Convert input string to NATO
+  export def main [
+    ...string: string # Input string
+  ]: nothing -> string {
+    let m = {
+      "a": "Alpha",
+      "b": "Bravo",
+      "d": "Delta",
+      "e": "Echo",
+      "f": "Foxtrot",
+      "g": "Golf",
+      "h": "Hotel",
+      "i": "India",
+      "j": "Juliett",
+      "k": "Kilo",
+      "l": "Lima",
+      "m": "Mike",
+      "n": "November",
+      "o": "Oscar",
+      "p": "Papa",
+      "q": "Quebec",
+      "r": "Romeo",
+      "s": "Sierra",
+      "t": "Tango",
+      "u": "Uniform",
+      "v": "Victor",
+      "w": "Whiskey",
+      "x": "X-ray",
+      "y": "Yankee",
+      "z": "Zulu",
+      "1": "One",
+      "2": "Two",
+      "3": "Three",
+      "4": "Four",
+      "5": "Five",
+      "6": "Six",
+      "7": "Seven",
+      "8": "Eight",
+      "9": "Nine",
+      "0": "Zero"
+    }
+  
+    $string | str join " " | split chars | reduce --fold "" {|it, acc|
+      let word = $m | get --optional ($it | str downcase)
+      if $acc == "" {
+        $word
+      } else {
+        $"($acc) ($word)"
+      }
+    }
+  }
+}
+use nato *
I home/nogui/nushell/autoload/ssh.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
diff --git a/home/nogui/nushell/autoload/ssh.nu b/home/nogui/nushell/autoload/ssh.nu
new file mode 100644
index 0000000000000000000000000000000000000000..5dff3fef413e6fb36ced677f430d95a4fcf3b5cd
--- /dev/null
+++ b/home/nogui/nushell/autoload/ssh.nu
@@ -0,0 +1,91 @@
+module ssh {
+    export extern main [
+        destination?: string@"nu-complete ssh-host"
+        -4            # Forces ssh to use IPv4 addresses only.
+        -6            # Forces ssh to use IPv6 addresses only.
+        -A            # Enables forwarding of connections from an authentication agent such as ssh-agent(1).
+        -a            # Disables forwarding of the authentication agent connection.
+        -B: string    # bind_interface
+        -b: string    # bind_address
+        -C            # Requests compression of all data
+        -c: string    # cipher_spec
+        -D            # [bind_address:]port
+        -E: string    # log_file
+        -e            # escape_char
+        -F: string    # configfile
+        -f            # Requests ssh to go to background just before command execution.
+        -G            # Causes ssh to print its configuration after evaluating Host and Match blocks and exit.
+        -g            # Allows remote hosts to connect to local forwarded ports
+        -I: string    # pkcs11
+        -i: string@"nu-complete ssh-identity"    # identity_file
+        -J: string    # destination
+        -K            # Enables GSSAPI-based authentication and forwarding(delegation) of GSSAPI credentials to the server.
+        -k            # Disables forwarding (delegation) of GSSAPI credentials to the server.
+        -L: string    # [bind_address:]port:host:hostport / [bind_address:]port:remote_socket / local_socket:host:hostport / local_socket:remote_socket
+        -l: string    # login_name
+        -M            # Places the ssh client into “master” mode for connection sharing.
+        -m: string    # mac_spec
+        -N            # Do not execute a remote command.
+        -n            # Redirects stdin from /dev/null (5) for details.
+        -O: string    # ctl_cmd
+        -o: string    # option
+    ]
+    
+    def parse-host [file: string] {
+        let lines = $file | open | lines | str trim
+    
+        mut result = []
+        for $line in $lines {
+            let data = $line | parse --regex '^Include\s+(?<file>.+)'
+            if ($data | is-not-empty) {
+                let include = parse-host ($data.file | first)
+                $result = ($result | append $include)
+                continue
+            }
+            let data = $line | parse  --regex '^Host\s+(?<host>.+)'
+            if ($data | is-not-empty) {
+                let host = $data.host | first
+                if ($host == '*') {
+                    continue
+                }
+                $result = ($result | append { 'value': $host, 'description': "" })
+                continue;
+            }
+            let data = $line | parse --regex '^HostName\s+(?<hostname>.+)'
+            if ($data | is-not-empty) {
+                let last = $result | last | update 'description' ($data.hostname | first)
+                $result = ($result | drop | append $last)
+            }
+        }
+        $result
+    }
+    
+    def "nu-complete ssh-host" [] {
+        mut files = [
+            '/etc/ssh/ssh_config',
+            '~/.ssh/config'
+        ] | where { |file| $file | path exists }
+    
+    
+        $files | each { |file|
+            parse-host $file
+        } | flatten
+    }
+    
+    def "nu-complete ssh-identity" [] {
+      ls ~/.ssh/
+      | where {|f|
+          ($f.name | path parse | get extension) == "pub"
+        }
+      | get name
+      | path parse
+      | each {|p| {'value': $'~/.ssh/($p.stem)', 'description': $p.stem} }
+    }
+    
+    export def ssh-add-all [] {
+        nu-complete ssh-identity
+        | each {|s| print $s.value; ^ssh-add ($s.value | path expand); print '' }
+        null
+    }
+}
+use ssh *
I home/nogui/nushell/autoload/tangled.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff --git a/home/nogui/nushell/autoload/tangled.nu b/home/nogui/nushell/autoload/tangled.nu
new file mode 100644
index 0000000000000000000000000000000000000000..e30ba6756c1415a71edbddab307c29100c2b261c
--- /dev/null
+++ b/home/nogui/nushell/autoload/tangled.nu
@@ -0,0 +1,60 @@
+module tangled {
+  # Strings CLI
+  #
+  # Examples:
+  # $ string main.go
+  # $ echo "Hey tanglers!" | string --title "tanglers.txt" --description "A file for all the tanglers"
+  export def string [
+    file?:              path   # File to create string from, otherwise stdin
+    --title (-t):       string # Title of the string (default is filename when file is provided, otherwise random uuid)
+    --description (-d): string # Description of the string
+  ]: [
+    path -> string
+    nothing -> string
+  ] {
+    mut _content = $in
+    mut _title = (random uuid) 
+    if ($file != null) {
+      $_content = ($file | open --raw | decode utf-8)
+      $_title = ($file | path basename)
+    }
+    if ($title != null) {
+      $_title = $title
+    }
+    mut _desc = ""
+    if ($description != null) {
+      $_desc = $description
+    }
+  
+    if ($_content == null or $_content == "") {
+      error make {msg: "Cannot create a string with no content"}
+    }
+  
+    let payload = ({
+      "$type": "sh.tangled.string",
+      "contents": $_content,
+      "filename": $_title,
+      "createdAt": (date now | format date "%Y-%m-%dT%H:%M:%SZ"),
+      "description": $_desc
+    } | to json)
+  
+    let tmp = (mktemp --tmpdir sh.tangled.string.XXX)
+    
+    $payload | save --force $tmp
+  
+    mut out = ""
+    try {
+      let resp = (^goat record create --no-validate $tmp)
+      # at://did:plc:35kdk2ntcs626zs6cm62i7ih/sh.tangled.string/3lxuash7vvc2f   bafyreifv7c6il2zsa67oa6umutb52izbgrnmz336wzbgti2we3tpw3bcj4
+      # 0    1   2   3                        4  5       6      7               8
+      let plc = ($resp | split words | get 3)
+      let rkey = ($resp | split words | get 7)
+      $out = $"https://tangled.sh/strings/did:plc:($plc)/($rkey)"
+    }
+  
+    rm $tmp
+  
+    $out
+  }
+}
+use tangled *
I home/nogui/nushell/autoload/tmp.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
diff --git a/home/nogui/nushell/autoload/tmp.nu b/home/nogui/nushell/autoload/tmp.nu
new file mode 100644
index 0000000000000000000000000000000000000000..003cff4384e2dc97b1a9115c8d3a32f4f6ee2764
--- /dev/null
+++ b/home/nogui/nushell/autoload/tmp.nu
@@ -0,0 +1,8 @@
+module tmp {
+  # Create a temporary directory and cd in to it
+  export def --env main []: nothing -> nothing {
+    let t = mktemp --directory
+    cd $t
+  }
+}
+use tmp *
D home/nogui/nushell/clone.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff --git a/home/nogui/nushell/clone.nu b/home/nogui/nushell/clone.nu
deleted file mode 100644
index 1e686813aa3b0a5b5893706726bb8277dd8a928f..0000000000000000000000000000000000000000
--- a/home/nogui/nushell/clone.nu
+++ /dev/null
@@ -1,31 +0,0 @@
-def "forge types" [] {
-  ["github", "gitea", "jojodev", "codeberg"]
-}
-
-export def clone [
-  repo: string # Repo name
-  --forge (-f) = "github": string@"forge types" # Forge type (github, gitea, jojodev, codeberg)
-  --owner (-o): string # Owner (default: current dir name)
-] {
-  mut id = 'gh'
-  if $forge == 'gitea' {
-    $id = 'gt'
-  } else if $forge == 'jojodev' {
-    $id = 'jj'
-  } else if $forge == 'codeberg' {
-    $id = 'cb'
-  }
-  mut namespace = ($env.PWD | path basename)
-  if $owner != '' {
-    $namespace = $owner
-  }
-  let origin = $'ssh:($id):jolheiser/($repo).git'
-  let upstream = $'($id):($namespace)/($repo).git'
-  ^git clone $origin
-  cd $repo
-  if $namespace != 'jolheiser' {
-    ^git remote add upstream $upstream
-    ^git fetch upstream
-  }
-}
-
M home/nogui/nushell/config.nu -> home/nogui/nushell/config.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
diff --git a/home/nogui/nushell/config.nu b/home/nogui/nushell/config.nu
index c72b8ced4d62640c2a9a2e1e5eff809ef97c4dfb..fd80fb76eeb1611c39a707abb9cea522c4525a9f 100644
--- a/home/nogui/nushell/config.nu
+++ b/home/nogui/nushell/config.nu
@@ -667,7 +667,3 @@       event: { send: menu name: commands_with_description }
     }
   ]
 }
-
-
-source ~/.config/nushell/jolheiser.nu
-
D home/nogui/nushell/git-bug.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
diff --git a/home/nogui/nushell/git-bug.nu b/home/nogui/nushell/git-bug.nu
deleted file mode 100644
index c0f421229e60b912d8daa9b7bfaa86a7824e2934..0000000000000000000000000000000000000000
--- a/home/nogui/nushell/git-bug.nu
+++ /dev/null
@@ -1,74 +0,0 @@
-export def "git bug init" [] {
-  git bug pull
-  let id = ^git-bug user -f json | from json | where name == 'jolheiser' | get --optional human_id.0
-  if ($id | is-not-empty) {
-    ^git-bug user adopt $id
-  } else {
-    ^git-bug user new --name 'jolheiser' --email 'git@jolheiser.com' --avatar 'https://www.libravatar.org/avatar/cc498b605dee7b6fb9e6422332691bb4'
-  }
-}
-
-export def "git bug pull" [] {
-  ^git fetch origin refs/bugs/*:refs/bugs/* refs/identities/*:refs/identities/*
-  ^rm -rf $"(^git rev-parse --git-dir)/git-bug"
-}
-
-export def "git bug push" [] {
-  ^git push origin refs/bugs/*:refs/bugs/* refs/identities/*:refs/identities/*
-}
-
-def "bug-id" [] {
-  ^git-bug bug --format json | from json | each {|bug| { value: $bug.human_id, description: $bug.title }}
-}
-
-export extern "git bug bug status" [
-  bug_id: string@bug-id
-]
-
-export extern "git bug bug status open" [
-  bug_id: string@bug-id
-]
-
-export extern "git bug bug status close" [
-  bug_id: string@bug-id
-]
-
-export extern "git bug bug rm" [
-  bug_id: string@bug-id
-]
-
-export extern "gitbug bug comment" [
-  bug_id: string@bug-id
-]
-
-export extern "git bug bug comment new" [
-  bug_id: string@bug-id
-]
-
-export extern "git bug bug label" [
-  bug_id: string@bug-id
-]
-
-export extern "git bug bug label new" [
-  bug_id: string@bug-id
-]
-
-export extern "git bug bug label rm" [
-  bug_id: string@bug-id
-]
-
-export extern "git bug bug select" [
-  bug_id: string@bug-id
-]
-
-export extern "git bug bug show" [
-  bug_id: string@bug-id
-]
-
-export extern "git bug bug title" [
-  bug_id: string@bug-id
-]
-
-export extern "git bug bug title edit" [
-  bug_id: string@bug-id
-]
D home/nogui/nushell/jolheiser.nu
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
diff --git a/home/nogui/nushell/jolheiser.nu b/home/nogui/nushell/jolheiser.nu
deleted file mode 100644
index f7f32744ace6ee6a9447e4ae5f3ad8eb9911b08d..0000000000000000000000000000000000000000
--- a/home/nogui/nushell/jolheiser.nu
+++ /dev/null
@@ -1,190 +0,0 @@
-## Aliases ## 
-alias cat = bat
-alias find = fd
-alias df = duf
-alias du = dust -b -d 1
-alias just = just --shell "nu" --shell-arg "-c"
-alias ll = ls -al
-
-## Functions ##
-def fg [args ...string] {
-  ^rg --ignore-case --color=always --line-number --no-heading $args 
-  | ^fzf --ansi --color 'hl:-1:underline,hl+:-1:underline:reverse' --delimiter ':' --preview "bat --color=always {1} --theme='ctp-mocha' --highlight-line {2}" --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' --bind $"enter:become\(($env.EDITOR) +{2} {1}\)"
-}
-
-def gomodsri [] {
-  let tmp = (mktemp -d)
-  go mod vendor -o $tmp
-  let sri = (go run tailscale.com/cmd/nardump@latest --sri $tmp)
-  $sri | save -f go.mod.sri
-  rm -rf $tmp
-  echo 'nixpkgs.lib.fileContents ./go.mod.sri'
-}
-
-def dev [
-  --port (-p) = 8080: int # Port
-] {
-  print $"Listening on http://localhost:($port)"
-  ^ssh -N -T -R $"3389:localhost:($port)" dragonwell
-}
-
-# Run a command if known, otherwise run it with nix
-def , [
-    cmd: string     # The command to run
-    ...args: string # Command arguments; all flags MUST be quoted
-  ] {
-  if (not (which $cmd | is-empty)) {
-    ^$cmd ...$args
-    return
-  }
-  ^nix run $"nixpkgs#($cmd)" -- ...$args
-}
-
-# Create a temporary directory and cd in to it
-def --env tmp []: nothing -> nothing {
-  let t = mktemp --directory
-  cd $t
-}
-
-# Make a directory and cd in to it
-def --env mkcd [
-  dir: path # The directory to create
-]: nothing -> nothing {
-  mkdir $dir
-  cd $dir
-}
-
-# Convert input string to NATO
-def nato [
-  ...string: string # Input string
-]: nothing -> string {
-  let m = {
-    "a": "Alpha",
-    "b": "Bravo",
-    "d": "Delta",
-    "e": "Echo",
-    "f": "Foxtrot",
-    "g": "Golf",
-    "h": "Hotel",
-    "i": "India",
-    "j": "Juliett",
-    "k": "Kilo",
-    "l": "Lima",
-    "m": "Mike",
-    "n": "November",
-    "o": "Oscar",
-    "p": "Papa",
-    "q": "Quebec",
-    "r": "Romeo",
-    "s": "Sierra",
-    "t": "Tango",
-    "u": "Uniform",
-    "v": "Victor",
-    "w": "Whiskey",
-    "x": "X-ray",
-    "y": "Yankee",
-    "z": "Zulu",
-    "1": "One",
-    "2": "Two",
-    "3": "Three",
-    "4": "Four",
-    "5": "Five",
-    "6": "Six",
-    "7": "Seven",
-    "8": "Eight",
-    "9": "Nine",
-    "0": "Zero"
-  }
-
-  $string | str join " " | split chars | reduce --fold "" {|it, acc|
-    let word = $m | get --optional ($it | str downcase)
-    if $acc == "" {
-      $word
-    } else {
-      $"($acc) ($word)"
-    }
-  }
-}
-
-# Print out all HTTP statuses, or a specific one for a given code
-def httpstatus [
-  code?: int # HTTP status code
-]: nothing -> string {
-  let s = {
-    "100": "Continue",
-    "101": "Switching Protocols",
-    "102": "Processing",
-    "200": "OK",
-    "201": "Created",
-    "202": "Accepted",
-    "203": "Non-Authoritative Information",
-    "204": "No Content",
-    "205": "Reset Content",
-    "206": "Partial Content",
-    "207": "Multi-Status",
-    "208": "Already Reported",
-    "300": "Multiple Choices",
-    "301": "Moved Permanently",
-    "302": "Found",
-    "303": "See Other",
-    "304": "Not Modified",
-    "305": "Use Proxy",
-    "307": "Temporary Redirect",
-    "400": "Bad Request",
-    "401": "Unauthorized",
-    "402": "Payment Required",
-    "403": "Forbidden",
-    "404": "Not Found",
-    "405": "Method Not Allowed",
-    "406": "Not Acceptable",
-    "407": "Proxy Authentication Required",
-    "408": "Request Timeout",
-    "409": "Conflict",
-    "410": "Gone",
-    "411": "Length Required",
-    "412": "Precondition Failed",
-    "413": "Request Entity Too Large",
-    "414": "Request-URI Too Large",
-    "415": "Unsupported Media Type",
-    "416": "Request Range Not Satisfiable",
-    "417": "Expectation Failed",
-    "418": "I'm a teapot",
-    "420": "Blaze it",
-    "422": "Unprocessable Entity",
-    "423": "Locked",
-    "424": "Failed Dependency",
-    "425": "No code",
-    "426": "Upgrade Required",
-    "428": "Precondition Required",
-    "429": "Too Many Requests",
-    "431": "Request Header Fields Too Large",
-    "449": "Retry with",
-    "500": "Internal Server Error",
-    "501": "Not Implemented",
-    "502": "Bad Gateway",
-    "503": "Service Unavailable",
-    "504": "Gateway Timeout",
-    "505": "HTTP Version Not Supported",
-    "506": "Variant Also Negotiates",
-    "507": "Insufficient Storage",
-    "509": "Bandwidth Limit Exceeded",
-    "510": "Not Extended",
-    "511": "Network Authentication Required",
-  }
-
-  if $code != null {
-    $s | get $"($code)"
-  } else {
-    $s | items {|key, value| echo $"($key) ($value)"} | to text
-  }
-}
-
-## Other ##
-$env.EDITOR = 'hx'
-$env.SSH_AUTH_SOCK = '/run/user/1000/ssh-agent'
-source ~/.config/nushell/ohmyposh.nu
-source ~/.config/nushell/ssh.nu
-source ~/.config/nushell/miniserve.nu
-source ~/.config/nushell/clone.nu
-source ~/.config/nushell/git-bug.nu
-source ~/.config/nushell/tangled.nu
D home/nogui/nushell/miniserve.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
diff --git a/home/nogui/nushell/miniserve.nu b/home/nogui/nushell/miniserve.nu
deleted file mode 100644
index 5418c40d2f230ad245734dca5d12341f4efeeff7..0000000000000000000000000000000000000000
--- a/home/nogui/nushell/miniserve.nu
+++ /dev/null
@@ -1,38 +0,0 @@
-export def serve [
-  path: path         # The path to serve 
-  --dir (-d): string # The base dir in miniserve for the path
-  --public (-p)      # Send to http://pubserve (via http://privserve) rather than http://files
-  --verbose (-v)     # Print uploads
-] {
-  let endpoint = if $public { "http://privserve" } else { "http://files" }
-  let url = if $public { "http://pubserve.serval-vibes.ts.net" } else { "http://files" }
-  let upload = $"($endpoint)/upload"
-  let baseName = $path | path basename
-  let cleanDir = if $dir != null { $"($dir | str trim --char '/')" } else { "" }
-  # When uploading, "" is invalid. It must either be "/" or relative "foo/bar/"
-  let uploadDir = $"($cleanDir)/"
-  let serveDir = if $cleanDir != "" { $uploadDir } else { "" }
-  if ($path | path type) == "dir" {
-    let prefix = $path | path expand
-    let baseDir = [$cleanDir, ($prefix | path basename | str trim --char '/')] | path join
-    glob -F $"($prefix)/**" | each {|g| 
-      let b = $g | str replace $prefix "" | str trim --left --char '/'
-      let d = [$baseDir, $b] | path join
-      if $verbose { print $"Creating dir ($d)" }
-      ^curl -F $"mkdir=($d)" $"($upload)?path=/" | complete
-    }
-    glob -D $"($prefix)/**" | each {|g| 
-      let f = $g | str replace $prefix "" | str trim --left --char '/'
-      let t = [$baseDir, $f] | path join
-      let p = $t | path dirname
-      if $verbose { print $"Uploading ($g) to ($t)" }
-      ^curl -F $"path=@($g)" $"($upload)?path=($p)" | complete
-    }
-  } else {
-    if $verbose { print $"Creating dir ($uploadDir)" }
-    ^curl -F $"mkdir=($uploadDir)" $"($upload)?path=/" | complete
-    if $verbose { print $"Uploading ($path | path expand) to ($serveDir)($baseName)" }
-    ^curl -F $"path=@($path)" $"($upload)?path=($uploadDir)" | complete
-  }
-  $"($url)/($serveDir)($baseName)"
-}
M home/nogui/nushell/ohmyposh.nu -> home/nogui/nushell/autoload/ohmyposh.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
diff --git a/home/nogui/nushell/ohmyposh.nu b/home/nogui/nushell/autoload/ohmyposh.nu
rename from home/nogui/nushell/ohmyposh.nu
rename to home/nogui/nushell/autoload/ohmyposh.nu
index f702bff725a15f5d653bde3c6a10018226979fac..7b29dc04349e7cbecfb0d070e071ebbcd0e1160b 100644
--- a/home/nogui/nushell/ohmyposh.nu
+++ b/home/nogui/nushell/autoload/ohmyposh.nu
@@ -19,7 +19,7 @@         # See https://github.com/nushell/nushell/discussions/6402#discussioncomment-3466687.
         let cmd_duration = if $env.CMD_DURATION_MS == "0823" { 0 } else { $env.CMD_DURATION_MS }
 
         let width = ((term size).columns | into string)
-        ^oh-my-posh print primary $"--config=($env.POSH_THEME)" --shell=nu $"--shell-version=($env.NU_VERSION)" $"--execution-time=($cmd_duration)" $"--error=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)"
+        ^oh-my-posh print primary $"--config=($env.POSH_THEME)" --shell=nu $"--shell-version=($env.NU_VERSION)" $"--execution-time=($cmd_duration)" $"--status=($env.LAST_EXIT_CODE)" $"--terminal-width=($width)"
     }
 }
 
D home/nogui/nushell/ssh.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
diff --git a/home/nogui/nushell/ssh.nu b/home/nogui/nushell/ssh.nu
deleted file mode 100644
index 5c38eadcca29ddd14b9ce99621010fd57f550322..0000000000000000000000000000000000000000
--- a/home/nogui/nushell/ssh.nu
+++ /dev/null
@@ -1,89 +0,0 @@
-export extern "ssh" [
-    destination?: string@"nu-complete ssh-host"
-    -4            # Forces ssh to use IPv4 addresses only.
-    -6            # Forces ssh to use IPv6 addresses only.
-    -A            # Enables forwarding of connections from an authentication agent such as ssh-agent(1).
-    -a            # Disables forwarding of the authentication agent connection.
-    -B: string    # bind_interface
-    -b: string    # bind_address
-    -C            # Requests compression of all data
-    -c: string    # cipher_spec
-    -D            # [bind_address:]port
-    -E: string    # log_file
-    -e            # escape_char
-    -F: string    # configfile
-    -f            # Requests ssh to go to background just before command execution.
-    -G            # Causes ssh to print its configuration after evaluating Host and Match blocks and exit.
-    -g            # Allows remote hosts to connect to local forwarded ports
-    -I: string    # pkcs11
-    -i: string@"nu-complete ssh-identity"    # identity_file
-    -J: string    # destination
-    -K            # Enables GSSAPI-based authentication and forwarding(delegation) of GSSAPI credentials to the server.
-    -k            # Disables forwarding (delegation) of GSSAPI credentials to the server.
-    -L: string    # [bind_address:]port:host:hostport / [bind_address:]port:remote_socket / local_socket:host:hostport / local_socket:remote_socket
-    -l: string    # login_name
-    -M            # Places the ssh client into “master” mode for connection sharing.
-    -m: string    # mac_spec
-    -N            # Do not execute a remote command.
-    -n            # Redirects stdin from /dev/null (5) for details.
-    -O: string    # ctl_cmd
-    -o: string    # option
-]
-
-def parse-host [file: string] {
-    let lines = $file | open | lines | str trim
-
-    mut result = []
-    for $line in $lines {
-        let data = $line | parse --regex '^Include\s+(?<file>.+)'
-        if ($data | is-not-empty) {
-            let include = parse-host ($data.file | first)
-            $result = ($result | append $include)
-            continue
-        }
-        let data = $line | parse  --regex '^Host\s+(?<host>.+)'
-        if ($data | is-not-empty) {
-            let host = $data.host | first
-            if ($host == '*') {
-                continue
-            }
-            $result = ($result | append { 'value': $host, 'description': "" })
-            continue;
-        }
-        let data = $line | parse --regex '^HostName\s+(?<hostname>.+)'
-        if ($data | is-not-empty) {
-            let last = $result | last | update 'description' ($data.hostname | first)
-            $result = ($result | drop | append $last)
-        }
-    }
-    $result
-}
-
-def "nu-complete ssh-host" [] {
-    mut files = [
-        '/etc/ssh/ssh_config',
-        '~/.ssh/config'
-    ] | where { |file| $file | path exists }
-
-
-    $files | each { |file|
-        parse-host $file
-    } | flatten
-}
-
-def "nu-complete ssh-identity" [] {
-  ls ~/.ssh/
-  | where {|f|
-      ($f.name | path parse | get extension) == "pub"
-    }
-  | get name
-  | path parse
-  | each {|p| {'value': $'~/.ssh/($p.stem)', 'description': $p.stem} }
-}
-
-export def ssh-add-all [] {
-    nu-complete ssh-identity
-    | each {|s| print $s.value; ^ssh-add ($s.value | path expand); print '' }
-    null
-}
-
D home/nogui/nushell/tangled.nu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
diff --git a/home/nogui/nushell/tangled.nu b/home/nogui/nushell/tangled.nu
deleted file mode 100644
index 3d09d3791aa5e53a56ad79bfb182c6c81d31c1c2..0000000000000000000000000000000000000000
--- a/home/nogui/nushell/tangled.nu
+++ /dev/null
@@ -1,57 +0,0 @@
-# Strings CLI
-#
-# Examples:
-# $ string main.go
-# $ echo "Hey tanglers!" | string --title "tanglers.txt" --description "A file for all the tanglers"
-export def string [
-  file?:              path   # File to create string from, otherwise stdin
-  --title (-t):       string # Title of the string (default is filename when file is provided, otherwise random uuid)
-  --description (-d): string # Description of the string
-]: [
-  path -> string
-  nothing -> string
-] {
-  mut _content = $in
-  mut _title = (random uuid) 
-  if ($file != null) {
-    $_content = ($file | open --raw | decode utf-8)
-    $_title = ($file | path basename)
-  }
-  if ($title != null) {
-    $_title = $title
-  }
-  mut _desc = ""
-  if ($description != null) {
-    $_desc = $description
-  }
-
-  if ($_content == null or $_content == "") {
-    error make {msg: "Cannot create a string with no content"}
-  }
-
-  let payload = ({
-    "$type": "sh.tangled.string",
-    "contents": $_content,
-    "filename": $_title,
-    "createdAt": (date now | format date "%Y-%m-%dT%H:%M:%SZ"),
-    "description": $_desc
-  } | to json)
-
-  let tmp = (mktemp --tmpdir sh.tangled.string.XXX)
-  
-  $payload | save --force $tmp
-
-  mut out = ""
-  try {
-    let resp = (^goat record create --no-validate $tmp)
-    # at://did:plc:35kdk2ntcs626zs6cm62i7ih/sh.tangled.string/3lxuash7vvc2f   bafyreifv7c6il2zsa67oa6umutb52izbgrnmz336wzbgti2we3tpw3bcj4
-    # 0    1   2   3                        4  5       6      7               8
-    let plc = ($resp | split words | get 3)
-    let rkey = ($resp | split words | get 7)
-    $out = $"https://tangled.sh/strings/did:plc:($plc)/($rkey)"
-  }
-
-  rm $tmp
-
-  $out
-}
M home/nogui/oh-my-posh.nix -> home/nogui/oh-my-posh.nix
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
diff --git a/home/nogui/oh-my-posh.nix b/home/nogui/oh-my-posh.nix
index 4e017c46ecead94b0a9b9d10cdb78c52d0d600f4..91c69b51f9e5e87e47eed514ef59375b79cae3ad 100644
--- a/home/nogui/oh-my-posh.nix
+++ b/home/nogui/oh-my-posh.nix
@@ -31,11 +31,12 @@                       builtins.toString (descriptionMax - 1)
                     }) ++ "…"
                   ),
                   "•",
-                  change_id.shortest(6).prefix() ++ "|" ++ change_id.shortest(6).rest(),
+                  change_id.shortest(6).prefix() ++ "(" ++ change_id.shortest(6).rest() ++ ")",
                   if(empty, "(empty)"),
                   if(conflict, "(conflict)"),
                   if(divergent, "(divergent)"),
                   if(hidden, "(hidden)"),
+                  if(immutable, "🔒"),
                 )
               '
       '';