{"id":21998242,"url":"https://github.com/simonswine/hoardix","last_synced_at":"2025-04-30T21:08:57.719Z","repository":{"id":64304376,"uuid":"376394177","full_name":"simonswine/hoardix","owner":"simonswine","description":"Hoard your nix derivations","archived":false,"fork":false,"pushed_at":"2023-06-20T07:52:21.000Z","size":98,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-30T21:08:53.296Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonswine.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-12T22:27:31.000Z","updated_at":"2023-04-23T04:39:59.000Z","dependencies_parsed_at":"2024-06-20T10:18:09.406Z","dependency_job_id":"e475d121-7665-4c89-98d8-a4a9a0c2b822","html_url":"https://github.com/simonswine/hoardix","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonswine%2Fhoardix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonswine%2Fhoardix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonswine%2Fhoardix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonswine%2Fhoardix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonswine","download_url":"https://codeload.github.com/simonswine/hoardix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251782775,"owners_count":21642987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T22:20:46.533Z","updated_at":"2025-04-30T21:08:57.698Z","avatar_url":"https://github.com/simonswine.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Hoardix\n:release-version: 0.1.0\n:url-gh: https://github.com/simonswine\n:url-repo: {url-gh}/hoardix\n:url-cachix: https://cachix.org\n:url-cache-nix: https://nixos.wiki/wiki/Binary_Cache\n:image-url-screenshot: https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/screenshot.png\n\n{url-repo}[Hoardix] is a {url-cachix}[Cachix] API compatible {url-cache-nix}[binary cache for Nix] derivations.\n\n== Usage\n\n=== Configuration\n\n[source,yaml]\n----\n# base url of how the cache is reached\n#\n# Cachix will be using the subdomain api.$base_domain to communicate with the\n# API, while every cache defined in caches, will be available under its\n# subdomain. So for the cachix to be reached it is advised to create a wildcard\n# dns record pointing at this cache *.$base_domain.\nbase_url: http://localhost:5000\n\n# modify http listen port. default: 5000\nlisten_port: 5000\n\n# modify metrics listen port. default:9500\nmetric_listen_port: 9500\n\n# define underlying storage for the cache\nstorage:\n  s3:\n   bucket: my-nixos-cache\n   region: eu-central-1\n   access_key: AKIA..\n   secret_key: \u003credacted\u003e\n\n# map of caches with the key being the subdomain of the cache.\ncaches:\n  private-cache:\n    # ed25519 private key which will be used to sign uploaded narinfo files.\n    #\n    # This key can be generated using:\n    # $ nix-store \\\n    #   --generate-binary-cache-key private-cache.cachix.my-domain.com \\\n    #   /dev/stdout /dev/null\n    private_key: \"private-cache.cachix.my-domain.com-1:\u003credacted\u003e\"\n\n    # public caches can be read without authentication. default: false\n    public: false\n\n    # priority defines the cache's priority, when looking for cached\n    # derivations. default: 41\n    priority: 41\n\n    # substituters allows to define upstream caches, which should be ignored\n    # while uploading derivations.\n    #\n    # This is example is the default upstream nixos binary cache.\n    substituters:\n      - url: \"https://cache.nixos.org\"\n        public_key: cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\n\n# this section shows how read and write tokens can be configured, which will\n# authorize requests.\ntokens:\n  - static:\n      tokens:\n        - insecure-write-token\n      mappings:\n        - caches:\n            - private-cache\n          permission: write\n  - static:\n      tokens:\n        - insecure-read-token-1\n        - insecure-read-token-2\n      mappings:\n        - caches:\n            - private-cache\n          permission: read\n----\n\n=== Docker\n\n[subs=\"attributes\"]\n----\n$ docker run -p 5000:5000 simonswine/hoardix:v{release-version}\n----\n\n==== Setup cache\n\n// Tested these and the following steps using docker run -t -i --net host nixos/nix:2.3.11\n\n[source,shell]\n----\n$ CACHIX_AUTH_TOKEN=insecure-write-token cachix --host http://localhost:5000 use my-cache\n----\n\n==== Build hello world derivation and push it to the cache\n\n[source,shell]\n----\n$ cat \u003e my-build.nix \u003c\u003cEOF\n{ nixpkgs ? import \u003cnixpkgs\u003e {} }:\nlet\n  inherit (nixpkgs) pkgs;\nin\n  pkgs.writeText \"hello.txt\" \"hello-hoardix\"\nEOF\n\n$ CACHIX_AUTH_TOKEN=insecure-write-token cachix --host http://localhost:5000 push my-cache $(nix-build --no-out-link my-build.nix)\n----\n\n==== Get derivation\n\n[source,shell]\n----\n$ STORE_PATH=$(nix-build --no-out-link my-build.nix)\n\n# Delete existing derivation\n$ nix-store --delete $STORE_PATH\n1 store paths deleted, 0.00 MiB freed\n\n# Download it again from the cache\n$ nix-store -r $STORE_PATH\nthese paths will be fetched (0.00 MiB download, 0.00 MiB unpacked):\n  /nix/store/98mzbdzn6vi2r65l8lqfjpp4sqpqrrv6-hello.txt\ncopying path '/nix/store/98mzbdzn6vi2r65l8lqfjpp4sqpqrrv6-hello.txt' from 'http://my-cache.localhost:5000'...\nwarning: you did not specify '--add-root'; the result might be removed by the garbage collector\n/nix/store/98mzbdzn6vi2r65l8lqfjpp4sqpqrrv6-hello.txt\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonswine%2Fhoardix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonswine%2Fhoardix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonswine%2Fhoardix/lists"}