-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
52 lines (49 loc) · 1.26 KB
/
flake.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
rec {
description = "The Grandest Project Ever";
nixConfig.bash-prompt = "[nix(submania)] ";
inputs = { nixpkgs.url = "github:nixos/nixpkgs/23.05"; };
outputs = { self, nixpkgs }:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
fooScript = pkgs.writeScriptBin "foo.sh" ''
#!/bin/sh
echo $FOO
'';
in {
devShells.x86_64-linux.default = pkgs.mkShell {
name = "The Grandest of Build Environments";
buildInputs = with pkgs; [
# godot_4
nodejs_18
terra
fooScript
]
++ ( with ocamlPackages;
[
dune_3
findlib
ocaml
ocaml-lsp
odoc
utop
]);
shellHook = ''
echo "Welcome to Grand-Town in $name"
export FOO="BAR"
'';
};
defaultPackage.x86_64-linux =
# Notice the reference to nixpkgs here.
with import nixpkgs { system = "x86_64-linux"; };
clang12Stdenv.mkDerivation {
name = "hello";
src = self;
buildPhase = ''
ls -la
clang -o hello ./hello.c
'';
installPhase = "mkdir -p $out/bin; install -t $out/bin hello";
};
};
}
# Good night!