Skip to content

Commit 69327e8

Browse files
committed
style(nix): Reformat *.nix files with nixfmt
1 parent 2d7abb1 commit 69327e8

File tree

4 files changed

+99
-101
lines changed

4 files changed

+99
-101
lines changed

modules/mcl-disko/primaryZfsPartition.nix

Lines changed: 75 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -10,86 +10,85 @@
1010
{
1111
type = "disk";
1212
device = disk;
13-
content =
14-
{
15-
type = if legacyBoot then "table" else "gpt";
16-
partitions =
17-
if !legacyBoot then
18-
{
19-
"ESP" = {
20-
device = "${disk}-part1";
21-
size = espSize;
22-
type = "EF00";
23-
content = {
24-
type = "filesystem";
25-
format = "vfat";
26-
mountpoint = if isSecondary then null else "/boot";
27-
mountOptions = [ "umask=0077" ];
28-
};
13+
content = {
14+
type = if legacyBoot then "table" else "gpt";
15+
partitions =
16+
if !legacyBoot then
17+
{
18+
"ESP" = {
19+
device = "${disk}-part1";
20+
size = espSize;
21+
type = "EF00";
22+
content = {
23+
type = "filesystem";
24+
format = "vfat";
25+
mountpoint = if isSecondary then null else "/boot";
26+
mountOptions = [ "umask=0077" ];
2927
};
28+
};
3029

31-
"zfs" = {
32-
device = "${disk}-part2";
33-
end = "-${swapSize}";
34-
type = "BF00";
35-
content = {
36-
type = "zfs";
37-
pool = "${poolName}";
38-
};
30+
"zfs" = {
31+
device = "${disk}-part2";
32+
end = "-${swapSize}";
33+
type = "BF00";
34+
content = {
35+
type = "zfs";
36+
pool = "${poolName}";
3937
};
38+
};
4039

41-
"swap" = {
42-
device = "${disk}-part3";
43-
size = swapSize;
44-
content = {
45-
type = "swap";
46-
randomEncryption = true;
47-
};
40+
"swap" = {
41+
device = "${disk}-part3";
42+
size = swapSize;
43+
content = {
44+
type = "swap";
45+
randomEncryption = true;
46+
};
47+
};
48+
}
49+
else
50+
[
51+
{
52+
name = "boot";
53+
start = "1MiB";
54+
end = "2MiB";
55+
part-type = "primary";
56+
flags = [ "bios_grub" ];
57+
}
58+
{
59+
name = "ESP";
60+
start = "2MiB";
61+
end = espSize;
62+
bootable = true;
63+
content = {
64+
type = "filesystem";
65+
format = "vfat";
66+
mountpoint = if isSecondary then null else "/boot";
67+
};
68+
}
69+
{
70+
name = "zfs";
71+
start = espSize;
72+
end = "-${swapSize}";
73+
part-type = "primary";
74+
content = {
75+
type = "zfs";
76+
pool = "${poolName}";
77+
};
78+
}
79+
{
80+
name = "swap";
81+
start = "-${swapSize}";
82+
end = "100%";
83+
part-type = "primary";
84+
content = {
85+
type = "swap";
86+
randomEncryption = true;
4887
};
4988
}
50-
else
51-
[
52-
{
53-
name = "boot";
54-
start = "1MiB";
55-
end = "2MiB";
56-
part-type = "primary";
57-
flags = [ "bios_grub" ];
58-
}
59-
{
60-
name = "ESP";
61-
start = "2MiB";
62-
end = espSize;
63-
bootable = true;
64-
content = {
65-
type = "filesystem";
66-
format = "vfat";
67-
mountpoint = if isSecondary then null else "/boot";
68-
};
69-
}
70-
{
71-
name = "zfs";
72-
start = espSize;
73-
end = "-${swapSize}";
74-
part-type = "primary";
75-
content = {
76-
type = "zfs";
77-
pool = "${poolName}";
78-
};
79-
}
80-
{
81-
name = "swap";
82-
start = "-${swapSize}";
83-
end = "100%";
84-
part-type = "primary";
85-
content = {
86-
type = "swap";
87-
randomEncryption = true;
88-
};
89-
}
90-
];
91-
}
92-
// lib.optionalAttrs legacyBoot {
93-
format = "gpt";
94-
};
89+
];
90+
}
91+
// lib.optionalAttrs legacyBoot {
92+
format = "gpt";
93+
};
9594
}

modules/mcl-disko/zpool.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ let
1212
options = {
1313
"com.sun:auto-snapshot" = if dataset.snapshot then "on" else "off";
1414
canmount = "on";
15-
} // (if (refreservation != null) then { inherit refreservation; } else { });
15+
}
16+
// (if (refreservation != null) then { inherit refreservation; } else { });
1617
};
1718

1819
restructuredDatasets = builtins.mapAttrs (

packages/default.nix

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,24 @@
5353
];
5454
};
5555

56-
packages =
57-
{
58-
lido-withdrawals-automation = pkgs.callPackage ./lido-withdrawals-automation { };
59-
pyroscope = pkgs.callPackage ./pyroscope { };
60-
random-alerts = pkgs.callPackage ./random-alerts { };
61-
}
62-
// optionalAttrs (system == "x86_64-linux" || system == "aarch64-darwin") {
63-
secret = import ./secret { inherit inputs' pkgs; };
64-
}
65-
// optionalAttrs isLinux {
66-
folder-size-metrics = pkgs.callPackage ./folder-size-metrics { };
67-
}
68-
// optionalAttrs (system == "x86_64-linux") {
69-
mcl = pkgs.callPackage ./mcl {
70-
buildDubPackage = inputs'.dlang-nix.legacyPackages.buildDubPackage.override {
71-
dCompiler = inputs'.dlang-nix.packages."ldc-binary-1_38_0";
72-
};
73-
inherit (legacyPackages.inputs.nixpkgs) cachix nix nix-eval-jobs;
56+
packages = {
57+
lido-withdrawals-automation = pkgs.callPackage ./lido-withdrawals-automation { };
58+
pyroscope = pkgs.callPackage ./pyroscope { };
59+
random-alerts = pkgs.callPackage ./random-alerts { };
60+
}
61+
// optionalAttrs (system == "x86_64-linux" || system == "aarch64-darwin") {
62+
secret = import ./secret { inherit inputs' pkgs; };
63+
}
64+
// optionalAttrs isLinux {
65+
folder-size-metrics = pkgs.callPackage ./folder-size-metrics { };
66+
}
67+
// optionalAttrs (system == "x86_64-linux") {
68+
mcl = pkgs.callPackage ./mcl {
69+
buildDubPackage = inputs'.dlang-nix.legacyPackages.buildDubPackage.override {
70+
dCompiler = inputs'.dlang-nix.packages."ldc-binary-1_38_0";
7471
};
72+
inherit (legacyPackages.inputs.nixpkgs) cachix nix nix-eval-jobs;
7573
};
74+
};
7675
};
7776
}

shells/default.nix

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,11 @@
4343
inputs'.dlang-nix.packages.dmd
4444
];
4545

46-
shellHook =
47-
''
48-
export REPO_ROOT="$PWD"
49-
figlet -t "Metacraft Nixos Modules"
50-
''
51-
+ config.pre-commit.installationScript;
46+
shellHook = ''
47+
export REPO_ROOT="$PWD"
48+
figlet -t "Metacraft Nixos Modules"
49+
''
50+
+ config.pre-commit.installationScript;
5251
};
5352
};
5453
}

0 commit comments

Comments
 (0)