-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
flake.nix
77 lines (76 loc) · 2.71 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
{
description = "A gemini browser";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachSystem
(with flake-utils.lib.system; [ x86_64-linux aarch64-linux ])
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
gtk_4_11 = pkgs.gtk4.overrideAttrs (old: rec {
version = "4.11.4";
src = pkgs.fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
repo = "gtk";
rev = version;
hash = "sha256-YobWcLJm8owjrz6c6aPMCrVZqYDvNpjIt5Zea2CtAZY=";
};
postPatch = old.postPatch + ''
patchShebangs build-aux/meson/gen-visibility-macros.py
'';
});
wrapGAppsHook_4_11 = pkgs.wrapGAppsHook.override { gtk3 = gtk_4_11; };
libadwaita_1_4 = (pkgs.libadwaita.override { gtk4 = gtk_4_11; }).overrideAttrs (old: rec {
version = "1.4.alpha";
src = pkgs.fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
repo = "libadwaita";
rev = version;
hash = "sha256-UUS5b6diRenpxxmGvVJoc6mVjEVGS9afLd8UKu+CJvI=";
};
buildInputs = old.buildInputs ++ [ pkgs.appstream ];
});
in
rec {
packages.geopard = pkgs.callPackage ./nix/geopard.nix {
gtk4 = gtk_4_11;
wrapGAppsHook4 = wrapGAppsHook_4_11;
libadwaita = libadwaita_1_4;
};
checks.default = pkgs.stdenv.mkDerivation {
name = "geopard-checks";
src = ./.;
cargoDeps = packages.geopard.cargoDeps;
configurePhase = ''
# These are replaced during the real build by meson
sed \
-e 's/str =.*;/str = "";/g' \
-e 's/i32 =.*;/i32 = 0;/g' \
src/build_config.rs.in \
> src/build_config.rs
'';
checkPhase = ''
cargo fmt --check;
cargo clippy -- -D warnings
'';
doCheck = true;
installPhase = ''echo "" > $out'';
nativeBuildInputs = with pkgs; [ openssl pkg-config glib gtk_4_11 libadwaita_1_4 clippy ];
buildInputs = with pkgs; [
clippy
cargo
rustc
rustPlatform.cargoSetupHook
rustfmt
];
};
packages.build-flatpak = pkgs.callPackage ./nix/build-flatpak.nix { };
packages.default = packages.geopard;
}
);
}