New modules for container managment
This commit is contained in:
parent
0a48b3d817
commit
93e9d585cb
7 changed files with 121 additions and 2 deletions
27
modules/virtualisation/lxc-guest.nix
Normal file
27
modules/virtualisation/lxc-guest.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.lxcGuest;
|
||||
in
|
||||
{
|
||||
options.lxcGuest = {
|
||||
enable = lib.mkEnableOption "NixOs inside LXC container";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# start tty0 on serial console
|
||||
systemd.services."getty@tty1" = {
|
||||
enable = lib.mkForce true;
|
||||
wantedBy = [ "getty.target" ]; # to start at boot
|
||||
serviceConfig.Restart = "always"; # restart when session is closed
|
||||
};
|
||||
|
||||
# Supress systemd units that don't work because of LXC.
|
||||
# https://blog.xirion.net/posts/nixos-proxmox-lxc/#configurationnix-tweak
|
||||
systemd.suppressedSystemUnits = [
|
||||
"dev-mqueue.mount"
|
||||
"sys-kernel-debug.mount"
|
||||
"sys-fs-fuse-connections.mount"
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue