Skip to content

Commit 091c04e

Browse files
authored
Merge pull request #272 from mlabs-haskell/szg251/nixfmt-rfc-style
Nixfmt RFC style
2 parents 0ba15ca + 334a2c9 commit 091c04e

File tree

63 files changed

+1653
-1124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1653
-1124
lines changed

api/build.nix

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{ inputs, ... }:
22
{
3-
perSystem = { pkgs, system, config, inputs', ... }:
3+
perSystem =
4+
{
5+
pkgs,
6+
system,
7+
config,
8+
inputs',
9+
...
10+
}:
411
let
512
proto-nix = inputs.proto-nix.lib.${system};
613
in
@@ -35,7 +42,11 @@
3542

3643
lambda-buffers-api-docs = proto-nix.docProto {
3744
src = ./.;
38-
protos = [ "lang.proto" "compiler.proto" "codegen.proto" ];
45+
protos = [
46+
"lang.proto"
47+
"compiler.proto"
48+
"codegen.proto"
49+
];
3950
};
4051
};
4152
};

docs/build.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
_: {
2-
perSystem = { pkgs, config, ... }:
2+
perSystem =
3+
{ pkgs, config, ... }:
34
{
45
devShells.dev-docs = pkgs.mkShell {
56
name = "docs-env";

docs/plutarch/build.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{ inputs, ... }:
22
{
3-
perSystem = { config, system, ... }:
3+
perSystem =
4+
{ config, system, ... }:
45
let
56
hsFlake = inputs.flake-lang.lib.${system}.haskellPlutusFlake {
67
src = ./.;
@@ -40,6 +41,5 @@
4041

4142
};
4243

43-
4444
};
4545
}

docs/plutustx/build.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{ inputs, ... }:
22
{
3-
perSystem = { config, system, ... }:
3+
perSystem =
4+
{ config, system, ... }:
45
let
56
hsFlake = inputs.flake-lang.lib.${system}.haskellPlutusFlake {
67
src = ./.;

docs/typescript-plutus/api/lbf/build.nix

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
_:
2-
{
3-
perSystem = { config, ... }:
1+
_: {
2+
perSystem =
3+
{ config, ... }:
44
let
5-
lbf-plutus-sample-project-typescript =
6-
config.lbf-nix.lbfPlutusTypescript {
7-
name = "lbf-plutus-sample-project";
8-
src = ./.;
9-
files = [ "MySchema.lbf" ];
10-
};
5+
lbf-plutus-sample-project-typescript = config.lbf-nix.lbfPlutusTypescript {
6+
name = "lbf-plutus-sample-project";
7+
src = ./.;
8+
files = [ "MySchema.lbf" ];
9+
};
1110
in
1211
{
1312
packages = {

docs/typescript-plutus/build.nix

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
{
33
imports = [ ./api/lbf/build.nix ];
44

5-
perSystem = { config, system, ... }:
5+
perSystem =
6+
{ config, system, ... }:
67
let
7-
tsFlake =
8-
inputs.flake-lang.lib.${system}.typescriptFlake {
9-
name = "plutus-sample-project";
10-
src = ./.;
8+
tsFlake = inputs.flake-lang.lib.${system}.typescriptFlake {
9+
name = "plutus-sample-project";
10+
src = ./.;
1111

12-
npmExtraDependencies = [
13-
config.packages.lbf-plutus-sample-project-typescript
14-
];
12+
npmExtraDependencies = [
13+
config.packages.lbf-plutus-sample-project-typescript
14+
];
1515

16-
devShellTools = config.settings.shell.tools;
17-
devShellHook = config.settings.shell.hook;
18-
};
16+
devShellTools = config.settings.shell.tools;
17+
devShellHook = config.settings.shell.hook;
18+
};
1919
in
2020
{
2121
packages = {

docs/typescript-prelude/api/lbf/build.nix

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
_:
2-
{
3-
perSystem = { config, ... }:
1+
_: {
2+
perSystem =
3+
{ config, ... }:
44
let
5-
lbf-prelude-sample-project-typescript =
6-
config.lbf-nix.lbfPreludeTypescript {
7-
name = "lbf-prelude-sample-project";
8-
src = ./.;
9-
files = [ "MySchema.lbf" ];
10-
};
5+
lbf-prelude-sample-project-typescript = config.lbf-nix.lbfPreludeTypescript {
6+
name = "lbf-prelude-sample-project";
7+
src = ./.;
8+
files = [ "MySchema.lbf" ];
9+
};
1110
in
1211
{
1312
packages = {

docs/typescript-prelude/build.nix

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
{
33
imports = [ ./api/lbf/build.nix ];
44

5-
perSystem = { config, system, ... }:
5+
perSystem =
6+
{ config, system, ... }:
67
let
7-
tsFlake =
8-
inputs.flake-lang.lib.${system}.typescriptFlake {
9-
name = "prelude-sample-project";
10-
src = ./.;
11-
npmExtraDependencies = [
12-
config.packages.lbf-prelude-sample-project-typescript
13-
];
8+
tsFlake = inputs.flake-lang.lib.${system}.typescriptFlake {
9+
name = "prelude-sample-project";
10+
src = ./.;
11+
npmExtraDependencies = [
12+
config.packages.lbf-prelude-sample-project-typescript
13+
];
1414

15-
devShellTools = config.settings.shell.tools;
16-
devShellHook = config.settings.shell.hook;
17-
};
15+
devShellTools = config.settings.shell.tools;
16+
devShellHook = config.settings.shell.hook;
17+
};
1818
in
1919
{
2020
packages = {

experimental/build.nix

+20-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
_: {
2-
perSystem = { pkgs, config, inputs', ... }:
2+
perSystem =
3+
{
4+
pkgs,
5+
config,
6+
inputs',
7+
...
8+
}:
39
{
410
devShells.dev-experimental = pkgs.mkShell {
511
name = "experimental-env";
6-
buildInputs = [
7-
pkgs.dhall
8-
pkgs.dhall-json
12+
buildInputs =
13+
[
14+
pkgs.dhall
15+
pkgs.dhall-json
916

10-
(pkgs.haskellPackages.ghcWithPackages (hsPkgs: [
11-
hsPkgs.text
12-
hsPkgs.HUnit
13-
]))
17+
(pkgs.haskellPackages.ghcWithPackages (hsPkgs: [
18+
hsPkgs.text
19+
hsPkgs.HUnit
20+
]))
1421

15-
pkgs.protobuf
16-
pkgs.haskellPackages.haskell-language-server
17-
]
18-
++ (pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.swiPrologWithGui ])
19-
++ config.settings.shell.tools;
22+
pkgs.protobuf
23+
pkgs.haskellPackages.haskell-language-server
24+
]
25+
++ (pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.swiPrologWithGui ])
26+
++ config.settings.shell.tools;
2027

2128
shellHook = config.settings.shell.hook;
2229
inputsFrom = [ inputs'.proto-nix.devShells.dev-proto-nix ];

extras/build.nix

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
{ config, flake-parts-lib, lib, ... }: {
1+
{
2+
config,
3+
flake-parts-lib,
4+
lib,
5+
...
6+
}:
7+
{
28

39
# Makes a system agnostic option (dunno why I needed this).
410
options.lbf-nix = lib.mkOption {
@@ -22,8 +28,9 @@
2228
options = {
2329

2430
# Makes a per system `lbf-nix` option.
25-
perSystem = flake-parts-lib.mkPerSystemOption
26-
({ pkgs, config, ... }: {
31+
perSystem = flake-parts-lib.mkPerSystemOption (
32+
{ pkgs, config, ... }:
33+
{
2734

2835
options.lbf-nix = lib.mkOption {
2936
type = lib.types.anything;
@@ -45,7 +52,8 @@
4552

4653
};
4754

48-
});
55+
}
56+
);
4957

5058
};
5159
}

extras/dev-shells/plutus-haskell/build.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{ inputs, ... }:
22
{
3-
perSystem = { config, system, ... }:
3+
perSystem =
4+
{ config, system, ... }:
45
let
56
hsFlake = inputs.flake-lang.lib.${system}.haskellPlutusFlake {
67
src = ./.;

extras/dev-shells/prelude-haskell/build.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{ inputs, ... }:
22
{
3-
perSystem = { config, system, ... }:
3+
perSystem =
4+
{ config, system, ... }:
45
let
56
hsFlake = inputs.flake-lang.lib.${system}.haskellFlake {
67
src = ./.;

extras/haskell-data.nix

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Makes a Cabal package with just a 'data' directory with proper 'data-filers' stanza
2-
pkgs: { srcs, cabalDataPatterns, cabalPackageName, cabalPackageVersion ? "0.1.0.0" }:
2+
pkgs:
3+
{
4+
srcs,
5+
cabalDataPatterns,
6+
cabalPackageName,
7+
cabalPackageVersion ? "0.1.0.0",
8+
}:
39
let
410
cabalTemplate = pkgs.writeTextFile {
511
name = "haskell-data.nix-cabal-template";
@@ -14,7 +20,7 @@ let
1420
library
1521
default-language: Haskell2010
1622
build-depends: base >=4.16
17-
exposed-modules: Paths_${builtins.replaceStrings ["-"] ["_"] cabalPackageName}
23+
exposed-modules: Paths_${builtins.replaceStrings [ "-" ] [ "_" ] cabalPackageName}
1824
'';
1925
};
2026
in

extras/lambda-buffers-utils/build.nix

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{ inputs, ... }:
22
{
3-
perSystem = { config, pkgs, system, ... }:
3+
perSystem =
4+
{
5+
config,
6+
pkgs,
7+
system,
8+
...
9+
}:
410
let
511
hsFlake = inputs.flake-lang.lib.${system}.haskellFlake {
612
src = ./.;

extras/lbf-nix/build.nix

+27-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
{ lib, inputs, ... }: {
2-
perSystem = { pkgs, config, system, ... }:
1+
{ lib, inputs, ... }:
2+
{
3+
perSystem =
4+
{
5+
pkgs,
6+
config,
7+
system,
8+
...
9+
}:
310
let
411
lbg-haskell = "${config.packages.lbg-haskell}/bin/lbg-haskell";
512
lbg-typescript = "${config.packages.lbg-typescript}/bin/lbg-typescript";
@@ -23,29 +30,27 @@
2330
lbfPurescript = import ./lbf-purescript.nix pkgs config.packages.lbf lbg-purescript;
2431
lbfPreludePurescript = import ./lbf-prelude-purescript.nix pkgs config.packages.lbf lbg-purescript;
2532
lbfPlutusPurescript = import ./lbf-plutus-purescript.nix pkgs config.packages.lbf lbg-purescript;
26-
lbfTypescript = opts: import ./lbf-typescript.nix
27-
{
33+
lbfTypescript =
34+
opts:
35+
import ./lbf-typescript.nix {
2836
inherit pkgs lbg-typescript;
2937
inherit (config.packages) lbf-list-modules-typescript lbf;
3038
inherit (inputs.flake-lang.lib.${system}) typescriptFlake;
31-
}
32-
opts;
33-
lbfPreludeTypescript = opts:
34-
import ./lbf-prelude-typescript.nix
35-
{
36-
inherit pkgs lbg-typescript config;
37-
inherit (config.packages) lbf-list-modules-typescript lbf;
38-
inherit (inputs.flake-lang.lib.${system}) typescriptFlake;
39-
}
40-
opts;
41-
lbfPlutusTypescript = opts:
42-
import ./lbf-plutus-typescript.nix
43-
{
44-
inherit pkgs lbg-typescript config;
45-
inherit (config.packages) lbf-list-modules-typescript lbf;
46-
inherit (inputs.flake-lang.lib.${system}) typescriptFlake;
47-
}
48-
opts;
39+
} opts;
40+
lbfPreludeTypescript =
41+
opts:
42+
import ./lbf-prelude-typescript.nix {
43+
inherit pkgs lbg-typescript config;
44+
inherit (config.packages) lbf-list-modules-typescript lbf;
45+
inherit (inputs.flake-lang.lib.${system}) typescriptFlake;
46+
} opts;
47+
lbfPlutusTypescript =
48+
opts:
49+
import ./lbf-plutus-typescript.nix {
50+
inherit pkgs lbg-typescript config;
51+
inherit (config.packages) lbf-list-modules-typescript lbf;
52+
inherit (inputs.flake-lang.lib.${system}) typescriptFlake;
53+
} opts;
4954
lbfRust = import ./lbf-rust.nix pkgs config.packages.lbf lbg-rust;
5055
lbfPreludeRust = import ./lbf-prelude-rust.nix pkgs config.packages.lbf lbg-rust;
5156
lbfPlutusRust = import ./lbf-plutus-rust.nix pkgs config.packages.lbf lbg-rust;

0 commit comments

Comments
 (0)