*.nix: remove unused code

This commit is contained in:
Astro 2022-03-22 18:13:17 +01:00
parent e16be776bb
commit 2de02cc5bb
25 changed files with 28 additions and 29 deletions

View File

@ -1,4 +1,4 @@
{ config, ... }:
{ ... }:
{
site.net.vpn = {
vlan = null;

View File

@ -14,7 +14,7 @@ let
)
) {} (builtins.attrValues containers);
makeServer = name: {
makeServer = _name: {
role = "server";
model = "pc";
interfaces = bridgeInterfaces // {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -1,5 +1,5 @@
# Routing daemon configuration
{ hostName, config, options, lib, pkgs, ... }:
{ hostName, config, lib, pkgs, ... }:
let
hostConf = config.site.hosts.${hostName};

View File

@ -1,5 +1,5 @@
# ISC DHCP/IPv4 server configuration
{ hostName, inputs, config, lib, ... }:
{ hostName, config, lib, ... }:
let
dhcpNets =

View File

@ -1,4 +1,4 @@
{ hostName, config, lib, pkgs, self, inputs, ... }:
{ hostName, config, lib, pkgs, self, ... }:
let
serial =

View File

@ -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";

View File

@ -1,4 +1,4 @@
{ hostName, inputs, config, lib, ... }:
{ hostName, config, lib, ... }:
let
hostConf = config.site.hosts.${hostName};

View File

@ -1,4 +1,4 @@
{ hostName, config, lib, pkgs, ... }:
{ config, pkgs, ... }:
let
privateKeyFile = ifName:

View File

@ -1,7 +1,6 @@
{ hostName, config, lib, pkgs, ... }:
let
gateway = "upstream1";
tunnels = lib.filterAttrs (_: { wireguard, ... }:
wireguard != null

View File

@ -1,4 +1,4 @@
{ pkgs, lib, config, hostName, ... }:
{ lib, config, hostName, ... }:
let
hostConf = config.site.hosts.${hostName};

View File

@ -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;

View File

@ -1,4 +1,4 @@
{ hostName, inputs, pkgs, config, options, lib, ... }:
{ hostName, inputs, pkgs, ... }:
{
boot.kernelParams = [

View File

@ -1,4 +1,4 @@
{ hostName, config, lib, pkgs, ... }:
{ hostName, config, lib, ... }:
let
# pick an address for a net's gateway

View File

@ -1,4 +1,4 @@
{ hostName, self, config, lib, pkgs, ... }:
{ self, config, lib, pkgs, ... }:
let
# Containers that are run on this host

View File

@ -1,5 +1,5 @@
# Server network configuration
{ hostName, self, config, lib, pkgs, ... }:
{ config, lib, ... }:
let
# LXC containers on this host

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ config, ... }:
{
boot.loader.grub.enable = true;

View File

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ ... }:
{
boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "usbhid" "sd_mod" "sr_mod" ];

View File

@ -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";
});
}) {} (

View File

@ -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} };

View File

@ -138,7 +138,7 @@ in rec {
logical-cypher-graph =
let
containers =
lib.filterAttrs (_: { isRouter, role, ... }:
lib.filterAttrs (_: { role, ... }:
role == "container"
) config.site.hosts;
in

View File

@ -134,7 +134,7 @@ in rec {
logical-graph =
let
containers =
lib.filterAttrs (_: { isRouter, role, ... }:
lib.filterAttrs (_: { role, ... }:
role == "container"
) config.site.hosts;
in

View File

@ -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;