Skip to content

Commit 3859368

Browse files
committed
Change nix formatter
1 parent 0687d7e commit 3859368

File tree

18 files changed

+261
-190
lines changed

18 files changed

+261
-190
lines changed

dev-net/build.nix

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
{ flake-parts-lib
2-
, self
3-
, withSystem
4-
, lib
5-
, ...
6-
}: {
7-
perSystem = { pkgs, system, ... }: lib.mkIf (system == "x86_64-linux") {
8-
checks.dev-net-nixos-test = pkgs.nixosTest (import ./test.nix {
9-
inherit flake-parts-lib self withSystem;
10-
});
11-
};
1+
{
2+
flake-parts-lib,
3+
self,
4+
withSystem,
5+
lib,
6+
...
7+
}:
8+
{
9+
perSystem =
10+
{ pkgs, system, ... }:
11+
lib.mkIf (system == "x86_64-linux") {
12+
checks.dev-net-nixos-test = pkgs.nixosTest (
13+
import ./test.nix {
14+
inherit flake-parts-lib self withSystem;
15+
}
16+
);
17+
};
1218

1319
flake = {
1420
nixosModules.dev-net = import ./cardano-dev-net.nix {

dev-net/cardano-dev-net.nix

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
_: { lib
2-
, config
3-
, pkgs
4-
, ...
5-
}:
1+
_:
2+
{
3+
lib,
4+
config,
5+
pkgs,
6+
...
7+
}:
68
let
7-
inherit (lib) mkOption types mkEnableOption mkIf;
9+
inherit (lib)
10+
mkOption
11+
types
12+
mkEnableOption
13+
mkIf
14+
;
815
inherit (builtins) toString;
916

1017
cfg = config.services.cardano-dev-net;

dev-net/test.nix

+42-34
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,54 @@
1-
{ self, ... }: {
1+
{ self, ... }:
2+
{
23
name = "Test Cardano Dev Net";
34

45
nodes =
56
let
67
# TODO(chfanghr): this *is* a nixosTest attribute in the new version of nixpkgs
7-
defaults = { config, pkgs, lib, ... }: {
8-
imports = [
9-
self.inputs.cardano-nix.nixosModules.default
10-
self.outputs.nixosModules.dev-net
11-
];
8+
defaults =
9+
{
10+
config,
11+
pkgs,
12+
lib,
13+
...
14+
}:
15+
{
16+
imports = [
17+
self.inputs.cardano-nix.nixosModules.default
18+
self.outputs.nixosModules.dev-net
19+
];
1220

13-
services = {
14-
cardano-dev-net.enable = true;
15-
ogmios = {
16-
enable = true;
17-
nodeSocketPath = config.services.cardano-dev-net.socketPath;
18-
nodeConfigPath = config.services.cardano-dev-net.dynamicConfigFile;
21+
services = {
22+
cardano-dev-net.enable = true;
23+
ogmios = {
24+
enable = true;
25+
nodeSocketPath = config.services.cardano-dev-net.socketPath;
26+
nodeConfigPath = config.services.cardano-dev-net.dynamicConfigFile;
27+
};
1928
};
20-
};
2129

22-
systemd.services.ogmios =
23-
let
24-
waitForOgmios = pkgs.writeShellScript "wait-for-ogmios" ''
25-
function is-listening {
26-
${lib.getExe' pkgs.iproute2 "ss"} \
27-
--no-header \
28-
--numeric \
29-
--listening \
30-
--tcp src = ${config.services.ogmios.host} and sport = inet:${toString config.services.ogmios.port} | grep LISTEN
31-
}
30+
systemd.services.ogmios =
31+
let
32+
waitForOgmios = pkgs.writeShellScript "wait-for-ogmios" ''
33+
function is-listening {
34+
${lib.getExe' pkgs.iproute2 "ss"} \
35+
--no-header \
36+
--numeric \
37+
--listening \
38+
--tcp src = ${config.services.ogmios.host} and sport = inet:${toString config.services.ogmios.port} | grep LISTEN
39+
}
3240
33-
until is-listening; do sleep 10; done
34-
'';
35-
in
36-
{
37-
after = [ "cardano-node-socket.service" ];
38-
serviceConfig.RestrictAddressFamilies = [ "AF_NETLINK" ];
39-
postStart = ''
40-
timeout 60 ${waitForOgmios}
41-
'';
42-
};
43-
};
41+
until is-listening; do sleep 10; done
42+
'';
43+
in
44+
{
45+
after = [ "cardano-node-socket.service" ];
46+
serviceConfig.RestrictAddressFamilies = [ "AF_NETLINK" ];
47+
postStart = ''
48+
timeout 60 ${waitForOgmios}
49+
'';
50+
};
51+
};
4452
in
4553
{
4654
machineWithNetworkMagic42 = {

extras/diesel-derive-pg/build.nix

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
{ inputs, ... }: {
2-
perSystem = { system, pkgs, config, ... }:
1+
{ inputs, ... }:
2+
{
3+
perSystem =
4+
{
5+
system,
6+
pkgs,
7+
config,
8+
...
9+
}:
310
let
4-
rustFlake =
5-
inputs.flake-lang.lib.${system}.rustFlake {
6-
src = ./.;
7-
crateName = "diesel-derive-pg";
8-
runTests = false;
11+
rustFlake = inputs.flake-lang.lib.${system}.rustFlake {
12+
src = ./.;
13+
crateName = "diesel-derive-pg";
14+
runTests = false;
915

10-
buildInputs = [ pkgs.postgresql.lib ];
16+
buildInputs = [ pkgs.postgresql.lib ];
1117

12-
devShellHook = config.settings.shell.hook;
18+
devShellHook = config.settings.shell.hook;
1319

14-
generateDocs = false;
15-
};
20+
generateDocs = false;
21+
};
1622
in
1723
{
1824
inherit (rustFlake) packages checks devShells;

extras/tx-bakery-testsuite/api/build.nix

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
{ inputs, ... }: {
2-
perSystem = { system, ... }:
1+
{ inputs, ... }:
2+
{
3+
perSystem =
4+
{ system, ... }:
35
{
46
packages = {
57
lbf-tx-bakery-tests-plutus-api-plutarch = inputs.lbf.lib."${system}".lbfPlutarch {
@@ -28,4 +30,3 @@
2830
};
2931
};
3032
}
31-

extras/tx-bakery-testsuite/tests/build.nix

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{ inputs, ... }:
22
{
33
perSystem =
4-
{ pkgs
5-
, config
6-
, system
7-
, inputs'
8-
, self'
9-
, ...
4+
{
5+
pkgs,
6+
config,
7+
system,
8+
inputs',
9+
self',
10+
...
1011
}:
1112

1213
let

extras/tx-bakery-testsuite/validation/build.nix

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{ inputs, ... }:
22
{
3-
perSystem = { config, system, pkgs, inputs', ... }:
3+
perSystem =
4+
{
5+
config,
6+
system,
7+
pkgs,
8+
inputs',
9+
...
10+
}:
411
let
512
hsFlake = inputs.flake-lang.lib."${system}".haskellPlutusFlake {
613
src = ./.;
@@ -40,7 +47,8 @@
4047
# WARN(bladyjoker): We have to pick the hsFlake.packages like this otherwise flake-parts goes into `infinite recursion`.
4148
tx-bakery-test-scripts-lib = hsFlake.packages."tx-bakery-test-scripts:lib:tx-bakery-test-scripts";
4249

43-
tx-bakery-test-scripts-cli = hsFlake.packages."tx-bakery-test-scripts:exe:tx-bakery-test-scripts-cli";
50+
tx-bakery-test-scripts-cli =
51+
hsFlake.packages."tx-bakery-test-scripts:exe:tx-bakery-test-scripts-cli";
4452

4553
tx-bakery-test-scripts-config = pkgs.stdenv.mkDerivation {
4654
name = "tx-bakery-test-scripts-config";

extras/tx-indexer-testsuite/build.nix

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{ inputs, ... }:
22
{
33
perSystem =
4-
{ system
5-
, pkgs
6-
, config
7-
, inputs'
8-
, self'
9-
, ...
4+
{
5+
system,
6+
pkgs,
7+
config,
8+
inputs',
9+
self',
10+
...
1011
}:
1112
let
1213
rustFlake = inputs.flake-lang.lib.${system}.rustFlake {

github-pages.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
hercules-ci.github-pages.branch = "main";
33

4-
perSystem = { config, pkgs, ... }:
4+
perSystem =
5+
{ config, pkgs, ... }:
56
let
67
github-pages-main-page = pkgs.writeText "README.md" ''
78
# [Transaction Village](https://github.com/Unbox-infinity/tx-village)

hercules-ci.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{ inputs, ... }: {
1+
{ inputs, ... }:
2+
{
23
imports = [
34
inputs.hci-effects.flakeModule # Adds hercules-ci and herculesCI options
45
./github-pages.nix

ledger-sim/build.nix

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
{ inputs, ... }: {
2-
perSystem = { config, system, ... }:
1+
{ inputs, ... }:
2+
{
3+
perSystem =
4+
{ config, system, ... }:
35
let
4-
hsFlake =
5-
inputs.flake-lang.lib.${system}.haskellPlutusFlake
6-
{
7-
src = ./.;
8-
name = "ledger-sim";
9-
inherit (config.settings.haskell) index-state compiler-nix-name;
6+
hsFlake = inputs.flake-lang.lib.${system}.haskellPlutusFlake {
7+
src = ./.;
8+
name = "ledger-sim";
9+
inherit (config.settings.haskell) index-state compiler-nix-name;
1010

11-
devShellTools = config.settings.shell.tools;
11+
devShellTools = config.settings.shell.tools;
1212

13-
devShellHook = config.settings.shell.hook;
14-
};
13+
devShellHook = config.settings.shell.hook;
14+
};
1515
in
1616
{
1717
devShells.dev-ledger-sim = hsFlake.devShell;

pkgs.nix

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Repo-wide Nixpkgs with a ton of overlays
22
{ inputs, ... }:
33
{
4-
perSystem = { pkgs, system, ... }: {
4+
perSystem =
5+
{ pkgs, system, ... }:
6+
{
57

6-
_module.args.pkgs = import inputs.nixpkgs {
7-
inherit system;
8-
};
8+
_module.args.pkgs = import inputs.nixpkgs {
9+
inherit system;
10+
};
911

10-
};
12+
};
1113
}

pre-commit.nix

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
{ inputs, ... }: {
1+
{ inputs, ... }:
2+
{
23
imports = [
34
inputs.pre-commit-hooks.flakeModule
45
];
5-
perSystem = { config, ... }:
6+
perSystem =
7+
{ config, ... }:
68
{
79
devShells.dev-pre-commit = config.pre-commit.devShell;
810
devShells.default = config.pre-commit.devShell;
@@ -13,7 +15,7 @@
1315
];
1416

1517
hooks = {
16-
nixpkgs-fmt.enable = true;
18+
nixfmt-rfc-style.enable = true;
1719
deadnix.enable = true;
1820
statix.enable = true;
1921
cabal-fmt.enable = true;

settings.nix

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# Repo wide settings
2-
{ lib, flake-parts-lib, inputs, ... }: {
2+
{
3+
lib,
4+
flake-parts-lib,
5+
inputs,
6+
...
7+
}:
8+
{
39

410
options = {
511

6-
perSystem = flake-parts-lib.mkPerSystemOption
7-
({ system, config, ... }: {
12+
perSystem = flake-parts-lib.mkPerSystemOption (
13+
{ system, config, ... }:
14+
{
815
options.settings = {
916

1017
shell = {
@@ -36,7 +43,6 @@
3643

3744
};
3845

39-
4046
config = {
4147

4248
settings = {
@@ -50,7 +56,7 @@
5056

5157
tools = [
5258
inputs.pre-commit-hooks.outputs.packages.${system}.deadnix
53-
inputs.pre-commit-hooks.outputs.packages.${system}.nixpkgs-fmt
59+
inputs.pre-commit-hooks.outputs.packages.${system}.nixfmt-rfc-style
5460

5561
inputs.pre-commit-hooks.outputs.packages.${system}.shellcheck
5662

@@ -73,7 +79,8 @@
7379
};
7480
};
7581

76-
});
82+
}
83+
);
7784

7885
};
7986

0 commit comments

Comments
 (0)