fwminex: +immich

This commit is contained in:
Motiejus Jakštys 2024-09-27 15:03:43 +03:00
parent 717849367a
commit f5a0bab032
6 changed files with 63 additions and 5 deletions

View File

@ -23,6 +23,7 @@ rec {
ports = { ports = {
grafana = 3000; grafana = 3000;
gitea = 3001; gitea = 3001;
immich = 3003;
soju = 6697; soju = 6697;
soju-ws = 6698; soju-ws = 6698;

View File

@ -202,16 +202,16 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1727122398, "lastModified": 1727335715,
"narHash": "sha256-o8VBeCWHBxGd4kVMceIayf5GApqTavJbTa44Xcg5Rrk=", "narHash": "sha256-1uw3y94dA4l22LkqHRIsb7qr3rV5XdxQFqctINfx8Cc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "30439d93eb8b19861ccbe3e581abf97bdc91b093", "rev": "28b5b8af91ffd2623e995e20aee56510db49001a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-unstable", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@ -3,7 +3,7 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "github:nix-community/flake-compat"; flake-compat.url = "github:nix-community/flake-compat";
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";

View File

@ -441,6 +441,14 @@ in
extraSubnets = [ myData.subnets.vno1.cidr ]; extraSubnets = [ myData.subnets.vno1.cidr ];
}; };
immich = {
enable = true;
paths = {
"M-Camera" = "/home/motiejus/annex2/M-Active";
"Pictures" = "/home/motiejus/annex2/Pictures";
};
};
ssh8022.server = { ssh8022.server = {
enable = true; enable = true;
keyfile = config.age.secrets.ssh8022-server.path; keyfile = config.age.secrets.ssh8022-server.path;

View File

@ -10,6 +10,7 @@
./grafana ./grafana
./hass ./hass
./headscale ./headscale
./immich
./jakstpub ./jakstpub
./matrix-synapse ./matrix-synapse
./minidlna ./minidlna

View File

@ -0,0 +1,48 @@
{
config,
lib,
pkgs,
myData,
nixpkgs-unstable,
...
}:
let
cfg = config.mj.services.immich;
in
{
options.mj.services.immich = with lib.types; {
enable = lib.mkEnableOption "enable immich";
paths = lib.mkOption { type = attrsOf str; };
};
imports = [ "${nixpkgs-unstable}/nixos/modules/services/web-apps/immich.nix" ];
config = lib.mkIf cfg.enable {
services.immich = {
enable = true;
port = myData.ports.immich;
package = pkgs.pkgs-unstable.immich;
mediaLocation = "/var/cache/immich/userdata";
};
mj.services.friendlyport.ports = [
{
subnets = [ myData.subnets.tailscale.cidr ];
tcp = [ myData.ports.immich ];
}
];
systemd = {
tmpfiles.rules = [ "d /var/cache/immich/userdata 0700 immich immich -" ];
services.immich.serviceConfig = {
ProtectHome = lib.mkForce "tmpfs";
CacheDirectory = "immich";
BindPaths = lib.mapAttrsToList (
name: srcpath: "${srcpath}:/var/cache/immich/userdata/${name}"
) cfg.paths;
};
};
};
}