Add NixOS ZFS EC2 AMI builder
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
{ config, lib, modulesPath, pkgs, ... }:
|
||||
|
||||
let
|
||||
nixPool = "nixos-zfs-nix";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
"${modulesPath}/virtualisation/amazon-image.nix"
|
||||
];
|
||||
|
||||
networking.hostName = "nixos-zfs-ec2";
|
||||
networking.hostId = "6e69787a";
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.amazon-ssm-agent
|
||||
pkgs.git
|
||||
pkgs.zfs
|
||||
];
|
||||
|
||||
services.amazon-ssm-agent.enable = true;
|
||||
|
||||
boot.supportedFilesystems = [ "zfs" ];
|
||||
boot.zfs.extraPools = [ nixPool ];
|
||||
boot.zfs.forceImportRoot = false;
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "${nixPool}/nix";
|
||||
fsType = "zfs";
|
||||
neededForBoot = true;
|
||||
options = [
|
||||
"nofail"
|
||||
"x-systemd.device-timeout=30s"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.sockets.nix-daemon = {
|
||||
after = [ "nix.mount" ];
|
||||
requires = [ "nix.mount" ];
|
||||
};
|
||||
|
||||
systemd.services.nix-daemon = {
|
||||
after = [ "nix.mount" ];
|
||||
requires = [ "nix.mount" ];
|
||||
};
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
Reference in New Issue
Block a user