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.
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"usb_storage"
"sd_mod"
"rtsx_usb_sdmmc"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
@ -12,14 +24,15 @@
disko.devices = (import ./partitions.nix { disks = [ "/dev/sda" ]; });
boot.loader.efi.efiSysMountPoint = "/boot/efi";
swapDevices = [{
device = "/swap/swapfile";
size = (1024 * 8) + (1024 * 2); # RAM size + 2 GB
}];
swapDevices = [
{
device = "/swap/swapfile";
size = (1024 * 8) + (1024 * 2); # RAM size + 2 GB
}
];
networking.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
pkgs.makeDiskoTest {
name = "test-disko-i15";
disko-config = ./partitions.nix;

View file

@ -1,6 +1,12 @@
{ disks ? [ "/dev/sda" ], ... }:
{
disks ? [ "/dev/sda" ],
...
}:
let
btrfs_options = [ "compress=zstd:3" "noatime" ];
btrfs_options = [
"compress=zstd:3"
"noatime"
];
in
{
disk.sda = {
@ -18,7 +24,10 @@ in
bootable = true;
content = {
type = "filesystem";
extraArgs = [ "-n" "BOOT_I15" ];
extraArgs = [
"-n"
"BOOT_I15"
];
format = "vfat";
mountpoint = "/boot";
# options = [ "defaults" ];
@ -35,15 +44,26 @@ in
keyFile = "/tmp/secret.key";
content = {
type = "btrfs";
extraArgs = [ "--label" "ROOT_I15" ];
subvolumes = let mountOptions = btrfs_options; in {
"/home" = { inherit mountOptions; };
"/nixos" = {
inherit mountOptions;
mountpoint = "/";
extraArgs = [
"--label"
"ROOT_I15"
];
subvolumes =
let
mountOptions = btrfs_options;
in
{
"/home" = {
inherit mountOptions;
};
"/nixos" = {
inherit mountOptions;
mountpoint = "/";
};
"/swap" = {
inherit mountOptions;
};
};
"/swap" = { inherit mountOptions; };
};
};
};
}