format all

This commit is contained in:
Kopatz
2025-10-30 21:59:31 +01:00
parent b1dda4d037
commit 8a78e618bb
188 changed files with 3526 additions and 1825 deletions

View File

@@ -1,7 +1,9 @@
{ config, lib, ... }:
with lib;
let cfg = config.custom.static-ip;
in {
let
cfg = config.custom.static-ip;
in
{
options.custom.static-ip = {
enable = mkEnableOption "Enables static-ip";
ip = lib.mkOption {
@@ -23,20 +25,23 @@ in {
};
};
config =
let fallback = "1.1.1.1";
in mkIf cfg.enable {
let
fallback = "1.1.1.1";
in
mkIf cfg.enable {
networking = {
defaultGateway = cfg.gateway;
useDHCP = false;
nameservers = [ cfg.dns ]
++ lib.lists.optionals (!config.services.resolved.enable) [ fallback ];
nameservers = [ cfg.dns ] ++ lib.lists.optionals (!config.services.resolved.enable) [ fallback ];
interfaces = {
${cfg.interface} = {
name = "eth0";
ipv4.addresses = [{
address = cfg.ip;
prefixLength = 24;
}];
ipv4.addresses = [
{
address = cfg.ip;
prefixLength = 24;
}
];
};
};
};