feat: update home-pc config

This commit is contained in:
Felix Schröter 2022-01-27 15:03:07 +01:00
parent 99223e4ad8
commit 33a712b637
Signed by: felschr
GPG key ID: 671E39E6744C807D
5 changed files with 37 additions and 31 deletions

View file

@ -18,7 +18,7 @@
sources=[('xkb', 'gb'), ('xkb', 'mozc-jp')] sources=[('xkb', 'gb'), ('xkb', 'mozc-jp')]
[org/gnome/mutter] [org/gnome/mutter]
experimental-features=['kms-modifiers'] experimental-features=['kms-modifiers', 'scale-monitor-framebuffer']
''; '';
programs.xwayland.enable = true; programs.xwayland.enable = true;

View file

@ -1,45 +1,50 @@
{ config, lib, pkgs, ... }: # 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, ... }:
{ {
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; [ "nvme" "ahci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; device = "/dev/disk/by-uuid/5830e9b3-260b-451c-bfee-2028c64c6199";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@" "compress-force=zstd" "noatime" ]; options = [ "subvol=@" "compress-force=zstd" "noatime" ];
}; };
boot.initrd.luks.devices."enc".device = boot.initrd.luks.devices."enc".device =
"/dev/disk/by-uuid/6f4f3ce1-57fd-4ec3-bb9d-7847853d2dcf"; "/dev/disk/by-uuid/1dd848b6-cd7f-4959-8500-a03ffdaeae66";
fileSystems."/home" = { fileSystems."/home" = {
device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; device = "/dev/disk/by-uuid/5830e9b3-260b-451c-bfee-2028c64c6199";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@home" "compress-force=zstd" "noatime" ]; options = [ "subvol=@home" "compress-force=zstd" "noatime" ];
}; };
fileSystems."/swap" = { fileSystems."/.swap" = {
device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; device = "/dev/disk/by-uuid/5830e9b3-260b-451c-bfee-2028c64c6199";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@swap" ]; options = [ "subvol=@swap" "nodatacow" ];
neededForBoot = true; neededForBoot = true;
}; };
fileSystems."/.snapshots" = { fileSystems."/.snapshots" = {
device = "/dev/disk/by-uuid/9ef41d63-a7ad-406d-8c2b-5ad3fb4c0ea6"; device = "/dev/disk/by-uuid/5830e9b3-260b-451c-bfee-2028c64c6199";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@snapshots" "compress-force=zstd" "noatime" ]; options = [ "subvol=@snapshots" "compress-force=zstd" "noatime" ];
}; };
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5C20-4516"; device = "/dev/disk/by-uuid/17B2-42C2";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [ ];
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View file

@ -3,7 +3,7 @@
{ {
imports = [ imports = [
./hardware/base.nix ./hardware/base.nix
./hardware/gpu-nvidia.nix ./hardware/gpu-amd.nix
./hardware/steam.nix ./hardware/steam.nix
./hardware/ledger.nix ./hardware/ledger.nix
./system ./system
@ -17,7 +17,7 @@
# declarative config broken atm: https://github.com/NixOS/nixpkgs/issues/91986 # declarative config broken atm: https://github.com/NixOS/nixpkgs/issues/91986
swapDevices = [{ swapDevices = [{
device = "/swap/swapfile"; device = "/.swap/swapfile";
size = 8192; size = 8192;
}]; }];
@ -38,7 +38,7 @@
programs.zsh.enable = true; programs.zsh.enable = true;
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
54950 # transmission 58324 # transmission
]; ];
networking.firewall.allowedUDPPorts = [ networking.firewall.allowedUDPPorts = [
24727 # AusweisApp2 24727 # AusweisApp2

View file

@ -7,15 +7,15 @@
<primary>yes</primary> <primary>yes</primary>
<monitor> <monitor>
<monitorspec> <monitorspec>
<connector>DP-2</connector> <connector>DP-3</connector>
<vendor>NVD</vendor> <vendor>GSM</vendor>
<product>G-SYNC 241910</product> <product>LG ULTRAGEAR</product>
<serial>#ASNICAsHCG3d</serial> <serial>110MAZVPXP89</serial>
</monitorspec> </monitorspec>
<mode> <mode>
<width>1920</width> <width>2560</width>
<height>1080</height> <height>1440</height>
<rate>119.982177734375</rate> <rate>143.97325134277344</rate>
</mode> </mode>
</monitor> </monitor>
</logicalmonitor> </logicalmonitor>

View file

@ -29,13 +29,13 @@ $drive
| | | |
| ├── /boot (mounted boot partition) | ├── /boot (mounted boot partition)
| | | |
| ├── /swap (mounted @swap subvolume) | ├── /.swap (mounted @swap subvolume)
| | | |
| └── /.snapshots (mounted @snapshots subvolume) | └── /.snapshots (mounted @snapshots subvolume)
| |
├── @home (mounted as /home) ├── @home (mounted as /home)
| |
├── @swap (mounted as /swap, contains swap file) ├── @swap (mounted as /.swap, contains swap file)
| |
└── @snapshots (mounted as /.snapshots) └── @snapshots (mounted as /.snapshots)
" "
@ -74,7 +74,7 @@ umount /mnt
mount -o subvol=@,compress-force=zstd,noatime /dev/mapper/enc /mnt mount -o subvol=@,compress-force=zstd,noatime /dev/mapper/enc /mnt
mkdir /mnt/home mkdir /mnt/home
mount -o subvol=@home,compress-force=zstd,noatime /dev/mapper/enc /mnt/home mount -o subvol=@home,compress-force=zstd,noatime /dev/mapper/enc /mnt/home
mkdir /mnt/swap mkdir /mnt/.swap
mount -o subvol=@swap,noatime /dev/mapper/enc /mnt/swap mount -o subvol=@swap,noatime /dev/mapper/enc /mnt/swap
mkdir /mnt/.snapshots mkdir /mnt/.snapshots
mount -o subvol=@snapshots,compress-force=zstd,noatime /dev/mapper/enc /mnt/.snapshots mount -o subvol=@snapshots,compress-force=zstd,noatime /dev/mapper/enc /mnt/.snapshots
@ -82,12 +82,12 @@ mkdir /mnt/boot
mount "$boot" /mnt/boot mount "$boot" /mnt/boot
# setup swap file # setup swap file
truncate -s 0 /mnt/swap/swapfile truncate -s 0 /mnt/.swap/swapfile
chattr +C /mnt/swap/swapfile chattr +C /mnt/.swap/swapfile
fallocate -l 8G /mnt/swap/swapfile fallocate -l 8G /mnt/.swap/swapfile
chmod 600 /mnt/swap/swapfile chmod 600 /mnt/.swap/swapfile
mkswap /mnt/swap/swapfile mkswap /mnt/.swap/swapfile
swapon /mnt/swap/swapfile swapon /mnt/.swap/swapfile
# generate hardware-configuration.nix # generate hardware-configuration.nix
nixos-generate-config --root /mnt nixos-generate-config --root /mnt
@ -96,5 +96,6 @@ echo
echo "Partitions have been created and hardware-configuration.nix has been generated." echo "Partitions have been created and hardware-configuration.nix has been generated."
echo "WARNING: Some hardware-configuration.nix options might need to be set manually:" echo "WARNING: Some hardware-configuration.nix options might need to be set manually:"
echo "- add compress-force & noatime options" echo "- add compress-force & noatime options"
echo '- add "neededForBoot = true;" to /swap' echo "- add nodatacow option to /.swap"
echo '- add "neededForBoot = true;" to /.swap'