-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
62 lines (54 loc) · 1.67 KB
/
shell.nix
File metadata and controls
62 lines (54 loc) · 1.67 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
56
57
58
59
60
61
62
# shell.nix for frogOS development environment
{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell {
name = "frogOS-dev-environment";
buildInputs = with pkgs; [
# Basic development tools
gnumake
gdb
qemu
parted
# Basic utilities
coreutils
util-linux
clang-tools # clang-format
# x86_64-elf cross-compiler and tools
pkgsCross.x86_64-embedded.buildPackages.gcc
pkgsCross.x86_64-embedded.buildPackages.binutils
];
# Environment variables for the shell
shellHook = ''
export PROJECT_ROOT=$(pwd)
export SYSROOT=$PROJECT_ROOT/sysroot
# Set up cross compiler executables
export CC="x86_64-elf-gcc"
export CXX="x86_64-elf-g++"
export LD="x86_64-elf-ld"
export AR="x86_64-elf-ar"
export AS="x86_64-elf-as"
# Make build scripts executable automatically
chmod +x $PROJECT_ROOT/default-host.sh
chmod +x $PROJECT_ROOT/target-triplet-to-arch.sh
chmod +x $PROJECT_ROOT/headers.sh
chmod +x $PROJECT_ROOT/config.sh
echo "==============================================="
echo "frogOS Development Environment"
echo "==============================================="
echo "Available cross-compiler tools:"
echo " CC : $CC"
echo " CXX : $CXX"
echo " LD : $LD"
echo " AR : $AR"
echo " AS : $AS"
echo ""
echo "Project configuration:"
echo " PROJECT_ROOT : $PROJECT_ROOT"
echo " SYSROOT : $SYSROOT"
echo "==============================================="
echo "Use 'nix-shell' to enter this environment"
echo "Run 'make' to build the entire system"
echo "==============================================="
'';
}