2026-03-15 15:53:14 +11:00
|
|
|
{
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
|
};
|
|
|
|
|
outputs = { nixpkgs, ... }: {
|
|
|
|
|
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
|
|
|
|
|
modules = [ ./configuration.nix ];
|
|
|
|
|
};
|
2026-03-15 19:32:34 +11:00
|
|
|
nixosModule = { ... }:
|
|
|
|
|
let
|
|
|
|
|
name = "amethyst";
|
|
|
|
|
subnet = "1";
|
|
|
|
|
in {
|
2026-03-15 15:53:14 +11:00
|
|
|
networking.nat = {
|
|
|
|
|
enable = true;
|
|
|
|
|
enableIPv6 = true;
|
|
|
|
|
internalInterfaces = [ "ve-+" ];
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-15 19:32:34 +11:00
|
|
|
systemd.tmpfiles.rules = [ "d /persist/containers/${name} 755 root users" ];
|
|
|
|
|
containers.${name} = {
|
2026-03-15 15:53:14 +11:00
|
|
|
autoStart = true;
|
|
|
|
|
privateNetwork = true;
|
2026-03-15 19:32:34 +11:00
|
|
|
hostAddress = "10.30.${subnet}.1";
|
|
|
|
|
localAddress = "10.30.${subnet}.2";
|
|
|
|
|
hostAddress6 = "fd0d:1::${subnet}:1";
|
|
|
|
|
localAddress6 = "fd0d:1::${subnet}:2";
|
2026-03-15 15:53:14 +11:00
|
|
|
# privateUsers = "pick";
|
|
|
|
|
nixpkgs = nixpkgs;
|
|
|
|
|
ephemeral = true;
|
|
|
|
|
config = { imports = [ ./configuration.nix ]; };
|
|
|
|
|
|
|
|
|
|
bindMounts."persist" = {
|
2026-03-15 19:32:34 +11:00
|
|
|
hostPath = "/persist/containers/${name}";
|
2026-03-15 15:53:14 +11:00
|
|
|
mountPoint = "/persist";
|
|
|
|
|
isReadOnly = false;
|
|
|
|
|
};
|
|
|
|
|
# flake = "path:" + ./.;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|