ostype => {
optional => 1,
type => 'string',
- enum => [qw(debian devuan ubuntu centos fedora opensuse archlinux alpine gentoo unmanaged)],
+ enum => [qw(debian devuan ubuntu centos fedora opensuse archlinux alpine gentoo nixos unmanaged)],
description => "OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used to skip and OS specific setup.",
},
console => {
use PVE::LXC::Setup::Gentoo;
use PVE::LXC::Setup::SUSE;
use PVE::LXC::Setup::Ubuntu;
+use PVE::LXC::Setup::NixOS;
use PVE::LXC::Setup::Unmanaged;
my $plugins = {
gentoo => 'PVE::LXC::Setup::Gentoo',
opensuse => 'PVE::LXC::Setup::SUSE',
ubuntu => 'PVE::LXC::Setup::Ubuntu',
+ nixos => 'PVE::LXC::Setup::NixOS',
unmanaged => 'PVE::LXC::Setup::Unmanaged',
};
return "alpine";
} elsif (-f "$rootdir/etc/gentoo-release") {
return "gentoo";
+ } elsif (-d "$rootdir/nix/store") {
+ return "nixos";
} elsif (-f "$rootdir/etc/os-release") {
die "unable to detect OS distribution\n";
} else {
Gentoo.pm \
SUSE.pm \
Ubuntu.pm \
+ NixOS.pm \
Unmanaged.pm \
.PHONY: install
--- /dev/null
+package PVE::LXC::Setup::NixOS;
+
+use strict;
+use warnings;
+
+use File::Path 'make_path';
+
+use PVE::LXC::Setup::Base;
+
+use base qw(PVE::LXC::Setup::Base);
+
+sub new {
+ my ($class, $conf, $rootdir) = @_;
+
+ my $self = { conf => $conf, rootdir => $rootdir, version => 0 };
+
+ $conf->{ostype} = "nixos";
+
+ return bless $self, $class;
+}
+
+sub template_fixup {
+ my ($self, $conf) = @_;
+}
+
+sub setup_network {
+ my ($self, $conf) = @_;
+
+ $self->setup_systemd_networkd($conf);
+}
+
+sub set_hostname {
+ my ($self, $conf) = @_;
+}
+
+sub set_timezone {
+ my ($self, $conf) = @_;
+}
+
+sub setup_init {
+ my ($self, $conf) = @_;
+}
+
+1;