nix/nixos/containers/default.nix
2024-03-26 11:35:38 +09:00

29 lines
875 B
Nix

{ stateVersion, hostname, username, ... }: {
imports = [
./${hostname}
../users/${username}
../common/modules/nixos.nix
../common/modules/networking.nix
# Services
../common/services/promtail.nix
../common/services/telegraf.nix
../common/services/tailscale.nix
../common/services/openssh.nix
];
# Generic Tailscale configs are in /nixos/common/services/tailscale.nix
# Set up the secrets file:
sops.secrets."tailscale_key" = {
owner = "root";
sopsFile = ../../secrets/containers/${hostname}.yaml;
restartUnits = [
"tailscaled.service"
"tailscaled-autoconnect.service"
];
};
boot.isContainer = true;
services.tailscale.authKeyFile = "/run/secrets/tailscale_key";
networking.hostName = "${hostname}";
# networking.interfaces."eth0".useDHCP = true;
system.stateVersion = stateVersion;
}