From 0ea64c03921224b3ea73383f6048f780b167ee95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Mon, 11 Jul 2022 21:34:04 -0300 Subject: [PATCH] Add monolith --- flake.nix | 12 +++++- system/configuration.nix | 5 --- ...ion.nix => i15-hardware-configuration.nix} | 0 system/monolith-hardware-configuration.nix | 41 +++++++++++++++++++ 4 files changed, 52 insertions(+), 6 deletions(-) rename system/{hardware-configuration.nix => i15-hardware-configuration.nix} (100%) create mode 100644 system/monolith-hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 19f1bb5..9941bfc 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,17 @@ nixosConfigurations = { i15 = lib.nixosSystem { inherit system; - modules = [ ./system/configuration.nix ]; + modules = [ + ./system/configuration.nix + ./system/i15-hardware-configuration.nix + ]; + }; + monolith = lib.nixosSystem { + inherit system; + modules = [ + ./system/configuration.nix + ./system/monolith-hardware-configuration.nix + ]; }; }; diff --git a/system/configuration.nix b/system/configuration.nix index 88c6a8c..9bff34b 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -44,11 +44,6 @@ let in { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/system/hardware-configuration.nix b/system/i15-hardware-configuration.nix similarity index 100% rename from system/hardware-configuration.nix rename to system/i15-hardware-configuration.nix diff --git a/system/monolith-hardware-configuration.nix b/system/monolith-hardware-configuration.nix new file mode 100644 index 0000000..a7121d9 --- /dev/null +++ b/system/monolith-hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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 = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/bea0fbbd-c1a2-4379-8cc5-658507e36032"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + boot.initrd.luks.devices."luks-fb41335e-cca7-47e2-a886-24549b8accb8".device = "/dev/disk/by-uuid/fb41335e-cca7-47e2-a886-24549b8accb8"; + + fileSystems."/boot/efi" = + { device = "/dev/disk/by-uuid/E2D7-919A"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/3e5781c7-5e56-4b5d-9720-12b384fad726"; } + ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}