diff --git a/flake.lock b/flake.lock index ddda4b4..4bf9015 100644 --- a/flake.lock +++ b/flake.lock @@ -448,30 +448,6 @@ "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": { "inputs": { "nixpkgs": [ @@ -851,22 +827,6 @@ } }, "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": { "lastModified": 1742276595, "narHash": "sha256-bsg9y3NoMGu0jgTI5XbxvzQFc9JtZB51i500WlVws80=", @@ -1013,14 +973,13 @@ "flake-parts": "flake-parts_2", "flake-utils": "flake-utils", "garage": "garage", - "helix": "helix", "home-manager": "home-manager", "lanzaboote": "lanzaboote", "lix-module": "lix-module", "nil": "nil", "nix-index-database": "nix-index-database", "nix-ld": "nix-ld", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable_2", "nixvim": "nixvim", "nvim-github-theme": "nvim-github-theme", diff --git a/flake.nix b/flake.nix index 54a1b90..b469e18 100644 --- a/flake.nix +++ b/flake.nix @@ -92,11 +92,6 @@ 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 = { url = "github:projekt0n/github-nvim-theme"; diff --git a/home/nixvim/default.nix b/home/nixvim/default.nix index 5199812..0ce28d6 100644 --- a/home/nixvim/default.nix +++ b/home/nixvim/default.nix @@ -167,7 +167,6 @@ installCargo = false; }; eslint.enable = true; - yamlls.enable = true; }; }; plugins.treesitter = { @@ -199,6 +198,13 @@ settings.current_line_blame = true; }; + plugins.copilot-chat = { + enable = true; + settings = { + model = "claude-3.5-sonnet"; + }; + }; + plugins.cmp-buffer.enable = true; plugins.cmp-emoji.enable = true; plugins.cmp-nvim-lsp.enable = true; diff --git a/home/yt/chunk.nix b/home/yt/chunk.nix index 474abfc..ad024cd 100644 --- a/home/yt/chunk.nix +++ b/home/yt/chunk.nix @@ -14,4 +14,8 @@ programs.home-manager.enable = true; systemd.user.startServices = "sd-switch"; + + home.packages = with pkgs; [ + attic-server + ]; } diff --git a/home/yt/ytnix.nix b/home/yt/ytnix.nix index 6ce06ec..1731475 100644 --- a/home/yt/ytnix.nix +++ b/home/yt/ytnix.nix @@ -152,17 +152,4 @@ }; 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"; - }; - }; - }; } diff --git a/hosts/chunk/garage.nix b/hosts/chunk/garage.nix index 6a25df2..81b4af3 100644 --- a/hosts/chunk/garage.nix +++ b/hosts/chunk/garage.nix @@ -15,7 +15,7 @@ replication_factor = 1; db_engine = "lmdb"; disable_scrub = true; - block_size = "128M"; + block_size = "10M"; compression_level = "none"; }; environmentFile = config.sops.secrets."garage/env".path; diff --git a/hosts/chunk/immich.nix b/hosts/chunk/immich.nix index f2636f1..6541770 100644 --- a/hosts/chunk/immich.nix +++ b/hosts/chunk/immich.nix @@ -9,7 +9,6 @@ let thumbsLocation = "/opt/immich/thumbs"; profileLocation = "/opt/immich/profile"; dbDataLocation = "/opt/immich/postgres"; - backupsLocation = "/opt/immich/backups"; in { virtualisation.oci-containers.containers = { @@ -22,7 +21,6 @@ in "${uploadLocation}:/usr/src/app/upload" "${thumbsLocation}:/usr/src/app/upload/thumbs" "${profileLocation}:/usr/src/app/upload/profile" - "${backupsLocation}:/usr/src/app/upload/backups" ]; environment = { REDIS_HOSTNAME = "immich-redis"; diff --git a/hosts/chunk/rclone.nix b/hosts/chunk/rclone.nix index 31cdf54..09f5b18 100644 --- a/hosts/chunk/rclone.nix +++ b/hosts/chunk/rclone.nix @@ -4,32 +4,6 @@ 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 = { enable = true; @@ -38,7 +12,21 @@ in after = [ "network-online.target" ]; requiredBy = [ "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 = { @@ -48,6 +36,28 @@ in after = [ "network-online.target" ]; requiredBy = [ "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"; + }; }; } diff --git a/modules/attic.nix b/modules/attic.nix index a43d444..c08afe1 100644 --- a/modules/attic.nix +++ b/modules/attic.nix @@ -30,31 +30,12 @@ in type = "s3"; region = "us-east-1"; bucket = "attic"; - # attic must be patched to never serve pre-signed s3 urls directly - # otherwise it will redirect clients to this localhost endpoint - endpoint = "http://127.0.0.1:3900"; + endpoint = "https://s3.cy7.sh"; }; garbage-collection = { 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"; }; }; diff --git a/overlay/attic/prefetch-8-chunks.patch b/overlay/attic/prefetch-8-chunks.patch index eafc514..3786541 100644 --- a/overlay/attic/prefetch-8-chunks.patch +++ b/overlay/attic/prefetch-8-chunks.patch @@ -1,16 +1,7 @@ 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 +++ 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( // TODO: Make num_prefetch configurable @@ -20,4 +11,3 @@ index 02e4857..b522154 100644 tracing::error!(%e, "Stream error"); e }); - diff --git a/overlay/default.nix b/overlay/default.nix index d8780e2..cd9f038 100644 --- a/overlay/default.nix +++ b/overlay/default.nix @@ -24,7 +24,6 @@ in meta.mainProgram = "garage"; } ); - helix = pkgFrom inputs.helix "default"; } ) ]