New module for standard LXC containers
This commit is contained in:
parent
3336068ab9
commit
ab86d3e6a2
2 changed files with 30 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./commons.nix
|
./commons.nix
|
||||||
./helper-functions.nix
|
./helper-functions.nix
|
||||||
|
./lxc-standard.nix
|
||||||
./server-node-users.nix
|
./server-node-users.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
29
modules/utils/lxc-standard.nix
Normal file
29
modules/utils/lxc-standard.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.utils.lxc-standard;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.utils.lxc-standard = {
|
||||||
|
enable = lib.mkEnableOption "Enable if the host is a service LXC container";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
# Enable SSH
|
||||||
|
services = {
|
||||||
|
openssh.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Monitor node with node_exporter
|
||||||
|
services.prometheus.exporters = {
|
||||||
|
node = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
enabledCollectors = [ "systemd" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.nameservers = [ "192.168.1.2" ];
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue