Skip to content

Instantly share code, notes, and snippets.

@byrongibson
Created June 29, 2021 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save byrongibson/c0c27c49bc335b481d3dded86fd24d10 to your computer and use it in GitHub Desktop.
Save byrongibson/c0c27c49bc335b481d3dded86fd24d10 to your computer and use it in GitHub Desktop.
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/hardware/network/broadcom-43xx.nix")
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/#step-4-1-configure-disks
# need tmpfs permissions set to 755 or some software like openssh will complain.
# Tmpfs size can be whatever you want it to be, based on your available RAM.
# size=512M is sufficient, or 1GB or 2GB if you need more headroom.
fileSystems."/" =
{ device = "tmpfs";
fsType = "tmpfs";
options = [ "defaults" "size=2G" "mode=755" ];
};
fileSystems."/nix" =
{ device = "rpool/local/nix";
fsType = "zfs";
};
fileSystems."/opt" =
{ device = "rpool/local/opt";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "rpool/safe/home";
fsType = "zfs";
};
fileSystems."/persist" =
{ device = "rpool/safe/persist";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/9F0B-2D34";
fsType = "vfat";
};
# No swap. If you must have swap, put it on a separate non-ZFS
# partition.
# https://nixos.wiki/wiki/NixOS_on_ZFS#Caveats
swapDevices = [ ];
# Default
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
# machine-specific properties
networking.hostId = "5d20fed3";
boot.zfs.devNodes = "/dev/disk/by-id/ata-WDC_WDS100T2B0B-00YS70_1831C1800343-part2";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment