This repository has been archived on 2024-11-08. You can view files and clone it, but cannot push or open issues or pull requests.
MiniNix/configuration.nix
2024-07-07 02:08:59 -05:00

57 lines
1.3 KiB
Nix

# This is a small config that can be used to bootstrap a system with ZFS.
{ config, lib, modulesPath, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
# Generate a hostId for ZFS
# head -c4 /dev/urandom | od -A none -t x4
networking.hostId = "f35c6293";
networking.hostName = "MiniNix";
boot = {
initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
initrd.kernelModules = [ ];
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
loader = {
grub = {
enable = true;
zfsSupport = true;
device = "nodev";
mirroredBoots = [
{ devices = [ "nodev" ]; path = "/boot"; }
];
};
efi = {
canTouchEfiVariables = true;
};
};
};
fileSystems."/" = {
device = "zroot/root";
fsType = "zfs";
};
fileSystems."/nix" = {
device = "zroot/nix";
fsType = "zfs";
};
fileSystems."/var" = {
device = "zroot/var";
fsType = "zfs";
};
fileSystems."/home" = {
device = "zroot/home";
fsType = "zfs";
};
swapDevices = [ ];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
system.stateVersion = "24.05";
}