splitting parts of system config
- hardware-configuration.nix separated into kernel-winter.nix and filesystem-winter.nix - kernel.nix split off into kernel-winter.nix
This commit is contained in:
parent
0f37f09199
commit
ab6049f578
5 changed files with 54 additions and 89 deletions
|
|
@ -14,10 +14,12 @@
|
||||||
|
|
||||||
imports = with modules.system; [
|
imports = with modules.system; [
|
||||||
audio
|
audio
|
||||||
|
base
|
||||||
|
filesystem-winter
|
||||||
gui
|
gui
|
||||||
hardware-configuration
|
|
||||||
input
|
input
|
||||||
kernel
|
kernel
|
||||||
|
kernel-winter
|
||||||
networking
|
networking
|
||||||
packages
|
packages
|
||||||
security
|
security
|
||||||
|
|
|
||||||
28
modules/system/filesystem-winter.nix
Normal file
28
modules/system/filesystem-winter.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
{ config, ... }:
|
||||||
|
let
|
||||||
|
mkMount = uuid: type: {
|
||||||
|
device = "/dev/disk/by-uuid/${uuid}";
|
||||||
|
fsType = type;
|
||||||
|
};
|
||||||
|
mkBtrfsMount = subvolid: mkMount "8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d" "btrfs" // {
|
||||||
|
options = [ "autodefrag" "compress=zstd:3" "nossd" "nossd_spread" "relatime" "subvolid=${builtins.toString subvolid}" ];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "rootfs";
|
||||||
|
fsType = "tmpfs";
|
||||||
|
options = [ "defaults" "size=4G" "mode=755" ];
|
||||||
|
};
|
||||||
|
"/boot" = mkMount "E8E8-E570" "vfat";
|
||||||
|
"/mnt/hdd" = mkMount "d5e3cfe5-c73a-4695-b81b-fc0215d4cefe" "ext4";
|
||||||
|
|
||||||
|
"/mnt/butter" = mkBtrfsMount 5;
|
||||||
|
"/nix" = mkBtrfsMount 258;
|
||||||
|
"/home" = mkBtrfsMount 260;
|
||||||
|
"/home/.snapshots" = mkBtrfsMount 319;
|
||||||
|
"/root" = mkBtrfsMount 261;
|
||||||
|
"/var" = mkBtrfsMount 259;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
# 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 = [ "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
|
|
||||||
boot.initrd.kernelModules = [];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [];
|
|
||||||
|
|
||||||
fileSystems."/" = {
|
|
||||||
device = "rootfs";
|
|
||||||
fsType = "tmpfs";
|
|
||||||
options = [ "defaults" "size=4G" "mode=755" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
|
||||||
device = "/dev/disk/by-uuid/E8E8-E570";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/mnt/butter" = {
|
|
||||||
device = "/dev/disk/by-uuid/8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [ "autodefrag" "compress=zstd:3" "nossd" "nossd_spread" "relatime" "subvolid=5" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/nix" = {
|
|
||||||
device = "/dev/disk/by-uuid/8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [ "autodefrag" "compress=zstd:3" "nossd" "nossd_spread" "relatime" "subvolid=258" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/home" = {
|
|
||||||
device = "/dev/disk/by-uuid/8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [ "autodefrag" "compress=zstd:3" "nossd" "nossd_spread" "relatime" "subvolid=260" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/home/.snapshots" = {
|
|
||||||
device = "/dev/disk/by-uuid/8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [ "autodefrag" "compress=zstd:3" "nossd" "nossd_spread" "relatime" "subvolid=319" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/root" = {
|
|
||||||
device = "/dev/disk/by-uuid/8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [ "autodefrag" "compress=zstd:3" "nossd" "nossd_spread" "relatime" "subvolid=261" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/var" = {
|
|
||||||
device = "/dev/disk/by-uuid/8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [ "autodefrag" "compress=zstd:3" "nossd" "nossd_spread" "relatime" "subvolid=259" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/mnt/hdd" = {
|
|
||||||
device = "/dev/disk/by-uuid/d5e3cfe5-c73a-4695-b81b-fc0215d4cefe";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [];
|
|
||||||
}
|
|
||||||
22
modules/system/kernel-winter.nix
Normal file
22
modules/system/kernel-winter.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{ config, pkgs, ... }: {
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
grub = {
|
||||||
|
enable = true;
|
||||||
|
efiSupport = true;
|
||||||
|
device = "nodev";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
initrd.kernelModules = [ "i915" ];
|
||||||
|
kernelParams = [
|
||||||
|
"amdgpu.gpu_recovery=1"
|
||||||
|
"amdgpu.si_support=1"
|
||||||
|
"radeon.si_support=0"
|
||||||
|
"intel_pstate=passive"
|
||||||
|
"msr.allow_writes=on"
|
||||||
|
];
|
||||||
|
kernelPackages = pkgs.lib.mkForce (pkgs.linuxPackagesFor pkgs.linux-lava);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,32 +1,14 @@
|
||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, ... }: {
|
||||||
powerManagement.cpuFreqGovernor = "ondemand";
|
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
|
||||||
systemd-boot.enable = true;
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
grub = {
|
|
||||||
enable = true;
|
|
||||||
efiSupport = true;
|
|
||||||
device = "nodev";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
blacklistedKernelModules = [ "uvcvideo" ];
|
blacklistedKernelModules = [ "uvcvideo" ];
|
||||||
initrd = {
|
initrd = {
|
||||||
includeDefaultModules = false;
|
includeDefaultModules = false;
|
||||||
kernelModules = [ "i915" ];
|
availableKernelModules = [ "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||||
};
|
};
|
||||||
kernel.sysctl = {
|
kernel.sysctl = {
|
||||||
"kernel.core_pattern" = "|/bin/false";
|
"kernel.core_pattern" = "|/bin/false";
|
||||||
"kernel.sysrq" = 1;
|
"kernel.sysrq" = 1;
|
||||||
};
|
};
|
||||||
kernelParams = [
|
|
||||||
"amdgpu.gpu_recovery=1"
|
|
||||||
"amdgpu.si_support=1"
|
|
||||||
"radeon.si_support=0"
|
|
||||||
"intel_pstate=passive"
|
|
||||||
"msr.allow_writes=on"
|
|
||||||
];
|
|
||||||
kernelPackages = pkgs.lib.mkForce (pkgs.linuxPackagesFor pkgs.linux-lava);
|
|
||||||
};
|
};
|
||||||
zramSwap.enable = true;
|
zramSwap.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue