Update a lot of options, simplify variables, replace options with tags

This commit is contained in:
Bun 2025-06-04 16:12:08 -04:00
parent dbc0ab6dd3
commit 7667ef9a1b
147 changed files with 663 additions and 928 deletions

View file

@ -1,13 +1,13 @@
{ config, ... }:
{
services.pipewire = {
enable = config.system.desktop.enable;
wireplumber.extraConfig."wireplumber.settings"."bluetooth.autoswitch-to-headset-profile" = false;
enable = builtins.elem "pc" config.system.nixos.tags;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
#jack.enable = true;
wireplumber.extraConfig."wireplumber.settings"."bluetooth.autoswitch-to-headset-profile" = false;
};
}

View file

@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }:
{ config, lib, ... }:
{
config = lib.mkIf config.system.desktop.enable {
config = lib.mkIf (builtins.elem "pc" config.system.nixos.tags) {
hardware.bluetooth = {
enable = true;
settings = {
@ -8,9 +8,7 @@
Policy.AutoEnable = "true";
};
};
environment = {
systemPackages = with pkgs; [ bluetui ];
persistence."/persist".directories = [ "/var/lib/bluetooth" ];
};
environment.persistence."/persist".directories = [ "/var/lib/bluetooth" ];
};
}

View file

@ -10,7 +10,6 @@
boot = {
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
kernelParams = [ "nouveau.config=NvGspRm=1" ];
blacklistedKernelModules = [ "pcspkr" ];
kernel.sysctl = {
"vm.max_map_count" = 2147483642;

View file

@ -7,6 +7,7 @@
./disks
./networking
./printing
./tlp
./udev
./video
];

View file

@ -2,17 +2,20 @@
{
boot = {
supportedFilesystems = {
ntfs = config.system.desktop.enable;
zfs = config.system.server.enable;
ntfs = builtins.elem "pc" config.system.nixos.tags;
zfs = builtins.elem "server" config.system.nixos.tags;
};
swraid = {
enable = config.system.server.enable;
enable = builtins.elem "server" config.system.nixos.tags;
mdadmConf = "MAILADDR contact@nixfox.ca";
};
};
services = lib.mkIf config.environment.persistence."/persist".enable {
btrfs.autoScrub.enable = true;
btrfs.autoScrub = {
enable = true;
interval = "weekly";
};
fstrim.enable = true;
};

View file

@ -1,6 +1,7 @@
{ config, ... }:
{
imports = [
./mounts
./mycelium
./nameservers
./wireless

View file

@ -0,0 +1,32 @@
{ config, lib, nodes, ... }:
{
fileSystems = let
netOpts = [
"noauto"
"soft"
"x-systemd.automount"
];
in with nodes; {
"midas" = {
enable = lib.mkDefault false;
device = "[${midas.config.deployment.targetHost}]:/storage";
mountPoint = "/network/Midas";
fsType = "nfs4";
options = netOpts;
};
"kitty" = {
enable = lib.mkDefault false;
device = "[${kitty.config.deployment.targetHost}]:/storage";
mountPoint = "/network/Kitty";
fsType = "nfs4";
options = netOpts;
};
"prophet" = {
enable = lib.mkDefault false;
device = "[${prophet.config.deployment.targetHost}]:/storage";
mountPoint = "/network/Prophet";
fsType = "nfs4";
options = netOpts;
};
};
}

View file

@ -1,7 +1,7 @@
{ config, ... }:
{ ... }:
{
networking.wireless = {
enable = config.system.desktop.enable;
enable = true;
userControlled.enable = true;
};
}

View file

@ -2,7 +2,7 @@
{
services = {
printing = {
enable = config.system.desktop.enable;
enable = builtins.elem "pc" config.system.nixos.tags;
drivers = with pkgs; [ hplip ];
};
avahi = {

View file

@ -0,0 +1,31 @@
{ config, ... }:
{
services.tlp = {
enable = true;
settings = let
leastBat = 80;
maxBat = 85;
in {
# Stop battery charging after threshold
START_CHARGE_THRESH_BAT0 = leastBat;
STOP_CHARGE_THRESH_BAT0 = maxBat;
START_CHARGE_THRESH_BAT1 = leastBat;
STOP_CHARGE_THRESH_BAT1 = maxBat;
# Change CPU energy/performance policy to power
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
# Enable the platform profile low-power
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
# Disable turbo boost
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
CPU_HWP_DYN_BOOST_ON_AC = 1;
CPU_HWP_DYN_BOOST_ON_BAT = 0;
};
};
}

View file

@ -1,6 +1,7 @@
{ config, lib, pkgs, ... }:
{ pkgs, ... }:
{
services.udev.packages = with pkgs; lib.mkIf config.system.desktop.enable [
services.udev.packages = with pkgs; [
android-udev-rules
game-devices-udev-rules
];
}

View file

@ -3,7 +3,7 @@
imports = [ ./nvidia ];
hardware.graphics = {
enable = config.system.desktop.enable;
enable = builtins.elem "pc" config.system.nixos.tags;
enable32Bit = if config.nixpkgs.hostPlatform.linuxArch == "x86_64" then true else false;
extraPackages = with pkgs; [
vulkan-loader

View file

@ -1,20 +1,18 @@
{ config, lib, ... }:
{
options.system.nvidia.enable = lib.mkEnableOption "Nvidia graphic drivers";
config = lib.mkIf (lib.elem "nvidia" config.services.xserver.videoDrivers) {
boot.kernelParams = [ "nvidia_drm.fbdev=1" ]; # Framebuffer fixes TTY access
config = lib.mkIf config.system.nvidia.enable {
hardware.nvidia = {
modesetting.enable = true;
nvidiaSettings = false;
open = true;
};
boot.kernelParams = [ "nvidia_drm.fbdev=1" ]; # Framebuffer fixes TTY access
services.xserver.videoDrivers = [ "nvidia" ];
nixpkgs.allowUnfreePackages = [ "nvidia-x11" ];
specialisation.nouveau.configuration.config.system.nvidia.enable = lib.mkForce false;
specialisation.nouveau.configuration.config.services.xserver.videoDrivers = lib.mkForce [ "nouveau" ];
} // {
boot.kernelParams = [ "nouveau.config=NvGspRm=1" ];
};
}