Skip to content

Commit

Permalink
laptop: add disko configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
brckd committed Dec 25, 2024
1 parent 1f5abbf commit cbdb59f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 25 deletions.
2 changes: 1 addition & 1 deletion configs/nixos/laptop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
...
}:
with lib; {
imports = [./hardware.nix];
imports = [./hardware.nix ./disko];

# System
networking.hostName = "laptop";
Expand Down
45 changes: 45 additions & 0 deletions configs/nixos/laptop/disko.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["umask=0077"];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
content = {
type = "btrfs";
subvolumes = {
"/" = {
mountpoint = "/";
mountOptions = ["compress=zstd" "noatime"];
};
"/home" = {
mountpoint = "/home";
mountOptions = ["compress=zstd" "noatime"];
};
};
};
};
};
};
};
};
};
};
}
26 changes: 2 additions & 24 deletions configs/nixos/laptop/hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,10 @@
];

boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "uas" "sd_mod" "sdhci_acpi" "rtsx_usb_sdmmc"];
boot.initrd.kernelModules = ["dm-snapshot"];
boot.kernelModules = ["kvm-intel" "cryptd"];
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/LUKS";
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];

fileSystems."/" = {
device = "/dev/disk/by-label/NIXOS";
fsType = "ext4";
};

fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
options = ["fmask=0077" "dmask=0077"];
};

fileSystems."/home" = {
device = "/dev/disk/by-label/HOME";
fsType = "ext4";
};

swapDevices = [
{device = "/dev/disk/by-label/SWAP";}
];

# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
Expand All @@ -46,6 +25,5 @@
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.enableAllFirmware = true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

0 comments on commit cbdb59f

Please sign in to comment.