nixos: Modularize NixOS and Home Manager config

This commit is contained in:
emmatherock
2026-06-17 15:53:15 -03:00
parent 60df66aab0
commit 8b6090acdb
31 changed files with 297 additions and 276 deletions
+66
View File
@@ -0,0 +1,66 @@
{ pkgs, ... }:
{
imports = [
./hardware-configuration.nix
../../modules/security/secureboot.nix
../../modules/services/maintenance.nix
../../modules/system/audio.nix
../../modules/system/fonts.nix
../../modules/system/gaming.nix
../../modules/system/graphics.nix
../../modules/system/packages.nix
../../modules/system/shells.nix
../../modules/system/users.nix
../../modules/system/networking.nix
../../modules/desktop/firefox.nix
../../modules/desktop/plasma.nix
../../modules/services/containers.nix
../../modules/services/vscode-server.nix
];
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
plymouth.enable = true;
initrd.kernelModules = [ "amdgpu" ];
kernelPackages = pkgs.linuxPackages_cachyos ;
kernelParams = [ "quiet" "splash" "boot.shell_on_fail" "loglevel=3" "iommu=pt" ];
};
time.timeZone = "America/Argentina/Buenos_Aires";
i18n.defaultLocale = "es_AR.UTF-8";
services.hardware.deepcool-digital-linux.enable = true;
services.udev.extraRules = ''
# Intel RAPL energy usage file
ACTION=="add", SUBSYSTEM=="powercap", KERNEL=="intel-rapl:0", RUN+="${pkgs.coreutils}/bin/chmod 444 /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj"
# DeepCool HID raw devices
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3633", MODE="0666"
# CH510 MESH DIGITAL
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="34d3", ATTRS{idProduct}=="1100", MODE="0666"
# Elgato 4K X (all speed modes)
SUBSYSTEM=="usb", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="009b", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="009c", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="009d", MODE="0666", GROUP="plugdev"
# Elgato 4K S (all speed modes)
SUBSYSTEM=="usb", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="00af", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="00ae", MODE="0666", GROUP="plugdev"
# nvtop
SUBSYSTEM=="drm", KERNEL=="card*", SUBSYSTEMS=="pci", DRIVERS=="amdgpu", RUN+="/bin/sh -c 'chmod -R g+r /sys/class/drm/%k/device/'"
'';
nixpkgs.config.allowUnfree = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
};
system.stateVersion = "25.11";
}
@@ -0,0 +1,61 @@
# 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, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/f67a5f9f-b31b-46f8-9026-6e276e5b0bb9";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/f67a5f9f-b31b-46f8-9026-6e276e5b0bb9";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/f67a5f9f-b31b-46f8-9026-6e276e5b0bb9";
fsType = "btrfs";
options = [ "subvol=@nix" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/64D0-FE2C";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/mnt/containers" = {
device = "/dev/disk/by-uuid/350fedfa-fa0b-4941-a07e-cec4e817e566";
fsType = "btrfs";
options = [ "subvol=containers" "compress=zstd:1" "discard=async" "noatime" ];
};
fileSystems."/mnt/ssd" = {
device = "/dev/disk/by-uuid/350fedfa-fa0b-4941-a07e-cec4e817e566";
fsType = "btrfs";
options = [ "subvol=ssd" "compress=zstd:1" "discard=async" "noatime" ];
};
fileSystems."/mnt/data" = {
device = "/dev/disk/by-uuid/dbab8467-a044-4a44-a265-0f268971f3db";
fsType = "btrfs";
options = [ "subvol=data" "compress=zstd:1" "autodefrag" "noatime" "x-systemd.device-timeout=40s" ];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}