-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
71 lines (65 loc) · 1.85 KB
/
shell.nix
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
let
pkgs = (import ./nix/shared.nix).pkgs;
cockpitProxy = let
proxyName = "cockpit-proxy";
proxyVersion = "2.0.1";
nixGleamSrc = pkgs.stdenv.mkDerivation {
name = "nix-gleam";
src = fetchGit {
url = "https://github.com/arnarg/nix-gleam.git";
rev = "d1d2d6bcc5be6ea6a2d31e48aa55e7ea3bd41a1f";
};
installPhase = ''
mkdir -p $out
cp $src/builder/default.nix $out
'';
};
nixGleam = (pkgs.callPackage nixGleamSrc {});
in nixGleam.buildGleamApplication {
pname = proxyName;
version = proxyVersion;
src = fetchGit {
url = "https://github.com/MarcoDaniels/cockpit-cms-proxy.git";
ref = "refs/tags/v${proxyVersion}";
};
};
dot2Env = pkgs.stdenv.mkDerivation {
name = "dot2Env";
version = "0.0.1";
src = fetchGit {
url = "https://github.com/MarcoDaniels/scripts.git";
rev = "38119e17ab198abe0fdf4ae2e3222596925f4b00";
};
installPhase = ''
mkdir -p $out/bin
cp $src/dot2Env.sh $out/bin/dot2Env
chmod +x $out/bin/dot2Env
'';
doCheck = true;
};
# concurrently Pages with Proxy & Preview
start = pkgs.writeShellScriptBin "start" ''
${pkgs.concurrently}/bin/concurrently "${pkgs.elmPackages.elm-pages}/bin/elm-pages dev" cockpit_cms_proxy
'';
elmPostInstall = pkgs.writeShellScriptBin "elmPostInstall" ''
${pkgs.elm2nix}/bin/elm2nix convert > nix/elm-srcs.nix
${pkgs.elm2nix}/bin/elm2nix snapshot
mv registry.dat nix/
'';
in pkgs.mkShell {
buildInputs = [
pkgs.nixfmt
pkgs.terraform
pkgs.nodejs_18
pkgs.concurrently
pkgs.elmPackages.elm
pkgs.elmPackages.elm-format
pkgs.elmPackages.elm-test
pkgs.elmPackages.elm-pages
pkgs.elm2nix
cockpitProxy
dot2Env
start
elmPostInstall
];
}