Skip to content

criome/nix-fetcher-data

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nix-fetcher-data

leave data alone

Rich Hickey - Simple Made Easy

Usage

In flake.nix:

{
  inputs.nix-fetcher-data = {
    url = "github:jlesquembre/nix-fetcher-data";
    inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = { nix-fetcher-data, nixpkgs, ... }@inputs:

    let
      pkgs = import nixpkgs {
        system = "x86_64-linux";
        overlays = [ nix-fetcher-data.overlays.default ];
      };
    in
    {
      # ...
    };
}

In a derivation:

{ stdenv
, nix-package-updater
, srcFromJson
, writeScriptBin
}:

let projectInfo = srcFromJson ./src.json; in

stdenv.mkDerivation {

  inherit (projectInfo) version src;

  passthru.updateScript = writeScriptBin "update-src"
    ''
      ${nix-package-updater} pkgs/foo/src.json
    '';
}

src.json looks like this:

{
  "version": "1.0",
  "fetcher": "fetchFromGitHub",
  "args": {
    "owner": "owner",
    "repo": "repo",
    "rev": "v1.0",
    "hash": "sha256-7YmJ2QHIabBu3C2kaLplxMXg9YP2KQ3OxYyFCVFOCsk=",
    "fetchSubmodules": true
  }
}

To update the version run nix run .#my-pkg.update-src

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nix 53.6%
  • Clojure 46.4%