nix/hosts/base-lxc.nix
2025-12-03 15:47:42 +01:00

40 lines
1 KiB
Nix

# Starting image for LXC containers on Proxmox
# How to generate the tarball and upload it to Proxmox:
# 1. nix build ".#nixosConfigurations.baseLXC.config.system.build.tarball"
# 2. rsync -vzh --progress ./result/tarball/nixos-system-x86_64-linux.tar.xz root@proxmox:/var/lib/vz/template/cache/nixos-system-<NIXOS-VERSION>-x86_64-lxc-template.tar.xz
{
config,
pkgs,
modulesPath,
self,
...
}:
let
sshKeys = import "${self}/ssh-keys.nix";
in
{
imports = [ (modulesPath + "/virtualisation/proxmox-lxc.nix") ];
users = {
users.root = {
hashedPassword = "$6$gir1YD6tNdC9xAj0$zLr1yt/ea9PvwygjHfQVnPmeCd1.2zrAKWiN80duidwOkZF6hwm06ta6J3O9uw6F3uUHC0N7iiKYhCgXXR.Q7/";
openssh.authorizedKeys.keys = sshKeys.provisioning-machine;
};
};
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Auto update
system.autoUpgrade.enable = true;
# Auto delete old generations
nix.gc.automatic = true;
nix.gc.options = "--delete-older-than 2d";
system.stateVersion = "25.11";
}