/ flake.nix
flake.nix
 1  {
 2    inputs = {
 3      nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
 4      radicle-update.url = "git+https://radicle.defelo.de/zPrhdopkKmKWdeEJJHx6TvKM832X.git";
 5    };
 6  
 7    outputs =
 8      {
 9        self,
10        nixpkgs,
11        radicle-update,
12      }:
13  
14      let
15        inherit (nixpkgs) lib;
16  
17        systems = [
18          "x86_64-linux"
19          "aarch64-linux"
20          "x86_64-darwin"
21          "aarch64-darwin"
22        ];
23        eachSystem = f: lib.genAttrs systems (s: f nixpkgs.legacyPackages.${s});
24      in
25  
26      {
27        packages = eachSystem (pkgs: {
28          update = pkgs.writers.writeNuBin "update" (builtins.readFile ./update.nu);
29  
30          update-push = pkgs.callPackage ./update-push.nix {
31            inherit radicle-update;
32            inherit (self.packages.${pkgs.stdenv.hostPlatform.system}) update;
33          };
34        });
35  
36        collections = lib.mapAttrs' (
37          name: _: lib.nameValuePair (lib.removeSuffix ".json" name) (lib.importJSON ./collections/${name})
38        ) (builtins.readDir ./collections);
39  
40        lists = lib.mapAttrs (hash: _: ./lists/${hash}) (builtins.readDir ./lists);
41  
42        source-hosts = lib.importJSON ./source-hosts.json;
43      };
44  }