first attempt at nixos containers
This commit is contained in:
parent
dc00743a48
commit
e6c1be95ee
1 changed files with 49 additions and 25 deletions
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
|
@ -10,33 +9,58 @@
|
|||
};
|
||||
|
||||
config = lib.mkIf config.settings.containers.lidarr.enable {
|
||||
virtualisation.arion.projects.lidarr = {
|
||||
settings = {
|
||||
project.name = "lidarr";
|
||||
services.lidarr = {
|
||||
service.useHostStore = true;
|
||||
nixos.useSystemd = true;
|
||||
nixos.configuration =
|
||||
{ lib, ... }:
|
||||
{
|
||||
boot.isContainer = true;
|
||||
boot.tmp.useTmpfs = true;
|
||||
networking.useDHCP = false;
|
||||
services.nscd.enable = false;
|
||||
system.nssModules = lib.mkForce [ ];
|
||||
containers.lidarr = {
|
||||
autoStart = true;
|
||||
forwardPorts = [
|
||||
{
|
||||
containerPort = 8686;
|
||||
hostPort = 8686;
|
||||
}
|
||||
];
|
||||
|
||||
services.lidarr.enable = true;
|
||||
services.lidarr.openFirewall = true;
|
||||
services.lidarr.dataDir = "/config";
|
||||
services.lidarr.user = "root";
|
||||
};
|
||||
service.ports = [ "8686:8686" ];
|
||||
service.volumes = [
|
||||
"/config/lidarr:/config"
|
||||
"/data:/data"
|
||||
];
|
||||
bindMounts = {
|
||||
"/data" = {
|
||||
hostPath = "/data";
|
||||
};
|
||||
"/var/lib/lidarr/.config/Lidarr" = {
|
||||
hostPath = "/config/lidarr";
|
||||
};
|
||||
};
|
||||
config =
|
||||
{ ... }:
|
||||
{
|
||||
services.lidarr.enable = true;
|
||||
services.lidarr.openFirewall = true;
|
||||
};
|
||||
};
|
||||
|
||||
# virtualisation.arion.projects.lidarr = {
|
||||
# settings = {
|
||||
# project.name = "lidarr";
|
||||
# services.lidarr = {
|
||||
# service.useHostStore = true;
|
||||
# nixos.useSystemd = true;
|
||||
# nixos.configuration =
|
||||
# { lib, ... }:
|
||||
# {
|
||||
# boot.isContainer = true;
|
||||
# boot.tmp.useTmpfs = true;
|
||||
# networking.useDHCP = false;
|
||||
# services.nscd.enable = false;
|
||||
# system.nssModules = lib.mkForce [ ];
|
||||
|
||||
# services.lidarr.enable = true;
|
||||
# services.lidarr.openFirewall = true;
|
||||
# services.lidarr.dataDir = "/config";
|
||||
# services.lidarr.user = "root";
|
||||
# };
|
||||
# service.ports = [ "8686:8686" ];
|
||||
# service.volumes = [
|
||||
# "/config/lidarr:/config"
|
||||
# "/data:/data"
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue