-
Notifications
You must be signed in to change notification settings - Fork 31
/
flake.nix
112 lines (97 loc) · 2.83 KB
/
flake.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
description = "Make HTTP requests and test APIs";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem(
system: let
overlays = [
(_: final: {
cartero = final.callPackage ./default.nix {
pkgs = final;
};
})
];
pkgs = import nixpkgs {
inherit
system
overlays
;
};
in {
packages = rec {
inherit (pkgs) cartero;
default = cartero;
};
devShells = with pkgs; let
buildShellRecipe = {
LD_LIBRARY_PATH = lib.makeLibraryPath [
gtk4
libadwaita
glib
];
nativeBuildInputs = [
meson
ninja
cargo
rustc
rustfmt
pkg-config
blueprint-compiler
desktop-file-utils
gtk4
shared-mime-info
glib
wrapGAppsHook
hicolor-icon-theme
];
buildInputs = [
gtksourceview5
pango
gdk-pixbuf
openssl_3_3
graphene
libadwaita
];
};
launchShellRecipe = {
buildInputs = [ cartero ];
};
in rec {
# use by default the full dev env.
default = mixedShell;
# a dev shell which helps to only build cartero manually without installing the dependencies.
buildingShell = mkShell (buildShellRecipe // {
name = "building-shell";
shellHook = ''
echo "> In this shell you should be able to build cartero manually without installing"
echo "> the dependencies since they already come installed automatically."
'';
});
# useful to test cartero by using nix develop --command cartero
launchShell = mkShell (launchShellRecipe // {
name = "launch-shell";
shellHook = ''
echo "> Here you can launch cartero by typing \`cartero\` in this interactive shell"
echo "> or by using nix develop --command cartero instead"
'';
});
# both
mixedShell = mkShell {
name = "full-dev-env";
inherit (buildShellRecipe)
LD_LIBRARY_PATH
;
buildInputs = []
++ buildShellRecipe.buildInputs
++ launchShellRecipe.buildInputs;
shellHook = ''
echo "> In this shell you should be able to either build cartero manually without installing"
echo "> the dependencies manually, or by running \`cartero\` you could launch a prebuilt version instead"
'';
};
};
}
);
}