From 79fda5eed9da7edf37a704c89a402664a1a4917f Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Sat, 2 Nov 2024 00:04:17 +0100 Subject: [PATCH] moves hardware specific to vsc and removes full path reference from flake --- config/nixos/configuration.nix | 5 --- config/nixos/flake.lock | 27 ++++++++++++++++ config/nixos/flake.nix | 4 ++- config/nixos/hardware/mennos-gamingpc.nix | 39 +++++++++++++++++++++++ 4 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 config/nixos/flake.lock create mode 100644 config/nixos/hardware/mennos-gamingpc.nix diff --git a/config/nixos/configuration.nix b/config/nixos/configuration.nix index bb1e0ad..eea4253 100644 --- a/config/nixos/configuration.nix +++ b/config/nixos/configuration.nix @@ -1,8 +1,6 @@ { config, pkgs, ... }: { imports = [ - # Include the results of the hardware scan. - /etc/nixos/hardware-configuration.nix ./packages/default.nix ./virtualization.nix ./users.nix @@ -14,9 +12,6 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "mennos-laptop"; - # networking.wireless.enable = true; - # Enable networking networking.networkmanager.enable = true; diff --git a/config/nixos/flake.lock b/config/nixos/flake.lock new file mode 100644 index 0000000..0f7109b --- /dev/null +++ b/config/nixos/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1730327045, + "narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "080166c15633801df010977d9d7474b4a6c549d7", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/config/nixos/flake.nix b/config/nixos/flake.nix index c29c5c1..aacf209 100644 --- a/config/nixos/flake.nix +++ b/config/nixos/flake.nix @@ -12,14 +12,16 @@ "mennos-laptop" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./configuration.nix + ./hardware/mennos-laptop.nix ./nvidia.nix + ./configuration.nix { networking.hostName = "mennos-laptop"; } ]; }; "mennos-gamingpc" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ + ./hardware/mennos-gamingpc.nix ./configuration.nix { networking.hostName = "mennos-desktop"; } ]; diff --git a/config/nixos/hardware/mennos-gamingpc.nix b/config/nixos/hardware/mennos-gamingpc.nix new file mode 100644 index 0000000..433ac37 --- /dev/null +++ b/config/nixos/hardware/mennos-gamingpc.nix @@ -0,0 +1,39 @@ +# 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" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/ac5a70cf-4b12-4d02-b5b4-a6eddf4c40b5"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/5610-F4A9"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + # 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.enp8s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}