web01: Use pict-rs 0.4.0
This allows separation of images & database which is something we want because we use the Hetzner Storage Box for images but local disk for the state db.
This commit is contained in:
parent
3587114d85
commit
28e9521199
3 changed files with 81 additions and 1 deletions
56
flake.lock
generated
56
flake.lock
generated
|
@ -40,6 +40,24 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1687171271,
|
||||
"narHash": "sha256-BJlq+ozK2B1sJDQXS3tzJM5a+oVZmi1q0FlBK/Xqv7M=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "abfb11bd1aec8ced1c9bb9adfe68018230f4fb3c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hercules-ci-effects": {
|
||||
"inputs": {
|
||||
"flake-parts": [
|
||||
|
@ -169,6 +187,28 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pict-rs": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1688870061,
|
||||
"narHash": "sha256-1WNd7Ei21g01S5ko6y+uyhHP+xlGtnrwU8MLMxnW3P8=",
|
||||
"ref": "refs/tags/v0.4.0",
|
||||
"rev": "fa74e3c82d942f7732087c86bc509aeb9216f487",
|
||||
"revCount": 705,
|
||||
"type": "git",
|
||||
"url": "https://git.asonix.dog/asonix/pict-rs.git"
|
||||
},
|
||||
"original": {
|
||||
"ref": "refs/tags/v0.4.0",
|
||||
"type": "git",
|
||||
"url": "https://git.asonix.dog/asonix/pict-rs.git"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"disko": "disko",
|
||||
|
@ -179,6 +219,7 @@
|
|||
"nixpkgs-update": "nixpkgs-update",
|
||||
"nixpkgs-update-github-releases": "nixpkgs-update-github-releases",
|
||||
"nur-update": "nur-update",
|
||||
"pict-rs": "pict-rs",
|
||||
"sops-nix": "sops-nix",
|
||||
"srvos": "srvos",
|
||||
"tf-pkgs": "tf-pkgs",
|
||||
|
@ -226,6 +267,21 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tf-pkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1685899275,
|
||||
|
|
|
@ -42,6 +42,13 @@
|
|||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
# Pict-rs is the image hosting server for Lemmy.
|
||||
# 0.4 comes with a separation of database and file storage which we require but isn't
|
||||
# in a stable release yet.
|
||||
# After pict-rs 0.4 is in nixpkgs we can remove this input.
|
||||
pict-rs.url = "git+https://git.asonix.dog/asonix/pict-rs.git?ref=refs/tags/v0.4.0";
|
||||
pict-rs.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
tf-pkgs.url = "github:NixOS/nixpkgs/3f697e808b31a955462bc0b20b229d4072c99aa7";
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_:
|
||||
{ inputs, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
domain = "lemmy.nix-community.org";
|
||||
|
@ -25,6 +25,23 @@ in
|
|||
dataDir = "/mnt/lemmy-pict-rs";
|
||||
};
|
||||
|
||||
# In the transition from 0.3.3 to 0.4 pict-rs breaks it's previous
|
||||
# conflation of data storage and statate storage.
|
||||
# 0.4 is still not released but we need this separation already.
|
||||
# This renames the env vars set by the NixOS module.
|
||||
#
|
||||
# Migrate to using upstream NixOS definitions when 0.4 is released.
|
||||
systemd.services.pict-rs.environment = {
|
||||
PICTRS__REPO__PATH = "/var/lib/pict-rs/sled";
|
||||
PICTRS__STORE__PATH = "/mnt/lemmy-pict-rs";
|
||||
};
|
||||
systemd.services.pict-rs.serviceConfig.ExecStart = lib.mkForce "${lib.getExe pkgs.pict-rs} run";
|
||||
nixpkgs.overlays = [
|
||||
(_final: _prev: {
|
||||
inherit (inputs.pict-rs.packages.x86_64-linux) pict-rs;
|
||||
})
|
||||
];
|
||||
|
||||
# Pict-rs uses DynamicUser
|
||||
systemd.services.pict-rs.serviceConfig.ReadWritePaths = "/mnt/lemmy-pict-rs";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue