~ruther/nix-fpga

ref: d32ae553858be49b17fcaf188c940637d54cbb91 nix-fpga/pkgs/common.nix -rw-r--r-- 648 bytes
d32ae553 — Rutherther chore: add license 1 year, 19 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
{ pkgs, ... }:

{
  runScriptPrefix = package: required: ''
    # Search for an imperative declaration of the installation directory of ${package}
    error=0
    if [[ -f ~/.config/${package}/nix.sh ]]; then
      source ~/.config/${package}/nix.sh
    else
      echo "nix-${package}-error: Did not find ~/.config/${package}/nix.sh" >&2
      error=1
    fi
    if [[ ! -d "$INSTALL_DIR" ]]; then
      echo "nix-${package}-error: INSTALL_DIR $INSTALL_DIR isn't a directory" >&2
      error=2
  '' + ''
    fi

    if [[ $error -ne 0 ]]; then
      exit $error
    fi
  '';

  finalPkgGenerator = pkgs.callPackage ./final-pkg-generator.nix {};
}
Do not follow this link