Skip to content

Commit a780926

Browse files
committed
Use flake-utils
1 parent c89a59c commit a780926

File tree

3 files changed

+59
-42
lines changed

3 files changed

+59
-42
lines changed

flake.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,48 @@
33
inputs = {
44
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
55
naersk.url = "github:nix-community/naersk";
6+
flake-utils.url = "github:numtide/flake-utils";
67
};
7-
outputs = { self, nixpkgs, naersk }:
8-
with import nixpkgs { system = "x86_64-linux"; };
9-
rec {
10-
packages.x86_64-linux.blueprint-compiler = callPackage ./nix/blueprint-compiler.nix { };
11-
packages.x86_64-linux.geopard = callPackage ./nix/geopard.nix {
12-
naersk-lib = naersk.lib.x86_64-linux;
13-
blueprint-compiler = packages.x86_64-linux.blueprint-compiler;
14-
};
15-
checks.x86_64-linux.default = stdenv.mkDerivation {
16-
name = "geopard-checks";
17-
src = ./.;
18-
cargoDeps = packages.x86_64-linux.geopard.cargoDeps;
19-
configurePhase = ''
20-
# These are replaced during the real build by meson
21-
sed \
22-
-e 's/str =.*;/str = "";/g' \
23-
-e 's/i32 =.*;/i32 = 0;/g' \
24-
src/build_config.rs.in \
25-
> src/build_config.rs
26-
'';
27-
checkPhase = ''
28-
cargo fmt --check;
29-
cargo clippy -- -D warnings
30-
'';
31-
doCheck = true;
32-
installPhase = ''echo "" > $out'';
33-
nativeBuildInputs = with nixpkgs.legacyPackages.x86_64-linux; [openssl pkg-config glib gtk4 libadwaita clippy];
34-
buildInputs = with nixpkgs.legacyPackages.x86_64-linux; [
35-
clippy
36-
rustPlatform.rust.cargo
37-
rustPlatform.rust.rustc
38-
rustPlatform.cargoSetupHook
39-
rustfmt
40-
];
41-
};
42-
packages.x86_64-linux.build-flatpak = callPackage ./nix/build-flatpak.nix { };
43-
packages.x86_64-linux.default = packages.x86_64-linux.geopard;
44-
};
8+
outputs = { self, nixpkgs, naersk, flake-utils }:
9+
flake-utils.lib.eachSystem
10+
(with flake-utils.lib.system; [ x86_64-linux aarch64-linux ])
11+
(system:
12+
let pkgs = nixpkgs.legacyPackages.${system}; in
13+
rec {
14+
packages.blueprint-compiler = pkgs.callPackage ./nix/blueprint-compiler.nix { };
15+
packages.geopard = pkgs.callPackage ./nix/geopard.nix {
16+
naersk-lib = naersk.lib.${system};
17+
blueprint-compiler = packages.blueprint-compiler;
18+
};
19+
checks.default = pkgs.stdenv.mkDerivation {
20+
name = "geopard-checks";
21+
src = ./.;
22+
cargoDeps = packages.geopard.cargoDeps;
23+
configurePhase = ''
24+
# These are replaced during the real build by meson
25+
sed \
26+
-e 's/str =.*;/str = "";/g' \
27+
-e 's/i32 =.*;/i32 = 0;/g' \
28+
src/build_config.rs.in \
29+
> src/build_config.rs
30+
'';
31+
checkPhase = ''
32+
cargo fmt --check;
33+
cargo clippy -- -D warnings
34+
'';
35+
doCheck = true;
36+
installPhase = ''echo "" > $out'';
37+
nativeBuildInputs = with pkgs; [ openssl pkg-config glib gtk4 libadwaita clippy ];
38+
buildInputs = with pkgs; [
39+
clippy
40+
rustPlatform.rust.cargo
41+
rustPlatform.rust.rustc
42+
rustPlatform.cargoSetupHook
43+
rustfmt
44+
];
45+
};
46+
packages.build-flatpak = pkgs.callPackage ./nix/build-flatpak.nix { };
47+
packages.default = packages.geopard;
48+
}
49+
);
4550
}

nix/default.nix

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)