refactoring
This commit is contained in:
parent
4311082a72
commit
c9804239d3
10 changed files with 214 additions and 268 deletions
|
|
@ -6,7 +6,7 @@
|
|||
...
|
||||
}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
# xorg.xkill
|
||||
# macchina
|
||||
bat
|
||||
bottom
|
||||
cifs-utils
|
||||
|
|
@ -14,64 +14,22 @@
|
|||
exfatprogs
|
||||
git
|
||||
inputs.helix.packages.${pkgs.system}.default
|
||||
# libthai
|
||||
localsend
|
||||
# macchina
|
||||
neofetch
|
||||
mesa
|
||||
neofetch
|
||||
ouch
|
||||
pueue
|
||||
ripgrep
|
||||
rustdesk
|
||||
screen
|
||||
skim
|
||||
tree
|
||||
wezterm
|
||||
# wget
|
||||
# yt-dlp
|
||||
# zellij
|
||||
pueue
|
||||
wget
|
||||
zstd
|
||||
];
|
||||
programs.partition-manager.enable = lib.mkDefault true;
|
||||
|
||||
services.tailscale.enable = true;
|
||||
services.tailscale.package = pkgs.tailscale;
|
||||
services.resolved.enable = true;
|
||||
|
||||
services.openssh.enable = true;
|
||||
services.flatpak.enable = lib.mkDefault true;
|
||||
services.printing.enable = lib.mkDefault true;
|
||||
|
||||
services.smartd.enable = true;
|
||||
services.btrfs.autoScrub.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";
|
||||
};
|
||||
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.bluetooth.enable = lib.mkDefault true;
|
||||
|
||||
boot.loader.systemd-boot.enable = lib.mkDefault true;
|
||||
boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
|
||||
boot.loader.timeout = 1;
|
||||
boot.supportedFilesystems = ["ntfs"];
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# TODO check why this???
|
||||
# networking.firewall.enable = true;
|
||||
|
||||
services.xserver.enable = lib.mkDefault true;
|
||||
services.xserver.xkb.layout = "us";
|
||||
systemd.services.display-manager.restartIfChanged = false;
|
||||
|
|
@ -83,6 +41,20 @@
|
|||
gwenview
|
||||
];
|
||||
|
||||
services.openssh.enable = true;
|
||||
# services.flatpak.enable = lib.mkDefault true;
|
||||
services.printing.enable = lib.mkDefault true;
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
services.tailscale.enable = true;
|
||||
services.tailscale.package = pkgs.tailscale;
|
||||
services.resolved.enable = true;
|
||||
networking.interfaces.tailscale0.useDHCP = false;
|
||||
|
||||
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;
|
||||
|
|
@ -91,7 +63,6 @@
|
|||
pulse.enable = true;
|
||||
wireplumber.enable = lib.mkDefault true;
|
||||
};
|
||||
hardware.pulseaudio.enable = lib.mkDefault false;
|
||||
|
||||
security.sudo-rs.enable = true;
|
||||
# security.sudo-rs.extraRules = [{
|
||||
|
|
@ -101,25 +72,6 @@
|
|||
# groups = [ "wheel" ];
|
||||
# }];
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
auto-optimise-store = true;
|
||||
trusted-users = ["root" "@wheel"];
|
||||
};
|
||||
nixpkgs.config = {allowUnfree = true;};
|
||||
|
||||
systemd.extraConfig = ''
|
||||
DefaultTimeoutStopSec=15s
|
||||
'';
|
||||
|
||||
time.timeZone = "US/Pacific";
|
||||
i18n.defaultLocale = "en_US.utf8";
|
||||
i18n.supportedLocales = ["all"];
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_CTYPE = "en_US.UTF-8";
|
||||
LC_MESSAGES = "en_US.UTF-8";
|
||||
LC_ALL = "en_US.UTF-8";
|
||||
};
|
||||
i18n.inputMethod = {
|
||||
enabled = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [
|
||||
|
|
@ -129,8 +81,49 @@
|
|||
];
|
||||
};
|
||||
|
||||
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 = "US/Pacific";
|
||||
services.automatic-timezoned.enable = lib.mkDefault true;
|
||||
i18n.defaultLocale = "en_US.utf8";
|
||||
i18n.supportedLocales = ["all"];
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_CTYPE = "en_US.UTF-8";
|
||||
LC_MESSAGES = "en_US.UTF-8";
|
||||
LC_ALL = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
boot.loader.systemd-boot.enable = lib.mkDefault true;
|
||||
boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
|
||||
boot.loader.timeout = 1;
|
||||
boot.supportedFilesystems = ["ntfs"];
|
||||
systemd.extraConfig = ''
|
||||
DefaultTimeoutStopSec=15s
|
||||
'';
|
||||
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.bluetooth.enable = lib.mkDefault true;
|
||||
|
||||
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
auto-optimise-store = true;
|
||||
trusted-users = ["root" "@wheel"];
|
||||
};
|
||||
nixpkgs.config = {allowUnfree = true;};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
system.stateVersion = lib.mkDefault "23.05";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
# THE FINALS audio borked
|
||||
services.pipewire.enable = false;
|
||||
hardware.pulseaudio.enable = true;
|
||||
hardware.pulseaudio.support32Bit = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# egl-wayland
|
||||
# gpt4all-chat
|
||||
# nvidia-vaapi-driver
|
||||
# foldingathome
|
||||
# mesa
|
||||
gwe
|
||||
openrgb
|
||||
snapper
|
||||
|
|
@ -19,6 +13,52 @@
|
|||
boot.kernel.sysctl."net.ipv4.ip_forward" = "1";
|
||||
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = "1";
|
||||
|
||||
# THE FINALS audio borked
|
||||
services.pipewire.enable = false;
|
||||
hardware.pulseaudio.enable = true;
|
||||
hardware.pulseaudio.support32Bit = true;
|
||||
services.pipewire.extraConfig = {
|
||||
pipewire."99-low-latency" = {
|
||||
context.properties = {
|
||||
default.allowed-rates = [44100 48000 96000];
|
||||
default.clock.rate = 192000;
|
||||
default.clock.quantum = 32;
|
||||
default.clock.min-quantum = 32;
|
||||
default.clock.max-quantum = 32;
|
||||
};
|
||||
context.modules = [
|
||||
{
|
||||
name = "libpipewire-module-rt";
|
||||
args = {
|
||||
nice.level = -12;
|
||||
rt.prio = 89;
|
||||
rt.time.soft = 200000;
|
||||
rt.time.hard = 200000;
|
||||
};
|
||||
flags = ["ifexists nofail"];
|
||||
}
|
||||
];
|
||||
};
|
||||
pipewire-pulse."99-low-latency" = {
|
||||
context.modules = [
|
||||
{
|
||||
name = "libpipewire-module-protocol-pulse";
|
||||
args = {
|
||||
pulse.min.req = "32/192000";
|
||||
pulse.default.req = "32/192000";
|
||||
pulse.max.req = "32/192000";
|
||||
pulse.min.quantum = "32/192000";
|
||||
pulse.max.quantum = "32/192000";
|
||||
};
|
||||
}
|
||||
];
|
||||
stream.properties = {
|
||||
node.latency = "32/192000";
|
||||
resample.quality = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# services.foldingathome = {
|
||||
# enable = true;
|
||||
# team = 223518;
|
||||
|
|
@ -26,14 +66,54 @@
|
|||
# extraArgs = ["--passkey=76ba03d55acf116776ba03d55acf1167"];
|
||||
# };
|
||||
|
||||
environment.sessionVariables = {
|
||||
# wayland chromium workaround
|
||||
NIXOS_OZONE_WL = "1";
|
||||
# environment.sessionVariables = {
|
||||
# # wayland chromium workaround
|
||||
# NIXOS_OZONE_WL = "1";
|
||||
|
||||
# firefox nvidia-vaapi-driver
|
||||
# MOZ_DISABLE_RDD_SANDBOX = "1";
|
||||
# LIBVA_DRIVER_NAME = "nvidia";
|
||||
# # firefox nvidia-vaapi-driver
|
||||
# # MOZ_DISABLE_RDD_SANDBOX = "1";
|
||||
# # LIBVA_DRIVER_NAME = "nvidia";
|
||||
# };
|
||||
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = true;
|
||||
# options: production, beta, vulkan_beta, latest
|
||||
# package = pkgs.linuxPackages_latest.nvidiaPackages.latest;
|
||||
package = pkgs.linuxPackages_zen.nvidiaPackages.latest;
|
||||
# open = true;
|
||||
};
|
||||
# enable core and mem freq sliders for nvidia
|
||||
services.xserver.deviceSection = ''
|
||||
Option "Coolbits" "8"
|
||||
'';
|
||||
systemd.services.nvpl = {
|
||||
description = "Increase GPU power limit to 400w";
|
||||
script = "/run/current-system/sw/bin/nvidia-smi -pl=400";
|
||||
wantedBy = ["multi-user.target"];
|
||||
};
|
||||
|
||||
services.udev.packages = [pkgs.openrgb];
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="hidraw*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a3c5", MODE="0666"
|
||||
'';
|
||||
|
||||
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";
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/eb9fcce2-e9f3-438a-b5ce-8f72f32f0e09";
|
||||
|
|
@ -71,18 +151,6 @@
|
|||
};
|
||||
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.snapshotInterval = "*:0/5";
|
||||
|
||||
# boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
boot.kernelPackages = pkgs.linuxPackages_zen;
|
||||
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
|
||||
|
|
@ -91,41 +159,8 @@
|
|||
# boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
|
||||
# boot.blacklistedKernelModules = with config.boot.kernelPackages; [ k10temp ];
|
||||
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = true;
|
||||
# options: production, beta, vulkan_beta, latest
|
||||
# package = pkgs.linuxPackages_latest.nvidiaPackages.latest;
|
||||
package = pkgs.linuxPackages_zen.nvidiaPackages.latest;
|
||||
# open = true;
|
||||
};
|
||||
# enable core and mem freq sliders for nvidia
|
||||
services.xserver.deviceSection = ''
|
||||
Option "Coolbits" "8"
|
||||
'';
|
||||
systemd.services.nvpl = {
|
||||
description = "Increase GPU power limit to 400w";
|
||||
script = "/run/current-system/sw/bin/nvidia-smi -pl=400";
|
||||
wantedBy = ["multi-user.target"];
|
||||
};
|
||||
|
||||
services.udev.packages = [pkgs.openrgb];
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="hidraw*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a3c5", MODE="0666"
|
||||
'';
|
||||
|
||||
# windows can suck my ass
|
||||
time.hardwareClockInLocalTime = true;
|
||||
|
||||
# services.xserver.displayManager = {
|
||||
# autoLogin.enable = true;
|
||||
# autoLogin.user = "tao";
|
||||
# };
|
||||
|
||||
networking.hostName = "NOcomputer";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,33 @@
|
|||
fw-ectool
|
||||
];
|
||||
|
||||
powerManagement.powertop.enable = true;
|
||||
services.fwupd.enable = true;
|
||||
services.fprintd.enable = true;
|
||||
hardware.sensor.iio.enable = true;
|
||||
|
||||
services.xserver.displayManager.defaultSession = "plasma";
|
||||
services.xserver.displayManager.sddm.wayland.enable = true;
|
||||
|
||||
# systemd.user.services.backlight = {
|
||||
# # description = "";
|
||||
# ExecStart = "${pkgs.prescurve}/bin/prescurve_backlight";
|
||||
# Restart = "on-failure";
|
||||
# wantedBy = [ "default.target" ];
|
||||
# };
|
||||
# hardware.sane = {
|
||||
# enable = true;
|
||||
# extraBackends = [ pkgs.epkowa ];
|
||||
# };
|
||||
|
||||
services.udev.extraRules = ''
|
||||
# Ethernet expansion card
|
||||
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20"
|
||||
|
||||
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
|
||||
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
|
||||
'';
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/e4244a97-9b48-49f0-8093-782163045020";
|
||||
fsType = "btrfs";
|
||||
|
|
@ -22,38 +49,8 @@
|
|||
fsType = "btrfs";
|
||||
options = ["subvol=nixos" "noatime" "compress-force=zstd:3" "discard=async"];
|
||||
};
|
||||
|
||||
swapDevices = [{device = "/dev/disk/by-uuid/ca55d0ea-c0db-44c5-af3a-e38eec803929";}];
|
||||
|
||||
# services.fstrim.enable = true;
|
||||
services.fprintd.enable = true;
|
||||
services.fwupd.enable = true;
|
||||
powerManagement.powertop.enable = true;
|
||||
hardware.sensor.iio.enable = true;
|
||||
|
||||
# systemd.user.services.backlight = {
|
||||
# # description = "";
|
||||
# ExecStart = "${pkgs.prescurve}/bin/prescurve_backlight";
|
||||
# Restart = "on-failure";
|
||||
# wantedBy = [ "default.target" ];
|
||||
# };
|
||||
|
||||
services.xserver.displayManager.defaultSession = "plasma";
|
||||
services.xserver.displayManager.sddm.wayland.enable = true;
|
||||
|
||||
# hardware.sane = {
|
||||
# enable = true;
|
||||
# extraBackends = [ pkgs.epkowa ];
|
||||
# };
|
||||
|
||||
services.udev.extraRules = ''
|
||||
# Ethernet expansion card
|
||||
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20"
|
||||
|
||||
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
|
||||
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
|
||||
'';
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue