diff --git a/extras/dev.nix b/extras/dev.nix index 1f2b9c5..ec653c8 100644 --- a/extras/dev.nix +++ b/extras/dev.nix @@ -1,5 +1,6 @@ {pkgs, ...}: { environment.systemPackages = with pkgs; [ + bash-language-server qemu # quickemu # lychee # link checker @@ -47,12 +48,13 @@ nil alejandra - # # python - # pypy3 - # python3 + # python + pypy3 + python3 # python310Packages.python-lsp-server - # ruff - # ruff-lsp + uv + ruff + ruff-lsp # go go diff --git a/systems/BASED.nix b/systems/BASED.nix index 203f909..00612a0 100644 --- a/systems/BASED.nix +++ b/systems/BASED.nix @@ -78,6 +78,12 @@ programs.ssh.startAgent = true; services.printing.enable = lib.mkDefault true; + services.printing.drivers = with pkgs; [hplip hplipWithPlugin gutenprint gutenprintBin]; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; networking.networkmanager.enable = true; services.tailscale.enable = true; diff --git a/users/tao.nix b/users/tao.nix index c4f065f..d0bab91 100644 --- a/users/tao.nix +++ b/users/tao.nix @@ -6,6 +6,7 @@ ... }: { users.users.tao.packages = with pkgs; [ + nufmt freerdp nixos-anywhere cloud-hypervisor diff --git a/users/tao/HOME.nix b/users/tao/HOME.nix index 63af39e..6e81bb7 100644 --- a/users/tao/HOME.nix +++ b/users/tao/HOME.nix @@ -22,6 +22,7 @@ in { source = ./autostart; recursive = true; }; + home.file.".config/direnv/lib/uv.sh".source = ./uv.sh; programs = { bat = { diff --git a/users/tao/helix.nix b/users/tao/helix.nix index f9262ff..516b26e 100644 --- a/users/tao/helix.nix +++ b/users/tao/helix.nix @@ -52,7 +52,7 @@ }; }; languages = { - use-grammars.only = ["rust" "c" "cpp" "typst" "nix" "html" "toml" "markdown" "just"]; + use-grammars.only = ["rust" "c" "cpp" "typst" "nix" "html" "toml" "markdown" "just" "bash"]; language = [ { name = "arduino"; diff --git a/users/tao/nushell/stuff.nu b/users/tao/nushell/stuff.nu index 5e109cf..f06cd8f 100644 --- a/users/tao/nushell/stuff.nu +++ b/users/tao/nushell/stuff.nu @@ -1,5 +1,7 @@ -task +task +alias xo = xdg-open +alias h = hx (sk) alias b = btm alias cringe = sudo bootctl set-oneshot auto-windows alias fetch = fastfetch @@ -10,13 +12,11 @@ alias zl = zellij alias snapper = snapper -c home alias quiet = sudo ectool fanduty 42 alias loud = sudo ectool autofanctl - alias jd = jj diff alias jc = jj desc alias js = jj status alias jp = jj git push alias jm = jj branch set main - def c [path: path = "~"] { export-env {cd $path} l @@ -37,11 +37,9 @@ def l [ } | sort-by type name -i -n } - def srg [pattern] { sk --ansi -i -c 'rg --color=always --line-number "{}"' } - alias nd = nix develop def ns [package] { nix shell $"nixpkgs#($package)" @@ -49,7 +47,6 @@ def ns [package] { def nr [package] { nix search nixpkgs $package } - def rebuild [subcommand] { sudo nice -n19 nixos-rebuild $subcommand --flake /home/tao/projects/NOflake/ --impure --verbose } @@ -70,15 +67,14 @@ def bump [] { alias rb = rebuild boot alias rs = rebuild switch alias gc = nh clean all - def check-mullvad [] { loop { print "checking connection status" http get https://am.i.mullvad.net/json | if $in.mullvad_exit_ip == true {break} + sleep 1sec } } - def tse [exit_node: string = ""] { if ($exit_node | is-empty) and (ps | find deluge | is-not-empty) { print "stop summoning first!" @@ -86,7 +82,9 @@ def tse [exit_node: string = ""] { } else { tailscale set --exit-node $exit_node } - check-mullvad + if ($exit_node | is-not-empty) { + check-mullvad + } } def tsp [] { tailscale exit-node list @@ -133,17 +131,14 @@ alias tsu = tailscale up alias tsd = tailscale down alias tsx = tailscale exit-node list alias tsa = 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 @@ -154,6 +149,5 @@ def fixme [] { | each {$"($in.text):($in.line_number)"} | hx ...$in } - source ~/.cache/starship/init.nu source ~/.zoxide.nu diff --git a/users/tao/uv.sh b/users/tao/uv.sh new file mode 100644 index 0000000..90b3a1e --- /dev/null +++ b/users/tao/uv.sh @@ -0,0 +1,23 @@ +layout_python_uv() { + local python=${1:-python} + [[ $# -gt 0 ]] && shift + unset PYTHONHOME + local python_version=$($python -V | cut -d " " -f 2 | cut -d . -f 1-2) + if [[ -z $python_version ]]; then + log_error "Could not find python's version" + return 1 + fi + + if [[ -n "${VIRTUAL_ENV:-}" ]]; then + local REPLY + realpath.absolute "$VIRTUAL_ENV" + VIRTUAL_ENV=$REPLY + else + VIRTUAL_ENV=$(direnv_layout_dir)/python-$python_version + fi + if [[ ! -d $VIRTUAL_ENV ]]; then + uv venv -p $python "$@" "$VIRTUAL_ENV" + fi + export VIRTUAL_ENV + PATH_add "$VIRTUAL_ENV/bin" +}