Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ jobs:
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v16
with:
name: stackptr
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Configure Attic cache
run: |
nix profile install github:zhaofengli/attic#attic-client
attic login rc https://cache.zx.dev ${{ secrets.ATTIC_TOKEN }}
attic use rc:main
- run: nix flake check
- name: Build NixOS system
- name: Build system configuration
run: |
if [ "${{ matrix.system }}" = "aarch64-darwin" ]; then
nix build .#darwinConfigurations.${{ matrix.host }}.system
else
nix build .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel
fi
- name: Push to Attic
if: github.ref == 'refs/heads/main'
run: attic push rc:main ./result
121 changes: 118 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
};
attic = {
url = "github:zhaofengli/attic";
inputs.nixpkgs.follows = "nixpkgs";
};
zx-dev = {
url = "github:stackptr/zx.dev";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down Expand Up @@ -115,9 +119,11 @@
nixConfig = {
experimental-features = ["nix-command" "flakes"];
extra-substituters = [
"https://cache.zx.dev"
"https://stackptr.cachix.org"
];
extra-trusted-public-keys = [
"main:sbkS1Xz6P4g66iyttRGj/o8aPODE6bVG9oKT98/ULKI="
"stackptr.cachix.org-1:5e2q7OxdRdAtvRmHTeogpgJKzQhbvFqNMmCMw71opZA="
];
};
Expand Down
Binary file added hosts/glyph/secrets/attic-credentials.age
Binary file not shown.
36 changes: 36 additions & 0 deletions hosts/glyph/services/attic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{config, ...}: {
age.secrets.attic-credentials = {
file = ./../secrets/attic-credentials.age;
mode = "440";
owner = "atticd";
group = "atticd";
};

services.atticd = {
enable = true;
environmentFile = config.age.secrets.attic-credentials.path;

settings = {
listen = "[::]:8199";

database.url = "sqlite:///var/lib/atticd/server.db?mode=rwc";

storage = {
type = "local";
path = "/var/lib/atticd/storage";
};

chunking = {
nar-size-threshold = 65536;
min-size = 16384;
avg-size = 65536;
max-size = 262144;
};

garbage-collection = {
interval = "12 hours";
default-retention-period = "30 days";
};
};
};
}
2 changes: 2 additions & 0 deletions hosts/glyph/services/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
...
}: {
imports = [
./attic.nix
./avahi.nix
./dns.nix
./filebrowser.nix
Expand Down Expand Up @@ -84,6 +85,7 @@
rc.backup = {
enable = true;
paths = [
"/var/lib/atticd/server.db"
"/var/lib/basic-memory"
"/var/lib/open-webui"
"/var/lib/roon-server/backup"
Expand Down
11 changes: 11 additions & 0 deletions hosts/spore/services/web/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@
proxyWebsockets = true;
};
};
"cache.zx.dev" = {
forceSSL = true;
useACMEHost = "zx.dev";
locations."/" = {
proxyPass = "http://glyph.rove-duck.ts.net:8199";
extraConfig = ''
client_max_body_size 0;
proxy_read_timeout 300;
'';
};
};
"jellyfin.zx.dev" = {
forceSSL = true;
useACMEHost = "zx.dev";
Expand Down
2 changes: 2 additions & 0 deletions lib/hosts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ inputs @ {
llm-profile,
nix-index-database,
zx-dev,
attic,
disko,
golink,
...
Expand Down Expand Up @@ -76,6 +77,7 @@ inputs @ {
{
nixpkgs.overlays = overlays;
}
attic.nixosModules.atticd
golink.nixosModules.default
zx-dev.nixosModules.default
];
Expand Down
1 change: 1 addition & 0 deletions lib/secrets/glyph.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ in {
"hosts/glyph/secrets/context7-api-key.age".publicKeys = keys;
"hosts/glyph/secrets/open-webui-env.age".publicKeys = keys;
"hosts/glyph/secrets/graphite-auth-token.age".publicKeys = keys;
"hosts/glyph/secrets/attic-credentials.age".publicKeys = keys;
}