Skip to content

Commit da2d87b

Browse files
committed
flake.nix: format
format the flake using alejandra
1 parent 5672e03 commit da2d87b

File tree

1 file changed

+79
-83
lines changed

1 file changed

+79
-83
lines changed

flake.nix

Lines changed: 79 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -15,102 +15,98 @@
1515
nix-filter.url = "github:numtide/nix-filter";
1616
};
1717

18-
outputs =
19-
inputs@{
20-
self,
21-
nixpkgs,
22-
parts,
23-
crane,
24-
rust,
25-
nix-filter,
26-
...
27-
}:
28-
parts.lib.mkFlake { inherit inputs; } {
18+
outputs = inputs @ {
19+
self,
20+
nixpkgs,
21+
parts,
22+
crane,
23+
rust,
24+
nix-filter,
25+
...
26+
}:
27+
parts.lib.mkFlake {inherit inputs;} {
2928
systems = [
3029
"aarch64-linux"
3130
"x86_64-linux"
3231
];
3332

34-
perSystem =
35-
{
36-
self',
37-
lib,
38-
system,
39-
...
40-
}:
41-
let
42-
pkgs = nixpkgs.legacyPackages.${system}.extend rust.overlays.default;
43-
rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
44-
craneLib = (crane.mkLib pkgs).overrideToolchain rust-toolchain;
45-
craneArgs = {
46-
pname = "cosmic-comp";
47-
version = self.rev or "dirty";
33+
perSystem = {
34+
self',
35+
lib,
36+
system,
37+
...
38+
}: let
39+
pkgs = nixpkgs.legacyPackages.${system}.extend rust.overlays.default;
40+
rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
41+
craneLib = (crane.mkLib pkgs).overrideToolchain rust-toolchain;
42+
craneArgs = {
43+
pname = "cosmic-comp";
44+
version = self.rev or "dirty";
4845

49-
src = nix-filter.lib.filter {
50-
root = ./.;
51-
include = [
52-
./src
53-
./i18n.toml
54-
./Cargo.toml
55-
./Cargo.lock
56-
./resources
57-
./cosmic-comp-config
58-
];
59-
};
60-
61-
nativeBuildInputs = with pkgs; [
62-
pkg-config
63-
autoPatchelfHook
64-
cmake
46+
src = nix-filter.lib.filter {
47+
root = ./.;
48+
include = [
49+
./src
50+
./i18n.toml
51+
./Cargo.toml
52+
./Cargo.lock
53+
./resources
54+
./cosmic-comp-config
6555
];
56+
};
6657

67-
buildInputs = with pkgs; [
68-
wayland
69-
systemd # For libudev
70-
seatd # For libseat
71-
libxkbcommon
72-
libinput
73-
mesa # For libgbm
74-
fontconfig
75-
stdenv.cc.cc.lib
76-
pixman
77-
libdisplay-info
78-
];
58+
nativeBuildInputs = with pkgs; [
59+
pkg-config
60+
autoPatchelfHook
61+
cmake
62+
];
7963

80-
runtimeDependencies = with pkgs; [
81-
libglvnd # For libEGL
82-
wayland # winit->wayland-sys wants to dlopen libwayland-egl.so
83-
# for running in X11
84-
xorg.libX11
85-
xorg.libXcursor
86-
xorg.libxcb
87-
xorg.libXi
88-
libxkbcommon
89-
# for vulkan backend
90-
vulkan-loader
91-
];
92-
};
64+
buildInputs = with pkgs; [
65+
wayland
66+
systemd # For libudev
67+
seatd # For libseat
68+
libxkbcommon
69+
libinput
70+
mesa # For libgbm
71+
fontconfig
72+
stdenv.cc.cc.lib
73+
pixman
74+
libdisplay-info
75+
];
9376

94-
cargoArtifacts = craneLib.buildDepsOnly craneArgs;
95-
cosmic-comp = craneLib.buildPackage (craneArgs // { inherit cargoArtifacts; });
96-
in
97-
{
98-
apps.cosmic-comp = {
99-
type = "app";
100-
program = lib.getExe self'.packages.default;
101-
};
77+
runtimeDependencies = with pkgs; [
78+
libglvnd # For libEGL
79+
wayland # winit->wayland-sys wants to dlopen libwayland-egl.so
80+
# for running in X11
81+
xorg.libX11
82+
xorg.libXcursor
83+
xorg.libxcb
84+
xorg.libXi
85+
libxkbcommon
86+
# for vulkan backend
87+
vulkan-loader
88+
];
89+
};
10290

103-
checks.cosmic-comp = cosmic-comp;
104-
packages.default = cosmic-comp;
91+
cargoArtifacts = craneLib.buildDepsOnly craneArgs;
92+
cosmic-comp = craneLib.buildPackage (craneArgs // {inherit cargoArtifacts;});
93+
in {
94+
apps.cosmic-comp = {
95+
type = "app";
96+
program = lib.getExe self'.packages.default;
97+
};
10598

106-
devShells.default = craneLib.devShell {
107-
LD_LIBRARY_PATH = lib.makeLibraryPath (
108-
__concatMap (d: d.runtimeDependencies) (__attrValues self'.checks)
109-
);
99+
checks.cosmic-comp = cosmic-comp;
100+
packages.default = cosmic-comp;
110101

111-
# include build inputs
112-
inputsFrom = [ cosmic-comp ];
113-
};
102+
devShells.default = craneLib.devShell {
103+
LD_LIBRARY_PATH = lib.makeLibraryPath (
104+
__concatMap (d: d.runtimeDependencies) (__attrValues self'.checks)
105+
);
106+
107+
# include build inputs
108+
inputsFrom = [cosmic-comp];
114109
};
110+
};
115111
};
116112
}

0 commit comments

Comments
 (0)