Skip to content

Instantly share code, notes, and snippets.

@ElvishJerricco
Created May 24, 2026 05:36
Show Gist options
  • Select an option

  • Save ElvishJerricco/c279bc1db9e72699a0e9a4acfd9a887c to your computer and use it in GitHub Desktop.

Select an option

Save ElvishJerricco/c279bc1db9e72699a0e9a4acfd9a887c to your computer and use it in GitHub Desktop.
{
config,
lib,
pkgs,
...
}:
{
imports = [
./hardware-configuration.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.zfs.devNodes = "/dev";
boot.kernelPackages = lib.last (
lib.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version)) (
builtins.attrValues (
lib.filterAttrs (
name: kernelPackages:
(builtins.match "linux_[0-9]+_[0-9]+" name) != null
&& (builtins.tryEval kernelPackages).success
&& (!kernelPackages.${config.boot.zfs.package.kernelModuleAttribute}.meta.broken)
) pkgs.linuxKernel.packages
)
)
);
boot.initrd.systemd.services.zfs-rollback = {
wantedBy = [ "initrd.target" ];
after = [ "zfs-import-tank.service" ];
before = [ "sysroot.mount" ];
path = [ pkgs.zfs ];
unitConfig.DefaultDependencies = false;
serviceConfig.Type = "oneshot";
script = ''
zfs rollback -r tank/local/root@blank && echo done
'';
};
networking.networkmanager.enable = true;
networking.hostId = "deadbeef";
services.displayManager.gdm.enable = true;
services.desktopManager.gnome.enable = true;
users.users.will = {
isNormalUser = true;
password = "asdf";
extraGroups = [ "wheel" ];
};
users.users.root.password = "asdf";
system.stateVersion = "26.05";
}
# 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 + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [
"ahci"
"xhci_pci"
"virtio_pci"
"sr_mod"
"virtio_blk"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "tank/local/root";
fsType = "zfs";
};
fileSystems."/nix" = {
device = "tank/local/nix";
fsType = "zfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/4095-C817";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
fileSystems."/etc/nixos" = {
device = "tank/local/nixos";
fsType = "zfs";
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment