-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoverlay.nix
41 lines (40 loc) · 1.29 KB
/
overlay.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
final: prev:
let
pkgs = prev;
in
rec {
# nixpkgs only exposes cura 4 due to difficulties with the cura 5 build system
# Just use the appimage for now
# Based on @MarSoft https://github.com/NixOS/nixpkgs/issues/186570#issuecomment-1627797219
cura = (
let
cura5 = pkgs.appimageTools.wrapType2 rec {
pname = "cura5";
version = "5.9.0";
tag = "${version}";
src = pkgs.fetchurl {
url = "https://github.com/Ultimaker/Cura/releases/download/${tag}/UltiMaker-Cura-${version}-linux-X64.AppImage";
hash = "sha256-STtVeM4Zs+PVSRO3cI0LxnjRDhOxSlttZF+2RIXnAp4=";
};
extraPkgs = pkgs: with pkgs; [ ];
};
in
pkgs.writeScriptBin "cura" ''
#! ${pkgs.bash}/bin/bash
# AppImage version of Cura loses current working directory and treats all paths relative to $HOME.
# So we convert each of the files passed as argument to an absolute path.
# This fixes use cases like `cd /path/to/my/files; cura my_model.stl another_model.stl`.
args=()
for a in "$@"; do
if [ -e "$a" ]; then
a="$(realpath "$a")"
fi
args+=("$a")
done
exec "${cura5}/bin/cura5" "''${args[@]}"
''
);
retroarch = pkgs.retroarch.withCores (cores: with cores; [
vba-next
]);
}