From 6a2cc7b49d227c39bbbd83daaff199e16ad27420 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Tue, 28 May 2024 20:40:46 -0700 Subject: [PATCH] config --- extras/dev.nix | 1 + flake.lock | 24 +++++----- systems/BASED.nix | 4 +- systems/NOlaptop.nix | 4 -- users/tao.nix | 1 + users/tao/helix.nix | 3 +- users/tao/nushell/stuff.nu | 93 ++++++++++++++++++++++++-------------- 7 files changed, 78 insertions(+), 52 deletions(-) diff --git a/extras/dev.nix b/extras/dev.nix index c3d3f94..382b114 100644 --- a/extras/dev.nix +++ b/extras/dev.nix @@ -8,6 +8,7 @@ # fontforge # radicle-node # hyperfine # benchmarking + markdown-oxide git-cliff b3sum direnv diff --git a/flake.lock b/flake.lock index 30367b0..50bfd8a 100644 --- a/flake.lock +++ b/flake.lock @@ -65,11 +65,11 @@ ] }, "locked": { - "lastModified": 1716930911, - "narHash": "sha256-t4HT5j3Jy7skRB5PINnxcEBCkgE89rGBpwTI7YS4Ffo=", + "lastModified": 1717097707, + "narHash": "sha256-HC5vJ3oYsjwsCaSbkIPv80e4ebJpNvFKQTBOGlHvjLs=", "owner": "nix-community", "repo": "home-manager", - "rev": "a9b36cbe9292a649222b89fdb9ae9907e9c74086", + "rev": "0eb314b4f0ba337e88123e0b1e57ef58346aafd9", "type": "github" }, "original": { @@ -107,11 +107,11 @@ ] }, "locked": { - "lastModified": 1716853176, - "narHash": "sha256-9gUu2VJu5bL+jjNS3mWG/h7T+vIsYhKYyQAunvZtBT4=", + "lastModified": 1717048113, + "narHash": "sha256-adjeBeqMoCYr/iY3/zHCl2c8WYRzi+0TfH/3itJZ0qE=", "owner": "lilyinstarlight", "repo": "nixos-cosmic", - "rev": "996ad8af9bfe04587c0457fcf72f5167e481fe5a", + "rev": "f7b84cb8a0c081a36c2692cbdcb6aee122f27e77", "type": "github" }, "original": { @@ -122,11 +122,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1716881121, - "narHash": "sha256-oTf3enbe/lbiNzsyZ8ria+422hx4e/FB3xQcY2LPnJw=", + "lastModified": 1716987116, + "narHash": "sha256-uuEkErFVsFdg2K0cKbNQ9JlFSAm/xYqPr4rbPLI91Y8=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "806e9d4a933dd1e75592e88894d4bd2f296f5bbf", + "rev": "8251761f93d6f5b91cee45ac09edb6e382641009", "type": "github" }, "original": { @@ -152,11 +152,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1716509168, - "narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=", + "lastModified": 1716948383, + "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bfb7a882678e518398ce9a31a881538679f6f092", + "rev": "ad57eef4ef0659193044870c731987a6df5cf56b", "type": "github" }, "original": { diff --git a/systems/BASED.nix b/systems/BASED.nix index f160ff4..817c1c6 100644 --- a/systems/BASED.nix +++ b/systems/BASED.nix @@ -25,7 +25,7 @@ pueue ripgrep rustdesk - screen + # screen skim tree wezterm @@ -78,6 +78,8 @@ networking.networkmanager.enable = true; services.tailscale.enable = true; + # TODO figure out a socks5 that blocks when not connected to tailscale exit-node + # services.tailscale.extraDaemonFlags = ["--socks5-server=localhost:1055"]; services.resolved.enable = true; # networking.interfaces.tailscale0.useDHCP = false; diff --git a/systems/NOlaptop.nix b/systems/NOlaptop.nix index b773ceb..026dba7 100644 --- a/systems/NOlaptop.nix +++ b/systems/NOlaptop.nix @@ -78,7 +78,6 @@ ''; boot.kernelPackages = pkgs.linuxPackages_latest; - # boot.kernelPackages = pkgs.linuxPackages_zen; boot.initrd.availableKernelModules = [ "nvme" "sd_mod" @@ -89,10 +88,7 @@ "uas" ]; boot.kernelParams = [ - # "mem_sleep_default=deep" "amdgpu.abmlevel=1" - # TODO DMUB bugfix? (apparently disables PSR?) - # "amdgpu.dcdebugmask=0x10" ]; boot.kernelModules = ["kvm-amd"]; boot.extraModulePackages = with config.boot.kernelPackages; [ diff --git a/users/tao.nix b/users/tao.nix index 702b2d6..9088fcf 100644 --- a/users/tao.nix +++ b/users/tao.nix @@ -54,6 +54,7 @@ typst-lsp vial wezterm + wl-clipboard-rs yt-dlp zathura zellij diff --git a/users/tao/helix.nix b/users/tao/helix.nix index 567408c..295b12f 100644 --- a/users/tao/helix.nix +++ b/users/tao/helix.nix @@ -34,6 +34,7 @@ }; keys.insert = { C-space = "completion"; + k = {k = "normal_mode";}; }; keys.normal = { k = "move_line_down"; @@ -51,7 +52,7 @@ }; }; languages = { - use-grammars.only = ["rust" "c" "cpp" "typst" "nix" "html"]; + use-grammars.only = ["rust" "c" "cpp" "typst" "nix" "html" "toml" "markdown"]; language = [ { name = "arduino"; diff --git a/users/tao/nushell/stuff.nu b/users/tao/nushell/stuff.nu index 8e81bb1..984f1e8 100644 --- a/users/tao/nushell/stuff.nu +++ b/users/tao/nushell/stuff.nu @@ -35,24 +35,23 @@ def l [ | sort-by type name -i -n } -def rg [pattern?] { - if $pattern == null { - sk --ansi -i -c 'rg --color=always --line-number "{}"' - } else { - rg $pattern - } +def srg [pattern] { + sk --ansi -i -c 'rg --color=always --line-number "{}"' } alias nd = nix develop def ns [package] { nix shell $"nixpkgs#($package)" } +def nr [package] { + nix search nixpkgs $package +} def rebuild [subcommand] { sudo nice -n19 nixos-rebuild $subcommand --flake /home/tao/projects/NOflake/ --impure --verbose - rm ~/.config/helix/runtime/grammars/* + rm -r ~/.config/helix/runtime/grammars/ hx --grammar fetch; hx --grammar build - rm -rf ~/.cache/jdtls/ + rustup update } def bump [] { cd /home/tao/projects/NOflake/ @@ -69,34 +68,39 @@ alias gc = nh clean all def tse [exit_node: string = ""] { - tailscale set --exit-node $exit_node + if ($exit_node | is-empty) and (ps | find deluge | is-not-empty) { + print "stop summoning first!" + return + } else { + tailscale set --exit-node $exit_node + } http get https://am.i.mullvad.net/json } -def tsp [] { - tailscale exit-node list - | split row "\n" - | each {str trim} - | filter {is-not-empty} - | skip 1 - | last 19 - | first 17 - | split column -r '\s{2,}' - | reject column5 column3 - | rename ip addr city - | par-each { - insert ping { - |row| $row.addr - | str replace "mullvad.ts.net" "relays.mullvad.net" - | ping -c5 -q $in - | split row "\n" - | last - | split column "/" - | get column6? - | get 0 - } - } - | sort-by ping -n -r - } +# def tsp [] { +# tailscale exit-node list +# | split row "\n" +# | each {str trim} +# | filter {is-not-empty} +# | skip 1 +# | last 19 +# | first 17 +# | split column -r '\s{2,}' +# | reject column5 column3 +# | rename ip addr city +# | par-each { +# insert ping { +# |row| $row.addr +# | str replace "mullvad.ts.net" "relays.mullvad.net" +# | ping -c5 -q $in +# | split row "\n" +# | last +# | split column "/" +# | get column6? +# | get 0 +# } +# } +# | sort-by ping -n -r +# } def tsr [] { tailscale status --json | from json @@ -116,7 +120,28 @@ alias tss = tailscale status alias tsu = tailscale up alias tsd = tailscale down alias tsx = tailscale exit-node list +alias tsp = tailscale exit-node suggest +def "config stuff" [] { + hx ~/projects/NOflake/users/tao/nushell/stuff.nu +} + +def deluge-gtk [] { + tsr + deluge-gtk +} +alias deluge = deluge-gtk + +def fixme [] { + rg TODO --json + | lines + | each {from json} + | where type == "match" + | get data + | flatten + | each {$"($in.text):($in.line_number)"} + | hx ...$in +} source ~/.cache/starship/init.nu source ~/.zoxide.nu