wip: Implement nyx overlay
This commit is contained in:
parent
755d4c5620
commit
6cbb18096f
7 changed files with 363 additions and 44 deletions
|
@ -1,15 +1,12 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./system.nix
|
||||
./users.nix
|
||||
./fonts.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
console = {
|
||||
font = "Lat2-Terminus16";
|
||||
keyMap = "us";
|
||||
|
@ -19,14 +16,7 @@
|
|||
xserver.xkb = {
|
||||
layout = "us";
|
||||
};
|
||||
|
||||
libinput.enable = true;
|
||||
openssh.enable = true;
|
||||
};
|
||||
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = false;
|
||||
};
|
||||
|
||||
networking.networkmanager = {
|
||||
|
|
|
@ -1,38 +1,35 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = ["nvme"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/11a954cd-1e6b-40e5-9322-e4b5349076fd";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=@"];
|
||||
};
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/41853b7d-f098-4ae6-ae9c-1b97b1074bde";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=@" ];
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."luks-62a94d2c-2306-417d-bbfa-c7c6d89043dd".device = "/dev/disk/by-uuid/62a94d2c-2306-417d-bbfa-c7c6d89043dd";
|
||||
boot.initrd.luks.devices."luks-fc6b34e2-c93a-4d14-8194-1c30b63f8fb5".device = "/dev/disk/by-uuid/fc6b34e2-c93a-4d14-8194-1c30b63f8fb5";
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/1F69-C02B";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0077" "dmask=0077"];
|
||||
};
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/47C4-D06C";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/4d101e1e-8f76-472e-8282-62bb23d122e4";}
|
||||
];
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/5743e1ce-4f91-4ab9-9b5d-b46eeda3fb1e"; }
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
|
|
202
hosts/micronix/system.nix
Normal file
202
hosts/micronix/system.nix
Normal file
|
@ -0,0 +1,202 @@
|
|||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
libs,
|
||||
...
|
||||
}: {
|
||||
boot.initrd.systemd = {
|
||||
enable = true;
|
||||
tpm2 = {enable = true;};
|
||||
dbus = {enable = true;};
|
||||
};
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_cachyos;
|
||||
|
||||
boot.kernelParams = [
|
||||
"default_hugepagesz=1G"
|
||||
"hugepagesz=1G"
|
||||
];
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
"vm.nr_hugepages" = 512;
|
||||
"vm.swappiness" = 200;
|
||||
"net.core.netdev_max_backlog" = 32768;
|
||||
"net.core.somaxconn" = 16384;
|
||||
"net.core.rmem_default" = 1048576;
|
||||
"net.core.rmem_max" = 16777216;
|
||||
"net.core.wmem_default" = 1048576;
|
||||
"net.core.wmem_max" = 16777216;
|
||||
"net.core.optmem_max" = 65536;
|
||||
"net.ipv4.tcp_rmem" = "4096 1048576 2097152";
|
||||
"net.ipv4.tcp_wmem" = "4096 65536 16777216";
|
||||
"net.ipv4.udp_rmem_min" = 8192;
|
||||
"net.ipv4.udp_wmem_min" = 8192;
|
||||
"net.ipv4.tcp_fastopen" = 3;
|
||||
"net.core.default_qdisc" = "cake";
|
||||
"net.ipv4.tcp_congestion_control" = "bbr";
|
||||
"vm.dirty_ratio" = 20;
|
||||
"vm.dirty_background_ratio" = 10;
|
||||
"vm.vfs_cache_pressure" = 25;
|
||||
"vm.hugetlb_optimize_vmemmap" = 1;
|
||||
};
|
||||
|
||||
services.scx = {
|
||||
enable = true;
|
||||
scheduler = "scx_lavd";
|
||||
extraArgs = ["--performance"];
|
||||
};
|
||||
|
||||
boot.runSize = "100%";
|
||||
boot.devSize = "100%";
|
||||
boot.devShmSize = "100%";
|
||||
boot.tmp.useTmpfs = true;
|
||||
boot.tmp.tmpfsSize = "100%";
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
|
||||
fileSystems."/" = {
|
||||
fsType = "btrfs";
|
||||
options = ["compress=zstd:6" "discard" "flushoncommit" "subvol=@"];
|
||||
};
|
||||
|
||||
services.btrfs.autoScrub = {
|
||||
fileSystems = ["/"]; # Assuming root is formatted with Btrfs.
|
||||
interval = "daily";
|
||||
enable = true;
|
||||
};
|
||||
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
priority = 100;
|
||||
memoryPercent = 100;
|
||||
};
|
||||
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
options = "-d";
|
||||
};
|
||||
|
||||
nix.optimise.automatic = true;
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = "cgroups dynamic-derivations flakes nix-command recursive-nix";
|
||||
auto-optimise-store = true;
|
||||
http-connections = 0;
|
||||
download-buffer-size = 671088640;
|
||||
max-jobs = "auto";
|
||||
sync-before-registering = true;
|
||||
use-cgroups = true;
|
||||
};
|
||||
|
||||
boot.initrd.kernelModules = ["amdgpu"];
|
||||
|
||||
# Processor settings for AMD
|
||||
hardware.cpu.amd = {
|
||||
sev.enable = true;
|
||||
updateMicrocode = true;
|
||||
};
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot = {
|
||||
enable = true;
|
||||
edk2-uefi-shell = {enable = true;};
|
||||
memtest86 = {enable = true;};
|
||||
configurationLimit = 3;
|
||||
};
|
||||
|
||||
boot.plymouth = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
networking.tempAddresses = "default";
|
||||
|
||||
# Load AMD GPU drivers early
|
||||
hardware.amdgpu.initrd = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
hardware.amdgpu.opencl = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Graphics
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
services.xserver.videoDrivers = ["amdgpu"];
|
||||
services.xserver.updateDbusEnvironment = true;
|
||||
services.xserver.enableTearFree = true;
|
||||
|
||||
qt = {
|
||||
platformTheme = "kde";
|
||||
};
|
||||
|
||||
# TLP
|
||||
services.power-profiles-daemon.enable = false; # We disable this because it sucks
|
||||
services.tlp.enable = true;
|
||||
services.tlp.settings = {
|
||||
CPU_DRIVER_OPMODE_ON_AC = "active";
|
||||
CPU_DRIVER_OPMODE_ON_BAT = "active";
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "schedutil";
|
||||
CPU_BOOST_ON_AC = 1;
|
||||
CPU_BOOST_ON_BAT = 0;
|
||||
PLATFORM_PROFILE_ON_AC = "performance";
|
||||
PLATFORM_PROFILE_ON_BAT = "low-power";
|
||||
DISK_IOSCHED = "kyber";
|
||||
RADEON_DPM_PERF_LEVEL_ON_AC = "high";
|
||||
WIFI_PWR_ON_AC = "off";
|
||||
WIFI_PWR_ON_BAT = "off";
|
||||
};
|
||||
|
||||
# Enable sound with pipewire.
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
|
||||
services.displayManager.sddm.enable = true;
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
services.displayManager.defaultSession = "plasma";
|
||||
services.displayManager.sddm.wayland.enable = true;
|
||||
|
||||
programs.dconf.enable = true;
|
||||
|
||||
xdg.portal.enable = true;
|
||||
xdg.portal.xdgOpenUsePortal = true;
|
||||
|
||||
environment.plasma6.excludePackages = with pkgs.kdePackages; [
|
||||
konsole
|
||||
oxygen
|
||||
libqaccessibilityclient
|
||||
];
|
||||
|
||||
services.dbus = {
|
||||
implementation = "broker";
|
||||
};
|
||||
|
||||
# SECURITY
|
||||
security = {
|
||||
tpm2 = {
|
||||
enable = true;
|
||||
}; # Having TPM2 is nice.
|
||||
polkit = {
|
||||
enable = true;
|
||||
};
|
||||
protectKernelImage = true;
|
||||
forcePageTableIsolation = true;
|
||||
};
|
||||
|
||||
systemd.tpm2.enable = true;
|
||||
}
|
|
@ -8,6 +8,8 @@
|
|||
inherit
|
||||
(pkgs)
|
||||
wget2
|
||||
alacritty
|
||||
firefox
|
||||
vesktop
|
||||
mpv
|
||||
imv
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue