forked from ranfdev/Geopard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
45 lines (45 loc) · 1.56 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
{
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}; in
rec {
packages.geopard = pkgs.callPackage ./nix/geopard.nix { };
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 gtk4 libadwaita clippy ];
buildInputs = with pkgs; [
clippy
rustPlatform.rust.cargo
rustPlatform.rust.rustc
rustPlatform.cargoSetupHook
rustfmt
];
};
packages.build-flatpak = pkgs.callPackage ./nix/build-flatpak.nix { };
packages.default = packages.geopard;
}
);
}