51 lines
1013 B
Nix
51 lines
1013 B
Nix
{ 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;
|
|
services.openssh.enable = lib.mkForce false;
|
|
|
|
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";
|
|
}
|