Compare commits

..

2 commits

Author SHA1 Message Date
cy
00a8ac69cf
nix fmt 2025-03-14 02:10:11 -04:00
cy
9c72baf1c0
make garage and rclone better 2025-03-14 02:09:30 -04:00
14 changed files with 100 additions and 105 deletions

View file

@ -13,7 +13,6 @@ env:
extra-experimental-features = nix-command flakes
accept-flake-config = true
TERM: ansi
jobs:
build-machines:
strategy:
@ -37,15 +36,12 @@ jobs:
remove-codeql: 'true'
remove-docker-images: 'true'
build-mount-path: /nix
- name: Install Nix
uses: nixbuild/nix-quick-install-action@master
- name: Sync repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5.1.0
with:
@ -63,12 +59,10 @@ jobs:
purge-primary-key: never
# always save the cache
save-always: true
- name: setup attic
run: |
nix profile install github:zhaofengli/attic
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
- name: build and cache
run: |
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
@ -76,7 +70,6 @@ jobs:
derivation="$(nix path-info --derivation "$package")"
cache="$(nix-store --query --requisites --include-outputs "$derivation")"
attic push main --stdin <<< "$cache"
build-homes:
strategy:
matrix:
@ -99,14 +92,11 @@ jobs:
remove-codeql: 'true'
remove-docker-images: 'true'
build-mount-path: /nix
- uses: nixbuild/nix-quick-install-action@master
- name: Sync repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5.1.0
with:
@ -124,12 +114,10 @@ jobs:
purge-primary-key: never
# always save the cache
save-always: true
- name: setup attic
run: |
nix profile install github:zhaofengli/attic
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
- name: build and cache
run: |
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"

View file

@ -16,7 +16,6 @@ env:
extra-experimental-features = nix-command flakes
accept-flake-config = true
TERM: ansi
jobs:
build-packages:
strategy:
@ -29,33 +28,26 @@ jobs:
- ubuntu-24.04-arm
- macos-latest
- macos-13
runs-on: ${{ matrix.os }}
steps:
- name: Install Nix
uses: cachix/install-nix-action@v30
- name: Sync repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: setup attic
run: |
nix profile install github:zhaofengli/attic
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
- run: nix build -L ${{ matrix.package }}
- name: cache result
run: |
derivation="$(nix path-info --derivation "${{ matrix.package }}")"
cache="$(nix-store --query --requisites --include-outputs "$derivation")"
attic push main --stdin <<< "$cache"
- name: prepare tarball to upload
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result
- name: upload result
uses: actions/upload-artifact@v4
with:

View file

@ -118,7 +118,6 @@ creation_rules:
- age:
- *chunk
- *cy
- path_regex: secrets/services/searx.yaml
key_groups:
- age:

View file

@ -10,8 +10,7 @@
extensions =
# if unfree
# with pkgs.vscode-marketplace;
with pkgs.open-vsx;
[
with pkgs.open-vsx; [
vscodevim.vim
jnoortheen.nix-ide
github.github-vscode-theme

View file

@ -10,15 +10,13 @@
api_bind_addr = "[::]:3900";
root_domain = "s3.cy7.sh";
};
s3_web = {
bind_addr = "[::]:3902";
root_domain = ".web.s3.cy7.sh";
index = "index.html";
};
admin.api_bind_addr = "[::]:3903";
rpc_bind_addr = "[::]:3901";
replication_factor = 1;
db_engine = "lmdb";
disable_scrub = true;
block_size = "10M";
compression_level = 3;
};
environmentFile = config.sops.secrets."garage/env".path;
};
@ -31,10 +29,6 @@
reverse_proxy localhost:3900
'';
};
"*.web.s3.cy7.sh".extraConfig = ''
import common
reverse_proxy localhost:3902
'';
"admin.s3.cy7.sh".extraConfig = ''
import common
reverse_proxy localhost:3903

View file

@ -29,6 +29,14 @@
}
];
}
{
job_name = "garage";
static_configs = [
{
targets = [ "127.0.0.1:3903" ];
}
];
}
];
};

View file

@ -32,9 +32,17 @@
serviceConfig = {
Type = "notify";
ExecStartPre = "/usr/bin/env mkdir -p /mnt/garage";
ExecStart = "${lib.getExe pkgs.rclone} mount --config ${
config.sops.secrets."rclone/config".path
} --cache-dir /var/cache/rclone --transfers=32 --checkers=32 --vfs-cache-mode writes --vfs-cache-max-size 5G --allow-other rsyncnet:garage /mnt/garage ";
ExecStart = ''
${lib.getExe pkgs.rclone} mount \
--config ${config.sops.secrets."rclone/config".path} \
--allow-other \
--cache-dir /var/cache/rclone \
--transfers=32 --checkers=32 \
--vfs-cache-mode writes \
--vfs-cache-max-size 5G \
--dir-cache-time 30d \
rsyncnet:garage /mnt/garage
'';
ExecStop = "${lib.getExe' pkgs.fuse "fusermount"} -u /mnt/garage";
};
};

View file

@ -6,9 +6,11 @@
}:
{
virtualisation.oci-containers.containers = {
immich-ml = let
immich-ml =
let
modelCache = "/opt/immich-ml";
in {
in
{
image = "ghcr.io/immich-app/immich-machine-learning:release";
autoStart = true;
pull = "newer";

View file

@ -147,7 +147,9 @@
"podman"
];
environment.systemPackages = with pkgs; lib.flatten [
environment.systemPackages =
with pkgs;
lib.flatten [
tmux
vim
wget

View file

@ -1,7 +1,9 @@
final: prev: {
bitwarden-desktop = prev.bitwarden-desktop.overrideAttrs (finalAttrs: prevAttrs: {
bitwarden-desktop = prev.bitwarden-desktop.overrideAttrs (
finalAttrs: prevAttrs: {
patches = prevAttrs.patches ++ [
./ssh-agent-no-confirm.patch
];
});
}
);
}

View file

@ -14,14 +14,15 @@ in
pkgFrom = flake: pkg: flake.packages.${prev.system}.${pkg};
in
{
conduwuit =
pkgFrom inputs.conduwuit "static-x86_64-linux-musl-all-features-x86_64-haswell-optimised";
conduwuit = pkgFrom inputs.conduwuit "static-x86_64-linux-musl-all-features-x86_64-haswell-optimised";
pixelflasher = nixpkgsFrom inputs.pixelflasher "pixelflasher";
attic-server = pkgFrom inputs.attic "attic-server";
attic = pkgFrom inputs.attic "attic";
garage = ((pkgFrom inputs.garage "default").overrideAttrs {
garage = (
(pkgFrom inputs.garage "default").overrideAttrs {
meta.mainProgram = "garage";
});
}
);
}
)
]