-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
79 lines (73 loc) · 2.01 KB
/
shell.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
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
{ forCI ? false }:
with import <nixpkgs> { };
let
projectUris = {
gotk4 = "[email protected]:diamondburned/gotk4.git";
gtk4-adwaita = "[email protected]:diamondburned/gotk4-adwaita.git";
gtk = "https://gitlab.gnome.org/GNOME/libadwaita.git";
libadwaita = "https://gitlab.gnome.org/GNOME/libadwaita.git";
};
cloneCmd = rootDir: key: uri: ''
if [[ -d ${rootDir}/${key} ]]; then
echo "${rootDir}/${key} already exists. Will not create."
else
mkdir -p ${rootDir}
${git}/bin/git clone --recurse-submodules -j8 ${uri} ${rootDir}/${key}
fi
'';
recurseProjectUris = rootDir: lib.mapAttrsToList (
name: value:
if builtins.isAttrs value
then recurseProjectUris "${rootDir}/${name}" value
else cloneCmd rootDir name value
);
PROJECT_ROOT = builtins.getEnv "PWD";
initGitPkg = writeShellScriptBin "initgit" ''
echo
echo Cloning necessary repos
echo
${lib.concatStringsSep "\n" (lib.flatten (recurseProjectUris PROJECT_ROOT projectUris))}
echo
'';
in
mkShell {
buildInputs = [
# Core GTK
gdk-pixbuf
glib
go_1_18
gobject-introspection
graphene
gtk3
gtk4
libadwaita
libxml2
# Gstreamer for audio
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
(gst_all_1.gst-plugins-good.override { gtkSupport = true; })
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-ugly
gst_all_1.gst-libav
# Build utilities
gnumake
pkgconfig
vulkan-headers
] ++ lib.lists.optional
(!forCI)
[
gi-docgen
gopls
gotools
initGitPkg
pre-commit
yq-go
];
# Workaround for the lack of wrapGAppsHook:
# https://nixos.wiki/wiki/Development_environment_with_nix-shell
shellHook = with pkgs.gnome; with pkgs; ''
export GDK_PIXBUF_MODULE_FILE='${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache'
export XDG_DATA_DIRS=$XDG_DATA_DIRS:${hicolor-icon-theme}/share:${adwaita-icon-theme}/share
export XDG_DATA_DIRS=$XDG_DATA_DIRS:$GSETTINGS_SCHEMAS_PATH
'';
}