-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
41 lines (38 loc) · 835 Bytes
/
Copy pathshell.nix
File metadata and controls
41 lines (38 loc) · 835 Bytes
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
{
pkgs ? import <nixpkgs> { },
}:
let
static = pkgs.pkgsStatic;
in
pkgs.mkShell {
packages = with pkgs; [
gcc
clang-tools # includes clangd and clang-format
gdb
pkg-config
valgrind
codecrafters-cli
ninja
readline
(writeShellApplication {
name = "build";
runtimeInputs = [ pkgs.gcc ];
text = "gcc main.c utils/*.c -I. -g -lreadline -Wall -Wextra -o mishell ";
})
(writeShellApplication {
name = "build-static";
runtimeInputs = [ static.gcc ];
text = ''
gcc "$@" -static -g -Wall -Wextra \
-I${static.readline.dev}/include \
-L${static.readline}/lib \
-L${static.ncurses}/lib \
-lreadline -lncursesw \
-o mishell
'';
})
];
shellHook = ''
echo " It's C time :)"
'';
}