server: add linode profile init

This commit is contained in:
ooks-io 2024-10-29 16:44:09 +11:00
parent db7b83037f
commit 3c0188a701
10 changed files with 170 additions and 22 deletions

View file

@ -0,0 +1,23 @@
{
pkgs,
lib,
inputs,
config,
...
}: let
make-disk-image = import "${inputs.nixpkgs}/nixos/lib/make-disk-image.nix";
in {
system.build.image = make-disk-image {
inherit lib pkgs config;
partitionTableType = "none";
name = "linode-image";
format = "raw";
# Linode requires the image to be gzip'd
# unzipped image cannot exceed 6gb
postVM = ''
${pkgs.gzip}/bin/gzip -6 -c -- $diskImage > \
$out/nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.img.gz
rm $diskImage
'';
};
}