This commit is contained in:
Tao Tien 2025-06-18 00:31:22 -07:00
parent 51409b72dc
commit e8366cc6cc
9 changed files with 677 additions and 662 deletions

View file

@ -1,162 +1,162 @@
{
inputs,
config,
pkgs,
lib,
...
inputs,
config,
pkgs,
lib,
...
}: {
users.users.tao.packages = with pkgs; [
# boxxy
calibre
# carapace
# cloud-hypervisor
# davinci-resolve
# fractal
# freerdp
# inputs.plasma-manager.packages.${pkgs.system}.default
# jellyfin-mpv-shim
# libsForQt5.kcharselect
# mendeley
# piper
# slack
# tectonic
# texlab
# thunderbird
# wkhtmltopdf
appimage-run
aspell
aspellDicts.en
bottles
darktable
deluge
discord
freecad-wayland
gocryptfs
gurk-rs
jellyfin-media-player
# kdePackages.plasma-vault
keepassxc
# leetcode-cli
man-pages
man-pages-posix
miniserve
mousai
nix-output-monitor
nixos-anywhere
nufmt
nushell
nvd
obs-studio
oculante
onlyoffice-bin
pandoc
pipe-rename
prusa-slicer
qmk
qmk-udev-rules
qmk_hid
ripgrep-all
signal-desktop
slack
snapper
starship
syncthingtray
taskwarrior3
tinymist
toastify
typst
usbutils
vial
wezterm
wl-clipboard-rs
yt-dlp
zathura
zellij
zoom-us
zoxide
];
programs.adb.enable = true;
programs.kdeconnect.enable = true;
environment.shells = with pkgs; [nushell];
users.users.tao.packages = with pkgs; [
# boxxy
calibre
# carapace
# cloud-hypervisor
# davinci-resolve
# fractal
# freerdp
# inputs.plasma-manager.packages.${pkgs.system}.default
# jellyfin-mpv-shim
# libsForQt5.kcharselect
# mendeley
# piper
# slack
# tectonic
# texlab
# thunderbird
# wkhtmltopdf
appimage-run
aspell
aspellDicts.en
bottles
darktable
deluge
discord
freecad-wayland
gocryptfs
gurk-rs
jellyfin-media-player
# kdePackages.plasma-vault
keepassxc
# leetcode-cli
man-pages
man-pages-posix
miniserve
mousai
nix-output-monitor
nixos-anywhere
nufmt
nushell
nvd
obs-studio
oculante
onlyoffice-bin
pandoc
pipe-rename
prusa-slicer
qmk
qmk-udev-rules
qmk_hid
ripgrep-all
signal-desktop
slack
snapper
starship
syncthingtray
taskwarrior3
tinymist
toastify
typst
usbutils
vial
wezterm
wl-clipboard-rs
yt-dlp
zathura
zellij
zoom-us
zoxide
];
programs.adb.enable = true;
programs.kdeconnect.enable = true;
environment.shells = with pkgs; [nushell];
# virtualisation.libvirtd.enable = true;
# virtualisation.libvirtd.qemu.swtpm.enable = true;
# virtualisation.spiceUSBRedirection.enable = true;
# programs.virt-manager.enable = true;
# virtualisation.libvirtd.enable = true;
# virtualisation.libvirtd.qemu.swtpm.enable = true;
# virtualisation.spiceUSBRedirection.enable = true;
# programs.virt-manager.enable = true;
# virtualisation.virtualbox.host = {
# enable = true;
# enableExtensionPack = true;
# };
# virtualisation.virtualbox.host = {
# enable = true;
# enableExtensionPack = true;
# };
# nixpkgs.overlays = [
# (final: prev: {
# options.services.snapper.configs = prev.options.services.snapper.configs.overrideAttrs (old: {
# configOptions.FSTYPE = lib.mkOption {
# type = lib.types.enum ["btrfs" "bcachefs"];
# };
# });
# })
# ];
# nixpkgs.overlays = [
# (final: prev: {
# options.services.snapper.configs = prev.options.services.snapper.configs.overrideAttrs (old: {
# configOptions.FSTYPE = lib.mkOption {
# type = lib.types.enum ["btrfs" "bcachefs"];
# };
# });
# })
# ];
disabledModules = ["services/misc/snapper.nix"];
imports = [../extras/snapper.nix];
services.snapper.configs = {
home = {
SUBVOLUME = "/home";
# FSTYPE = "bcachefs";
FSTYPE =
if lib.strings.hasPrefix "NOlaptop" (builtins.readFile /etc/hostname)
then "bcachefs"
else "btrfs";
ALLOW_USERS = ["tao"];
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
TIMELINE_LIMIT_HOURLY = 5;
TIMELINE_LIMIT_DAILY = 7;
disabledModules = ["services/misc/snapper.nix"];
imports = [../extras/snapper.nix];
services.snapper.configs = {
home = {
SUBVOLUME = "/home";
# FSTYPE = "bcachefs";
FSTYPE =
if lib.strings.hasPrefix "NOlaptop" (builtins.readFile /etc/hostname)
then "bcachefs"
else "btrfs";
ALLOW_USERS = ["tao"];
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
TIMELINE_LIMIT_HOURLY = 5;
TIMELINE_LIMIT_DAILY = 7;
};
};
};
services.snapper.snapshotInterval = "*:0/5";
services.snapper.snapshotInterval = "*:0/5";
hardware.keyboard.qmk.enable = true;
services.udev.extraRules = ''
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
'';
# services.ratbagd.enable = true;
hardware.keyboard.qmk.enable = true;
services.udev.extraRules = ''
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
'';
# services.ratbagd.enable = true;
boot.extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
];
boot.extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
'';
boot.extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
];
boot.extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
'';
fonts.packages = with pkgs; [
# (nerdfonts.override {fonts = ["FiraCode"];})
nerd-fonts.fira-code
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-color-emoji
ibm-plex
cooper-hewitt
];
fonts.packages = with pkgs; [
# (nerdfonts.override {fonts = ["FiraCode"];})
nerd-fonts.fira-code
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-color-emoji
ibm-plex
cooper-hewitt
];
documentation.enable = true;
documentation.enable = true;
# age.secrets.password-tao.file = ../secrets/syncthing-uwuraid.age;
users.users.tao = {
isNormalUser = true;
# hashedPasswordFile = config.age.secrets.password-tao.path;
extraGroups = ["audio" "video" "wheel" "libvirtd" "dialout" "game"];
shell = pkgs.nushell;
};
# age.secrets.password-tao.file = ../secrets/syncthing-uwuraid.age;
users.users.tao = {
isNormalUser = true;
# hashedPasswordFile = config.age.secrets.password-tao.path;
extraGroups = ["audio" "video" "wheel" "libvirtd" "dialout" "game"];
shell = pkgs.nushell;
};
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;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.verbose = true;
home-manager.backupFileExtension = ".hm-bak";
home-manager.users.tao = import ./tao/HOME.nix {inherit inputs pkgs lib config;};
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;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.verbose = true;
home-manager.backupFileExtension = ".hm-bak";
home-manager.users.tao = import ./tao/HOME.nix {inherit inputs pkgs lib config;};
}

View file

@ -1,261 +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.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.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;
};
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;
};
};
};
bat = {
enable = true;
config = {
theme = "gruvbox-dark";
};
direnv = {
enable = true;
enableNushellIntegration = true;
nix-direnv.enable = true;
};
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;
};
direnv = {
enable = true;
enableNushellIntegration = true;
nix-direnv.enable = true;
git = {
enable = true;
userName = "Tao Tien";
userEmail = "29749622+taotien@users.noreply.github.com";
# extraConfig = {
# };
ignores = [
"/target"
".direnv"
];
};
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)))));
};
ssh = {
enable = true;
addKeysToAgent = "yes";
compression = true;
matchBlocks = {
"stargate" = {
hostname = "stargate.cs.usfca.edu";
user = "tltien";
forwardAgent = true;
identityFile = "/home/tao/.ssh/id_ed25519";
};
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;
"griffin" = {
hostname = "griffin.cs.usfca.edu";
user = "tltien";
forwardAgent = true;
identityFile = "/home/tao/.ssh/id_ed25519";
# proxyCommand = "ssh griffin.cs.usfca.edu";
};
git = {
enable = true;
userName = "Tao Tien";
userEmail = "29749622+taotien@users.noreply.github.com";
# extraConfig = {
# };
ignores = [
"/target"
".direnv"
];
"github" = {
hostname = "github.com";
forwardAgent = true;
identityFile = "/home/tao/.ssh/id_ed25519";
};
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)))));
};
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";
};
};
};
starship = {
enable = true;
enableNushellIntegration = true;
settings = builtins.fromTOML (builtins.readFile ./starship.toml);
};
# taskwarrior = {
# enable = true;
# package = pkgs.taskwarrior3;
# dataLocation = "/home/tao/sync";
# "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";
# };
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 = {};
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;
};
};
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;
# };
};
"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;
};
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";
home.username = "tao";
home.homeDirectory = "/home/tao";
home.stateVersion = "23.11";
}