mirror of
https://github.com/codedownio/time-ghc-modules.git
synced 2024-11-20 20:08:39 +03:00
Add nix derivation
This commit is contained in:
parent
711becd671
commit
02033ddc3d
27
default.nix
Normal file
27
default.nix
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
pkgs ? import (import ./pinned-nixpkgs.nix) {}
|
||||
}:
|
||||
|
||||
let
|
||||
script = ./time-ghc-modules;
|
||||
process = ./scripts/process;
|
||||
index = ./dist/index.html;
|
||||
|
||||
in
|
||||
|
||||
with pkgs;
|
||||
|
||||
runCommand "time-ghc-modules" {
|
||||
propagatedBuildInputs = [makeWrapper];
|
||||
inherit script process index;
|
||||
} ''
|
||||
mkdir -p $out/bin
|
||||
cp $script $out/bin/time-ghc-modules
|
||||
wrapProgram $out/bin/time-ghc-modules --prefix PATH : ${lib.makeBinPath [ sqlite ]}
|
||||
|
||||
mkdir -p $out/bin/scripts
|
||||
ln -s $process $out/bin/scripts/process
|
||||
|
||||
mkdir -p $out/bin/dist
|
||||
ln -s $index $out/bin/dist/index.html
|
||||
''
|
6
pinned-nixpkgs.nix
Normal file
6
pinned-nixpkgs.nix
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
builtins.fetchGit {
|
||||
url = "https://github.com/NixOS/nixpkgs.git";
|
||||
rev = "973910f5c31b9ba6c171c33a8bd7199990b14c72";
|
||||
ref = "release-21.05";
|
||||
}
|
6
time-ghc-modules-nix
Executable file
6
time-ghc-modules-nix
Executable file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
|
||||
$(nix-build $SCRIPT_DIR)/bin/time-ghc-modules "$@"
|
Loading…
Reference in New Issue
Block a user