8000 GitHub - Pitometsu/nixfix: You surely don't need it. It's a test repository to work on nix the package manager edge case problems
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

You surely don't need it. It's a test repository to work on nix the package manager edge case problems

Notifications You must be signed in to change notification settings

Pitometsu/nixfix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

What did I try:

snippet from Makefile:

echo "file://`realpath ./artifact`" > ./url
nix-hash --type sha256 --base32 ./artifact ./sha256
nix-prefetch-url --type sha256 --name artifact \
		`printf \`cat ./url\``
		`printf \`cat ./sha256\``
nice nix-build --pure -Q

snippet from default.nix

{ stdenv }:

with stdenv;

mkDerivation {
  name = "ma";
  src = with builtins; fetchTarball {
    url = replaceStrings ["\n"] [""] (
      readFile ./url
    );
    sha256 = replaceStrings ["\n"] [""] (
      readFile ./sha256
    );
  };
  installPhase = ''
    mkdir -p $out
    cp -a ./{.[^.]*,*} $out/
  '';
}

or simply:

{ stdenv, requireFile }:

with stdenv;

let
  src = with builtins; requireFile {
    url = replaceStrings ["\n"] [""] (
      readFile ./url
    );
    sha256 = replaceStrings ["\n"] [""] (
      readFile ./sha256
    );
    hashMode = "recursive";
  };
in

artifact = runCommand "artifact" {} ''
  mkdir -p $out
  cp -a ${src}/{.[^.]*,*} $out/
'';

About

You surely don't need it. It's a test repository to work on nix the package manager edge case problems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0