old
1{
2 inputs,
3 lib,
4 ...
5}: {
6 flake-file.inputs.ncro = {
7 url = "github:manic-systems/ncro";
8 inputs.nixpkgs.follows = "nixpkgs";
9 };
10
11 den.aspects.core.nix.substituters = {
12 cache = {
13 directories = [
14 {
15 directory = "/var/lib/private/ncro";
16 user = "nobody";
17 group = "nogroup";
18 mode = "0700";
19 }
20 ];
21 };
22
23 nixos = {config, ...}: {
24 imports = [inputs.ncro.nixosModules.ncro];
25
26 nix.settings = {
27 substituters = lib.mkForce ["http://${config.services.ncro.settings.server.listen}"];
28 trusted-public-keys = [
29 ];
30 };
31
32 services.ncro = {
33 enable = true;
34 settings = {
35 server = {
36 listen = "localhost:9000";
37 read_timeout = "30s";
38 write_timeout = "30s";
39 };
40 cache = {
41 db_path = "/var/lib/ncro/routes.db";
42 };
43 upstreams = [
44 {
45 url = "https://cache.nixos.org";
46 priority = 15;
47 public_key = "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=";
48 }
49 {
50 url = "https://nix-community.cachix.org";
51 priority = 20;
52 public_key = "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=";
53 }
54 {
55 url = "https://mirrors.ustc.edu.cn/nix-channels/store";
56 priority = 10;
57 }
58 {
59 url = "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store";
60 priority = 10;
61 }
62 {
63 url = "https://cache.flox.dev";
64 priority = 30;
65 public_key = "flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs=";
66 }
67 ];
68 };
69 };
70 };
71 };
72}