2024-05-18 14:54:30 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-09-20 18:38:53 +02:00
|
|
|
let
|
|
|
|
latestZfsCompatibleLinuxPackages = lib.pipe pkgs.linuxKernel.packages [
|
|
|
|
builtins.attrValues
|
|
|
|
(builtins.filter (kPkgs: (builtins.tryEval kPkgs).success && kPkgs ? kernel && kPkgs.kernel.pname == "linux" && !kPkgs.zfs.meta.broken))
|
|
|
|
(builtins.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version)))
|
|
|
|
lib.last
|
|
|
|
];
|
|
|
|
in
|
2024-05-18 14:54:30 +02:00
|
|
|
{
|
2024-04-16 12:23:50 +02:00
|
|
|
# more descriptive hostname than just "nixos"
|
|
|
|
networking.hostName = lib.mkDefault "nixos-installer";
|
|
|
|
|
2023-05-15 14:54:05 +02:00
|
|
|
# We are stateless, so just default to latest.
|
|
|
|
system.stateVersion = config.system.nixos.version;
|
|
|
|
|
2024-08-16 11:13:08 +02:00
|
|
|
# Enable bcachefs support
|
|
|
|
boot.supportedFilesystems.bcachefs = lib.mkDefault true;
|
|
|
|
|
2023-05-15 14:54:05 +02:00
|
|
|
# use latest kernel we can support to get more hardware support
|
2024-08-16 10:34:39 +02:00
|
|
|
boot.zfs.package = pkgs.zfsUnstable;
|
2024-09-20 18:38:53 +02:00
|
|
|
boot.kernelPackages = latestZfsCompatibleLinuxPackages;
|
2023-05-15 14:54:05 +02:00
|
|
|
|
|
|
|
documentation.enable = false;
|
2024-05-19 17:08:41 +02:00
|
|
|
documentation.man.man-db.enable = false;
|
2023-05-15 14:54:05 +02:00
|
|
|
|
2024-07-21 16:20:42 +02:00
|
|
|
# make it easier to debug boot failures
|
|
|
|
boot.initrd.systemd.emergencyAccess = true;
|
|
|
|
|
2024-01-15 17:03:47 +01:00
|
|
|
environment.systemPackages = [
|
2024-05-26 09:50:14 +02:00
|
|
|
pkgs.nixos-install-tools
|
2024-01-15 17:03:47 +01:00
|
|
|
# for zapping of disko
|
|
|
|
pkgs.jq
|
|
|
|
# for copying extra files of nixos-anywhere
|
|
|
|
pkgs.rsync
|
2024-09-18 16:31:09 +02:00
|
|
|
# alternative to nixos-generate-config
|
|
|
|
] ++ lib.optional (pkgs.lib.versionAtLeast lib.version "24.11") pkgs.nixos-facter;
|
2023-05-15 14:54:05 +02:00
|
|
|
|
2023-11-19 13:23:42 +01:00
|
|
|
imports = [
|
|
|
|
./nix-settings.nix
|
|
|
|
];
|
|
|
|
|
2023-12-10 11:57:48 +01:00
|
|
|
# Don't add nixpkgs to the image to save space, for our intended use case we don't need it
|
|
|
|
system.installer.channel.enable = false;
|
2023-05-15 14:54:05 +02:00
|
|
|
}
|