Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

Commit 5280e1c

Browse files
authored
Merge pull request #453 from bloxx12/drop-flake-utils
flake.nix: cleanup
2 parents 398a404 + 227300c commit 5280e1c

File tree

2 files changed

+40
-67
lines changed

2 files changed

+40
-67
lines changed

flake.lock

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

flake.nix

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
inputs = {
55
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
6-
flake-utils.url = "github:numtide/flake-utils";
76
flake-compat = {
87
url = "github:edolstra/flake-compat";
98
flake = false;
@@ -17,37 +16,39 @@
1716
outputs = {
1817
self,
1918
nixpkgs,
20-
flake-utils,
2119
rust-overlay,
2220
...
23-
}:
24-
{
25-
overlays.default = final: prev: {inherit (self.packages.${prev.system}) swww;};
26-
}
27-
// flake-utils.lib.eachDefaultSystem (
28-
system: let
29-
inherit (nixpkgs) lib;
30-
31-
pkgs = import nixpkgs {
32-
inherit system;
33-
overlays = [(import rust-overlay)];
34-
};
35-
36-
cargo-toml = lib.importTOML ./Cargo.toml;
37-
inherit (cargo-toml.workspace.package) rust-version;
38-
rust = pkgs.rust-bin.stable.${rust-version}.default;
39-
40-
rustPlatform = pkgs.makeRustPlatform {
41-
cargo = rust;
42-
rustc = rust;
43-
};
44-
in {
45-
packages = {
46-
swww = rustPlatform.buildRustPackage {
21+
}: let
22+
inherit (nixpkgs) lib;
23+
systems = [
24+
"x86_64-linux"
25+
"aarch64-linux"
26+
"x86_64-darwin"
27+
"aarch64-darwin"
28+
];
29+
pkgsFor = lib.genAttrs systems (system:
30+
import nixpkgs {
31+
localSystem.system = system;
32+
overlays = [(import rust-overlay)];
33+
});
34+
cargoToml = lib.importTOML ./Cargo.toml;
35+
inherit (cargoToml.workspace.package) rust-version;
36+
in {
37+
packages =
38+
lib.mapAttrs (system: pkgs: {
39+
swww = let
40+
rust = pkgs.rust-bin.stable.${rust-version}.default;
41+
42+
rustPlatform = pkgs.makeRustPlatform {
43+
cargo = rust;
44+
rustc = rust;
45+
};
46+
in
47+
rustPlatform.buildRustPackage {
4748
pname = "swww";
4849

4950
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
50-
inherit (cargo-toml.workspace.package) version;
51+
inherit (cargoToml.workspace.package) version;
5152

5253
cargoLock.lockFile = ./Cargo.lock;
5354

@@ -87,16 +88,22 @@
8788
};
8889
};
8990

90-
default = self.packages.${system}.swww;
91-
};
91+
default = self.packages.${system}.swww;
92+
})
93+
pkgsFor;
9294

93-
formatter = pkgs.alejandra;
95+
formatter = lib.mapAttrs (_: pkgs: pkgs.alejandra) pkgsFor;
9496

95-
devShells.default = pkgs.mkShell {
97+
devShells =
98+
lib.mapAttrs (system: pkgs: {
99+
default = pkgs.mkShell {
96100
inputsFrom = [self.packages.${system}.swww];
97101

98102
packages = [pkgs.rust-bin.stable.${rust-version}.default];
99103
};
100-
}
101-
);
104+
})
105+
pkgsFor;
106+
107+
overlays.default = final: prev: {inherit (self.packages.${prev.system}) swww;};
108+
};
102109
}

0 commit comments

Comments
 (0)