mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
Remove all uses of lib.flatten
This commit is contained in:
parent
23762ecb29
commit
b7d927cb39
4 changed files with 27 additions and 32 deletions
|
|
@ -15,11 +15,11 @@ let
|
||||||
|> lib.filesystem.listFilesRecursive
|
|> lib.filesystem.listFilesRecursive
|
||||||
|> builtins.filter (lib.hasSuffix ".nix");
|
|> builtins.filter (lib.hasSuffix ".nix");
|
||||||
in
|
in
|
||||||
lib.flatten [
|
[
|
||||||
{ networking = { inherit hostName; }; }
|
{ networking = { inherit hostName; }; }
|
||||||
"${self}/hosts/shared.nix"
|
"${self}/hosts/shared.nix"
|
||||||
hostFiles
|
]
|
||||||
];
|
++ hostFiles;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,12 +90,12 @@ in
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
[
|
[
|
||||||
"crowdsecurity/linux"
|
(lib.singleton "crowdsecurity/linux")
|
||||||
(lib.optional (lib.elem "sshd" cfg.sources) "crowdsecurity/sshd")
|
(lib.optional (lib.elem "sshd" cfg.sources) "crowdsecurity/sshd")
|
||||||
(lib.optional (lib.elem "caddy" cfg.sources) "crowdsecurity/caddy")
|
(lib.optional (lib.elem "caddy" cfg.sources) "crowdsecurity/caddy")
|
||||||
(lib.optional (lib.elem "iptables" cfg.sources) "crowdsecurity/iptables")
|
(lib.optional (lib.elem "iptables" cfg.sources) "crowdsecurity/iptables")
|
||||||
]
|
]
|
||||||
|> lib.flatten
|
|> lib.concatLists
|
||||||
|> lib.map installCollection
|
|> lib.map installCollection
|
||||||
|> lib.concatLines
|
|> lib.concatLines
|
||||||
|> (text: pkgs.writeShellScript "crowdsec-install-collections" "set -e\n${text}")
|
|> (text: pkgs.writeShellScript "crowdsec-install-collections" "set -e\n${text}")
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ in
|
||||||
username = "";
|
username = "";
|
||||||
password = "";
|
password = "";
|
||||||
};
|
};
|
||||||
conditions = lib.flatten [
|
conditions = lib.concatLists [
|
||||||
extraConditions
|
extraConditions
|
||||||
(lib.optional (lib.hasPrefix "http" url) "[STATUS] == 200")
|
(lib.optional (lib.hasPrefix "http" url) "[STATUS] == 200")
|
||||||
(lib.optional (lib.hasPrefix "tcp" url) "[CONNECTED] == true")
|
(lib.optional (lib.hasPrefix "tcp" url) "[CONNECTED] == true")
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,7 @@ in
|
||||||
{
|
{
|
||||||
options.custom.wifi.enable = lib.mkEnableOption "";
|
options.custom.wifi.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.custom.wifi.enable (
|
config = lib.mkIf config.custom.wifi.enable {
|
||||||
lib.mkMerge (
|
|
||||||
lib.flatten [
|
|
||||||
{
|
|
||||||
networking.wireless.iwd = {
|
networking.wireless.iwd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
@ -30,19 +27,17 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.iwgtk ];
|
environment.systemPackages = [ pkgs.iwgtk ];
|
||||||
}
|
|
||||||
|
|
||||||
(
|
sops.secrets =
|
||||||
networks
|
networks
|
||||||
|> lib.map (name: {
|
|> lib.map (name: {
|
||||||
sops.secrets."iwd/${name}" = { };
|
name = "iwd/${name}";
|
||||||
|
value = { };
|
||||||
systemd.tmpfiles.rules = [
|
|
||||||
"C /var/lib/iwd/${name} - - - - ${config.sops.secrets."iwd/${name}".path}"
|
|
||||||
];
|
|
||||||
})
|
})
|
||||||
)
|
|> lib.listToAttrs;
|
||||||
]
|
|
||||||
)
|
systemd.tmpfiles.rules =
|
||||||
);
|
networks
|
||||||
|
|> lib.map (name: "C /var/lib/iwd/${name} - - - - ${config.sops.secrets."iwd/${name}".path}");
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue