From 52f9b876b56ddf5b2e244f23b84ebc7872d75edb Mon Sep 17 00:00:00 2001 From: Till Date: Mon, 15 May 2023 02:43:36 +0200 Subject: [PATCH] getting there --- flake.nix | 15 ++++++++++- system/hardware-nova.nix | 57 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 system/hardware-nova.nix diff --git a/flake.nix b/flake.nix index 68e6bb5..c1e1922 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,19 @@ outputs = { self, nixpkgs, home-manager, ... }@inputs: { nixosConfigurations = { + nova = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + { + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + networking.hostName = "nova"; + } + ./system + ./system/hardware-nova.nix + ]; + }; romulus = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; modules = [ @@ -27,7 +40,7 @@ }; homeConfigurations = { - "till@romulus" = home-manager.lib.homeManagerConfiguration { + till = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; extraSpecialArgs = { inherit inputs; }; modules = [ diff --git a/system/hardware-nova.nix b/system/hardware-nova.nix new file mode 100644 index 0000000..aabf5e2 --- /dev/null +++ b/system/hardware-nova.nix @@ -0,0 +1,57 @@ +# 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 = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/6a0d25d4-0253-4467-85cc-ab3e0ef71f54"; + fsType = "btrfs"; + options = [ "subvol=root" "compress=zstd" ]; + }; + + boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/eaad533f-8586-4002-9c53-5aecf8e7abd8"; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/6a0d25d4-0253-4467-85cc-ab3e0ef71f54"; + fsType = "btrfs"; + options = [ "subvol=home" "compress=zstd" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/6a0d25d4-0253-4467-85cc-ab3e0ef71f54"; + fsType = "btrfs"; + options = [ "subvol=nix" "compress=zstd" "noatime"]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/7362-C4C4"; + fsType = "vfat"; + }; + + swapDevices = [{ + device = "/swapfile"; + size = 8 * 1045; + }]; + + # 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.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}