diff --git a/flake.nix b/flake.nix index c88e038..5b1fb8e 100644 --- a/flake.nix +++ b/flake.nix @@ -9,9 +9,10 @@ url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; lazyvim-nixvim.url = "github:azuwis/lazyvim-nixvim"; }; - outputs = inputs@{ self, nixpkgs, home-manager, disko, lazyvim-nixvim, ... }: { + outputs = inputs@{ self, nixpkgs, home-manager, disko, lazyvim-nixvim, nixos-hardware,... }: { nixosConfigurations = import ./hosts { inherit inputs; }; }; } diff --git a/hosts/default.nix b/hosts/default.nix index 4b6be80..5cea98d 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -99,4 +99,13 @@ in ./nix-desktop.nix ]; }; + + nix-surface1 = mkHost { + hostName = "nix-surface1"; + system = "x86_64-linux"; + extraModules = [ + ./nix-surface.nix + inputs.nixos-hardware.nixosModules.microsoft-surface-go + ]; + }; } diff --git a/hosts/nix-surface.nix b/hosts/nix-surface.nix new file mode 100644 index 0000000..ecf4227 --- /dev/null +++ b/hosts/nix-surface.nix @@ -0,0 +1,23 @@ +{ config, lib, 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 = [ ]; + boot.kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "udev.log_priority=3" + "rd.systemd.show_status=auto" + ]; + + disko.devices.disk.main.content.partitions.swap.size = "16G"; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}