-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
100 lines (87 loc) · 3.07 KB
/
flake.nix
File metadata and controls
100 lines (87 loc) · 3.07 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
inputs = {
modernpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
nixpkgs.follows = "nix-ros-overlay/nixpkgs";
nix-ros-overlay.url = "github:lopsided98/nix-ros-overlay/develop";
astra-msgs.url =
"github:SHC-ASTRA/astra_msgs/93dc0e0919249d5ff3e3a601c81e5b578cfd46e9";
};
outputs = { self, nix-ros-overlay, modernpkgs, nixpkgs, astra-msgs }@inputs:
nix-ros-overlay.inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ nix-ros-overlay.overlays.default ];
};
astra_msgs_pkgs = astra-msgs.packages.${system};
rosDistro = "humble";
mpkgs = import modernpkgs { inherit system; };
in {
devShells.default = pkgs.mkShell {
name = "basestation-game";
packages = with pkgs; [
colcon
mpkgs.godotPackages_4_6.godot-mono
(with pkgs.rosPackages.${rosDistro};
buildEnv {
paths = [
ros-core
ros2cli
ros2run
ament-cmake-core
python-cmake-module
rosbridge-suite
];
})
astra_msgs_pkgs.astra-msgs
];
extraPaths = [ ];
env = {
ASTRAMSGS = "${inputs.astra-msgs.outPath}";
# ROSBRIDGE =
# "${pkgs.rosPackages.${rosDistro}.rosbridge-suite.outPath}";
ROSBRIDGESERVER =
"${pkgs.rosPackages.${rosDistro}.rosbridge-server.outPath}";
# ROSBRIDGELIBRARY =
# "${pkgs.rosPackages.${rosDistro}.rosbridge-library.outPath}";
ROSCOMPILER = "./ROS/Compiler";
};
shellHook = ''
dotnet run --no-build --configuration Release --debug False --project $ROSCOMPILER
'';
};
default = pkgs.mkDerivation {
pname = "basestation-game";
version = "0.1.0";
src = ./.;
nativeBuildInputs = with modernpkgs; [
mono
unzip
makeWrapper
godotPackages_4_6.godot-mono
];
buildInputs = with modernpkgs; [
mono
unzip
makeWrapper
dotnet-sdk_10
godotPackages_4_6.godot-mono
];
buildPhase = ''
runHook preBuild
export HOME=$TMPDIR
mkdir -p $HOME/.local/share/godot
ln -s ${modernpkgs.godotPackages_4_6.export-template-mono}/share/godot/export_templates $HOME/.local/share/godot
mkdir -p $out/bin/
godot-mono --path . --headless --export-release "nix ${system}" $out/bin/basestation-game
ls > $out/log
runHook postBuild
'';
};
});
nixConfig = {
extra-substituters = [ "https://ros.cachix.org" ];
extra-trusted-public-keys =
[ "ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo=" ];
};
}