diff --git a/defaults/hardware/thinkpad-x1-gen9.nix b/defaults/hardware/thinkpad-x1-gen9.nix new file mode 100644 index 0000000..a44a11c --- /dev/null +++ b/defaults/hardware/thinkpad-x1-gen9.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, modulesPath, hardwareModules, ... }: { + + imports = with hardwareModules; [ + (modulesPath + "/installer/scan/not-detected.nix") + hardwareModules.lenovo-thinkpad-x1-9th-gen + ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" + "ahci" + "usbhid" + ]; + boot.kernelModules = [ "kvm-intel" ]; + + boot.initrd.kernelModules = [ "dm-snapshot" ]; # TODO: This should be moved to defaults + + environment.systemPackages = with pkgs; [ + modemmanager + libmbim + ]; + + # CPU Configuration + hardware.cpu.intel.updateMicrocode = true; + services.throttled.enable = true; + powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; +} diff --git a/flake.nix b/flake.nix index 884c550..7aec25c 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,7 @@ inherit system; config.allowUnfree = true; # For vscode }; - hosts = [ "speer" "hummelberg" ]; + hosts = [ "speer" "hummelberg" "ochsenchopf" ]; in { checks.${system}.formatCheck = let pkgs = pkgsUnstable; in pkgs.runCommand "nixfmt-check" { } '' diff --git a/host/ochsenchopf/default.nix b/host/ochsenchopf/default.nix new file mode 100644 index 0000000..109d2da --- /dev/null +++ b/host/ochsenchopf/default.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: { + + imports = [ + ./filesystems.nix + ./networking.nix + + ../../defaults/hardware/thinkpad-x1-gen9.nix + + ../../defaults/base + ../../defaults/cifs-auth-fix + ../../defaults/desktop + + # TODO: threemaModules.openvpn + ]; + + virtualisation = { # TODO: This should probably be somewhere else. + docker = { + enable = true; + enableOnBoot = false; + }; + libvirtd.enable = true; + }; + + # Set your time zone. + time.timeZone = "Europe/Amsterdam"; + + # This value determines the NixOS release from which the default + # settings for stateful data, like fi:le locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "21.11"; # Did you read the comment? + +} diff --git a/host/ochsenchopf/filesystems.nix b/host/ochsenchopf/filesystems.nix new file mode 100644 index 0000000..bf7a4c0 --- /dev/null +++ b/host/ochsenchopf/filesystems.nix @@ -0,0 +1,30 @@ +{ config, pkgs, lib, ... }: { + + boot.initrd.luks.devices = { + "luks".device = "/dev/disk/by-label/luks"; + }; + + fileSystems = let rootdev = "/dev/disk/by-label/hv_ochsenchopf"; in { + "/" = { + device = rootdev; + fsType = "btrfs"; + options = [ "subvol=nixos" ]; + }; + "/home" = { + device = rootdev; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; + "/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + }; + }; + + swapDevices = [{ device = "/dev/disk/by-label/swap"; }]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + +} diff --git a/host/ochsenchopf/networking.nix b/host/ochsenchopf/networking.nix new file mode 100644 index 0000000..ee0547f --- /dev/null +++ b/host/ochsenchopf/networking.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ + networking = { + networkmanager = { + enable = true; + #enableFccUnlock = true; # TODO: Enable with nixos 22.05 + }; + useDHCP = false; + hostName = "ochsenchopf"; + }; +}