flake: format with nixfmt
Browse files at this commite6203313cec9c26a98e3034df3c302cc4a482850Parent: 938061d1 changed file +28 -19
- flake.nix +28 -19
flake.nixmodified+28 -19
| @@ -13,19 +13,25 @@ | |||
| 13 | }; | 13 | }; |
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | - outputs = { | 16 | + outputs = |
| 17 | - self, | 17 | + { |
| 18 | - nixpkgs, | 18 | + self, |
| 19 | - crane, | 19 | + nixpkgs, |
| 20 | - nix-filter, | 20 | + crane, |
| 21 | - flake-utils, | 21 | + nix-filter, |
| 22 | - fenix, | 22 | + flake-utils, |
| 23 | - ... | 23 | + fenix, |
| 24 | - }: let | 24 | + ... |
| 25 | - systems = ["aarch64-linux" "x86_64-linux"]; | 25 | + }: |
| 26 | - in | 26 | + let |
| 27 | + systems = [ | ||
| 28 | + "aarch64-linux" | ||
| 29 | + "x86_64-linux" | ||
| 30 | + ]; | ||
| 31 | + in | ||
| 27 | flake-utils.lib.eachSystem systems ( | 32 | flake-utils.lib.eachSystem systems ( |
| 28 | - system: let | 33 | + system: |
| 34 | + let | ||
| 29 | pkgs = nixpkgs.legacyPackages.${system}; | 35 | pkgs = nixpkgs.legacyPackages.${system}; |
| 30 | toolchain = fenix.packages.${system}.complete.toolchain; | 36 | toolchain = fenix.packages.${system}.complete.toolchain; |
| 31 | craneLib = (crane.mkLib pkgs).overrideToolchain toolchain; | 37 | craneLib = (crane.mkLib pkgs).overrideToolchain toolchain; |
| @@ -36,10 +42,10 @@ | |||
| 36 | 42 | ||
| 37 | src = nixpkgs.lib.cleanSourceWith { | 43 | src = nixpkgs.lib.cleanSourceWith { |
| 38 | src = craneLib.path ./.; | 44 | src = craneLib.path ./.; |
| 39 | - filter = path: type: | 45 | + filter = |
| 46 | + path: type: | ||
| 40 | (builtins.match "resources" path == null) | 47 | (builtins.match "resources" path == null) |
| 41 | - || ((craneLib.filterCargoSources path type) | 48 | + || ((craneLib.filterCargoSources path type) && (builtins.match "niri-visual-tests" path == null)); |
| 42 | - && (builtins.match "niri-visual-tests" path == null)); | ||
| 43 | }; | 49 | }; |
| 44 | 50 | ||
| 45 | nativeBuildInputs = with pkgs; [ | 51 | nativeBuildInputs = with pkgs; [ |
| @@ -83,17 +89,20 @@ | |||
| 83 | }; | 89 | }; |
| 84 | 90 | ||
| 85 | cargoArtifacts = craneLib.buildDepsOnly craneArgs; | 91 | cargoArtifacts = craneLib.buildDepsOnly craneArgs; |
| 86 | - niri = craneLib.buildPackage (craneArgs // {inherit cargoArtifacts;}); | 92 | + niri = craneLib.buildPackage (craneArgs // { inherit cargoArtifacts; }); |
| 87 | - in { | 93 | + in |
| 94 | + { | ||
| 88 | formatter = pkgs.nixfmt-rfc-style; | 95 | formatter = pkgs.nixfmt-rfc-style; |
| 89 | 96 | ||
| 90 | checks.niri = niri; | 97 | checks.niri = niri; |
| 91 | packages.default = niri; | 98 | packages.default = niri; |
| 92 | 99 | ||
| 93 | devShells.default = craneLib.devShell { | 100 | devShells.default = craneLib.devShell { |
| 94 | - inputsFrom = [niri]; | 101 | + inputsFrom = [ niri ]; |
| 95 | 102 | ||
| 96 | - LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (craneArgs.runtimeDependencies ++ craneArgs.nativeBuildInputs ++ craneArgs.buildInputs); | 103 | + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath ( |
| 104 | + craneArgs.runtimeDependencies ++ craneArgs.nativeBuildInputs ++ craneArgs.buildInputs | ||
| 105 | + ); | ||
| 97 | inherit (niri) LIBCLANG_PATH; | 106 | inherit (niri) LIBCLANG_PATH; |
| 98 | }; | 107 | }; |
| 99 | } | 108 | } |