diff --git a/config/net/vpn.nix b/config/net/vpn.nix index 1c92c90..61e0c43 100644 --- a/config/net/vpn.nix +++ b/config/net/vpn.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ ... }: { site.net.vpn = { vlan = null; diff --git a/config/server.nix b/config/server.nix index f7595f0..24f9ef0 100644 --- a/config/server.nix +++ b/config/server.nix @@ -14,7 +14,7 @@ let ) ) {} (builtins.attrValues containers); - makeServer = name: { + makeServer = _name: { role = "server"; model = "pc"; interfaces = bridgeInterfaces // { diff --git a/flake.nix b/flake.nix index fed8f7f..6ea1cba 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,7 @@ }; in { # Config, and utilities - lib = nixpkgs.lib.extend (final: prev: + lib = nixpkgs.lib.extend (_final: _prev: import ./nix/lib { inherit self; inherit openwrt; diff --git a/nix/lib/config/options.nix b/nix/lib/config/options.nix index ae7345f..9956e93 100644 --- a/nix/lib/config/options.nix +++ b/nix/lib/config/options.nix @@ -224,7 +224,7 @@ let }; }; - interfaceOpts = { name, ... }: { + interfaceOpts = { ... }: { options = { hwaddr = mkOption { type = with types; nullOr str; @@ -433,7 +433,7 @@ let wifi = mkOption { default = {}; type = with types; attrsOf (submodule ( - { name, ... }: { + { ... }: { options = { htmode = mkOption { type = enum [ "HT20" "HT40-" "HT40+" "VHT80" ]; @@ -443,7 +443,7 @@ let }; ssids = mkOption { type = attrsOf (submodule ( - { name, ... }: { + { ... }: { options = { net = mkOption { type = str; @@ -479,7 +479,7 @@ let type = types.int; }; peers = mkOption { - type = with types; attrsOf (submodule ({ name, ... }: { + type = with types; attrsOf (submodule ({ ... }: { options = { asn = mkOption { type = types.int; diff --git a/nix/lib/dns.nix b/nix/lib/dns.nix index 1970fa7..2700b0b 100644 --- a/nix/lib/dns.nix +++ b/nix/lib/dns.nix @@ -43,7 +43,7 @@ rec { ); # generate zones only for nets with hosts - namedNets = lib.filterAttrs (name: { hosts4, hosts6, dynamicDomain, ... }: + namedNets = lib.filterAttrs (_name: { hosts4, hosts6, dynamicDomain, ... }: (hosts4 != [] && hosts6 != []) || dynamicDomain ) config.site.net; @@ -143,7 +143,7 @@ rec { )) {} (builtins.attrNames namedNets); # `{ dn42 = [ "....ip6.arpa" ]; }` - reverseZones6 = builtins.mapAttrs (ctx: reverseHosts6ctx: + reverseZones6 = builtins.mapAttrs (_ctx: reverseHosts6ctx: builtins.attrNames ( builtins.foldl' (result: rname: result // { "${builtins.substring ((128 - reverseZone6Size) / 2) (72 - ((128 - reverseZone6Size) / 2)) rname}" = true; diff --git a/nix/nixos-module/container/bird.nix b/nix/nixos-module/container/bird.nix index 26703c4..f410423 100644 --- a/nix/nixos-module/container/bird.nix +++ b/nix/nixos-module/container/bird.nix @@ -1,5 +1,5 @@ # Routing daemon configuration -{ hostName, config, options, lib, pkgs, ... }: +{ hostName, config, lib, pkgs, ... }: let hostConf = config.site.hosts.${hostName}; diff --git a/nix/nixos-module/container/dhcp-server.nix b/nix/nixos-module/container/dhcp-server.nix index 0e50c99..ab035d9 100644 --- a/nix/nixos-module/container/dhcp-server.nix +++ b/nix/nixos-module/container/dhcp-server.nix @@ -1,5 +1,5 @@ # ISC DHCP/IPv4 server configuration -{ hostName, inputs, config, lib, ... }: +{ hostName, config, lib, ... }: let dhcpNets = diff --git a/nix/nixos-module/container/dns.nix b/nix/nixos-module/container/dns.nix index eaa4bfc..9ec4ada 100644 --- a/nix/nixos-module/container/dns.nix +++ b/nix/nixos-module/container/dns.nix @@ -1,4 +1,4 @@ -{ hostName, config, lib, pkgs, self, inputs, ... }: +{ hostName, config, lib, pkgs, self, ... }: let serial = diff --git a/nix/nixos-module/container/netboot.nix b/nix/nixos-module/container/netboot.nix index f7bce68..3b855a3 100644 --- a/nix/nixos-module/container/netboot.nix +++ b/nix/nixos-module/container/netboot.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: let netboot_xyz_efi = pkgs.fetchurl { url = "https://github.com/netbootxyz/netboot.xyz/releases/download/2.0.40/netboot.xyz.efi"; diff --git a/nix/nixos-module/container/upstream/pppoe.nix b/nix/nixos-module/container/upstream/pppoe.nix index 3b4abd1..cfa5c9f 100644 --- a/nix/nixos-module/container/upstream/pppoe.nix +++ b/nix/nixos-module/container/upstream/pppoe.nix @@ -1,4 +1,4 @@ -{ hostName, inputs, config, lib, ... }: +{ hostName, config, lib, ... }: let hostConf = config.site.hosts.${hostName}; diff --git a/nix/nixos-module/container/vpn.nix b/nix/nixos-module/container/vpn.nix index 76aa383..ce00b1f 100644 --- a/nix/nixos-module/container/vpn.nix +++ b/nix/nixos-module/container/vpn.nix @@ -1,4 +1,4 @@ -{ hostName, config, lib, pkgs, ... }: +{ config, pkgs, ... }: let privateKeyFile = ifName: diff --git a/nix/nixos-module/container/wireguard.nix b/nix/nixos-module/container/wireguard.nix index eca7090..814e9d4 100644 --- a/nix/nixos-module/container/wireguard.nix +++ b/nix/nixos-module/container/wireguard.nix @@ -1,7 +1,6 @@ { hostName, config, lib, pkgs, ... }: let - gateway = "upstream1"; tunnels = lib.filterAttrs (_: { wireguard, ... }: wireguard != null diff --git a/nix/nixos-module/container/yggdrasil.nix b/nix/nixos-module/container/yggdrasil.nix index d4445d6..eaacf69 100644 --- a/nix/nixos-module/container/yggdrasil.nix +++ b/nix/nixos-module/container/yggdrasil.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, hostName, ... }: +{ lib, config, hostName, ... }: let hostConf = config.site.hosts.${hostName}; diff --git a/nix/nixos-module/default.nix b/nix/nixos-module/default.nix index cfe7cbb..d899867 100644 --- a/nix/nixos-module/default.nix +++ b/nix/nixos-module/default.nix @@ -1,6 +1,6 @@ # Pulls together NixOS configuration modules according to the # name/role of the host to be built. -{ hostName, config, lib, pkgs, ... }: +{ hostName, config, lib, ... }: let inherit (lib) optionals; diff --git a/nix/nixos-module/defaults.nix b/nix/nixos-module/defaults.nix index eff8d1c..98e9e03 100644 --- a/nix/nixos-module/defaults.nix +++ b/nix/nixos-module/defaults.nix @@ -1,4 +1,4 @@ -{ hostName, inputs, pkgs, config, options, lib, ... }: +{ hostName, inputs, pkgs, ... }: { boot.kernelParams = [ diff --git a/nix/nixos-module/network.nix b/nix/nixos-module/network.nix index b49855e..9942673 100644 --- a/nix/nixos-module/network.nix +++ b/nix/nixos-module/network.nix @@ -1,4 +1,4 @@ -{ hostName, config, lib, pkgs, ... }: +{ hostName, config, lib, ... }: let # pick an address for a net's gateway diff --git a/nix/nixos-module/server/lxc-containers.nix b/nix/nixos-module/server/lxc-containers.nix index 630a8d2..a7cd177 100644 --- a/nix/nixos-module/server/lxc-containers.nix +++ b/nix/nixos-module/server/lxc-containers.nix @@ -1,4 +1,4 @@ -{ hostName, self, config, lib, pkgs, ... }: +{ self, config, lib, pkgs, ... }: let # Containers that are run on this host diff --git a/nix/nixos-module/server/network.nix b/nix/nixos-module/server/network.nix index 0bdd637..ea7c4cd 100644 --- a/nix/nixos-module/server/network.nix +++ b/nix/nixos-module/server/network.nix @@ -1,5 +1,5 @@ # Server network configuration -{ hostName, self, config, lib, pkgs, ... }: +{ config, lib, ... }: let # LXC containers on this host diff --git a/nix/nixos-module/server/server1.nix b/nix/nixos-module/server/server1.nix index 4e30539..f2b1b4a 100644 --- a/nix/nixos-module/server/server1.nix +++ b/nix/nixos-module/server/server1.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, ... }: { boot.loader.grub.enable = true; diff --git a/nix/nixos-module/server/server2.nix b/nix/nixos-module/server/server2.nix index 240ed86..307efd1 100644 --- a/nix/nixos-module/server/server2.nix +++ b/nix/nixos-module/server/server2.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ ... }: { boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "usbhid" "sd_mod" "sr_mod" ]; diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 95af4be..c7783fb 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -59,7 +59,7 @@ let vm-packages = builtins.foldl' (rootfs: hostName: rootfs // { "${hostName}-vm" = self.nixosConfigurations.${hostName}.config.system.build.vm - .overrideAttrs (oa: { + .overrideAttrs (_oa: { meta.mainProgram = "run-${hostName}-vm"; }); }) {} ( diff --git a/nix/pkgs/dns-slaves.nix b/nix/pkgs/dns-slaves.nix index f1b5f4e..b313628 100644 --- a/nix/pkgs/dns-slaves.nix +++ b/nix/pkgs/dns-slaves.nix @@ -15,7 +15,7 @@ let in writeText "named.slave.conf" ( - lib.concatMapStringsSep "\n" ({ name, ns, ... }: '' + lib.concatMapStringsSep "\n" ({ name, ... }: '' zone "${name}" IN { type slave; masters {${mastersStr} }; diff --git a/nix/pkgs/network-cypher-graphs.nix b/nix/pkgs/network-cypher-graphs.nix index 094cc70..c24f24d 100644 --- a/nix/pkgs/network-cypher-graphs.nix +++ b/nix/pkgs/network-cypher-graphs.nix @@ -138,7 +138,7 @@ in rec { logical-cypher-graph = let containers = - lib.filterAttrs (_: { isRouter, role, ... }: + lib.filterAttrs (_: { role, ... }: role == "container" ) config.site.hosts; in diff --git a/nix/pkgs/network-graphs.nix b/nix/pkgs/network-graphs.nix index 92713a2..937aded 100644 --- a/nix/pkgs/network-graphs.nix +++ b/nix/pkgs/network-graphs.nix @@ -134,7 +134,7 @@ in rec { logical-graph = let containers = - lib.filterAttrs (_: { isRouter, role, ... }: + lib.filterAttrs (_: { role, ... }: role == "container" ) config.site.hosts; in diff --git a/nix/pkgs/switches/linksys-srw2048.nix b/nix/pkgs/switches/linksys-srw2048.nix index daff0b2..a7bbb25 100644 --- a/nix/pkgs/switches/linksys-srw2048.nix +++ b/nix/pkgs/switches/linksys-srw2048.nix @@ -1,5 +1,5 @@ # https://www.crc.id.au/real-console-on-linksys-srw2024-switch/ -{ self, pkgs, hostName, config, hostConfig +{ pkgs, hostName, config, hostConfig , sort, sortBy, sortNetsByVlan , ... }: with pkgs;