Compare commits

..

22 commits

Author SHA1 Message Date
cy
f1bc98713f
flake update
Signed-off-by: cy <cy@cy7.sh>
2025-03-26 10:47:21 -04:00
cy
b5d3358f52
vscode stuff and try to make treefmt not suck 2025-03-26 10:43:56 -04:00
cy
8c921fc1ab
nixvim: enable yamlls; home/chunk: remove attic-server 2025-03-20 19:46:04 -04:00
cy
55267c5154
attic: don't chunk, s3 at localhost, start after garage 2025-03-20 19:45:22 -04:00
cy
9400279feb
garage: use 128M block_size 2025-03-20 19:44:45 -04:00
cy
31e8487a3f
immich: backup database to disk (not mount) 2025-03-20 19:44:29 -04:00
cy
c67622ba36
refactor rclone, use same serviceConfig for all mounts 2025-03-20 19:43:22 -04:00
cy
8ffe43a441
attic: always prefer streams 2025-03-20 16:10:39 -04:00
cy
959deb8dbc
try helix 2025-03-20 13:04:47 -04:00
cy
02dc7351ef
make rclone master 2025-03-20 10:11:56 -04:00
cy
5cc48a3eb3
try alternative cache domain 2025-03-20 10:11:56 -04:00
cy
6fa16fa422
try default conduwuit package 2025-03-20 00:46:23 -04:00
cy
384398b08a
misc 2025-03-19 23:14:24 -04:00
cy
ed929219da
nixvim: rm copilot stuff i never use 2025-03-18 23:16:06 -04:00
cy
f28234e555
workflow: add system-features 2025-03-18 15:40:06 -04:00
cy
1c8135095c
attic: try prefetching 8 chunks 2025-03-18 14:18:02 -04:00
cy
2260347ed9
flake update 2025-03-18 13:55:45 -04:00
cy
c299b501a6
workflow: use cachix installer 2025-03-18 00:15:32 -04:00
cy
f0add8c95f
rm lix-module from overlay 2025-03-17 23:42:19 -04:00
cy
ec9283ee26
workflow: rm cache nix store action 2025-03-17 23:38:40 -04:00
cy
7b4f70fbe6
remove lix input (only use lix-module) 2025-03-17 23:37:41 -04:00
cy
d50d2dcb73
workflow: always() cache 2025-03-17 22:35:44 -04:00
18 changed files with 286 additions and 286 deletions

View file

@ -3,16 +3,18 @@ on:
workflow_dispatch: workflow_dispatch:
push: push:
pull_request: pull_request:
env: env:
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }} ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
NIX_CONFIG: | NIX_CONFIG: |
show-trace = true show-trace = true
extra-substituters = https://cache.cy7.sh/main extra-substituters = https://cdn.cy7.sh/main
extra-trusted-public-keys = main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0= extra-trusted-public-keys = main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0=
experimental-features = nix-command flakes experimental-features = nix-command flakes
extra-experimental-features = nix-command flakes
accept-flake-config = true accept-flake-config = true
system-features = nixos-test benchmark big-parallel kvm
TERM: ansi TERM: ansi
jobs: jobs:
build-machines: build-machines:
strategy: strategy:
@ -36,33 +38,20 @@ jobs:
remove-codeql: 'true' remove-codeql: 'true'
remove-docker-images: 'true' remove-docker-images: 'true'
build-mount-path: /nix build-mount-path: /nix
- name: Install Nix - name: Install Nix
uses: nixbuild/nix-quick-install-action@master uses: cachix/install-nix-action@v30
- name: Sync repository - name: Sync repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
persist-credentials: false persist-credentials: false
- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5.1.0
with:
# restore and save a cache using this key
primary-key: nix-${{ runner.os }}-${{ matrix.machine }}-${{ hashFiles('**/*.nix', 'flake.lock') }}
# if there's no cache hit, restore a cache by this prefix
restore-prefixes-first-match: nix-${{ runner.os }}-${{ matrix.machine }}-
# do purge caches
purge: true
# purge all versions of the cache
purge-prefixes: nix-${{ runner.os }}-
# created more than this number of seconds ago relative to the start of the `Post Restore` phase
purge-last-accessed: 86400
# except the version with the `primary-key`, if it exists
purge-primary-key: never
# always save the cache
save-always: true
- name: setup attic - name: setup attic
run: | run: |
nix profile install github:zhaofengli/attic nix profile install github:zhaofengli/attic
attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN" attic login cy7 https://cache.cy7.sh "$ATTIC_TOKEN"
- name: build - name: build
run: | run: |
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel" package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
@ -97,28 +86,12 @@ jobs:
remove-codeql: 'true' remove-codeql: 'true'
remove-docker-images: 'true' remove-docker-images: 'true'
build-mount-path: /nix build-mount-path: /nix
- uses: nixbuild/nix-quick-install-action@master - name: Install Nix
uses: cachix/install-nix-action@v30
- name: Sync repository - name: Sync repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
persist-credentials: false persist-credentials: false
- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5.1.0
with:
# restore and save a cache using this key
primary-key: nix-${{ runner.os }}-${{ matrix.home }}-${{ hashFiles('**/*.nix', 'flake.lock') }}
# if there's no cache hit, restore a cache by this prefix
restore-prefixes-first-match: nix-${{ runner.os }}-${{ matrix.home }}-
# do purge caches
purge: true
# purge all versions of the cache
purge-prefixes: nix-${{ runner.os }}-
# created more than this number of seconds ago relative to the start of the `Post Restore` phase
purge-last-accessed: 86400
# except the version with the `primary-key`, if it exists
purge-primary-key: never
# always save the cache
save-always: true
- name: setup attic - name: setup attic
run: | run: |
nix profile install github:zhaofengli/attic nix profile install github:zhaofengli/attic

View file

@ -10,10 +10,9 @@ env:
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }} ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
NIX_CONFIG: | NIX_CONFIG: |
show-trace = true show-trace = true
extra-substituters = https://cache.cy7.sh/main extra-substituters = https://cdn.cy7.sh/main
extra-trusted-public-keys = main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0= extra-trusted-public-keys = main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0=
experimental-features = nix-command flakes experimental-features = nix-command flakes
extra-experimental-features = nix-command flakes
accept-flake-config = true accept-flake-config = true
TERM: ansi TERM: ansi
jobs: jobs:

216
flake.lock generated
View file

@ -131,11 +131,11 @@
"rocksdb": "rocksdb" "rocksdb": "rocksdb"
}, },
"locked": { "locked": {
"lastModified": 1742163799, "lastModified": 1742266954,
"narHash": "sha256-00cdNSSAOCGQpWRq7mauC1cm55hQ3JJ9phW7f2TLZes=", "narHash": "sha256-PoVjZXR24r1WPyWWK+DZDAlVr4otn/BcxY7/jd8fehM=",
"owner": "girlbossceo", "owner": "girlbossceo",
"repo": "conduwuit", "repo": "conduwuit",
"rev": "658c19d55eb5fdf30f27e189c414208e2eae6e24", "rev": "7bf92c8a3710eeff229bd86bc81a89daa94b66d5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -146,11 +146,11 @@
}, },
"crane": { "crane": {
"locked": { "locked": {
"lastModified": 1742143293, "lastModified": 1742394900,
"narHash": "sha256-8oKPsMlqlOQ7qnTWvhBEcfVFY1WqHIcSilGVtaLAquw=", "narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "de3bb0155823298161c1c0a7805f10d4b4074bbb", "rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -361,11 +361,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742243551, "lastModified": 1742547966,
"narHash": "sha256-hp2tKtJHW/vbiIT4hRhP8cfZEACAWZ92lCdaO9WEi2E=", "narHash": "sha256-AJfw+XRaRyrlpb9Wy6rVz44JePy0AXWPECXVPBnrOfI=",
"owner": "deuxfleurs-org", "owner": "deuxfleurs-org",
"repo": "garage", "repo": "garage",
"rev": "6906a4ff12838da2a74bdaeb7e7cd05cd1d69699", "rev": "14d2f2b18da015508d4a1e31b2f014da5188d516",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -448,6 +448,30 @@
"type": "github" "type": "github"
} }
}, },
"helix": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": "nixpkgs_4",
"rust-overlay": [
"rust-overlay"
]
},
"locked": {
"lastModified": 1742907812,
"narHash": "sha256-iloXwOZWx43mRvW3tlqRbqlDCIkOudrbtqVWE+q5OLg=",
"owner": "helix-editor",
"repo": "helix",
"rev": "388a3b78e3c4feff9c058b020c12f9eb47e72168",
"type": "github"
},
"original": {
"owner": "helix-editor",
"repo": "helix",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -455,11 +479,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742246081, "lastModified": 1742996658,
"narHash": "sha256-1e4oFbtdOOb6NqauHevWWjEUXZnfZ6RUAJJjn9i4YBc=", "narHash": "sha256-snxgTLVq6ooaD3W3mPHu7LVWpoZKczhxHAUZy2ea4oA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c657142e24a43ea1035889f0b0a7c24598e0e18a", "rev": "693840c01b9bef9e54100239cef937e53d4661bf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -564,29 +588,17 @@
} }
}, },
"lix": { "lix": {
"inputs": { "flake": false,
"flake-compat": [
"flake-compat"
],
"nix2container": "nix2container",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression",
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": { "locked": {
"lastModified": 1742262179, "lastModified": 1742622332,
"narHash": "sha256-bmywICXzaly0Q9orrv8ADTAPyNrzjzPX52Dk5I2omd4=", "narHash": "sha256-z652gNdFc/95Fheq4DzVObERYRo+j9RdCF6tzkR8r80=",
"ref": "refs/heads/main", "rev": "6059cbb031e49e05dd5d16208e2e50d3ab2611db",
"rev": "5243a6f8b4d5936ffdf2b5b44451e5949a73da06", "type": "tarball",
"revCount": 17681, "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/6059cbb031e49e05dd5d16208e2e50d3ab2611db.tar.gz?rev=6059cbb031e49e05dd5d16208e2e50d3ab2611db"
"type": "git",
"url": "https://git.lix.systems/lix-project/lix"
}, },
"original": { "original": {
"type": "git", "type": "tarball",
"url": "https://git.lix.systems/lix-project/lix" "url": "https://git.lix.systems/lix-project/lix/archive/main.tar.gz"
} }
}, },
"lix-module": { "lix-module": {
@ -595,19 +607,17 @@
"flake-utils" "flake-utils"
], ],
"flakey-profile": "flakey-profile", "flakey-profile": "flakey-profile",
"lix": [ "lix": "lix",
"lix"
],
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1741894565, "lastModified": 1742945498,
"narHash": "sha256-2FD0NDJbEjUHloVrtEIms5miJsj1tvQCc/0YK5ambyc=", "narHash": "sha256-MB/b/xcDKqaVBxJIIxwb81r8ZiGLeKEcqokATRRroo8=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "a6da43f8193d9e329bba1795c42590c27966082e", "rev": "fa69ae26cc32dda178117b46487c2165c0e08316",
"revCount": 136, "revCount": 138,
"type": "git", "type": "git",
"url": "https://git.lix.systems/lix-project/nixos-module" "url": "https://git.lix.systems/lix-project/nixos-module"
}, },
@ -727,11 +737,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742174123, "lastModified": 1742701275,
"narHash": "sha256-pDNzMoR6m1ZSJToZQ6XDTLVSdzIzmFl1b8Pc3f7iV6Y=", "narHash": "sha256-AulwPVrS9859t+eJ61v24wH/nfBEIDSXYxlRo3fL/SA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "2cfb4e1ca32f59dd2811d7a6dd5d4d1225f0955c", "rev": "36dc43cb50d5d20f90a28d53abb33a32b0a2aae6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -747,11 +757,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742204505, "lastModified": 1742804816,
"narHash": "sha256-sHBzuG9K/VrvOrcLd9GwoCLaQZDVedi/00YmFfdKq/A=", "narHash": "sha256-oRNAhQwybNM5IUeGLR/4APdiec3t8t3vuWALEGg0t/Q=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-ld", "repo": "nix-ld",
"rev": "bc1ecb8ca83507c764a3909f02f1acf53c033585", "rev": "27a5f75260a086f391c0eca38a5e306b9823a0b4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -760,22 +770,6 @@
"type": "github" "type": "github"
} }
}, },
"nix2container": {
"flake": false,
"locked": {
"lastModified": 1724996935,
"narHash": "sha256-njRK9vvZ1JJsP8oV2OgkBrpJhgQezI03S7gzskCcHos=",
"owner": "nlewo",
"repo": "nix2container",
"rev": "fa6bb0a1159f55d071ba99331355955ae30b3401",
"type": "github"
},
"original": {
"owner": "nlewo",
"repo": "nix2container",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1730531603, "lastModified": 1730531603,
@ -792,22 +786,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1730741070, "lastModified": 1730741070,
@ -826,11 +804,11 @@
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1742136038, "lastModified": 1742751704,
"narHash": "sha256-DDe16FJk18sadknQKKG/9FbwEro7A57tg9vB5kxZ8kY=", "narHash": "sha256-rBfc+H1dDBUQ2mgVITMGBPI1PGuCznf9rcWX/XIULyE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a1185f4064c18a5db37c5c84e5638c78b46e3341", "rev": "f0946fa5f1fb876a9dc2e1850d9d3a4e3f914092",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -874,11 +852,27 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1742230170, "lastModified": 1740560979,
"narHash": "sha256-BEny83HblVcCGgSG3NHljafuWQE6+yP8XNUIydsIyoA=", "narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0f80da4f5e0dbe1f917f6f3643a262bae7dbb34e", "rev": "5135c59491985879812717f4c9fea69604e7f26f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1742960832,
"narHash": "sha256-xdp71QH76Q0esAJi4+5xDzpgBQNFpq8xn6UNfyT/s9w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "24693557f72603e8f2c514ee26854d5c2aad9090",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -899,11 +893,11 @@
"nuschtosSearch": "nuschtosSearch" "nuschtosSearch": "nuschtosSearch"
}, },
"locked": { "locked": {
"lastModified": 1742255305, "lastModified": 1742991302,
"narHash": "sha256-XxygfriVXQt+5Iqh6AOjZL5Aes5dH2xzVKpHpL8pDQg=", "narHash": "sha256-5S+qnc5ijgFWlAWS9+L7uAgpDnL0RtVEDhVpHWGoavA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "78f6166c23f80bdfbcc8c44b20f7f4132299a33f", "rev": "1c0dd320d9c4f250ac33382e11d370b7abe97622",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -922,11 +916,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1738508923, "lastModified": 1742659553,
"narHash": "sha256-4DaDrQDAIxlWhTjH6h/+xfG05jt3qDZrZE/7zDLQaS4=", "narHash": "sha256-i/JCrr/jApVorI9GkSV5to+USrRCa0rWuQDH8JSlK2A=",
"owner": "NuschtOS", "owner": "NuschtOS",
"repo": "search", "repo": "search",
"rev": "86e2038290859006e05ca7201425ea5b5de4aecb", "rev": "508752835128a3977985a4d5225ff241f7756181",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -967,22 +961,6 @@
"type": "github" "type": "github"
} }
}, },
"pre-commit-hooks": {
"flake": false,
"locked": {
"lastModified": 1733318908,
"narHash": "sha256-SVQVsbafSM1dJ4fpgyBqLZ+Lft+jcQuMtEL3lQWx2Sk=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "6f4e2a2112050951a314d2733a994fbab94864c6",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"pre-commit-hooks-nix": { "pre-commit-hooks-nix": {
"inputs": { "inputs": {
"flake-compat": [ "flake-compat": [
@ -1035,14 +1013,14 @@
"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": "lix",
"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_4", "nixpkgs": "nixpkgs_5",
"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",
@ -1077,11 +1055,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742178793, "lastModified": 1742956365,
"narHash": "sha256-S2onMdoDS4tIYd3/Jc5oFEZBr2dJOgPrh9KzSO/bfDw=", "narHash": "sha256-Slrqmt6kJ/M7Z/ce4ebQWsz2aeEodrX56CsupOEPoz0=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "954582a766a50ebef5695a9616c93b5386418c08", "rev": "a0e3395c63cdbc9c1ec17915f8328c077c79c4a1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1097,11 +1075,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742239755, "lastModified": 1742700801,
"narHash": "sha256-ptn8dR4Uat3UUadGYNnB7CIH9SQm8mK69D2A/twBUXQ=", "narHash": "sha256-ZGlpUDsuBdeZeTNgoMv+aw0ByXT2J3wkYw9kJwkAS4M=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "787afce414bcce803b605c510b60bf43c11f4b55", "rev": "67566fe68a8bed2a7b1175fdfb0697ed22ae8852",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1147,11 +1125,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739829690, "lastModified": 1742982148,
"narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=", "narHash": "sha256-aRA6LSxjlbMI6MmMzi/M5WH/ynd8pK+vACD9za3MKLQ=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "3d0579f5cc93436052d94b73925b48973a104204", "rev": "61c88349bf6dff49fa52d7dfc39b21026c2a8881",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1170,11 +1148,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742262692, "lastModified": 1742954036,
"narHash": "sha256-kCuy1Fld1vFmor6SZ48DdtiLv9/zUhW8lCaTA+Py+es=", "narHash": "sha256-L6QGMSkquAqW2IjiAI6Q0e0aOR1DsZW8teDxzHQaNaA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-vscode-extensions", "repo": "nix-vscode-extensions",
"rev": "32de9a383db6b555ac92877dd8b5b986f4151de7", "rev": "463df39cfb76e4896a8625554d3c675c30fbe63a",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -51,12 +51,6 @@
url = "git+https://git.lix.systems/lix-project/nixos-module"; url = "git+https://git.lix.systems/lix-project/nixos-module";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
inputs.lix.follows = "lix";
};
lix = {
url = "git+https://git.lix.systems/lix-project/lix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.follows = "flake-compat";
}; };
nix-ld = { nix-ld = {
url = "github:nix-community/nix-ld"; url = "github:nix-community/nix-ld";
@ -98,6 +92,11 @@
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";
@ -113,7 +112,7 @@
nixConfig = { nixConfig = {
extra-substituters = [ extra-substituters = [
"https://nix-community.cachix.org" "https://nix-community.cachix.org"
"https://cache.cy7.sh/main" "https://cdn.cy7.sh/main"
]; ];
extra-trusted-public-keys = [ extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
@ -135,7 +134,6 @@
imports = [ imports = [
inputs.treefmt.flakeModule inputs.treefmt.flakeModule
]; ];
debug = true;
systems = [ systems = [
"x86_64-linux" "x86_64-linux"
]; ];
@ -148,11 +146,14 @@
treefmt = { treefmt = {
projectRootFile = "flake.nix"; projectRootFile = "flake.nix";
programs.nixfmt.enable = true; programs.nixfmt.enable = true;
programs.stylua.enable = true;
programs.yamlfmt.enable = true;
programs.typos.enable = true; programs.typos.enable = true;
programs.shellcheck.enable = true; programs.shellcheck.enable = true;
programs.yamlfmt = {
enable = true;
settings.retain_line_breaks = true;
};
settings.global.excludes = [ settings.global.excludes = [
"secrets/*" "secrets/*"
"**/*.png" # tries to format a png file "**/*.png" # tries to format a png file

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, lib, ... }:
{ {
programs.vscode = { programs.vscode = {
enable = true; enable = true;
@ -22,10 +22,13 @@
emilast.logfilehighlighter emilast.logfilehighlighter
tamasfe.even-better-toml tamasfe.even-better-toml
golang.go golang.go
ms-python.python
christian-kohler.path-intellisense
]; ];
userSettings = userSettings =
let let
vimCommonKeyBindings = [ vimCommonKeyBindings = [
# nice emacs bindings
{ {
"before" = [ "C-a" ]; "before" = [ "C-a" ];
"commands" = [ "cursorHome" ]; "commands" = [ "cursorHome" ];
@ -34,6 +37,19 @@
"before" = [ "C-e" ]; "before" = [ "C-e" ];
"commands" = [ "cursorEnd" ]; "commands" = [ "cursorEnd" ];
} }
{
"before" = [ "C-b" ];
"commands" = [ "cursorLeft" ];
}
{
"before" = [ "C-f" ];
"commands" = [ "cursorRight" ];
}
# ctrl+h to turn off search highlighting
{
"before" = [ "C-h" ];
"commands" = [ ":nohl" ];
}
]; ];
in in
{ {
@ -73,7 +89,7 @@
"markdown-preview-enhanced.previewTheme" = "github-dark.css"; "markdown-preview-enhanced.previewTheme" = "github-dark.css";
"nix.enableLanguageServer" = true; "nix.enableLanguageServer" = true;
"nix.serverPath" = "nil"; "nix.serverPath" = "${lib.getExe pkgs.nil}";
"bookmarks.saveBookmarksInProject" = true; "bookmarks.saveBookmarksInProject" = true;
"cSpell.enabledFileTypes" = { "cSpell.enabledFileTypes" = {
@ -83,6 +99,15 @@
# vim stuff # vim stuff
"vim.leader" = ","; "vim.leader" = ",";
"extensions.experimental.affinity" = {
"vscodevim.vim" = 1;
};
"vim.sneak" = true;
"vim.sneakUseIgnorecaseAndSmartcase" = true;
"vim.enableNeovim" = true;
"vim.hlsearch" = true;
"vim.easymotion" = true;
"editor.lineNumbers" = "relative";
"vim.normalModeKeyBindings" = vimCommonKeyBindings ++ [ "vim.normalModeKeyBindings" = vimCommonKeyBindings ++ [
{ {
"before" = [ ";" ]; "before" = [ ";" ];
@ -117,6 +142,13 @@
]; ];
"commands" = [ "workbench.action.toggleSidebarVisibility" ]; "commands" = [ "workbench.action.toggleSidebarVisibility" ];
} }
{
"before" = [
"<space>"
"s"
];
"commands" = [ "workbench.action.toggleSidebarVisibility" ];
}
{ {
"before" = [ "before" = [
"<leader>" "<leader>"
@ -190,10 +222,33 @@
"commands" = [ "editor.action.outdentLines" ]; "commands" = [ "editor.action.outdentLines" ];
} }
]; ];
"extensions.experimental.affinity" = {
"vscodevim.vim" = 1;
};
}; };
keybindings = [
# repeat these vim bindings here cause otherwise they get overridden by vscode
{
"key" = "ctrl+b";
"when" = "inputFocus";
"command" = "cursorLeft";
}
{
"key" = "ctrl+f";
"when" = "inputFocus";
"command" = "cursorRight";
}
# clear default bindings that conflict
{
"key" = "ctrl+f";
"command" = "-actions.find";
}
{
"key" = "ctrl+b";
"command" = "-workbench.action.toggleSidebarVisibility";
}
{
"key" = "ctrl+w";
"command" = "-workbench.action.closeActiveEditor";
}
];
}; };
}; };
} }

View file

@ -71,41 +71,6 @@
key = "<C-e>"; key = "<C-e>";
mode = "i"; mode = "i";
} }
# quick chat with copilot
{
key = "<leader>ccq";
action.__raw = ''
function()
local input = vim.fn.input("Quick chat: ")
if input ~= "" then
require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer })
end
end
'';
mode = [
"n"
"v"
];
}
# ask perplexity a quick question
{
key = "<leader>ccs";
action.__raw = ''
function()
local input = vim.fn.input("Perplexity: ")
if input ~= "" then
require("CopilotChat").ask(input, {
agent = "perplexityai",
selection = false,
})
end
end
'';
mode = [
"n"
"v"
];
}
]; ];
plugins.cmp = { plugins.cmp = {
@ -198,10 +163,11 @@
}; };
rust_analyzer = { rust_analyzer = {
enable = true; enable = true;
installRustc = true; installRustc = false;
installCargo = true; installCargo = false;
}; };
eslint.enable = true; eslint.enable = true;
yamlls.enable = true;
}; };
}; };
plugins.treesitter = { plugins.treesitter = {
@ -233,13 +199,6 @@
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;

View file

@ -14,8 +14,4 @@
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
];
} }

View file

@ -60,7 +60,6 @@
unzip unzip
anki-bin anki-bin
trezorctl trezorctl
trezor-agent
q q
gdb gdb
fuzzel fuzzel
@ -77,7 +76,6 @@
)) ))
p7zip p7zip
qbittorrent qbittorrent
nil
android-tools android-tools
frida-tools frida-tools
mitmproxy mitmproxy
@ -100,9 +98,10 @@
nix-output-monitor nix-output-monitor
wl-clipboard-rs wl-clipboard-rs
pixelflasher pixelflasher
element-desktop cinny-desktop
freetube freetube
gopls gopls
rust-analyzer
]; ];
home.sessionVariables = { home.sessionVariables = {
@ -152,4 +151,17 @@
}; };
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";
};
};
};
} }

View file

@ -92,7 +92,7 @@
"s" = "sudo"; "s" = "sudo";
"nrs" = "sudo nixos-rebuild switch -L --flake . --log-format internal-json -v |& nom --json"; "nrs" = "sudo nixos-rebuild switch -L --flake . --log-format internal-json -v |& nom --json";
"nrt" = "sudo nixos-rebuild test -L --flake . --log-format internal-json -v |& nom --json"; "nrt" = "sudo nixos-rebuild test -L --flake . --log-format internal-json -v |& nom --json";
"hrs" = "home-manager switch -L --flake . |& nom --json"; "hrs" = "home-manager switch -L --flake .";
"g" = "git"; "g" = "git";
"ga" = "git add"; "ga" = "git add";
"gaa" = "git add --all"; "gaa" = "git add --all";

View file

@ -15,7 +15,7 @@
replication_factor = 1; replication_factor = 1;
db_engine = "lmdb"; db_engine = "lmdb";
disable_scrub = true; disable_scrub = true;
block_size = "10M"; block_size = "128M";
compression_level = "none"; compression_level = "none";
}; };
environmentFile = config.sops.secrets."garage/env".path; environmentFile = config.sops.secrets."garage/env".path;

View file

@ -9,6 +9,7 @@ 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 = {
@ -21,6 +22,7 @@ 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";

View file

@ -4,6 +4,32 @@
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;
@ -12,21 +38,7 @@
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 = { serviceConfig = mkServiceConfig "photos:" "/mnt/photos";
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 = {
@ -36,26 +48,6 @@
after = [ "network-online.target" ]; after = [ "network-online.target" ];
requiredBy = [ "garage.service" ]; requiredBy = [ "garage.service" ];
before = [ "garage.service" ]; before = [ "garage.service" ];
serviceConfig = { serviceConfig = mkServiceConfig "rsyncnet:garage" "/mnt/garage";
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 10M \
--vfs-read-chunk-streams 32 \
rsyncnet:garage /mnt/garage
'';
ExecStop = "${lib.getExe' pkgs.fuse "fusermount"} -u /mnt/garage";
};
}; };
} }

View file

@ -13,9 +13,9 @@
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0=" "main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0="
]; ];
trusted-substituters = [ extra-substituters = [
"https://nix-community.cachix.org" "https://nix-community.cachix.org"
"https://cache.cy7.sh/main" "https://cdn.cy7.sh/main"
]; ];
}; };
channel.enable = false; channel.enable = false;

View file

@ -18,7 +18,7 @@ in
settings = { settings = {
listen = "[::]:8091"; listen = "[::]:8091";
api-endpoint = "https://cache.cy7.sh/"; api-endpoint = "https://cache.cy7.sh/";
allowed-hosts = [ "cache.cy7.sh" ]; allowed-hosts = [ "cache.cy7.sh" "cdn.cy7.sh" ];
require-proof-of-possession = false; require-proof-of-possession = false;
compression = { compression = {
type = "none"; type = "none";
@ -30,18 +30,40 @@ in
type = "s3"; type = "s3";
region = "us-east-1"; region = "us-east-1";
bucket = "attic"; bucket = "attic";
endpoint = "https://s3.cy7.sh"; # 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";
}; };
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;
};
}; };
}; };
services.caddy.virtualHosts."cache.cy7.sh".extraConfig = '' systemd.services.atticd = {
import common requires = [ "garage.service" ];
reverse_proxy localhost:8091 after = [ "garage.service" ];
''; environment = {
RUST_LOG = "INFO";
};
};
services.caddy.virtualHosts."cache.cy7.sh" = {
serverAliases = [ "cdn.cy7.sh" ];
extraConfig = ''
import common
reverse_proxy localhost:8091
'';
};
}; };
} }

View file

@ -1,7 +1,7 @@
final: prev: { final: prev: {
attic-server = prev.attic-server.overrideAttrs { attic-server = prev.attic-server.overrideAttrs {
patches = [ patches = [
./prefetch-N-chunks.patch ./prefetch-8-chunks.patch
]; ];
}; };
} }

View file

@ -0,0 +1,23 @@
diff --git a/server/src/api/binary_cache.rs b/server/src/api/binary_cache.rs
index 02e4857..b522154 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
// The ideal size depends on the average chunk size
- let merged = merge_chunks(chunks, streamer, storage, 2).map_err(|e| {
+ let merged = merge_chunks(chunks, streamer, storage, 8).map_err(|e| {
tracing::error!(%e, "Stream error");
e
});

View file

@ -1,13 +0,0 @@
diff --git a/server/src/api/binary_cache.rs b/server/src/api/binary_cache.rs
index 02e4857..71eeee8 100644
--- a/server/src/api/binary_cache.rs
+++ b/server/src/api/binary_cache.rs
@@ -262,7 +262,7 @@ async fn get_nar(
// TODO: Make num_prefetch configurable
// The ideal size depends on the average chunk size
- let merged = merge_chunks(chunks, streamer, storage, 2).map_err(|e| {
+ let merged = merge_chunks(chunks, streamer, storage, 16).map_err(|e| {
tracing::error!(%e, "Stream error");
e
});

View file

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