i15 format
This commit is contained in:
		
							parent
							
								
									386fb53ba8
								
							
						
					
					
						commit
						262255432f
					
				
					 3 changed files with 59 additions and 21 deletions
				
			
		| 
						 | 
					@ -1,10 +1,22 @@
 | 
				
			||||||
{ config, lib, pkgs, modulesPath, ... }: {
 | 
					{
 | 
				
			||||||
 | 
					  config,
 | 
				
			||||||
 | 
					  lib,
 | 
				
			||||||
 | 
					  pkgs,
 | 
				
			||||||
 | 
					  modulesPath,
 | 
				
			||||||
 | 
					  ...
 | 
				
			||||||
 | 
					}:
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
  networking.hostName = "i15"; # Define your hostname.
 | 
					  networking.hostName = "i15"; # Define your hostname.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
 | 
					  imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  boot.initrd.availableKernelModules =
 | 
					  boot.initrd.availableKernelModules = [
 | 
				
			||||||
    [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ];
 | 
					    "xhci_pci"
 | 
				
			||||||
 | 
					    "ahci"
 | 
				
			||||||
 | 
					    "usb_storage"
 | 
				
			||||||
 | 
					    "sd_mod"
 | 
				
			||||||
 | 
					    "rtsx_usb_sdmmc"
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
  boot.initrd.kernelModules = [ ];
 | 
					  boot.initrd.kernelModules = [ ];
 | 
				
			||||||
  boot.kernelModules = [ "kvm-intel" ];
 | 
					  boot.kernelModules = [ "kvm-intel" ];
 | 
				
			||||||
  boot.extraModulePackages = [ ];
 | 
					  boot.extraModulePackages = [ ];
 | 
				
			||||||
| 
						 | 
					@ -12,14 +24,15 @@
 | 
				
			||||||
  disko.devices = (import ./partitions.nix { disks = [ "/dev/sda" ]; });
 | 
					  disko.devices = (import ./partitions.nix { disks = [ "/dev/sda" ]; });
 | 
				
			||||||
  boot.loader.efi.efiSysMountPoint = "/boot/efi";
 | 
					  boot.loader.efi.efiSysMountPoint = "/boot/efi";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  swapDevices = [{
 | 
					  swapDevices = [
 | 
				
			||||||
    device = "/swap/swapfile";
 | 
					    {
 | 
				
			||||||
    size = (1024 * 8) + (1024 * 2); # RAM size + 2 GB
 | 
					      device = "/swap/swapfile";
 | 
				
			||||||
  }];
 | 
					      size = (1024 * 8) + (1024 * 2); # RAM size + 2 GB
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  networking.useDHCP = lib.mkDefault true;
 | 
					  networking.useDHCP = lib.mkDefault true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
 | 
					  powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
 | 
				
			||||||
  hardware.cpu.intel.updateMicrocode =
 | 
					  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
 | 
				
			||||||
    lib.mkDefault config.hardware.enableRedistributableFirmware;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,9 @@
 | 
				
			||||||
{ config, lib, pkgs, ... }:
 | 
					{
 | 
				
			||||||
 | 
					  config,
 | 
				
			||||||
 | 
					  lib,
 | 
				
			||||||
 | 
					  pkgs,
 | 
				
			||||||
 | 
					  ...
 | 
				
			||||||
 | 
					}:
 | 
				
			||||||
pkgs.makeDiskoTest {
 | 
					pkgs.makeDiskoTest {
 | 
				
			||||||
  name = "test-disko-i15";
 | 
					  name = "test-disko-i15";
 | 
				
			||||||
  disko-config = ./partitions.nix;
 | 
					  disko-config = ./partitions.nix;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,12 @@
 | 
				
			||||||
{ disks ? [ "/dev/sda" ], ... }:
 | 
					{
 | 
				
			||||||
 | 
					  disks ? [ "/dev/sda" ],
 | 
				
			||||||
 | 
					  ...
 | 
				
			||||||
 | 
					}:
 | 
				
			||||||
let
 | 
					let
 | 
				
			||||||
  btrfs_options = [ "compress=zstd:3" "noatime" ];
 | 
					  btrfs_options = [
 | 
				
			||||||
 | 
					    "compress=zstd:3"
 | 
				
			||||||
 | 
					    "noatime"
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
in
 | 
					in
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  disk.sda = {
 | 
					  disk.sda = {
 | 
				
			||||||
| 
						 | 
					@ -18,7 +24,10 @@ in
 | 
				
			||||||
          bootable = true;
 | 
					          bootable = true;
 | 
				
			||||||
          content = {
 | 
					          content = {
 | 
				
			||||||
            type = "filesystem";
 | 
					            type = "filesystem";
 | 
				
			||||||
            extraArgs = [ "-n" "BOOT_I15" ];
 | 
					            extraArgs = [
 | 
				
			||||||
 | 
					              "-n"
 | 
				
			||||||
 | 
					              "BOOT_I15"
 | 
				
			||||||
 | 
					            ];
 | 
				
			||||||
            format = "vfat";
 | 
					            format = "vfat";
 | 
				
			||||||
            mountpoint = "/boot";
 | 
					            mountpoint = "/boot";
 | 
				
			||||||
            # options = [ "defaults" ];
 | 
					            # options = [ "defaults" ];
 | 
				
			||||||
| 
						 | 
					@ -35,15 +44,26 @@ in
 | 
				
			||||||
            keyFile = "/tmp/secret.key";
 | 
					            keyFile = "/tmp/secret.key";
 | 
				
			||||||
            content = {
 | 
					            content = {
 | 
				
			||||||
              type = "btrfs";
 | 
					              type = "btrfs";
 | 
				
			||||||
              extraArgs = [ "--label" "ROOT_I15" ];
 | 
					              extraArgs = [
 | 
				
			||||||
              subvolumes = let mountOptions = btrfs_options; in {
 | 
					                "--label"
 | 
				
			||||||
                "/home" = { inherit mountOptions; };
 | 
					                "ROOT_I15"
 | 
				
			||||||
                "/nixos" = {
 | 
					              ];
 | 
				
			||||||
                  inherit mountOptions;
 | 
					              subvolumes =
 | 
				
			||||||
                  mountpoint = "/";
 | 
					                let
 | 
				
			||||||
 | 
					                  mountOptions = btrfs_options;
 | 
				
			||||||
 | 
					                in
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                  "/home" = {
 | 
				
			||||||
 | 
					                    inherit mountOptions;
 | 
				
			||||||
 | 
					                  };
 | 
				
			||||||
 | 
					                  "/nixos" = {
 | 
				
			||||||
 | 
					                    inherit mountOptions;
 | 
				
			||||||
 | 
					                    mountpoint = "/";
 | 
				
			||||||
 | 
					                  };
 | 
				
			||||||
 | 
					                  "/swap" = {
 | 
				
			||||||
 | 
					                    inherit mountOptions;
 | 
				
			||||||
 | 
					                  };
 | 
				
			||||||
                };
 | 
					                };
 | 
				
			||||||
                "/swap" = { inherit mountOptions; };
 | 
					 | 
				
			||||||
              };
 | 
					 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
          };
 | 
					          };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue