Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Created September 23, 2020 21:02
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 cleverca22/a046f82e997e2a0c72b2b00c117ab50e to your computer and use it in GitHub Desktop.
Save cleverca22/a046f82e997e2a0c72b2b00c117ab50e to your computer and use it in GitHub Desktop.
{
nixosConfigurations = pkgs.nixosConfigurations // {
# attrs of interest:
# * config.system.build.zfsImage
# * config.system.build.uploadAmi
zfs-ami = import "${nixpkgs}/nixos" {
configuration = { pkgs, lib, ... }:
{
imports = [
ops-lib.nixosModules.make-zfs-image
ops-lib.nixosModules.zfs-runtime
"${nixpkgs}/nixos/modules/profiles/headless.nix"
"${nixpkgs}/nixos/modules/virtualisation/ec2-data.nix"
];
nix.package = self.packages.x86_64-linux.nixFlakes;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
systemd.services.amazon-shell-init.path = [ pkgs.sops ];
nixpkgs.config.allowUnfreePredicate = x: builtins.elem (lib.getName x) [
"ec2-ami-tools"
"ec2-api-tools"
];
zfs.regions = [
"eu-west-1"
"ap-northeast-1"
"ap-northeast-2"
"eu-central-1"
"us-east-2"
];
};
system = "x86_64-linux";
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment