Skip to content

Commit e27f4a1

Browse files
committed
Revert accidental formatting change
1 parent b62a027 commit e27f4a1

File tree

1 file changed

+16
-28
lines changed

1 file changed

+16
-28
lines changed

flake.nix

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
22
description = "Unified hosts file with base extensions.";
3-
outputs =
4-
{ self, nixpkgs, ... }@inputs:
3+
outputs = { self, nixpkgs, ... }@inputs:
54
let
65
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.unix;
6+
7+
nixpkgsFor = forAllSystems (system: import nixpkgs {
8+
inherit system;
9+
});
10+
711
toUnboundConf = (
812
file:
913
builtins.concatStringsSep "\n" (
@@ -23,25 +27,16 @@
2327
) (nixpkgs.lib.strings.splitString "\n" (builtins.readFile file))
2428
)
2529
);
26-
27-
nixpkgsFor = forAllSystems (
28-
system:
29-
import nixpkgs {
30-
inherit system;
31-
}
32-
);
3330
in
3431
{
35-
nixosModule =
36-
{ config, ... }:
32+
nixosModule = { config, ... }:
3733
with nixpkgs.lib;
3834
let
3935
cfg = config.networking.stevenBlackHosts;
40-
alternatesList =
41-
(if cfg.blockFakenews then [ "fakenews" ] else [ ])
42-
++ (if cfg.blockGambling then [ "gambling" ] else [ ])
43-
++ (if cfg.blockPorn then [ "porn" ] else [ ])
44-
++ (if cfg.blockSocial then [ "social" ] else [ ]);
36+
alternatesList = (if cfg.blockFakenews then [ "fakenews" ] else []) ++
37+
(if cfg.blockGambling then [ "gambling" ] else []) ++
38+
(if cfg.blockPorn then [ "porn" ] else []) ++
39+
(if cfg.blockSocial then [ "social" ] else []);
4540
alternatesPath = "alternates/" + builtins.concatStringsSep "-" alternatesList + "/";
4641
in
4742
{
@@ -58,20 +53,14 @@
5853
config = mkIf cfg.enable {
5954
networking.extraHosts =
6055
let
61-
orig = builtins.readFile (
62-
"${self}/" + (if alternatesList != [ ] then alternatesPath else "") + "hosts"
63-
);
56+
orig = builtins.readFile ("${self}/" + (if alternatesList != [] then alternatesPath else "") + "hosts");
6457
ipv6 = builtins.replaceStrings [ "0.0.0.0" ] [ "::" ] orig;
65-
in
66-
orig + (optionalString cfg.enableIPv6 ("\n" + ipv6));
58+
in orig + (optionalString cfg.enableIPv6 ("\n" + ipv6));
6759
};
6860
};
6961

70-
devShells = forAllSystems (
71-
system:
72-
let
73-
pkgs = nixpkgsFor.${system};
74-
in
62+
devShells = forAllSystems (system:
63+
let pkgs = nixpkgsFor.${system}; in
7564
{
7665
default = pkgs.mkShell {
7766
buildInputs = with pkgs; [
@@ -80,8 +69,7 @@
8069
python3Packages.requests
8170
];
8271
};
83-
}
84-
);
72+
});
8573

8674
overlays.default = (
8775
final: prev: {

0 commit comments

Comments
 (0)