2022-06-05 01:43:16 -03:00
# 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.
2022-07-21 00:32:09 -03:00
{ config , lib , pkgs , modulesPath , . . . }: {
imports = [ ( modulesPath + " / i n s t a l l e r / s c a n / n o t - d e t e c t e d . n i x " ) ] ;
boot . initrd . availableKernelModules =
[ " n v m e " " x h c i _ p c i " " a h c i " " u s b _ s t o r a g e " " u s b h i d " " s d _ m o d " ] ;
2022-06-05 01:43:16 -03:00
boot . initrd . kernelModules = [ ] ;
2022-08-04 11:58:56 -03:00
boot . kernelModules = [ " k v m - a m d " " a m d g p u " ] ;
hardware . opengl . driSupport = true ;
# For 32 bit applications
hardware . opengl . driSupport32Bit = true ;
hardware . opengl . extraPackages = with pkgs ; [ amdvlk ] ;
2022-08-06 18:32:34 -03:00
# For 32 bit applications
2022-08-04 11:58:56 -03:00
# Only available on unstable
hardware . opengl . extraPackages32 = with pkgs ; [ driversi686Linux . amdvlk ] ;
2022-08-06 18:32:34 -03:00
environment . variables = { AMD_VULKAN_ICD = " R A D V " ; } ;
2022-08-04 11:58:56 -03:00
2022-06-05 01:43:16 -03:00
boot . extraModulePackages = [ ] ;
2022-07-21 00:32:09 -03:00
fileSystems . " / " = {
device = " / d e v / d i s k / b y - l a b e l / B T R F S _ R O O T " ;
fsType = " b t r f s " ;
options = [ " s u b v o l = n i x o s " ] ;
} ;
2022-07-19 20:57:18 -03:00
boot . initrd . luks . reusePassphrases = true ;
boot . initrd . luks . devices = {
" m a i n " . device = " / d e v / d i s k / b y - l a b e l / C R Y P T _ R O O T " ;
" d a t a " . device = " / d e v / d i s k / b y - l a b e l / C R Y P T _ D A T A " ;
} ;
2022-07-21 00:32:09 -03:00
fileSystems . " / b o o t / e f i " = {
device = " / d e v / d i s k / b y - l a b e l / N I X B O O T " ;
fsType = " v f a t " ;
} ;
fileSystems . " / h o m e " = {
device = " / d e v / d i s k / b y - l a b e l / B T R F S _ R O O T " ;
fsType = " b t r f s " ;
options = [ " s u b v o l = h o m e " ] ;
} ;
fileSystems . " / h o m e / l e l g e n i o / G a m e s " = {
device = " / d e v / d i s k / b y - l a b e l / B T R F S _ D A T A " ;
fsType = " b t r f s " ;
options = [ " s u b v o l = @ g a m e s " " n o f a i l " ] ;
} ;
fileSystems . " / h o m e / l e l g e n i o / D o w n l o a d s / T o r r e n t s " = {
device = " / d e v / d i s k / b y - l a b e l / B T R F S _ D A T A " ;
fsType = " b t r f s " ;
options = [ " s u b v o l = @ t o r r e n t s " " n o f a i l " ] ;
} ;
2022-07-19 20:19:10 -03:00
services . udev . extraRules = ''
ACTION == " a d d " , SUBSYSTEM == " p c i " , DRIVER == " p c i e p o r t " , ATTR { power/wakeup } = " d i s a b l e d "
'' ;
2022-06-05 01:43:16 -03:00
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking . useDHCP = lib . mkDefault true ;
2022-07-11 21:34:04 -03:00
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
2022-07-21 00:32:09 -03:00
hardware . cpu . amd . updateMicrocode =
lib . mkDefault config . hardware . enableRedistributableFirmware ;
2022-07-15 22:03:57 -03:00
networking . hostName = " m o n o l i t h " ; # Define your hostname.
2022-08-07 13:59:05 -03:00
# swap
systemd . services = {
create-swapfile = {
serviceConfig . Type = " o n e s h o t " ;
wantedBy = [ " s w a p - s w a p f i l e . s w a p " ] ;
script = ''
$ { pkgs . coreutils } /bin/truncate - s 0 /swap/swapfile
$ { pkgs . e2fsprogs } /bin/chattr + C /swap/swapfile
$ { pkgs . btrfs-progs } /bin/btrfs property set /swap/swapfile compression none
'' ;
} ;
} ;
fileSystems . " / s w a p " = {
device = " / d e v / d i s k / b y - l a b e l / B T R F S _ R O O T " ;
fsType = " b t r f s " ;
2022-08-07 15:12:25 -03:00
options = [
" s u b v o l = s w a p "
] ; # Note these options effect the entire BTRFS filesystem and not just this volume, with the exception of `"subvol=swap"`, the other options are repeated in my other `fileSystem` mounts
2022-08-07 13:59:05 -03:00
} ;
swapDevices = [ {
device = " / s w a p / s w a p f i l e " ;
size = ( 1024 * 16 ) + ( 1024 * 2 ) ; # RAM size + 2 GB
} ] ;
2022-07-21 00:32:09 -03:00
}