a dotfile but it's really big
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add treefmt, replace topiary-nu with nufmt

- Add treefmt.toml matching helix formatter settings
- nix: nixfmt -s -w 120
- nu: nufmt
- json: biome with 2-space indent
- Replace topiary-nu with nufmt in helix and opencode configs
- Remove custom topiary-nu package
- Format existing .nu and .nix files with treefmt

karitham 40a3168a b4af26b5

+40 -118
-1
modules/default.nix
··· 24 24 packages = { 25 25 pokego = pkgs.callPackage ./pkgs/pokego.nix { }; 26 26 http-nu = pkgs.callPackage ./pkgs/http-nu.nix { }; 27 - topiary-nu = pkgs.callPackage ./pkgs/topiary-nu.nix { }; 28 27 malachite = pkgs.callPackage ./pkgs/malachite.nix { }; 29 28 multi-scrobbler = pkgs.callPackage ./pkgs/multi-scrobbler.nix { }; 30 29
+1 -3
modules/desktop/wm/waybar.nix
··· 7 7 }: 8 8 { 9 9 config = lib.mkIf config.desktop.waybar.enable { 10 - programs.niri.settings.spawn-at-startup = [ 11 - { command = [ "systemctl --user restart waybar.service" ]; } 12 - ]; 10 + programs.niri.settings.spawn-at-startup = [ { command = [ "systemctl --user restart waybar.service" ]; } ]; 13 11 programs.waybar = { 14 12 enable = true; 15 13 systemd.enable = true;
+19 -31
modules/dev/editor/copy-remote-path.nu
··· 1 1 #!/usr/bin/env nix-shell 2 2 #!nix-shell -i nu -p nushell jujutsu wl-clipboard 3 - 4 3 # Generates a remote git URL for the given file and line, and copies it to the clipboard. 5 4 def main [ 6 5 file: string # Absolute or relative path to the file 7 6 --line-start (-s): string # The starting line number (e.g., cursor line) 8 7 --line-end (-e): string # The ending line number (for selections) 9 8 ] { 10 - let root = (jj workspace root | str trim) 11 - let rel_path = ($file | path expand | path relative-to $root) 12 - 13 - # Intersect current ancestry with the ancestry of all remote bookmarks 14 - let ref = (jj log -r "heads(::@ & ::remote_bookmarks())" -n 1 --no-graph -T "commit_id" | str trim) 15 - 16 - if ($ref | is-empty) { 17 - print -e "Error: No pushed commits found in the current ancestry." 18 - exit 1 19 - } 20 - 21 - let remote_url = ( 22 - jj git remote list 23 - | parse "{remote} {url}" 24 - | where remote == "origin" 25 - | get url.0 26 - | if ($in | str contains "://") { $in } else { $"https://($in | str replace ':' '/')" } 27 - | url parse 28 - ) 29 - 30 - # Construct the line number suffix (GitHub format) 31 - let start = if ($line_start | is-empty) { "" } else { $line_start } 32 - let end = if ($line_end | is-empty) { "" } else { $"-L($line_end)" } 33 - let line_suffix = if ($start | is-empty) { "" } else { $"#L($start)($end)" } 34 - 35 - # Construct the final URL 36 - let url = $"https://($remote_url.host)($remote_url.path | str replace '.git' '')/blob/($ref)/($rel_path)($line_suffix)" 37 - 38 - $url | wl-copy 39 - print -e $"Copied to clipboard: ($url)" 9 + let root = (jj workspace root | str trim) 10 + let rel_path = ($file | path expand | path relative-to $root) 11 + # Intersect current ancestry with the ancestry of all remote bookmarks 12 + let ref = (jj log -r "heads(::@ & ::remote_bookmarks())" -n 1 --no-graph -T "commit_id" | str trim) 13 + if ($ref | is-empty) { 14 + print -e "Error: No pushed commits found in the current ancestry." 15 + exit 1 16 + } 17 + let remote_url = ( 18 + jj git remote list | parse "{remote} {url}" | where remote == "origin" | get url.0 | if ($in | str contains "://") { $in } else { $"https://($in | str replace ':' '/')" } | url parse 19 + ) 20 + # Construct the line number suffix (GitHub format) 21 + let start = if ($line_start | is-empty) { "" } else { $line_start } 22 + let end = if ($line_end | is-empty) { "" } else { $"-L($line_end)" } 23 + let line_suffix = if ($start | is-empty) { "" } else { $"#L($start)($end)" } 24 + # Construct the final URL 25 + let url = $"https://($remote_url.host)($remote_url.path | str replace '.git' '')/blob/($ref)/($rel_path)($line_suffix)" 26 + $url | wl-copy 27 + print -e $"Copied to clipboard: ($url)" 40 28 }
+3 -7
modules/dev/editor/helix.nix
··· 3 3 pkgs, 4 4 inputs, 5 5 inputs', 6 - self', 7 6 config, 8 7 ... 9 8 }: ··· 27 26 gopls-cleaned 28 27 sql-formatter 29 28 prettier 29 + nufmt 30 30 ]; 31 31 in 32 32 lib.mkIf config.dev.editor.enable { ··· 557 557 name = "nu"; 558 558 language-servers = [ "nu-lsp" ]; 559 559 formatter = { 560 - command = "${lib.getExe self'.packages.topiary-nu}"; 561 - args = [ 562 - "format" 563 - "--language" 564 - "nu" 565 - ]; 560 + command = "nufmt"; 561 + args = [ "--stdin" ]; 566 562 }; 567 563 auto-format = true; 568 564 }
+12 -18
modules/dev/tools/scripts/ll.nu
··· 1 1 #!/usr/bin/env -S nu --no-config-file 2 2 # we assume jj & nushell & libnotify are in path 3 - 4 3 def main [] { 5 - let now = (date now) 6 - let date_path = ($now | format date "%Y/%m") 7 - let day_file = ($now | format date "%d.md") 8 - let log_dir = $"($env.HOME)/notes/logs/($date_path)" 9 - 10 - mkdir $log_dir 11 - 12 - let target = ($log_dir | path join $day_file) 13 - run-external $env.EDITOR $target 14 - 15 - cd $log_dir 16 - 17 - jj describe -m $"Log update: ($now | format date '%F %T')" 18 - jj bookmark set main -r @ 19 - jj git push -b main 20 - 21 - notify-send 'Log Synced' 'Updates pushed to git.' 4 + let now = (date now) 5 + let date_path = ($now | format date "%Y/%m") 6 + let day_file = ($now | format date "%d.md") 7 + let log_dir = $"($env.HOME)/notes/logs/($date_path)" 8 + mkdir $log_dir 9 + let target = ($log_dir | path join $day_file) 10 + run-external $env.EDITOR $target 11 + cd $log_dir 12 + jj describe -m $"Log update: ($now | format date '%F %T')" 13 + jj bookmark set main -r @ 14 + jj git push -b main 15 + notify-send 'Log Synced' 'Updates pushed to git.' 22 16 }
+3 -6
modules/opencode/default.nix
··· 118 118 ]; 119 119 extensions = [ ".sql" ]; 120 120 }; 121 - topiary-nu = { 121 + nufmt = { 122 122 command = [ 123 - "${lib.getExe self'.packages.topiary-nu}" 124 - "format" 125 - "--language" 126 - "nu" 127 - "$FILE" 123 + "nufmt" 124 + "--stdin" 128 125 ]; 129 126 extensions = [ ".nu" ]; 130 127 };
-45
modules/pkgs/topiary-nu.nix
··· 1 - { 2 - lib, 3 - writeShellApplication, 4 - topiary, 5 - nushell, 6 - tree-sitter-grammars, 7 - writeText, 8 - linkFarm, 9 - pkgs, # otherwise lint issue because `fetchurl` is a builtin 10 - }: 11 - let 12 - langDir = linkFarm "topiary-nu-languages" [ 13 - { 14 - name = "nu.scm"; 15 - path = pkgs.fetchurl { 16 - url = "https://raw.githubusercontent.com/blindFS/topiary-nushell/main/languages/nu.scm"; 17 - hash = "sha256-2o7oIFkxuy8u8HNkiEzNnoKekmwaxClCWQnQg3rgVeU="; 18 - }; 19 - } 20 - ]; 21 - configFile = writeText "languages.json" ( 22 - builtins.toJSON { 23 - languages = { 24 - nu = { 25 - extensions = [ "nu" ]; 26 - grammar.source.path = "${tree-sitter-grammars.tree-sitter-nu}/parser"; 27 - }; 28 - }; 29 - } 30 - ); 31 - in 32 - writeShellApplication { 33 - name = "topiary-nu"; 34 - runtimeInputs = [ 35 - nushell 36 - topiary 37 - ]; 38 - runtimeEnv = { 39 - TOPIARY_CONFIG_FILE = configFile; 40 - TOPIARY_LANGUAGE_DIR = langDir; 41 - }; 42 - text = '' 43 - ${lib.getExe topiary} "$@" 44 - ''; 45 - }
+2 -7
systems/reg/pds.nix
··· 1 1 { config, lib, ... }: 2 2 let 3 - inherit (lib) 4 - mkMerge 5 - mkDefault 6 - ; 3 + inherit (lib) mkMerge mkDefault; 7 4 in 8 5 { 9 - imports = [ 10 - ../../modules/services/acme-nginx.nix 11 - ]; 6 + imports = [ ../../modules/services/acme-nginx.nix ]; 12 7 13 8 sops = { 14 9 secrets.pds = {