This commit is contained in:
Tao Tien 2024-05-28 20:40:46 -07:00
parent 3f1279ea08
commit 6a2cc7b49d
7 changed files with 78 additions and 52 deletions

View file

@ -8,6 +8,7 @@
# fontforge # fontforge
# radicle-node # radicle-node
# hyperfine # benchmarking # hyperfine # benchmarking
markdown-oxide
git-cliff git-cliff
b3sum b3sum
direnv direnv

24
flake.lock generated
View file

@ -65,11 +65,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1716930911, "lastModified": 1717097707,
"narHash": "sha256-t4HT5j3Jy7skRB5PINnxcEBCkgE89rGBpwTI7YS4Ffo=", "narHash": "sha256-HC5vJ3oYsjwsCaSbkIPv80e4ebJpNvFKQTBOGlHvjLs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "a9b36cbe9292a649222b89fdb9ae9907e9c74086", "rev": "0eb314b4f0ba337e88123e0b1e57ef58346aafd9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -107,11 +107,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1716853176, "lastModified": 1717048113,
"narHash": "sha256-9gUu2VJu5bL+jjNS3mWG/h7T+vIsYhKYyQAunvZtBT4=", "narHash": "sha256-adjeBeqMoCYr/iY3/zHCl2c8WYRzi+0TfH/3itJZ0qE=",
"owner": "lilyinstarlight", "owner": "lilyinstarlight",
"repo": "nixos-cosmic", "repo": "nixos-cosmic",
"rev": "996ad8af9bfe04587c0457fcf72f5167e481fe5a", "rev": "f7b84cb8a0c081a36c2692cbdcb6aee122f27e77",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -122,11 +122,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1716881121, "lastModified": 1716987116,
"narHash": "sha256-oTf3enbe/lbiNzsyZ8ria+422hx4e/FB3xQcY2LPnJw=", "narHash": "sha256-uuEkErFVsFdg2K0cKbNQ9JlFSAm/xYqPr4rbPLI91Y8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "806e9d4a933dd1e75592e88894d4bd2f296f5bbf", "rev": "8251761f93d6f5b91cee45ac09edb6e382641009",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -152,11 +152,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1716509168, "lastModified": 1716948383,
"narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=", "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bfb7a882678e518398ce9a31a881538679f6f092", "rev": "ad57eef4ef0659193044870c731987a6df5cf56b",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -25,7 +25,7 @@
pueue pueue
ripgrep ripgrep
rustdesk rustdesk
screen # screen
skim skim
tree tree
wezterm wezterm
@ -78,6 +78,8 @@
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
services.tailscale.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; services.resolved.enable = true;
# networking.interfaces.tailscale0.useDHCP = false; # networking.interfaces.tailscale0.useDHCP = false;

View file

@ -78,7 +78,6 @@
''; '';
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
# boot.kernelPackages = pkgs.linuxPackages_zen;
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"nvme" "nvme"
"sd_mod" "sd_mod"
@ -89,10 +88,7 @@
"uas" "uas"
]; ];
boot.kernelParams = [ boot.kernelParams = [
# "mem_sleep_default=deep"
"amdgpu.abmlevel=1" "amdgpu.abmlevel=1"
# TODO DMUB bugfix? (apparently disables PSR?)
# "amdgpu.dcdebugmask=0x10"
]; ];
boot.kernelModules = ["kvm-amd"]; boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = with config.boot.kernelPackages; [ boot.extraModulePackages = with config.boot.kernelPackages; [

View file

@ -54,6 +54,7 @@
typst-lsp typst-lsp
vial vial
wezterm wezterm
wl-clipboard-rs
yt-dlp yt-dlp
zathura zathura
zellij zellij

View file

@ -34,6 +34,7 @@
}; };
keys.insert = { keys.insert = {
C-space = "completion"; C-space = "completion";
k = {k = "normal_mode";};
}; };
keys.normal = { keys.normal = {
k = "move_line_down"; k = "move_line_down";
@ -51,7 +52,7 @@
}; };
}; };
languages = { languages = {
use-grammars.only = ["rust" "c" "cpp" "typst" "nix" "html"]; use-grammars.only = ["rust" "c" "cpp" "typst" "nix" "html" "toml" "markdown"];
language = [ language = [
{ {
name = "arduino"; name = "arduino";

View file

@ -35,24 +35,23 @@ def l [
| sort-by type name -i -n | sort-by type name -i -n
} }
def rg [pattern?] { def srg [pattern] {
if $pattern == null {
sk --ansi -i -c 'rg --color=always --line-number "{}"' sk --ansi -i -c 'rg --color=always --line-number "{}"'
} else {
rg $pattern
}
} }
alias nd = nix develop alias nd = nix develop
def ns [package] { def ns [package] {
nix shell $"nixpkgs#($package)" nix shell $"nixpkgs#($package)"
} }
def nr [package] {
nix search nixpkgs $package
}
def rebuild [subcommand] { def rebuild [subcommand] {
sudo nice -n19 nixos-rebuild $subcommand --flake /home/tao/projects/NOflake/ --impure --verbose 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 hx --grammar fetch; hx --grammar build
rm -rf ~/.cache/jdtls/ rustup update
} }
def bump [] { def bump [] {
cd /home/tao/projects/NOflake/ cd /home/tao/projects/NOflake/
@ -69,34 +68,39 @@ alias gc = nh clean all
def tse [exit_node: string = ""] { def tse [exit_node: string = ""] {
if ($exit_node | is-empty) and (ps | find deluge | is-not-empty) {
print "stop summoning first!"
return
} else {
tailscale set --exit-node $exit_node tailscale set --exit-node $exit_node
}
http get https://am.i.mullvad.net/json http get https://am.i.mullvad.net/json
} }
def tsp [] { # def tsp [] {
tailscale exit-node list # tailscale exit-node list
| split row "\n" # | split row "\n"
| each {str trim} # | each {str trim}
| filter {is-not-empty} # | filter {is-not-empty}
| skip 1 # | skip 1
| last 19 # | last 19
| first 17 # | first 17
| split column -r '\s{2,}' # | split column -r '\s{2,}'
| reject column5 column3 # | reject column5 column3
| rename ip addr city # | rename ip addr city
| par-each { # | par-each {
insert ping { # insert ping {
|row| $row.addr # |row| $row.addr
| str replace "mullvad.ts.net" "relays.mullvad.net" # | str replace "mullvad.ts.net" "relays.mullvad.net"
| ping -c5 -q $in # | ping -c5 -q $in
| split row "\n" # | split row "\n"
| last # | last
| split column "/" # | split column "/"
| get column6? # | get column6?
| get 0 # | get 0
} # }
} # }
| sort-by ping -n -r # | sort-by ping -n -r
} # }
def tsr [] { def tsr [] {
tailscale status --json tailscale status --json
| from json | from json
@ -116,7 +120,28 @@ alias tss = tailscale status
alias tsu = tailscale up alias tsu = tailscale up
alias tsd = tailscale down alias tsd = tailscale down
alias tsx = tailscale exit-node list 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 ~/.cache/starship/init.nu
source ~/.zoxide.nu source ~/.zoxide.nu