From 01abe6ae003bc381a7e15939cc40096dbbd6659d Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:25:13 -0700 Subject: [PATCH] suf --- extras/dev.nix | 16 ++++++++++++++-- systems/NOlaptop.nix | 20 ++++++++++++-------- users/tao/nushell/extras/alias.nu | 1 + users/tao/nushell/extras/nix.nu | 7 +++++++ users/tao/nushell/extras/stuff.nu | 2 +- users/tao/nushell/extras/tailscale.nu | 1 + 6 files changed, 36 insertions(+), 11 deletions(-) diff --git a/extras/dev.nix b/extras/dev.nix index 0ad64d5..4995cc2 100644 --- a/extras/dev.nix +++ b/extras/dev.nix @@ -1,4 +1,9 @@ -{pkgs, ...}: { +{ + lib, + pkgs, + ... +}: { + programs.qgroundcontrol.enable = true; environment.systemPackages = with pkgs; [ # keep-sorted start # act @@ -133,7 +138,14 @@ virtualisation.docker = { enable = true; - storageDriver = "btrfs"; + # storageDriver = + # if lib.strings.hasPrefix "NOlaptop" (builtins.readFile /etc/hostname) + # then "bcachefs" + # else "btrfs"; + storageDriver = + if lib.strings.hasPrefix "NOcomputer" (builtins.readFile /etc/hostname) + then "btrfs" + else null; }; # virtualisation.docker.rootless = { # enable = true; diff --git a/systems/NOlaptop.nix b/systems/NOlaptop.nix index 1c8dc59..87f10d2 100644 --- a/systems/NOlaptop.nix +++ b/systems/NOlaptop.nix @@ -3,8 +3,7 @@ config, pkgs, ... -}: -{ +}: { # nixpkgs.overlays = [ # (final: prev: { # libinput = prev.libinput.overrideAttrs (old: { @@ -47,12 +46,6 @@ services.xserver.videoDrivers = [ "amdgpu" ]; - hardware.graphics.extraPackages = with pkgs; [ - amdvlk - ]; - hardware.graphics.extraPackages32 = with pkgs; [ - driversi686Linux.amdvlk - ]; boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelParams = [ @@ -75,6 +68,17 @@ "nixos-test" ]; } + { + hostName = "localhost"; + systems = ["x86_64-linux" "i686-linux"]; + supportedFeatures = [ + "benchmark" + "big-parallel" + "gccarch-znver4" + "kvm" + "nixos-test" + ]; + } ]; nix.extraOptions = '' builders-use-substitutes = true diff --git a/users/tao/nushell/extras/alias.nu b/users/tao/nushell/extras/alias.nu index 6079303..333193b 100644 --- a/users/tao/nushell/extras/alias.nu +++ b/users/tao/nushell/extras/alias.nu @@ -73,4 +73,5 @@ def cpedit [file: path] { mv $file $"($file).sym"; cp $"($file).sym" $file; chmod +w $file } +alias core-job = job alias job = job list diff --git a/users/tao/nushell/extras/nix.nu b/users/tao/nushell/extras/nix.nu index 7cc3494..2a60c72 100644 --- a/users/tao/nushell/extras/nix.nu +++ b/users/tao/nushell/extras/nix.nu @@ -10,6 +10,13 @@ def ns [...packages: string] { # } def rebuild [subcommand, --builders: string] { + if ( + df -h | detect columns --guess | where "Mounted on" == "/" or "Mounted on" == "/boot" | get Use% | each {parse "{usage}%" | get usage | into int} | flatten | all {$in < 99} + ) { + print "not enough disk space!" + return false + } + mut builders = $builders; if (open /etc/hostname --raw) == "NOlaptop\n" and ($builders != "") { if (ping -c1 -W1 nocomputer | complete | $in.exit_code == 0) { diff --git a/users/tao/nushell/extras/stuff.nu b/users/tao/nushell/extras/stuff.nu index 4a40824..31b1c45 100644 --- a/users/tao/nushell/extras/stuff.nu +++ b/users/tao/nushell/extras/stuff.nu @@ -50,7 +50,7 @@ def "fans" [duty?: int] { } "NOlaptop" => { match $duty { - null => { sudo ectool autofanctl } + null => { sudo ectool autofanctrl } _ => { sudo ectool fanduty $duty } } } diff --git a/users/tao/nushell/extras/tailscale.nu b/users/tao/nushell/extras/tailscale.nu index d0b244c..c976eb7 100644 --- a/users/tao/nushell/extras/tailscale.nu +++ b/users/tao/nushell/extras/tailscale.nu @@ -78,5 +78,6 @@ alias ts = tailscale status alias tu = tailscale up alias td = tailscale down alias ta = tailscale exit-node suggest +alias tt = tailscale switch --list | detect columns | input list -d Tailnet | get ID | t switch $in alias wno = ssh root@whyfi "etherwake -i br-lan 04:42:1A:E7:62:C3"