This commit is contained in:
Tao Tien 2025-06-22 21:49:42 -07:00
parent 4c27a575a3
commit 703c40aa3c
5 changed files with 443 additions and 435 deletions

View file

@ -6,11 +6,6 @@
mountConfig = {Options = "noauto,noatime,async,users,rw,x-systemd.automount,credentials=${config.age.secrets.uwuraid.path},gid=users,file_mode=0770,dir_mode=0770";};
};
in [
(opts
// {
what = "//100.97.47.81/anime";
where = "/mnt/uwuraid/anime";
})
(opts
// {
what = "//100.97.47.81/backup";
@ -56,7 +51,6 @@
};
};
in [
(opts // {where = "/mnt/uwuraid/anime";})
(opts // {where = "/mnt/uwuraid/backup";})
(opts // {where = "/mnt/uwuraid/everything";})
(opts // {where = "/mnt/uwuraid/downloads";})

View file

@ -1,197 +1,198 @@
{
inputs,
lib,
pkgs,
modulesPath,
...
inputs,
lib,
pkgs,
modulesPath,
...
}: {
environment.systemPackages = with pkgs; [
# inputs.helix.packages.${pkgs.system}.default
# screen
bat
bottom
cifs-utils
du-dust
dumbpipe
exfatprogs
fastfetch
ffmpeg
firefox
git
helix
inputs.agenix.packages.${pkgs.system}.default
inputs.zen-browser.packages."${system}".default
jujutsu
mesa
mpv
ouch
pueue
ripgrep
# rustdesk
sendme
skim
tree
wezterm
wget
zstd
];
programs.partition-manager.enable = lib.mkDefault true;
# programs.nh = {
# enable = true;
# };
programs.firefox.enable = true;
programs.firefox.policies = {
DisablePocket = true;
PasswordManagerEnabled = false;
NoDefaultBookmarks = false;
};
programs.firefox.preferences = {
"media.ffmpeg.vaapi.enabled" = true;
"widget.use-xdg-desktop-portal.file-picker" = 1;
"widget.use-xdg-desktop-portal.location" = 1;
"widget.use-xdg-desktop-portal.mime-handler" = 1;
"widget.use-xdg-desktop-portal.open-uri" = 1;
"widget.use-xdg-desktop-portal.settings" = 1;
"accessibility.browsewithcaret_shortcut.enabled" = false;
"browser.bookmarks.restore_default_bookmarks" = false;
};
services.flatpak.enable = true;
hardware.graphics.enable = true;
# hardware.opengl = {
# enable = true;
# extraPackaged = with pkgs; [
# libvdpau-va-gl
# ];
# };
services.xserver.enable = lib.mkDefault true;
services.xserver.excludePackages = [pkgs.xterm];
services.xserver.xkb.layout = "us";
systemd.services.display-manager.restartIfChanged = false;
services.displayManager.sddm.enable = lib.mkDefault true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = lib.mkDefault true;
environment.plasma6.excludePackages = with pkgs; [
kdePackages.elisa
kdePackages.konsole
kdePackages.gwenview
kdePackages.kate
xterm
];
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [
];
programs.ssh.startAgent = true;
services.gnome.gcr-ssh-agent.enable = false;
services.printing.enable = lib.mkDefault true;
services.printing.drivers = with pkgs; lib.mkDefault [gutenprint gutenprintBin];
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
networking.networkmanager.enable = true;
networking.networkmanager.wifi.backend = "iwd";
services.tailscale.enable = true;
services.resolved.enable = true;
networking.wireless.iwd = {
enable = true;
settings.IPv6.Enabled = true;
settings.Settings.AutoConnect = true;
};
services.smartd.enable = true;
# services.btrfs.autoScrub.enable = lib.mkDefault true;
# hardware.pulseaudio.enable = lib.mkDefault false;
security.rtkit.enable = true;
services.pipewire = {
enable = lib.mkDefault true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = lib.mkDefault true;
};
security.sudo-rs.enable = true;
security.sudo.enable = false;
i18n.inputMethod = {
enable = lib.mkDefault true;
type = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-gtk
fcitx5-mozc
fcitx5-rime
environment.systemPackages = with pkgs; [
# inputs.helix.packages.${pkgs.system}.default
# screen
bat
bottom
cifs-utils
du-dust
dumbpipe
exfatprogs
fastfetch
ffmpeg
firefox
git
helix
inputs.agenix.packages.${pkgs.system}.default
inputs.zen-browser.packages."${system}".default
jujutsu
mesa
mpv
ouch
pueue
ripgrep
# rustdesk
sendme
skim
tree
wezterm
wget
zstd
];
};
programs.partition-manager.enable = lib.mkDefault true;
environment.variables = {
EDITOR = "hx";
VISUAL = "hx";
PAGER = "bat";
SKIM_DEFAULT_COMMAND = "rg --files";
};
environment.sessionVariables = {
EDITOR = "hx";
VISUAL = "hx";
PAGER = "bat";
SKIM_DEFAULT_COMMAND = "rg --files";
};
# programs.nh = {
# enable = true;
# };
time.timeZone = lib.mkDefault "US/Pacific";
# services.automatic-timezoned.enable = lib.mkDefault true;
# i18n.defaultLocale = "en_US.UTF-8";
# i18n.extraLocaleSettings = {
# LC_CTYPE = "en_US.UTF-8";
# LC_MESSAGES = "en_US.UTF-8";
# LC_ALL = "en_US.UTF-8";
# };
programs.firefox.enable = true;
programs.firefox.policies = {
DisablePocket = true;
PasswordManagerEnabled = false;
NoDefaultBookmarks = false;
};
programs.firefox.preferences = {
"media.ffmpeg.vaapi.enabled" = true;
systemd.extraConfig = ''
DefaultTimeoutStopSec=15s
'';
"widget.use-xdg-desktop-portal.file-picker" = 1;
"widget.use-xdg-desktop-portal.location" = 1;
"widget.use-xdg-desktop-portal.mime-handler" = 1;
"widget.use-xdg-desktop-portal.open-uri" = 1;
"widget.use-xdg-desktop-portal.settings" = 1;
zramSwap = {
enable = true;
algorithm = "zstd";
};
"accessibility.browsewithcaret_shortcut.enabled" = false;
"browser.bookmarks.restore_default_bookmarks" = false;
};
boot.loader.systemd-boot.enable = lib.mkDefault true;
boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
boot.loader.timeout = lib.mkForce 1;
# boot.supportedFilesystems = ["ntfs" "btrfs"];
hardware.enableAllFirmware = true;
hardware.bluetooth.enable = lib.mkDefault true;
# hardware.bluetooth.settings.General.Experimental = true;
services.flatpak.enable = true;
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
nix.settings = {
experimental-features = "nix-command flakes";
auto-optimise-store = true;
# adding logged in users allows for passwordless root
# trusted-users = ["root"];
system-features = [
"benchmark"
"big-parallel"
"gccarch-znver3"
"gccarch-znver4"
"kvm"
"nixos-test"
hardware.graphics.enable = true;
# hardware.opengl = {
# enable = true;
# extraPackaged = with pkgs; [
# libvdpau-va-gl
# ];
# };
services.xserver.enable = lib.mkDefault true;
services.xserver.excludePackages = [pkgs.xterm];
services.xserver.xkb.layout = "us";
systemd.services.display-manager.restartIfChanged = false;
services.displayManager.sddm.enable = lib.mkDefault true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = lib.mkDefault true;
environment.plasma6.excludePackages = with pkgs; [
kdePackages.elisa
kdePackages.konsole
kdePackages.gwenview
kdePackages.kate
kdePackages.xwaylandvideobridge
xterm
];
};
nixpkgs.config = {allowUnfree = true;};
nix.nixPath = ["nixpkgs=${pkgs.path}"];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
system.stateVersion = lib.mkDefault "23.05";
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [
];
programs.ssh.startAgent = true;
services.gnome.gcr-ssh-agent.enable = false;
services.printing.enable = lib.mkDefault true;
services.printing.drivers = with pkgs; lib.mkDefault [gutenprint gutenprintBin];
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
networking.networkmanager.enable = true;
networking.networkmanager.wifi.backend = "iwd";
services.tailscale.enable = true;
services.resolved.enable = true;
networking.wireless.iwd = {
enable = true;
settings.IPv6.Enabled = true;
settings.Settings.AutoConnect = true;
};
services.smartd.enable = true;
# services.btrfs.autoScrub.enable = lib.mkDefault true;
# hardware.pulseaudio.enable = lib.mkDefault false;
security.rtkit.enable = true;
services.pipewire = {
enable = lib.mkDefault true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = lib.mkDefault true;
};
security.sudo-rs.enable = true;
security.sudo.enable = false;
i18n.inputMethod = {
enable = lib.mkDefault true;
type = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-gtk
fcitx5-mozc
fcitx5-rime
];
};
environment.variables = {
EDITOR = "hx";
VISUAL = "hx";
PAGER = "bat";
SKIM_DEFAULT_COMMAND = "rg --files";
};
environment.sessionVariables = {
EDITOR = "hx";
VISUAL = "hx";
PAGER = "bat";
SKIM_DEFAULT_COMMAND = "rg --files";
};
time.timeZone = lib.mkDefault "US/Pacific";
# services.automatic-timezoned.enable = lib.mkDefault true;
# i18n.defaultLocale = "en_US.UTF-8";
# i18n.extraLocaleSettings = {
# LC_CTYPE = "en_US.UTF-8";
# LC_MESSAGES = "en_US.UTF-8";
# LC_ALL = "en_US.UTF-8";
# };
systemd.extraConfig = ''
DefaultTimeoutStopSec=15s
'';
zramSwap = {
enable = true;
algorithm = "zstd";
};
boot.loader.systemd-boot.enable = lib.mkDefault true;
boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
boot.loader.timeout = lib.mkForce 1;
# boot.supportedFilesystems = ["ntfs" "btrfs"];
hardware.enableAllFirmware = true;
hardware.bluetooth.enable = lib.mkDefault true;
# hardware.bluetooth.settings.General.Experimental = true;
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
nix.settings = {
experimental-features = "nix-command flakes";
auto-optimise-store = true;
# adding logged in users allows for passwordless root
# trusted-users = ["root"];
system-features = [
"benchmark"
"big-parallel"
"gccarch-znver3"
"gccarch-znver4"
"kvm"
"nixos-test"
];
};
nixpkgs.config = {allowUnfree = true;};
nix.nixPath = ["nixpkgs=${pkgs.path}"];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
system.stateVersion = lib.mkDefault "23.05";
}

View file

@ -1,269 +1,269 @@
{
config,
pkgs,
inputs,
lib,
...
config,
pkgs,
inputs,
lib,
...
}: let
cargoFile = builtins.readFile ./cargo.toml;
cargoConfig = builtins.replaceStrings ["/path/to/sccache" "/path/to/mold"] ["${pkgs.sccache}/bin/sccache" "${pkgs.mold}/bin/mold}"] cargoFile;
age.secrets.syncthing-NOcomputer.file = ../secrets/syncthing-NOcomputer.age;
age.secrets.syncthing-NOlaptop.file = ../secrets/syncthing-NOlaptop.age;
age.secrets.syncthing-uwuraid.file = ../secrets/syncthing-uwuraid.age;
cargoFile = builtins.readFile ./cargo.toml;
cargoConfig = builtins.replaceStrings ["/path/to/sccache" "/path/to/mold"] ["${pkgs.sccache}/bin/sccache" "${pkgs.mold}/bin/mold}"] cargoFile;
age.secrets.syncthing-NOcomputer.file = ../secrets/syncthing-NOcomputer.age;
age.secrets.syncthing-NOlaptop.file = ../secrets/syncthing-NOlaptop.age;
age.secrets.syncthing-uwuraid.file = ../secrets/syncthing-uwuraid.age;
in {
imports = [
./boxxy.nix
(import ./helix.nix {inherit pkgs inputs;})
# ./plasma.nix
# ./firefox.nix
];
imports = [
./boxxy.nix
(import ./helix.nix {inherit pkgs inputs;})
# ./plasma.nix
# ./firefox.nix
];
# home.sessionPath = [
# "/home/tao/.cargo/bin"
# ];
home.file.".cargo/config.toml".text = cargoConfig;
home.file.".config/autostart" = {
source = ./autostart;
recursive = true;
};
home.file.".config/direnv/lib/".source = ./direnv;
home.file.".config/direnv/lib/".recursive = true;
programs = {
bacon = {
enable = true;
settings.jobs.default = {
command = [
"cargo"
"clippy"
"--"
"-A"
"clippy::bool_to_int_with_if"
"-A"
"clippy::collapsible_else_if"
"-A"
"clippy::collapsible_if"
"-A"
"clippy::derive_partial_eq_without_eq"
"-A"
"clippy::get_first"
"-A"
"clippy::if_same_then_else"
"-A"
"clippy::len_without_is_empty"
"-A"
"clippy::map_entry"
"-A"
"clippy::while_let_on_iterator"
];
need_stdout = false;
};
# home.sessionPath = [
# "/home/tao/.cargo/bin"
# ];
home.file.".cargo/config.toml".text = cargoConfig;
home.file.".config/autostart" = {
source = ./autostart;
recursive = true;
};
home.file.".config/direnv/lib/".source = ./direnv;
home.file.".config/direnv/lib/".recursive = true;
bat = {
enable = true;
config = {
theme = "gruvbox-dark";
};
};
bottom = {
enable = true;
settings = {
color = "gruvbox";
flags = {
battery =
# if lib.strings.hasPrefix "NOlaptop" (builtins.readFile /etc/hostname)
# then true
# else false;
true;
hide_time = true;
enable_gpu = true;
programs = {
bacon = {
enable = true;
settings.jobs.default = {
command = [
"cargo"
"clippy"
"--"
"-A"
"clippy::bool_to_int_with_if"
"-A"
"clippy::collapsible_else_if"
"-A"
"clippy::collapsible_if"
"-A"
"clippy::derive_partial_eq_without_eq"
"-A"
"clippy::get_first"
"-A"
"clippy::if_same_then_else"
"-A"
"clippy::len_without_is_empty"
"-A"
"clippy::map_entry"
"-A"
"clippy::while_let_on_iterator"
];
need_stdout = false;
};
};
};
};
direnv = {
enable = true;
enableNushellIntegration = true;
nix-direnv.enable = true;
};
bat = {
enable = true;
config = {
theme = "gruvbox-dark";
};
};
jujutsu = {
enable = true;
settings = {
user = {
name = "Tao Tien";
email = "29749622+taotien@users.noreply.github.com";
bottom = {
enable = true;
settings = {
color = "gruvbox";
flags = {
battery =
# if lib.strings.hasPrefix "NOlaptop" (builtins.readFile /etc/hostname)
# then true
# else false;
true;
hide_time = true;
enable_gpu = true;
};
};
};
ui = {
default-command = "log";
};
};
# package = inputs.jujutsu.packages.${pkgs.system}.default;
};
git = {
enable = true;
userName = "Tao Tien";
userEmail = "29749622+taotien@users.noreply.github.com";
# extraConfig = {
# };
ignores = [
"/target"
".direnv"
];
};
direnv = {
enable = true;
enableNushellIntegration = true;
nix-direnv.enable = true;
};
nushell = {
enable = true;
configFile.source = ./nushell/config.nu;
envFile.source = ./nushell/env.nu;
# extraConfig = builtins.readFile ./nushell/stuff.nu;
extraConfig = lib.concatStrings (map builtins.readFile (map (x: ./nushell/extras/. + x) (map (x: "/" + x) (builtins.attrNames (builtins.readDir ./nushell/extras)))));
};
jujutsu = {
enable = true;
settings = {
user = {
name = "Tao Tien";
email = "29749622+taotien@users.noreply.github.com";
};
ui = {
default-command = "log";
};
};
# package = inputs.jujutsu.packages.${pkgs.system}.default;
};
ssh = {
enable = true;
addKeysToAgent = "yes";
compression = true;
matchBlocks = {
"stargate" = {
hostname = "stargate.cs.usfca.edu";
user = "tltien";
forwardAgent = true;
identityFile = "/home/tao/.ssh/id_ed25519";
git = {
enable = true;
userName = "Tao Tien";
userEmail = "29749622+taotien@users.noreply.github.com";
# extraConfig = {
# };
ignores = [
"/target"
".direnv"
];
};
"griffin" = {
hostname = "griffin.cs.usfca.edu";
user = "tltien";
forwardAgent = true;
identityFile = "/home/tao/.ssh/id_ed25519";
# proxyCommand = "ssh griffin.cs.usfca.edu";
nushell = {
enable = true;
configFile.source = ./nushell/config.nu;
envFile.source = ./nushell/env.nu;
# extraConfig = builtins.readFile ./nushell/stuff.nu;
extraConfig = lib.concatStrings (map builtins.readFile (map (x: ./nushell/extras/. + x) (map (x: "/" + x) (builtins.attrNames (builtins.readDir ./nushell/extras)))));
};
"github" = {
hostname = "github.com";
forwardAgent = true;
identityFile = "/home/tao/.ssh/id_ed25519";
ssh = {
enable = true;
addKeysToAgent = "yes";
compression = true;
matchBlocks = {
"stargate" = {
hostname = "stargate.cs.usfca.edu";
user = "tltien";
forwardAgent = true;
identityFile = "/home/tao/.ssh/id_ed25519";
};
"griffin" = {
hostname = "griffin.cs.usfca.edu";
user = "tltien";
forwardAgent = true;
identityFile = "/home/tao/.ssh/id_ed25519";
# proxyCommand = "ssh griffin.cs.usfca.edu";
};
"github" = {
hostname = "github.com";
forwardAgent = true;
identityFile = "/home/tao/.ssh/id_ed25519";
};
# "uwuraid" = {
# hostname = "uwuraid";
# user = "root";
# # extraOptions = ["-t" "cd /mnt/user; exet \$SHELL -l"];
# # requesttty = true;
# # identityFile = "/home/tao/.ssh/id_ed25519";
# proxyCommand = "ssh -t root@uwuraid cd /mnt/user; exec \\$SHELL -l";
# };
};
};
# "uwuraid" = {
# hostname = "uwuraid";
# user = "root";
# # extraOptions = ["-t" "cd /mnt/user; exet \$SHELL -l"];
# # requesttty = true;
# # identityFile = "/home/tao/.ssh/id_ed25519";
# proxyCommand = "ssh -t root@uwuraid cd /mnt/user; exec \\$SHELL -l";
starship = {
enable = true;
enableNushellIntegration = true;
settings = builtins.fromTOML (builtins.readFile ./starship.toml);
};
# taskwarrior = {
# enable = true;
# package = pkgs.taskwarrior3;
# dataLocation = "/home/tao/sync";
# };
};
};
starship = {
enable = true;
enableNushellIntegration = true;
settings = builtins.fromTOML (builtins.readFile ./starship.toml);
};
# taskwarrior = {
# enable = true;
# package = pkgs.taskwarrior3;
# dataLocation = "/home/tao/sync";
# };
wezterm = {
enable = true;
extraConfig = builtins.readFile ./wezterm.lua;
};
zathura = {
enable = true;
options = {
selection-clipboard = "clipboard";
};
};
zellij = {
enable = true;
settings = {};
};
zoxide = {
enable = true;
enableNushellIntegration = true;
};
};
services = {
pueue = {
enable = true;
settings = {};
};
};
services.syncthing = {
enable = true;
# user = "tao";
# dataDir = "/home/tao/sync";
# configDir = "/home/tao/.config/syncthing";
overrideDevices = true;
overrideFolders = true;
# openDefaultPorts = true;
settings = {
devices = {
# we do a lil anti-patterns https://github.com/ryantm/agenix?tab=readme-ov-file#builtinsreadfile-anti-pattern
# bootstrap by commenting out devices first and rebuild switch impurely
"nocomputer".id = builtins.readFile config.age.secrets.syncthing-NOcomputer.path;
"nolaptop".id = builtins.readFile config.age.secrets.syncthing-NOlaptop.path;
"uwuraid".id = builtins.readFile config.age.secrets.syncthing-uwuraid.path;
};
folders = let
devs = [
"nocomputer"
"nolaptop"
"uwuraid"
];
in {
# "documents" = {
# path = "/home/tao/documents";
# devices = devs;
# };
"pictures" = {
path = "/home/tao/pictures";
devices = devs;
wezterm = {
enable = true;
extraConfig = builtins.readFile ./wezterm.lua;
};
"projects" = {
path = "/home/tao/projects";
devices = devs;
zathura = {
enable = true;
options = {
selection-clipboard = "clipboard";
};
};
"school" = {
path = "/home/tao/school";
devices = devs;
zellij = {
enable = true;
settings = {};
};
"sync" = {
path = "/home/tao/sync";
devices = devs;
zoxide = {
enable = true;
enableNushellIntegration = true;
};
# "work" = {
# path = "/home/tao/work";
# devices = devs;
# };
};
};
};
xdg.userDirs = {
desktop = "desktop";
documents = "documents";
download = "downloads";
music = "music";
pictures = "pictures";
templates = "templates";
videos = "videos";
publicShare = null;
createDirectories = true;
enable = true;
};
services = {
pueue = {
enable = true;
settings = {};
};
};
home.username = "tao";
home.homeDirectory = "/home/tao";
home.stateVersion = "23.11";
services.syncthing = {
enable = true;
# user = "tao";
# dataDir = "/home/tao/sync";
# configDir = "/home/tao/.config/syncthing";
overrideDevices = true;
overrideFolders = true;
# openDefaultPorts = true;
settings = {
devices = {
# we do a lil anti-patterns https://github.com/ryantm/agenix?tab=readme-ov-file#builtinsreadfile-anti-pattern
# bootstrap by commenting out devices first and rebuild switch impurely
"nocomputer".id = builtins.readFile config.age.secrets.syncthing-NOcomputer.path;
"nolaptop".id = builtins.readFile config.age.secrets.syncthing-NOlaptop.path;
"uwuraid".id = builtins.readFile config.age.secrets.syncthing-uwuraid.path;
};
folders = let
devs = [
"nocomputer"
"nolaptop"
"uwuraid"
];
in {
# "documents" = {
# path = "/home/tao/documents";
# devices = devs;
# };
"pictures" = {
path = "/home/tao/pictures";
devices = devs;
};
"projects" = {
path = "/home/tao/projects";
devices = devs;
};
"school" = {
path = "/home/tao/school";
devices = devs;
};
"sync" = {
path = "/home/tao/sync";
devices = devs;
};
# "work" = {
# path = "/home/tao/work";
# devices = devs;
# };
};
};
};
xdg.userDirs = {
desktop = "desktop";
documents = "documents";
download = "downloads";
music = "music";
pictures = "pictures";
templates = "templates";
videos = "videos";
publicShare = null;
createDirectories = true;
enable = true;
};
home.username = "tao";
home.homeDirectory = "/home/tao";
home.stateVersion = "23.11";
}

View file

@ -189,7 +189,9 @@
{
name = "nix";
auto-format = true;
formatter = {command = "alejandra";};
formatter = {
command = "alejandra";
};
}
{
name = "toml";

View file

@ -47,6 +47,8 @@ def jm --wrapped [-r: string = "@", ...rest] {
}
alias la = ls -a
alias ll = ls -l
alias lal = ls -la
alias ccp = cp -prv
alias mvp = mv-full -pv
@ -58,3 +60,12 @@ def --env c [path: path = "~"] {
def l --wrapped [path: path = ".", ...rest] {
ls ...$rest $path | sort-by type name -i -n
}
alias list-automounts = systemctl list-units --type=automount
def remount [] {
let reload = list-automounts | detect columns -n | get column0 | input list --multi
for mount in $reload {
systemctl resart $mount
}
}