i15 format

This commit is contained in:
Leonardo Eugênio 2024-06-13 22:01:35 -03:00
parent b1c96cb075
commit 538a7c202e
3 changed files with 59 additions and 21 deletions

View file

@ -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"; device = "/swap/swapfile";
size = (1024 * 8) + (1024 * 2); # RAM size + 2 GB 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;
} }

View file

@ -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;

View file

@ -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,14 +44,25 @@ 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"
];
subvolumes =
let
mountOptions = btrfs_options;
in
{
"/home" = {
inherit mountOptions;
};
"/nixos" = { "/nixos" = {
inherit mountOptions; inherit mountOptions;
mountpoint = "/"; mountpoint = "/";
}; };
"/swap" = { inherit mountOptions; }; "/swap" = {
inherit mountOptions;
};
}; };
}; };
}; };