Compare commits
7 commits
main
...
test-s3-ca
Author | SHA1 | Date | |
---|---|---|---|
90ccdfe4a3 | |||
96372deb31 | |||
ef2285b04b | |||
694f3c5243 | |||
448ac0cedf | |||
146c61cea1 | |||
85fe97c35a |
8 changed files with 67 additions and 34 deletions
29
.github/workflows/build-machines-and-homes.yml
vendored
29
.github/workflows/build-machines-and-homes.yml
vendored
|
@ -7,12 +7,15 @@ env:
|
|||
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
||||
NIX_CONFIG: |
|
||||
show-trace = true
|
||||
extra-substituters = https://cdn.cy7.sh/main
|
||||
extra-trusted-public-keys = main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0=
|
||||
experimental-features = nix-command flakes
|
||||
accept-flake-config = true
|
||||
system-features = nixos-test benchmark big-parallel kvm
|
||||
secret-key-files = /home/runner/cache-priv-key.pem
|
||||
extra-substituters = https://nixcache.cy7.sh
|
||||
extra-trusted-public-keys = nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8=
|
||||
TERM: ansi
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets. AWS_SECRET_ACCESS_KEY }}
|
||||
jobs:
|
||||
build-machines:
|
||||
strategy:
|
||||
|
@ -36,16 +39,14 @@ jobs:
|
|||
remove-codeql: 'true'
|
||||
remove-docker-images: 'true'
|
||||
build-mount-path: /nix
|
||||
- name: setup binary cache key
|
||||
run: echo "${{ secrets.NIX_CACHE_SECRET_KEY }}" >> /home/runner/cache-priv-key.pem
|
||||
- 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"
|
||||
- name: build
|
||||
run: |
|
||||
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
|
||||
|
@ -53,10 +54,7 @@ jobs:
|
|||
- name: cache
|
||||
if: always()
|
||||
run: |
|
||||
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
|
||||
derivation="$(nix path-info --derivation "$package")"
|
||||
cache="$(nix-store --query --requisites --include-outputs "$derivation")"
|
||||
xargs attic push main <<< "$cache"
|
||||
nix copy ".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel" --to "s3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem"
|
||||
build-homes:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -80,16 +78,14 @@ jobs:
|
|||
remove-codeql: 'true'
|
||||
remove-docker-images: 'true'
|
||||
build-mount-path: /nix
|
||||
- name: setup binary cache key
|
||||
run: echo "${{ secrets.NIX_CACHE_SECRET_KEY }}" >> /home/runner/cache-priv-key.pem
|
||||
- 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"
|
||||
- name: build
|
||||
run: |
|
||||
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
|
||||
|
@ -97,7 +93,4 @@ jobs:
|
|||
- name: cache
|
||||
if: always()
|
||||
run: |
|
||||
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
|
||||
derivation="$(nix path-info --derivation "$package")"
|
||||
cache="$(nix-store --query --requisites --include-outputs "$derivation")"
|
||||
xargs attic push main <<< "$cache"
|
||||
nix copy ".#homeConfigurations."${{ matrix.home }}".activationPackage" --to "s3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem"
|
||||
|
|
15
.github/workflows/build-packages.yml
vendored
15
.github/workflows/build-packages.yml
vendored
|
@ -10,10 +10,11 @@ env:
|
|||
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
||||
NIX_CONFIG: |
|
||||
show-trace = true
|
||||
extra-substituters = https://cdn.cy7.sh/main
|
||||
extra-trusted-public-keys = main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0=
|
||||
experimental-features = nix-command flakes
|
||||
accept-flake-config = true
|
||||
secret-key-files = /home/runner/cache-priv-key.pem
|
||||
extra-substituters = https://nixcache.cy7.sh
|
||||
extra-trusted-public-keys = nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8=
|
||||
TERM: ansi
|
||||
jobs:
|
||||
build-packages:
|
||||
|
@ -29,23 +30,19 @@ jobs:
|
|||
- macos-13
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: setup binary cache key
|
||||
run: echo "${{ secrets.NIX_CACHE_SECRET_KEY }}" >> /home/runner/cache-priv-key.pem
|
||||
- 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
|
||||
if: always()
|
||||
run: |
|
||||
derivation="$(nix path-info --derivation "${{ matrix.package }}")"
|
||||
cache="$(nix-store --query --requisites --include-outputs "$derivation")"
|
||||
xargs attic push main <<< "$cache"
|
||||
nix copy "${{ matrix.machine }}" --to "s3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem"
|
||||
- name: prepare tarball to upload
|
||||
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result
|
||||
- name: upload result
|
||||
|
|
|
@ -123,3 +123,8 @@ creation_rules:
|
|||
- age:
|
||||
- *chunk
|
||||
- *cy
|
||||
- path_regex: secrets/cache-priv-key.pem
|
||||
key_groups:
|
||||
- age:
|
||||
- *yt
|
||||
- *cy
|
||||
|
|
|
@ -111,11 +111,11 @@
|
|||
nixConfig = {
|
||||
extra-substituters = [
|
||||
"https://nix-community.cachix.org"
|
||||
"https://cdn.cy7.sh/main"
|
||||
"https://nixcache.cy7.sh"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0="
|
||||
"nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8="
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
@ -10,6 +10,11 @@
|
|||
api_bind_addr = "[::]:3900";
|
||||
root_domain = "s3.cy7.sh";
|
||||
};
|
||||
s3_web = {
|
||||
bind_addr = "[::]:3902";
|
||||
root_domain = ".web.cy7.sh";
|
||||
add_host_to_metrics = true;
|
||||
};
|
||||
admin.api_bind_addr = "[::]:3903";
|
||||
rpc_bind_addr = "[::]:3901";
|
||||
replication_factor = 1;
|
||||
|
@ -33,5 +38,12 @@
|
|||
import common
|
||||
reverse_proxy localhost:3903
|
||||
'';
|
||||
"*.web.cy7.sh" = {
|
||||
serverAliases = [ "nixcache.cy7.sh" ];
|
||||
extraConfig = ''
|
||||
import common
|
||||
reverse_proxy localhost:3902
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,20 +14,22 @@ let
|
|||
--config ${config.sops.secrets."rclone/config".path} \
|
||||
--allow-other \
|
||||
--cache-dir /var/cache/rclone \
|
||||
--transfers 32 \
|
||||
--transfers 16 \
|
||||
--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 \
|
||||
--vfs-read-chunk-size 16M \
|
||||
--vfs-read-chunk-streams 16 \
|
||||
--sftp-concurrency 128 \
|
||||
--sftp-chunk-size 255k \
|
||||
--buffer-size 0 \
|
||||
${remote} ${mount}
|
||||
'';
|
||||
ExecStop = "${lib.getExe' pkgs.fuse "fusermount"} -zu ${mount}";
|
||||
OOMScoreAdjust = -1000;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
];
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0="
|
||||
"nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8="
|
||||
];
|
||||
extra-substituters = [
|
||||
"https://nix-community.cachix.org"
|
||||
"https://cdn.cy7.sh/main"
|
||||
"https://nixcache.cy7.sh"
|
||||
];
|
||||
};
|
||||
channel.enable = false;
|
||||
|
|
24
secrets/cache-priv-key.pem
Normal file
24
secrets/cache-priv-key.pem
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"data": "ENC[AES256_GCM,data:IVRg3IqrlV1Cy3xwyVszhUnRzbWP3OSb/XZF1H0N30eKL8d0DxFGngC5qMgRcmSs203/QL3w0fENp1u0f8tVajqJVlzLjlsiQrMdtXmiMv0LKO7E+aj4UZ0wMchB0XgSVUWrKUXxZrA=,iv:3GtA07yuAAI++RsLSwY3U62k1iG9+hvkGn45HjFt/Gk=,tag:PJ13CrjcE06KMC383txqHw==,type:str]",
|
||||
"sops": {
|
||||
"kms": null,
|
||||
"gcp_kms": null,
|
||||
"azure_kv": null,
|
||||
"hc_vault": null,
|
||||
"age": [
|
||||
{
|
||||
"recipient": "age1sy0at69err83qyml2vqu8xvwjccfws447aaadfvacj2qluw3p45s2mtrw8",
|
||||
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBVdkxBV3NSL1NDRjhPanpZ\nWTQwUmJmTExNOG0xZ1l1M2ZUSlFaTWdzS2hvCkdNT0dmK3FhcC85RE1mQmN1Uncw\nU1A4Znk1Vnk3RmY1UWdBY21VdnRZdWMKLS0tIHhTYUVUeTZsYkJFWk5LdnNDWlc5\ndDFDMUN2RmN0MDNXclpEMFA5Z0F5M0kKsLgc2D73RPNdTo4q7hBPGcBVPGwY73g+\nqQZbkVVzKPHo814ivwIVFYv+i5Qvf+p985Rko/fQ98GxW0G5c9Qfkg==\n-----END AGE ENCRYPTED FILE-----\n"
|
||||
},
|
||||
{
|
||||
"recipient": "age10h6pg5qdpc4t0rpmksfv788a57f04n83zgqaezkjjn65nkhv547s0vxfdn",
|
||||
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBuZ3B4czExQVZxNUJGNk1X\nbE9Md1Z6blM1S2xhb3VLT0JWbUpjSkxxS1U0Cm41bmt5Rk9LVTJFbVRFT2xxM01i\nTGUyYVU2RWdzRUhBVmNsTzJZWmh6cFUKLS0tIFlXVHQrcTVvbnptRitQVkVXRHBJ\nTjIxVXFvRmRQbUFHRXFjbFIva1IxVG8KciKyUdNjec7ocuKVX8KflMVPKpf/tEVr\nTxudivOoQ0XaqyPVi3cWDpuk2IAWUuJDxjmEctE6JgPtQvs1GsKCdg==\n-----END AGE ENCRYPTED FILE-----\n"
|
||||
}
|
||||
],
|
||||
"lastmodified": "2025-03-27T20:37:28Z",
|
||||
"mac": "ENC[AES256_GCM,data:35iUoodcjvIn+VAE20f2sHFaTh3+aqCYQ4HalWdVz4eUSkVNcdXs2uqOZtFv3MszDiH9izM84OyHwykudJ99QE3B/NwpfIoKQaU6Qg5X/g/rC1meffMaZwcASVbepjznahbTKmJqeSrMeybrBIV+6FaSjWXn0+D72GEEM1vgH9c=,iv:N2CbttHJsczm37qdapOCrlNeSSgsZBDlvWyvUpa3mkk=,tag:btniVwaVS9h4jDo4IM2wcA==,type:str]",
|
||||
"pgp": null,
|
||||
"unencrypted_suffix": "_unencrypted",
|
||||
"version": "3.9.4"
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue