From 21d7561a5693871330f435f0b000241433e96dd7 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Sat, 24 Feb 2024 02:30:17 -0800 Subject: [PATCH] alejandra? --- extras/cosmic.nix | 2 +- extras/dev.nix | 7 ++- extras/gaming.nix | 81 ++++++++++++++-------------- extras/uwuraid.nix | 118 +++++++++++++++++++++++++++-------------- flake.nix | 100 ++++++++++++++++++---------------- systems/BASED.nix | 18 ++++--- systems/NObangers.nix | 6 +-- systems/NOcamp.nix | 4 +- systems/NOcomputer.nix | 45 ++++++++-------- systems/NOlaptop.nix | 15 +++--- systems/NOserver.nix | 4 +- users/pi.nix | 7 ++- users/tao.nix | 15 ++++-- users/tao/cargo.nix | 4 +- users/tao/helix.nix | 51 ++++++++++++++---- users/tao/home.nix | 17 +++--- users/vy.nix | 6 +-- 17 files changed, 296 insertions(+), 204 deletions(-) diff --git a/extras/cosmic.nix b/extras/cosmic.nix index f1bfede..9af52df 100644 --- a/extras/cosmic.nix +++ b/extras/cosmic.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [ cosmic-term fontconfig diff --git a/extras/dev.nix b/extras/dev.nix index 99d2935..5e741e7 100644 --- a/extras/dev.nix +++ b/extras/dev.nix @@ -1,4 +1,8 @@ -{ inputs, pkgs, ... }: { +{ + inputs, + pkgs, + ... +}: { environment.systemPackages = with pkgs; [ # freecad # pijul @@ -33,6 +37,7 @@ # nix nil nixpkgs-fmt + alejandra # python pypy3 diff --git a/extras/gaming.nix b/extras/gaming.nix index c68ee5b..6255d67 100644 --- a/extras/gaming.nix +++ b/extras/gaming.nix @@ -1,5 +1,5 @@ # { pkgs, aagl, ... }: { -{ pkgs, ... }: { +{pkgs, ...}: { # imports = [ aagl.nixosModules.default ]; environment.systemPackages = with pkgs; [ @@ -24,48 +24,51 @@ # nix.settings = aagl.nixConfig; # programs.honkers-railway-launcher.enable = true; - users = { groups.game = { }; }; + users = {groups.game = {};}; security.pam.loginLimits = [ - { domain = "@game"; type = "-"; item = "nice"; value = -20; } + { + domain = "@game"; + type = "-"; + item = "nice"; + value = -20; + } ]; security.rtkit.enable = true; - environment.etc = - let - json = pkgs.formats.json { }; - in - { - "pipewire/pipewire.conf.d/92-low-latency.conf".source = json.generate "92-low-latency.conf" { - context.properties = { - # default.allowed-rates = [] - default.clock.rate = 48000; - default.clock.quantum = 32; - default.clock.min-quantum = 32; - default.clock.max-quantum = 32; - }; + environment.etc = let + json = pkgs.formats.json {}; + in { + "pipewire/pipewire.conf.d/92-low-latency.conf".source = json.generate "92-low-latency.conf" { + context.properties = { + # default.allowed-rates = [] + default.clock.rate = 48000; + default.clock.quantum = 32; + default.clock.min-quantum = 32; + default.clock.max-quantum = 32; }; - "pipewire/pipewire-pulse.d/92-low-latency.conf".source = json.generate "92-low-latency.conf" { - context.modules = [ - { - name = "libpipewire-module-protocol-pulse"; - args = { - pulse.min.req = "32/48000"; - pulse.default.req = "32/48000"; - pulse.max.req = "32/48000"; - pulse.min.quantum = "32/48000"; - pulse.max.quantum = "32/48000"; - }; - } - ]; - stream.properties = { - node.latency = "32/48000"; - resample.quality = 1; - }; - }; - # "pipewire/pipewire.d/99-input-denoising.conf" = json.generate "99-input-denoising.conf" { - # context.modules = [{ - # name = "libpipewire-module-filter-chain"; - # }]; - # }; }; + "pipewire/pipewire-pulse.d/92-low-latency.conf".source = json.generate "92-low-latency.conf" { + context.modules = [ + { + name = "libpipewire-module-protocol-pulse"; + args = { + pulse.min.req = "32/48000"; + pulse.default.req = "32/48000"; + pulse.max.req = "32/48000"; + pulse.min.quantum = "32/48000"; + pulse.max.quantum = "32/48000"; + }; + } + ]; + stream.properties = { + node.latency = "32/48000"; + resample.quality = 1; + }; + }; + # "pipewire/pipewire.d/99-input-denoising.conf" = json.generate "99-input-denoising.conf" { + # context.modules = [{ + # name = "libpipewire-module-filter-chain"; + # }]; + # }; + }; } diff --git a/extras/uwuraid.nix b/extras/uwuraid.nix index 17537a3..d5abacc 100644 --- a/extras/uwuraid.nix +++ b/extras/uwuraid.nix @@ -1,43 +1,79 @@ -{ ... }: { +{...}: { services.rpcbind.enable = true; - systemd.mounts = - let - opts = { - type = "cifs"; - mountConfig = { Options = "users,noauto,credentials=/etc/nixos/smb-secrets,noatime,uid=1000,gid=100"; }; - }; - in - [ - (opts // { what = "//100.97.47.81/anime"; where = "/mnt/uwuraid/anime"; }) - (opts // { what = "//100.97.47.81/appdata"; where = "/mnt/uwuraid/appdata"; }) - (opts // { what = "//100.97.47.81/backup"; where = "/mnt/uwuraid/backup"; }) - (opts // { what = "//100.97.47.81/everything"; where = "/mnt/uwuraid/everything"; }) - (opts // { what = "//100.97.47.81/isos"; where = "/mnt/uwuraid/isos"; }) - # (opts // { what = "//100.97.47.81/jellyfin"; where = "/mnt/uwuraid/jellyfin"; }) - (opts // { what = "//100.97.47.81/movies"; where = "/mnt/uwuraid/movies"; }) - (opts // { what = "//100.97.47.81/music"; where = "/mnt/uwuraid/music"; }) - (opts // { what = "//100.97.47.81/photos"; where = "/mnt/uwuraid/photos"; }) - (opts // { what = "//100.97.47.81/syncthing"; where = "/mnt/uwuraid/syncthing"; }) - (opts // { what = "//100.97.47.81/television"; where = "/mnt/uwuraid/television"; }) - ]; - systemd.automounts = - let - opts = { - wantedBy = [ "multi-user.target" ]; - automountConfig = { TimeoutIdleSec = "60"; }; - }; - in - [ - (opts // { where = "/mnt/uwuraid/anime"; }) - (opts // { where = "/mnt/uwuraid/appdata"; }) - (opts // { where = "/mnt/uwuraid/backup"; }) - (opts // { where = "/mnt/uwuraid/everything"; }) - (opts // { where = "/mnt/uwuraid/isos"; }) - # (opts // { where = "/mnt/uwuraid/jellyfin"; }) - (opts // { where = "/mnt/uwuraid/movies"; }) - (opts // { where = "/mnt/uwuraid/music"; }) - (opts // { where = "/mnt/uwuraid/photos"; }) - (opts // { where = "/mnt/uwuraid/syncthing"; }) - (opts // { where = "/mnt/uwuraid/television"; }) - ]; + systemd.mounts = let + opts = { + type = "cifs"; + mountConfig = {Options = "users,noauto,credentials=/etc/nixos/smb-secrets,noatime,uid=1000,gid=100";}; + }; + in [ + (opts + // { + what = "//100.97.47.81/anime"; + where = "/mnt/uwuraid/anime"; + }) + (opts + // { + what = "//100.97.47.81/appdata"; + where = "/mnt/uwuraid/appdata"; + }) + (opts + // { + what = "//100.97.47.81/backup"; + where = "/mnt/uwuraid/backup"; + }) + (opts + // { + what = "//100.97.47.81/everything"; + where = "/mnt/uwuraid/everything"; + }) + (opts + // { + what = "//100.97.47.81/isos"; + where = "/mnt/uwuraid/isos"; + }) + # (opts // { what = "//100.97.47.81/jellyfin"; where = "/mnt/uwuraid/jellyfin"; }) + (opts + // { + what = "//100.97.47.81/movies"; + where = "/mnt/uwuraid/movies"; + }) + (opts + // { + what = "//100.97.47.81/music"; + where = "/mnt/uwuraid/music"; + }) + (opts + // { + what = "//100.97.47.81/photos"; + where = "/mnt/uwuraid/photos"; + }) + (opts + // { + what = "//100.97.47.81/syncthing"; + where = "/mnt/uwuraid/syncthing"; + }) + (opts + // { + what = "//100.97.47.81/television"; + where = "/mnt/uwuraid/television"; + }) + ]; + systemd.automounts = let + opts = { + wantedBy = ["multi-user.target"]; + automountConfig = {TimeoutIdleSec = "60";}; + }; + in [ + (opts // {where = "/mnt/uwuraid/anime";}) + (opts // {where = "/mnt/uwuraid/appdata";}) + (opts // {where = "/mnt/uwuraid/backup";}) + (opts // {where = "/mnt/uwuraid/everything";}) + (opts // {where = "/mnt/uwuraid/isos";}) + # (opts // { where = "/mnt/uwuraid/jellyfin"; }) + (opts // {where = "/mnt/uwuraid/movies";}) + (opts // {where = "/mnt/uwuraid/music";}) + (opts // {where = "/mnt/uwuraid/photos";}) + (opts // {where = "/mnt/uwuraid/syncthing";}) + (opts // {where = "/mnt/uwuraid/television";}) + ]; } diff --git a/flake.nix b/flake.nix index 07ff1f5..1187227 100644 --- a/flake.nix +++ b/flake.nix @@ -23,55 +23,63 @@ nixConfig = { # extra-substituters = [ "https://hyprland.cachix.org" "https://ezkea.cachix.org" ]; # extra-trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "ezkea.cachix.org-1:ioBmUbJTZIKsHmWWXPe1FSFbeVe+afhfgqgTSNd34eI=" ]; - extra-substituters = [ "https://hyprland.cachix.org" ]; - extra-trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; + extra-substituters = ["https://hyprland.cachix.org"]; + extra-trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; }; # outputs = { self, nixpkgs, nixos-hardware, nixos-raspberrypi, home-manager, helix, aagl, ... }@inputs: - outputs = { self, nixpkgs, nixos-hardware, nixos-raspberrypi, home-manager, helix, jujutsu, ... }@inputs: - { - nixosConfigurations = { - NOcomputer = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; - modules = [ - nixos-hardware.nixosModules.common-cpu-amd - nixos-hardware.nixosModules.common-gpu-nvidia-nonprime - ./systems/BASED.nix - ./systems/NOcomputer.nix - ./users/tao.nix - home-manager.nixosModules.home-manager - ./extras/uwuraid.nix - ./extras/dev.nix - ./extras/gaming.nix - ./extras/cosmic.nix - ]; - }; - NOlaptop = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; - modules = [ - nixos-hardware.nixosModules.common-cpu-intel - # inputs.nixos-hardware.nixosModules.framework-12th-gen-intel - ./systems/BASED.nix - ./systems/NOlaptop.nix - ./users/tao.nix - home-manager.nixosModules.home-manager - ./extras/uwuraid.nix - ./extras/dev.nix - ./extras/gaming.nix - ./extras/cosmic.nix - ]; - }; - # NObangers = nixos-system [ - # # ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable-arm ]; }) - # nixos-hw.raspberry-pi-4 - # nixos-rpi.hardware - # ./systems/BASED.nix - # ./systems/NObangers.nix - # ./users/pi.nix - # ./extras/uwuraid.nix - # ]; + outputs = { + self, + nixpkgs, + nixos-hardware, + nixos-raspberrypi, + home-manager, + helix, + jujutsu, + ... + } @ inputs: { + nixosConfigurations = { + NOcomputer = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = {inherit inputs;}; + modules = [ + nixos-hardware.nixosModules.common-cpu-amd + nixos-hardware.nixosModules.common-gpu-nvidia-nonprime + ./systems/BASED.nix + ./systems/NOcomputer.nix + ./users/tao.nix + home-manager.nixosModules.home-manager + ./extras/uwuraid.nix + ./extras/dev.nix + ./extras/gaming.nix + ./extras/cosmic.nix + ]; }; + NOlaptop = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = {inherit inputs;}; + modules = [ + nixos-hardware.nixosModules.common-cpu-intel + # inputs.nixos-hardware.nixosModules.framework-12th-gen-intel + ./systems/BASED.nix + ./systems/NOlaptop.nix + ./users/tao.nix + home-manager.nixosModules.home-manager + ./extras/uwuraid.nix + ./extras/dev.nix + ./extras/gaming.nix + ./extras/cosmic.nix + ]; + }; + # NObangers = nixos-system [ + # # ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable-arm ]; }) + # nixos-hw.raspberry-pi-4 + # nixos-rpi.hardware + # ./systems/BASED.nix + # ./systems/NObangers.nix + # ./users/pi.nix + # ./extras/uwuraid.nix + # ]; }; + }; } diff --git a/systems/BASED.nix b/systems/BASED.nix index edc91f6..9029775 100644 --- a/systems/BASED.nix +++ b/systems/BASED.nix @@ -1,4 +1,10 @@ -{ inputs, lib, pkgs, modulesPath, ... }: { +{ + inputs, + lib, + pkgs, + modulesPath, + ... +}: { environment.systemPackages = with pkgs; [ # xorg.xkill bat @@ -60,7 +66,7 @@ boot.loader.systemd-boot.enable = lib.mkDefault true; boot.loader.efi.canTouchEfiVariables = lib.mkDefault true; boot.loader.timeout = 1; - boot.supportedFilesystems = [ "ntfs" ]; + boot.supportedFilesystems = ["ntfs"]; networking.networkmanager = { enable = true; @@ -96,9 +102,9 @@ nix.settings = { experimental-features = "nix-command flakes"; auto-optimise-store = true; - trusted-users = [ "root" "@wheel" ]; + trusted-users = ["root" "@wheel"]; }; - nixpkgs.config = { allowUnfree = true; }; + nixpkgs.config = {allowUnfree = true;}; systemd.extraConfig = '' DefaultTimeoutStopSec=15s @@ -106,7 +112,7 @@ time.timeZone = "US/Pacific"; i18n.defaultLocale = "en_US.utf8"; - i18n.supportedLocales = [ "all" ]; + i18n.supportedLocales = ["all"]; i18n.extraLocaleSettings = { LC_CTYPE = "en_US.UTF-8"; LC_MESSAGES = "en_US.UTF-8"; @@ -121,7 +127,7 @@ ]; }; - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; system.stateVersion = lib.mkDefault "23.05"; diff --git a/systems/NObangers.nix b/systems/NObangers.nix index 19e61f6..33d0961 100644 --- a/systems/NObangers.nix +++ b/systems/NObangers.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [ libraspberrypi raspberrypi-eeprom @@ -7,7 +7,7 @@ fileSystems."/" = { device = "/dev/disk/by-label/NIXOS_SD"; fsType = "ext4"; - options = [ "noatime" ]; + options = ["noatime"]; # autoResize = true; }; programs.partition-manager.enable = false; @@ -16,7 +16,7 @@ services.btrfs.autoScrub.enable = false; boot = { - initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" "vc4" "pcie_brcmstb" "reset-raspberrypi" ]; + initrd.availableKernelModules = ["xhci_pci" "usbhid" "usb_storage" "vc4" "pcie_brcmstb" "reset-raspberrypi"]; # initrd.availableKernelModules = [ "xhci_pci" ]; kernelParams = [ "8250.nr_uarts=1" diff --git a/systems/NOcamp.nix b/systems/NOcamp.nix index bd427d4..04169e2 100644 --- a/systems/NOcamp.nix +++ b/systems/NOcamp.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [ arduino firefox @@ -9,7 +9,7 @@ networking.hostName = "NObcer"; users.users.ssrov = { isNormalUser = true; - extraGroups = [ "dialout" ]; + extraGroups = ["dialout"]; hashedPassword = ""; }; } diff --git a/systems/NOcomputer.nix b/systems/NOcomputer.nix index d73e2fd..c51eedd 100644 --- a/systems/NOcomputer.nix +++ b/systems/NOcomputer.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { services.xserver.displayManager = { autoLogin.enable = true; autoLogin.user = "tao"; @@ -27,17 +27,17 @@ fileSystems."/home" = { device = "/dev/disk/by-uuid/eb9fcce2-e9f3-438a-b5ce-8f72f32f0e09"; fsType = "btrfs"; - options = [ "subvol=home_snaps/0/snapshot" "noatime" "compress-force=zstd:3" "discard=async" ]; + options = ["subvol=home_snaps/0/snapshot" "noatime" "compress-force=zstd:3" "discard=async"]; }; fileSystems."/home/.snapshots" = { device = "/dev/disk/by-uuid/eb9fcce2-e9f3-438a-b5ce-8f72f32f0e09"; fsType = "btrfs"; - options = [ "subvol=home_snaps/" "noatime" "compress-force=zstd:3" "discard=async" ]; + options = ["subvol=home_snaps/" "noatime" "compress-force=zstd:3" "discard=async"]; }; fileSystems."/home/tao/Games" = { device = "/dev/disk/by-uuid/eb9fcce2-e9f3-438a-b5ce-8f72f32f0e09"; fsType = "btrfs"; - options = [ "subvol=games" "nosuid" "nodev" "noatime" "compress-force=zstd:3" "users" "rw" "exec" "discard=async" ]; + options = ["subvol=games" "nosuid" "nodev" "noatime" "compress-force=zstd:3" "users" "rw" "exec" "discard=async"]; }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/2B28-151D"; @@ -46,31 +46,30 @@ fileSystems."/" = { device = "/dev/disk/by-uuid/eb9fcce2-e9f3-438a-b5ce-8f72f32f0e09"; fsType = "btrfs"; - options = [ "subvol=nixos" "noatime" "compress-force=zstd:3" "discard=async" ]; + options = ["subvol=nixos" "noatime" "compress-force=zstd:3" "discard=async"]; }; fileSystems."/var" = { device = "/dev/disk/by-uuid/eb9fcce2-e9f3-438a-b5ce-8f72f32f0e09"; fsType = "btrfs"; - options = [ "subvol=nixos/var" "noatime" "compress-force=zstd:3" "discard=async" ]; + options = ["subvol=nixos/var" "noatime" "compress-force=zstd:3" "discard=async"]; }; fileSystems."/tmp" = { device = "/dev/disk/by-uuid/eb9fcce2-e9f3-438a-b5ce-8f72f32f0e09"; fsType = "btrfs"; - options = [ "subvol=nixos/tmp" "discard=async" ]; + options = ["subvol=nixos/tmp" "discard=async"]; }; - swapDevices = [{ device = "/dev/disk/by-uuid/ca0ed3d7-8758-4ac7-b016-8b4cd9608ded"; }]; + swapDevices = [{device = "/dev/disk/by-uuid/ca0ed3d7-8758-4ac7-b016-8b4cd9608ded";}]; - services.snapper.configs = - { - home = { - SUBVOLUME = "/home"; - ALLOW_USERS = [ "tao" ]; - TIMELINE_CREATE = true; - TIMELINE_CLEANUP = true; - TIMELINE_LIMIT_HOURLY = "5"; - TIMELINE_LIMIT_DAILY = "7"; - }; + services.snapper.configs = { + home = { + SUBVOLUME = "/home"; + ALLOW_USERS = ["tao"]; + TIMELINE_CREATE = true; + TIMELINE_CLEANUP = true; + TIMELINE_LIMIT_HOURLY = "5"; + TIMELINE_LIMIT_DAILY = "7"; }; + }; services.snapper.snapshotInterval = "*:0/5"; # systemd.user.services.fans = { @@ -83,9 +82,9 @@ # boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_zen; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - boot.kernelModules = [ "i2c-dev" "kvm-amd" ]; - boot.kernelParams = [ "nvidia-drm.modeset=1" ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; + boot.kernelModules = ["i2c-dev" "kvm-amd"]; + boot.kernelParams = ["nvidia-drm.modeset=1"]; # boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ]; # boot.blacklistedKernelModules = with config.boot.kernelPackages; [ k10temp ]; boot.kernel.sysctl."net.ipv4.ip_forward" = "1"; @@ -109,10 +108,10 @@ systemd.services.nvpl = { description = "Increase GPU power limit to 400w"; script = "/run/current-system/sw/bin/nvidia-smi -pl=400"; - wantedBy = [ "multi-user.target" ]; + wantedBy = ["multi-user.target"]; }; - services.udev.packages = [ pkgs.openrgb ]; + services.udev.packages = [pkgs.openrgb]; services.udev.extraRules = '' KERNEL=="hidraw*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a3c5", MODE="0666" ''; diff --git a/systems/NOlaptop.nix b/systems/NOlaptop.nix index 49ee7c5..857304f 100644 --- a/systems/NOlaptop.nix +++ b/systems/NOlaptop.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [ # prescurve # libsForQt5.skanpage @@ -10,20 +10,20 @@ fileSystems."/home" = { device = "/dev/disk/by-uuid/e4244a97-9b48-49f0-8093-782163045020"; fsType = "btrfs"; - options = [ "subvol=home-snaps/0/snapshot" "noatime" "compress-force=zstd:3" "discard=async" ]; + options = ["subvol=home-snaps/0/snapshot" "noatime" "compress-force=zstd:3" "discard=async"]; }; fileSystems."/home/tao/Games" = { device = "/dev/disk/by-uuid/e4244a97-9b48-49f0-8093-782163045020"; fsType = "btrfs"; - options = [ "subvol=games" "nosuid" "nodev" "noatime" "compress-force=zstd:3" "users" "rw" "exec" "discard=async" ]; + options = ["subvol=games" "nosuid" "nodev" "noatime" "compress-force=zstd:3" "users" "rw" "exec" "discard=async"]; }; fileSystems."/" = { device = "/dev/disk/by-uuid/e4244a97-9b48-49f0-8093-782163045020"; fsType = "btrfs"; - options = [ "subvol=nixos" "noatime" "compress-force=zstd:3" "discard=async" ]; + options = ["subvol=nixos" "noatime" "compress-force=zstd:3" "discard=async"]; }; - swapDevices = [{ device = "/dev/disk/by-uuid/ca55d0ea-c0db-44c5-af3a-e38eec803929"; }]; + swapDevices = [{device = "/dev/disk/by-uuid/ca55d0ea-c0db-44c5-af3a-e38eec803929";}]; services.fprintd.enable = true; services.fwupd.enable = true; @@ -45,7 +45,6 @@ # wantedBy = [ "default.target" ]; # }; - # SUBSYSTEM=="backlight", GROUP="video", MODE="0664" services.udev.extraRules = '' # Ethernet expansion card @@ -69,9 +68,9 @@ "nvme.noacpi=1" "i915.enable_psr=1" ]; - boot.blacklistedKernelModules = [ "cros-usbpd-charger" ]; + boot.blacklistedKernelModules = ["cros-usbpd-charger"]; boot.extraModprobeConfig = ''options snd-hda-intel model=dell-headset-multi''; - boot.kernelModules = [ "kvm-intel" ]; + boot.kernelModules = ["kvm-intel"]; powerManagement.cpuFreqGovernor = "powersave"; systemd.sleep.extraConfig = "HibernateDelaySec=180m"; # boot.kernel.sysctl."net.ipv4.ip_forward" = "1"; diff --git a/systems/NOserver.nix b/systems/NOserver.nix index 15fc874..9f08d6e 100644 --- a/systems/NOserver.nix +++ b/systems/NOserver.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [ bat bottom @@ -32,4 +32,4 @@ VISUAL = "hx"; SKIM_DEFAULT_COMMAND = "rg --files"; }; - +} diff --git a/users/pi.nix b/users/pi.nix index 5a86930..03dece6 100644 --- a/users/pi.nix +++ b/users/pi.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { users.users.tao.packages = with pkgs; [ libsForQt5.kdeconnect-kde ]; @@ -16,14 +15,14 @@ # }; fonts.fonts = with pkgs; [ - (nerdfonts.override { fonts = [ "FiraCode" ]; }) + (nerdfonts.override {fonts = ["FiraCode"];}) noto-fonts-cjk noto-fonts-emoji ]; users.users.tao = { isNormalUser = true; - extraGroups = [ "wheel" "dialout" ]; + extraGroups = ["wheel" "dialout"]; # shell = pkgs.nushell; }; diff --git a/users/tao.nix b/users/tao.nix index 1de0b94..c061599 100644 --- a/users/tao.nix +++ b/users/tao.nix @@ -1,4 +1,9 @@ -{ inputs, config, pkgs, ... }: { +{ + inputs, + config, + pkgs, + ... +}: { users.users.tao.packages = with pkgs; [ # birdtray # cider @@ -65,7 +70,7 @@ ]; # programs.adb.enable = true; programs.mosh.enable = true; - environment.shells = with pkgs; [ nushell ]; + environment.shells = with pkgs; [nushell]; services.udev.extraRules = '' KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl" @@ -94,14 +99,14 @@ ''; fonts.packages = with pkgs; [ - (nerdfonts.override { fonts = [ "FiraCode" ]; }) + (nerdfonts.override {fonts = ["FiraCode"];}) noto-fonts-cjk noto-fonts-color-emoji ]; users.users.tao = { isNormalUser = true; - extraGroups = [ "video" "wheel" "libvirtd" "dialout" "game" ]; + extraGroups = ["video" "wheel" "libvirtd" "dialout" "game"]; shell = pkgs.nushell; }; @@ -114,5 +119,5 @@ home-manager.useGlobalPkgs = true; home-manager.verbose = true; home-manager.backupFileExtension = ".hm-bak"; - home-manager.users.tao = (import ./tao/home.nix { inherit inputs pkgs; }); + home-manager.users.tao = import ./tao/home.nix {inherit inputs pkgs;}; } diff --git a/users/tao/cargo.nix b/users/tao/cargo.nix index f4e308c..a9c9c84 100644 --- a/users/tao/cargo.nix +++ b/users/tao/cargo.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { home.file.".cargo/config.toml".text = '' [alias] rr = "run --release" @@ -31,7 +31,7 @@ # # linker = "musl-gcc" # linker = "clang" # rustflag = ["-C", "target-cpu=native", "link-arg=ld-path=${pkgs.mold}/bin/mold"] - + [target.x86-unknown-linux-gnu] # linker = "musl-gcc" linker = "clang" diff --git a/users/tao/helix.nix b/users/tao/helix.nix index 9890bbf..1b9562e 100644 --- a/users/tao/helix.nix +++ b/users/tao/helix.nix @@ -1,4 +1,8 @@ -{ inputs, pkgs, ... }: { +{ + inputs, + pkgs, + ... +}: { programs.helix = { settings = { theme = "dracula"; @@ -16,9 +20,9 @@ select = "underline"; }; statusline = { - left = [ "mode" "spinner" "spacer" "version-control" ]; - center = [ "file-name" "file-modification-indicator" ]; - right = [ "diagnostics" "primary-selection-length" "total-line-numbers" "selections" "position" ]; + left = ["mode" "spinner" "spacer" "version-control"]; + center = ["file-name" "file-modification-indicator"]; + right = ["diagnostics" "primary-selection-length" "total-line-numbers" "selections" "position"]; }; lsp = { display-messages = true; @@ -42,15 +46,42 @@ auto-format = true; formatter = { command = "clang-format"; - args = [ "--style=file:/home/tao/Templates/clang-format" ]; + args = ["--style=file:/home/tao/Templates/clang-format"]; + }; + indent = { + tab-width = 8; + unit = "\t"; }; - indent = { tab-width = 8; unit = "\t"; }; } # { name = "css"; comment = "/*"; } - { name = "html"; auto-format = false; indent = { tab-width = 4; unit = "\t"; }; } - { name = "java"; auto-format = true; indent = { tab-width = 4; unit = "\t"; }; } - { name = "nix"; auto-format = true; formatter = { command = "nixpkgs-fmt"; }; } - { name = "typst"; indent = { tab-width = 4; unit = " "; }; } + { + name = "html"; + auto-format = false; + indent = { + tab-width = 4; + unit = "\t"; + }; + } + { + name = "java"; + auto-format = true; + indent = { + tab-width = 4; + unit = "\t"; + }; + } + { + name = "nix"; + auto-format = true; + formatter = {command = "alejandra";}; + } + { + name = "typst"; + indent = { + tab-width = 4; + unit = " "; + }; + } # { name = "rust"; } ]; language-servers = { diff --git a/users/tao/home.nix b/users/tao/home.nix index b4417a3..7106f4f 100644 --- a/users/tao/home.nix +++ b/users/tao/home.nix @@ -1,6 +1,10 @@ -{ pkgs, inputs, ... }: { +{ + pkgs, + inputs, + ... +}: { imports = [ - (import ./helix.nix { inherit pkgs inputs; }) + (import ./helix.nix {inherit pkgs inputs;}) # ./hyprland.nix ./cargo.nix ]; @@ -13,10 +17,9 @@ name = "Tao Tien"; email = "29749622+taotien@users.noreply.github.com"; }; - ui = - { - default-command = "log"; - }; + ui = { + default-command = "log"; + }; }; package = inputs.jujutsu.packages.${pkgs.system}.default; }; @@ -46,7 +49,7 @@ zellij = { enable = true; - settings = { }; + settings = {}; }; zoxide = { diff --git a/users/vy.nix b/users/vy.nix index fdf69de..2f6c903 100644 --- a/users/vy.nix +++ b/users/vy.nix @@ -1,11 +1,9 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { users.users.vy.packages = with pkgs; [ - ]; users.users.vy = { isNormalUser = true; - extraGroups = [ "scanner" "lp" ]; + extraGroups = ["scanner" "lp"]; }; }