-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdefault.nix
More file actions
55 lines (47 loc) · 1.38 KB
/
default.nix
File metadata and controls
55 lines (47 loc) · 1.38 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## Prefer nixpkgs 22.05 (same as buildkit)
{pkgs ? import (fetchTarball { url = "https://github.com/nixos/nixpkgs/archive/ce6aa13369b667ac2542593170993504932eb836.tar.gz"; sha256 = "0d643wp3l77hv2pmg2fi7vyxn4rwy0iyr8djcw1h5x72315ck9ik"; }) {
inherit system;
},
system ? builtins.currentSystem,
noDev ? false,
php ? pkgs.php74,
phpPackages ? pkgs.php74Packages
}:
let
stdenv = pkgs.stdenv;
## Make a single "src" with copies of all our files.
makeLatestSrc = stdenv.mkDerivation rec {
## There must be a better way...
name = "loco-src";
src = ./src;
bin = ./bin;
patches = ./patches;
scripts = ./scripts;
composerJson = ./composer.json;
composerLock = ./composer.lock;
buildCommand = ''
mkdir $out
cp -r $src $out/src
cp -r $bin $out/bin
cp -r $patches $out/patches
cp -r $scripts $out/scripts
cp $composerJson $out/composer.json
cp $composerLock $out/composer.lock
'';
};
in stdenv.mkDerivation rec {
name = "loco";
src = makeLatestSrc;
#src = pkgs.fetchFromGitHub {
# owner = "totten";
# repo = "loco";
# rev = "FIXME";
# sha256 = "FIXME";
#};
buildInputs = [ php phpPackages.composer phpPackages.box pkgs.git pkgs.cacert ];
builder = "${src}/scripts/nix-builder.sh";
shellHook = ''
PATH="$PWD/bin:$PWD/extern:$PATH"
export PATH
'';
}