Compare commits
No commits in common. "8c921fc1ab4d703cffd19bee965280845ff1ad24" and "02dc7351efac7d11e4b997609abdb6bdd1fb6848" have entirely different histories.
8c921fc1ab
...
02dc7351ef
11 changed files with 53 additions and 124 deletions
43
flake.lock
generated
43
flake.lock
generated
|
@ -448,30 +448,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"helix": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": [
|
|
||||||
"flake-utils"
|
|
||||||
],
|
|
||||||
"nixpkgs": "nixpkgs_4",
|
|
||||||
"rust-overlay": [
|
|
||||||
"rust-overlay"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1742479163,
|
|
||||||
"narHash": "sha256-YC0zdGyZMu7seA2Jm1mxtcxE4lSeVwvCPMfWzJ8+o/c=",
|
|
||||||
"owner": "helix-editor",
|
|
||||||
"repo": "helix",
|
|
||||||
"rev": "b7d735ffe66a03ab5970e5f860923aada50d4e4c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "helix-editor",
|
|
||||||
"repo": "helix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -851,22 +827,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 1740560979,
|
|
||||||
"narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "5135c59491985879812717f4c9fea69604e7f26f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_5": {
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742276595,
|
"lastModified": 1742276595,
|
||||||
"narHash": "sha256-bsg9y3NoMGu0jgTI5XbxvzQFc9JtZB51i500WlVws80=",
|
"narHash": "sha256-bsg9y3NoMGu0jgTI5XbxvzQFc9JtZB51i500WlVws80=",
|
||||||
|
@ -1013,14 +973,13 @@
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_2",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"garage": "garage",
|
"garage": "garage",
|
||||||
"helix": "helix",
|
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"lanzaboote": "lanzaboote",
|
"lanzaboote": "lanzaboote",
|
||||||
"lix-module": "lix-module",
|
"lix-module": "lix-module",
|
||||||
"nil": "nil",
|
"nil": "nil",
|
||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
"nix-ld": "nix-ld",
|
"nix-ld": "nix-ld",
|
||||||
"nixpkgs": "nixpkgs_5",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"nixpkgs-stable": "nixpkgs-stable_2",
|
"nixpkgs-stable": "nixpkgs-stable_2",
|
||||||
"nixvim": "nixvim",
|
"nixvim": "nixvim",
|
||||||
"nvim-github-theme": "nvim-github-theme",
|
"nvim-github-theme": "nvim-github-theme",
|
||||||
|
|
|
@ -92,11 +92,6 @@
|
||||||
flake-utils.follows = "flake-utils";
|
flake-utils.follows = "flake-utils";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
helix = {
|
|
||||||
url = "github:helix-editor/helix";
|
|
||||||
inputs.flake-utils.follows = "flake-utils";
|
|
||||||
inputs.rust-overlay.follows = "rust-overlay";
|
|
||||||
};
|
|
||||||
|
|
||||||
nvim-github-theme = {
|
nvim-github-theme = {
|
||||||
url = "github:projekt0n/github-nvim-theme";
|
url = "github:projekt0n/github-nvim-theme";
|
||||||
|
|
|
@ -167,7 +167,6 @@
|
||||||
installCargo = false;
|
installCargo = false;
|
||||||
};
|
};
|
||||||
eslint.enable = true;
|
eslint.enable = true;
|
||||||
yamlls.enable = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
plugins.treesitter = {
|
plugins.treesitter = {
|
||||||
|
@ -199,6 +198,13 @@
|
||||||
settings.current_line_blame = true;
|
settings.current_line_blame = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugins.copilot-chat = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
model = "claude-3.5-sonnet";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
plugins.cmp-buffer.enable = true;
|
plugins.cmp-buffer.enable = true;
|
||||||
plugins.cmp-emoji.enable = true;
|
plugins.cmp-emoji.enable = true;
|
||||||
plugins.cmp-nvim-lsp.enable = true;
|
plugins.cmp-nvim-lsp.enable = true;
|
||||||
|
|
|
@ -14,4 +14,8 @@
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
systemd.user.startServices = "sd-switch";
|
systemd.user.startServices = "sd-switch";
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
attic-server
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,17 +152,4 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.nix-index-database.comma.enable = true;
|
programs.nix-index-database.comma.enable = true;
|
||||||
programs.helix = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
theme = "github_dark";
|
|
||||||
editor = {
|
|
||||||
line-number = "relative";
|
|
||||||
lsp.display-messages = true;
|
|
||||||
};
|
|
||||||
keys.insert = {
|
|
||||||
"C-[" = "normal_mode";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
replication_factor = 1;
|
replication_factor = 1;
|
||||||
db_engine = "lmdb";
|
db_engine = "lmdb";
|
||||||
disable_scrub = true;
|
disable_scrub = true;
|
||||||
block_size = "128M";
|
block_size = "10M";
|
||||||
compression_level = "none";
|
compression_level = "none";
|
||||||
};
|
};
|
||||||
environmentFile = config.sops.secrets."garage/env".path;
|
environmentFile = config.sops.secrets."garage/env".path;
|
||||||
|
|
|
@ -9,7 +9,6 @@ let
|
||||||
thumbsLocation = "/opt/immich/thumbs";
|
thumbsLocation = "/opt/immich/thumbs";
|
||||||
profileLocation = "/opt/immich/profile";
|
profileLocation = "/opt/immich/profile";
|
||||||
dbDataLocation = "/opt/immich/postgres";
|
dbDataLocation = "/opt/immich/postgres";
|
||||||
backupsLocation = "/opt/immich/backups";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
virtualisation.oci-containers.containers = {
|
virtualisation.oci-containers.containers = {
|
||||||
|
@ -22,7 +21,6 @@ in
|
||||||
"${uploadLocation}:/usr/src/app/upload"
|
"${uploadLocation}:/usr/src/app/upload"
|
||||||
"${thumbsLocation}:/usr/src/app/upload/thumbs"
|
"${thumbsLocation}:/usr/src/app/upload/thumbs"
|
||||||
"${profileLocation}:/usr/src/app/upload/profile"
|
"${profileLocation}:/usr/src/app/upload/profile"
|
||||||
"${backupsLocation}:/usr/src/app/upload/backups"
|
|
||||||
];
|
];
|
||||||
environment = {
|
environment = {
|
||||||
REDIS_HOSTNAME = "immich-redis";
|
REDIS_HOSTNAME = "immich-redis";
|
||||||
|
|
|
@ -4,32 +4,6 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
mkServiceConfig = remote: mount: {
|
|
||||||
Type = "notify";
|
|
||||||
TimeoutSec = "5min 20s";
|
|
||||||
ExecStartPre = "/usr/bin/env mkdir -p ${mount}";
|
|
||||||
ExecStart = ''
|
|
||||||
${lib.getExe pkgs.rclone} mount \
|
|
||||||
--config ${config.sops.secrets."rclone/config".path} \
|
|
||||||
--allow-other \
|
|
||||||
--cache-dir /var/cache/rclone \
|
|
||||||
--transfers 32 \
|
|
||||||
--vfs-cache-mode full \
|
|
||||||
--vfs-cache-min-free-space 5G \
|
|
||||||
--dir-cache-time 30d \
|
|
||||||
--no-checksum \
|
|
||||||
--no-modtime \
|
|
||||||
--vfs-fast-fingerprint \
|
|
||||||
--vfs-read-chunk-size 4M \
|
|
||||||
--vfs-read-chunk-streams 32 \
|
|
||||||
--sftp-concurrency 128 \
|
|
||||||
--sftp-chunk-size 255k \
|
|
||||||
${remote} ${mount}
|
|
||||||
'';
|
|
||||||
ExecStop = "${lib.getExe' pkgs.fuse "fusermount"} -zu ${mount}";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
systemd.services.immich-mount = {
|
systemd.services.immich-mount = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -38,7 +12,21 @@ in
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
requiredBy = [ "podman-immich-server.service" ];
|
requiredBy = [ "podman-immich-server.service" ];
|
||||||
before = [ "podman-immich-server.service" ];
|
before = [ "podman-immich-server.service" ];
|
||||||
serviceConfig = mkServiceConfig "photos:" "/mnt/photos";
|
serviceConfig = {
|
||||||
|
Type = "notify";
|
||||||
|
ExecStartPre = "/usr/bin/env mkdir -p /mnt/photos";
|
||||||
|
ExecStart = ''
|
||||||
|
${lib.getExe pkgs.rclone} mount \
|
||||||
|
--config ${config.sops.secrets."rclone/config".path} \
|
||||||
|
--cache-dir /var/cache/rclone \
|
||||||
|
--transfers=32 \
|
||||||
|
--dir-cache-time 30d \
|
||||||
|
--vfs-cache-mode writes \
|
||||||
|
--vfs-cache-max-size 2G \
|
||||||
|
photos: /mnt/photos
|
||||||
|
'';
|
||||||
|
ExecStop = "${lib.getExe' pkgs.fuse "fusermount"} -u /mnt/photos";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.garage-mount = {
|
systemd.services.garage-mount = {
|
||||||
|
@ -48,6 +36,28 @@ in
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
requiredBy = [ "garage.service" ];
|
requiredBy = [ "garage.service" ];
|
||||||
before = [ "garage.service" ];
|
before = [ "garage.service" ];
|
||||||
serviceConfig = mkServiceConfig "rsyncnet:garage" "/mnt/garage";
|
serviceConfig = {
|
||||||
|
Type = "notify";
|
||||||
|
ExecStartPre = "/usr/bin/env mkdir -p /mnt/garage";
|
||||||
|
ExecStart = ''
|
||||||
|
${lib.getExe pkgs.rclone} mount \
|
||||||
|
--config ${config.sops.secrets."rclone/config".path} \
|
||||||
|
--allow-other \
|
||||||
|
--cache-dir /var/cache/rclone \
|
||||||
|
--transfers 32 \
|
||||||
|
--vfs-cache-mode full \
|
||||||
|
--vfs-cache-min-free-space 5G \
|
||||||
|
--dir-cache-time 30d \
|
||||||
|
--no-checksum \
|
||||||
|
--no-modtime \
|
||||||
|
--vfs-fast-fingerprint \
|
||||||
|
--vfs-read-chunk-size 4M \
|
||||||
|
--vfs-read-chunk-streams 64 \
|
||||||
|
--sftp-concurrency 128 \
|
||||||
|
--sftp-chunk-size 255k \
|
||||||
|
rsyncnet:garage /mnt/garage
|
||||||
|
'';
|
||||||
|
ExecStop = "${lib.getExe' pkgs.fuse "fusermount"} -u /mnt/garage";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,31 +30,12 @@ in
|
||||||
type = "s3";
|
type = "s3";
|
||||||
region = "us-east-1";
|
region = "us-east-1";
|
||||||
bucket = "attic";
|
bucket = "attic";
|
||||||
# attic must be patched to never serve pre-signed s3 urls directly
|
endpoint = "https://s3.cy7.sh";
|
||||||
# otherwise it will redirect clients to this localhost endpoint
|
|
||||||
endpoint = "http://127.0.0.1:3900";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
garbage-collection = {
|
garbage-collection = {
|
||||||
default-retention-period = "1 month";
|
default-retention-period = "1 month";
|
||||||
};
|
};
|
||||||
|
|
||||||
chunking = {
|
|
||||||
# disable chunking since garage does its own
|
|
||||||
nar-size-threshold = 0;
|
|
||||||
# defaults
|
|
||||||
min-size = 16384;
|
|
||||||
avg-size = 65536;
|
|
||||||
max-size = 262144;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.atticd = {
|
|
||||||
requires = [ "garage.service" ];
|
|
||||||
after = [ "garage.service" ];
|
|
||||||
environment = {
|
|
||||||
RUST_LOG = "INFO";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,7 @@
|
||||||
diff --git a/server/src/api/binary_cache.rs b/server/src/api/binary_cache.rs
|
diff --git a/server/src/api/binary_cache.rs b/server/src/api/binary_cache.rs
|
||||||
index 02e4857..b522154 100644
|
index 02e4857..71eeee8 100644
|
||||||
--- a/server/src/api/binary_cache.rs
|
--- a/server/src/api/binary_cache.rs
|
||||||
+++ b/server/src/api/binary_cache.rs
|
+++ b/server/src/api/binary_cache.rs
|
||||||
@@ -215,7 +215,7 @@ async fn get_nar(
|
|
||||||
let chunk = chunks[0].as_ref().unwrap();
|
|
||||||
let remote_file = &chunk.remote_file.0;
|
|
||||||
let storage = state.storage().await?;
|
|
||||||
- match storage.download_file_db(remote_file, false).await? {
|
|
||||||
+ match storage.download_file_db(remote_file, true).await? {
|
|
||||||
Download::Url(url) => Ok(Redirect::temporary(&url).into_response()),
|
|
||||||
Download::AsyncRead(stream) => {
|
|
||||||
let stream = ReaderStream::new(stream).map_err(|e| {
|
|
||||||
@@ -262,7 +262,7 @@ async fn get_nar(
|
@@ -262,7 +262,7 @@ async fn get_nar(
|
||||||
|
|
||||||
// TODO: Make num_prefetch configurable
|
// TODO: Make num_prefetch configurable
|
||||||
|
@ -20,4 +11,3 @@ index 02e4857..b522154 100644
|
||||||
tracing::error!(%e, "Stream error");
|
tracing::error!(%e, "Stream error");
|
||||||
e
|
e
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ in
|
||||||
meta.mainProgram = "garage";
|
meta.mainProgram = "garage";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
helix = pkgFrom inputs.helix "default";
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue