Skip to content

Commit a7503ca

Browse files
committed
flake: formatted flake
1 parent afe38aa commit a7503ca

File tree

1 file changed

+51
-34
lines changed

1 file changed

+51
-34
lines changed

flake.nix

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@
66
flake-utils.url = "github:numtide/flake-utils";
77
};
88

9-
outputs = { self, nixpkgs, flake-utils } @inputs:
10-
flake-utils.lib.eachDefaultSystem (system:
9+
outputs =
10+
{
11+
self,
12+
nixpkgs,
13+
flake-utils,
14+
}@inputs:
15+
flake-utils.lib.eachDefaultSystem (
16+
system:
1117
let
1218
pkgs = import nixpkgs {
1319
inherit system;
@@ -16,7 +22,8 @@
1622
bazel = bazel_7;
1723
jdk = jdk;
1824
};
19-
in {
25+
in
26+
{
2027
devShells.default =
2128
let
2229
# There is too much volatility between even micro-versions of
@@ -25,7 +32,9 @@
2532

2633
# clang tidy: use latest.
2734
clang_for_tidy = pkgs.llvmPackages_18.clang-tools;
28-
in with pkgs; pkgs.mkShell{
35+
in
36+
with pkgs;
37+
pkgs.mkShell {
2938
packages = with pkgs; [
3039
git
3140
common.bazel
@@ -51,38 +60,39 @@
5160
openfpgaloader
5261
];
5362

54-
CLANG_TIDY="${clang_for_tidy}/bin/clang-tidy";
55-
CLANG_FORMAT="${clang_for_formatting}/bin/clang-format";
63+
CLANG_TIDY = "${clang_for_tidy}/bin/clang-tidy";
64+
CLANG_FORMAT = "${clang_for_formatting}/bin/clang-format";
5665

5766
shellHook = ''
5867
exec bash
5968
'';
6069
};
6170

6271
# Package fpga-assembler.
63-
packages.default = (pkgs.callPackage (
64-
{
65-
buildBazelPackage,
66-
stdenv,
67-
fetchFromGitHub,
68-
lib,
69-
nix-gitignore,
70-
}:
71-
let
72-
system = stdenv.hostPlatform.system;
73-
registry = fetchFromGitHub {
74-
owner = "bazelbuild";
75-
repo = "bazel-central-registry";
76-
rev = "63f3af762b2fdd7acaa7987856cd3ac314eaea09";
77-
hash = "sha256-ugNzoP0gdrhl9vH1TRdwoevuTsSqjitXnAoMSSTlCgI=";
78-
};
79-
in
72+
packages.default =
73+
(pkgs.callPackage (
74+
{
75+
buildBazelPackage,
76+
stdenv,
77+
fetchFromGitHub,
78+
lib,
79+
nix-gitignore,
80+
}:
81+
let
82+
system = stdenv.hostPlatform.system;
83+
registry = fetchFromGitHub {
84+
owner = "bazelbuild";
85+
repo = "bazel-central-registry";
86+
rev = "63f3af762b2fdd7acaa7987856cd3ac314eaea09";
87+
hash = "sha256-ugNzoP0gdrhl9vH1TRdwoevuTsSqjitXnAoMSSTlCgI=";
88+
};
89+
in
8090
buildBazelPackage {
8191
pname = "fpga-as";
8292

8393
version = "0.0.1";
8494

85-
src = nix-gitignore.gitignoreSourcePure [] ./.;
95+
src = nix-gitignore.gitignoreSourcePure [ ] ./.;
8696

8797
bazelFlags = [
8898
"--registry"
@@ -99,7 +109,7 @@
99109
aarch64-linux = "sha256-E4VHjDa0qkHmKUNpTBfJi7dhMLcd1z5he+p31/XvUl8=";
100110
x86_64-linux = "sha256-hVBJB0Hsd9sXuEoNcjhTkbPl89vlZT1w39JppCD+n8Y=";
101111
}
102-
.${system} or (throw "No hash for system: ${system}");
112+
.${system} or (throw "No hash for system: ${system}");
103113
};
104114

105115
removeRulesCC = false;
@@ -133,15 +143,22 @@
133143
platforms = lib.platforms.linux;
134144
};
135145
}
136-
) {}).overrideAttrs (final: prev: {
137-
# Fixup the deps so they always contain correrct
138-
# shebangs paths pointing to the store.
139-
deps = prev.deps.overrideAttrs (final: prev: {
140-
installPhase = ''
141-
patchShebangs $bazelOut/external
142-
'' + prev.installPhase;
143-
});
144-
});
146+
) { }).overrideAttrs
147+
(
148+
final: prev: {
149+
# Fixup the deps so they always contain correrct
150+
# shebangs paths pointing to the store.
151+
deps = prev.deps.overrideAttrs (
152+
final: prev: {
153+
installPhase =
154+
''
155+
patchShebangs $bazelOut/external
156+
''
157+
+ prev.installPhase;
158+
}
159+
);
160+
}
161+
);
145162
}
146163
);
147164
}

0 commit comments

Comments
 (0)