2022-11-04 14:25:13 +01:00
|
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
|
|
|
|
2023-05-07 18:49:07 +02:00
|
|
|
|
{ config, pkgs, ... }:
|
2022-11-04 14:25:13 +01:00
|
|
|
|
let
|
|
|
|
|
datadir = "/var/lib/pmm/config";
|
2023-05-07 18:49:07 +02:00
|
|
|
|
container = config.virtualisation.oci-containers.containers.plex-meta-manager.image;
|
2022-11-04 14:25:13 +01:00
|
|
|
|
run_pmm = pkgs.writeScriptBin "pmm-run" ''
|
2023-05-07 19:54:14 +02:00
|
|
|
|
sudo ${pkgs.podman}/bin/podman run -d --rm -it \
|
2022-11-04 14:25:13 +01:00
|
|
|
|
-v "/var/lib/pmm/config:/config:rw" \
|
|
|
|
|
-v "/etc/pmm/Anime.yml:/config/Anime.yml:ro" \
|
|
|
|
|
-v "/etc/pmm/Movies.yml:/config/Movies.yml:ro" \
|
|
|
|
|
-v "/etc/pmm/TVShows.yml:/config/TVShows.yml:ro" \
|
|
|
|
|
${container} --run
|
|
|
|
|
'';
|
2023-09-25 11:56:02 +02:00
|
|
|
|
in
|
|
|
|
|
{
|
2022-11-04 14:25:13 +01:00
|
|
|
|
imports = [ ];
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "22.11"; # Did you read the comment?
|
|
|
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ ];
|
|
|
|
|
|
|
|
|
|
environment.etc.pmm.source = ./config;
|
|
|
|
|
|
|
|
|
|
environment.systemPackages = [ run_pmm ];
|
|
|
|
|
|
|
|
|
|
virtualisation.podman.enable = true;
|
|
|
|
|
virtualisation.oci-containers = {
|
|
|
|
|
backend = "podman";
|
|
|
|
|
containers = {
|
|
|
|
|
plex-meta-manager = {
|
2023-09-20 16:00:29 +02:00
|
|
|
|
image = "meisnate12/plex-meta-manager:v1.19.1";
|
2022-11-04 14:25:13 +01:00
|
|
|
|
volumes = [
|
|
|
|
|
"${datadir}:/config:rw"
|
|
|
|
|
"/etc/pmm/Anime.yml:/config/Anime.yml:ro"
|
|
|
|
|
"/etc/pmm/Movies.yml:/config/Movies.yml:ro"
|
|
|
|
|
"/etc/pmm/TVShows.yml:/config/TVShows.yml:ro"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|