~ruther/nix-fpga

ref: f618f1a0e7c1ac5e3ff8b6b99ecc006cdcaef8bc nix-fpga/pkgs/final-pkg-generator.nix -rw-r--r-- 598 bytes
f618f1a0 — Rutherther docs: update information about ISE since cable is fixed 1 year, 26 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ lib, stdenv, customInstallScript ? "", fhsEnv ? "", executables ? "", mainProgram ? "" }:

let
  genScript = file: ''
    #!/usr/bin/env bash
    exec ${lib.getExe fhsEnv} ${file} \"\$@\"
  '';

  createScript = file: ''
   echo "${genScript file}" > $out/bin/${file}
   chmod +x $out/bin/${file}
  '';

  createScripts = map (file: createScript file) executables;

in stdenv.mkDerivation {
  name = mainProgram;

  installPhase = ''
    mkdir -p $out/bin
  '' + customInstallScript + (lib.concatStrings createScripts);

  phases = [ "installPhase" ];

  meta = {
    inherit mainProgram;
  };
}
Do not follow this link