diff --git a/options/custom/containers/miniflux.nix b/options/custom/containers/miniflux.nix new file mode 100644 index 0000000..a2de3d2 --- /dev/null +++ b/options/custom/containers/miniflux.nix @@ -0,0 +1,49 @@ +{ + config, + inputs, + lib, + ... +}: +with lib; let + cfg = config.custom.containers.miniflux; +in { + options.custom.containers.miniflux = { + enable = mkOption {default = false;}; + }; + + config = mkIf cfg.enable { + age.secrets = let + secret = filename: { + file = "${inputs.self}/secrets/${filename}"; + }; + in { + "${config.custom.profile}/miniflux/.env" = secret "${config.custom.profile}/miniflux/.env"; + "${config.custom.profile}/miniflux/db.env" = secret "${config.custom.profile}/miniflux/db.env"; + }; + + #?? arion-miniflux pull + environment.shellAliases.arion-miniflux = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.miniflux.settings.out.dockerComposeYaml}"; + + virtualisation.arion.projects.miniflux.settings.services = { + # https://github.com/miniflux/v2 + # https://miniflux.app/docs/docker.html + miniflux.service = { + container_name = "miniflux"; + depends_on = ["db"]; + env_file = [config.age.secrets."${config.custom.profile}/miniflux/.env".path]; + image = "miniflux/miniflux:2.2.6"; + ports = ["127.0.0.1:8808:8080"]; + restart = "unless-stopped"; + volumes = ["${config.custom.containers.directory}/miniflux/data:/data"]; + }; + + db.service = { + container_name = "miniflux-db"; + env_file = [config.age.secrets."${config.custom.profile}/miniflux/db.env".path]; + image = "postgres:17"; + restart = "unless-stopped"; + volumes = ["${config.custom.containers.directory}/miniflux/db:/var/lib/postgresql/data"]; + }; + }; + }; +} diff --git a/secrets/desktop/miniflux/.env b/secrets/desktop/miniflux/.env new file mode 100644 index 0000000..ccfe8d7 Binary files /dev/null and b/secrets/desktop/miniflux/.env differ diff --git a/secrets/desktop/miniflux/db.env b/secrets/desktop/miniflux/db.env new file mode 100644 index 0000000..03ff1d8 --- /dev/null +++ b/secrets/desktop/miniflux/db.env @@ -0,0 +1,12 @@ +age-encryption.org/v1 +-> ssh-ed25519 8E6j8Q KG3tGfbba0HZYcC6HKhtuSblrNom4c9xjsgybBUwnXQ +eXSJssy/jilOozZiMDZGgF8WdrPVoAqFYDpz2MOwtoo +-> ssh-ed25519 sfxzoQ 3gtQpxCy2zjcdal1NQb8sHTbJd1uk4ZJKpnBTq329wE +YDrgCqhSEsLJYjYls2vH/FvxGV6vOJYhvobYfCIwRLY +-> ssh-ed25519 g5GcDQ N5vf0tseMkshp5fCw5UAMcR6IXrmCMrKAR/oSQcw+Dk +p1z4wJZsDXrcLftHoK2QN50+nXvJq5Jfh/yyu2uV++o +-> ssh-ed25519 T/dATA 24gYylwgdWdhQbSRUmp0vVACFH/FZuMyPDWNuitLxhs +A1ptnWpFnmxSdcZ0jCW/cDPj07cJa3U6bwPriHHXqxM +--- pOX2mj5Txlc1XwsJMqx9on0BlUgNqZaGa8DBzt6wzZU +�������, +"iʖՃ�8h��.��_�ړ��t�����P#:��>;�`&VB��pԛIq�Cyn�I���}9����8�1p������ķ��I8�-.�G�Л�����f \ No newline at end of file diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 4d384a3..9e1aafd 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -77,6 +77,8 @@ in { "server/mastodon/.env".publicKeys = server; "server/mastodon/db.env".publicKeys = server; "server/matrix-conduit/conduwuit.toml".publicKeys = server; + "server/miniflux/.env".publicKeys = server; + "server/miniflux/db.env".publicKeys = server; "server/netbox/.env".publicKeys = server; "server/netbox/cache.env".publicKeys = server; "server/netbox/db.env".publicKeys = server;