1
0

Compare commits

..

1 Commits

Author SHA1 Message Date
Flake Update Bot
852ea7aeb6 Update nixpkgs 2025-10-25-01-03 2025-10-25 03:03:19 +02:00
12 changed files with 20 additions and 329 deletions

38
flake.lock generated
View File

@@ -269,11 +269,11 @@
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1759516991,
"narHash": "sha256-esoe/uYPyy4a6hAwZq1QgkSe7dnZ5c0zHHXDq/JG9Yk=",
"lastModified": 1751801455,
"narHash": "sha256-hUJqtS88SbNQQSEJAPFyY2vLMh8yA8rQ6jbul50p64M=",
"ref": "lix-2.93",
"rev": "b1328322a49e8e153635ea8b3b602db363de727f",
"revCount": 4284,
"rev": "b940aca430a7ca41f70bdb320659dd62026fe0e9",
"revCount": 4261,
"type": "git",
"url": "https://git.lix.systems/lix-project/hydra.git"
},
@@ -301,11 +301,11 @@
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1757791921,
"narHash": "sha256-83qbJckLOLrAsKO88UI9N4QRatNEc3gUFtLMiAPwK0g=",
"lastModified": 1751235704,
"narHash": "sha256-Jzm3KPZ2gL+0Nl3Mw/2E0B3vqDDi1Xt5+9VCXghUDZ8=",
"ref": "release-2.93",
"rev": "b7c2f17e9133e8b85d41c58b52f9d4e3254f41da",
"revCount": 17892,
"rev": "f3a7bbe5f8d1a8504ddb6362d50106904523e440",
"revCount": 17874,
"type": "git",
"url": "https://git.lix.systems/lix-project/lix"
},
@@ -327,11 +327,11 @@
]
},
"locked": {
"lastModified": 1756125859,
"narHash": "sha256-6a+PWILmqHCs9B5eIBLg6HSZ8jYweZpgOWO8FlyVwYI=",
"lastModified": 1753282722,
"narHash": "sha256-KYMUrTV7H/RR5/HRnjV5R3rRIuBXMemyJzTLi50NFTs=",
"ref": "release-2.93",
"rev": "d3292125035b04df00d01549a26e948631fabe1e",
"revCount": 156,
"rev": "46a9e8fcfe4be72b4c7c8082ee11d2c42da1e873",
"revCount": 149,
"type": "git",
"url": "https://git.lix.systems/lix-project/nixos-module.git"
},
@@ -353,11 +353,11 @@
"pre-commit-hooks": "pre-commit-hooks_2"
},
"locked": {
"lastModified": 1759940703,
"narHash": "sha256-/dXDCzYnQbkqCsvUDIxgIH4BS/fyxIu73m2v4ftJLXQ=",
"lastModified": 1753306924,
"narHash": "sha256-jLCEW0FvjFhC+c4RHzH+xbkSOxrnpFHnhjOw6sudhx0=",
"ref": "release-2.93",
"rev": "75c03142049242a5687309e59e4f356fbc92789a",
"revCount": 17894,
"rev": "1a4393d0aac31aba21f5737ede1b171e11336d77",
"revCount": 17884,
"type": "git",
"url": "https://git.lix.systems/lix-project/lix.git"
},
@@ -634,11 +634,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1759281824,
"narHash": "sha256-FIBE1qXv9TKvSNwst6FumyHwCRH3BlWDpfsnqRDCll0=",
"lastModified": 1751582995,
"narHash": "sha256-u7ubvtxdTnFPpV27AHpgoKn7qHuE7sgWgza/1oj5nzA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5b5be50345d4113d04ba58c444348849f5585b4a",
"rev": "7a732ed41ca0dd64b4b71b563ab9805a80a7d693",
"type": "github"
},
"original": {

View File

@@ -6,7 +6,6 @@
./hardware-configuration.nix
./dns.nix
./ds-lite-ncfttb.nix
./mdns.nix
./net-dsl.nix
./net-gastnetz.nix
@@ -17,7 +16,7 @@
./net-printer.nix
./net-voip.nix
./ntp.nix
./ppp-ncfttb.nix
./ppp.nix
./scan-to-gpg.nix
./wg-clerie.nix
];

View File

@@ -1,18 +0,0 @@
{ ... }:
{
profiles.clerie.ds-lite = {
enable = true;
wanInterfaceName = "ppp-ncfttb";
tunnelInterfaceName = "ds-lite-ncfttb";
lanInterfaces = [
{
name = "net-heimnetz";
sla_id = 201;
prefix_len = 64;
}
];
};
}

View File

@@ -48,8 +48,5 @@
},
"cleriewi.uber.space": {
"clerie-uberspace": { "enable": true }
},
"reichart.uber.space": {
"clerie-uberspace": { "enable": true }
}
}

View File

@@ -1,12 +0,0 @@
{ pkgs, ... }:
pkgs.writeShellApplication {
name = "ds-lite-dhcpcd-hook";
text = builtins.readFile ./ds-lite-dhcpcd-hook.sh;
runtimeInputs = with pkgs; [
iproute2
jq
dig
gawk
];
}

View File

@@ -1,102 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# Setting up required environment variables
# shellcheck disable=SC2154
WAN_INTERFACE_NAME="${DS_LITE_WAN_INTERFACE_NAME}"
# shellcheck disable=SC2154
TUNNEL_INTERFACE_NAME="${DS_LITE_TUNNEL_INTERFACE_NAME}"
log_dhcp () {
echo "<ds-lite-dhcpcd-hook> ${WAN_INTERFACE_NAME}: $1"
}
log_tunnel () {
echo "<ds-lite-dhcpcd-hook> ${WAN_INTERFACE_NAME} (${TUNNEL_INTERFACE_NAME}): $1"
}
# Check if the event calling this hook is for the wan interface
# exit immediately if not
# shellcheck disable=SC2154
if [[ "$interface" != "$WAN_INTERFACE_NAME" ]]; then
exit
fi
# Make sure the event calling this hook carries the environment variable
# in question. The environment variable is not provided with every call
# and we just want to exit if it is not provided
# shellcheck disable=SC2154
if [[ ! -v new_dhcp6_aftr_name ]]; then
# Variable is not set
exit
fi
# shellcheck disable=SC2154
if [[ -z "${new_dhcp6_aftr_name}" ]]; then
# Variable is empty, can't do anything
exit
fi
# shellcheck disable=SC2154
AFTR_NAME="$new_dhcp6_aftr_name"
log_dhcp "Received new AFTR_NAME ${AFTR_NAME}"
# Make sure we have a nameserver to resolve aftr name against
# shellcheck disable=SC2154
if [[ ! -v new_dhcp6_name_servers ]]; then
# Variable is not set
exit
fi
# shellcheck disable=SC2154
if [[ -z "${new_dhcp6_name_servers}" ]]; then
# Variable is empty, can't do anything
exit
fi
# shellcheck disable=SC2154
NAME_SERVERS="$new_dhcp6_name_servers"
log_dhcp "Received new NAME_SERVERS ${NAME_SERVERS}"
# Select first nameserver
NAME_SERVER="$(echo "${NAME_SERVERS}" | awk '{print $1;}')"
log_dhcp "Selected NAME_SERVER ${NAME_SERVER}"
# Figure out a usable IPv6 address on the wan interface, to origin our DNS requests and tunnel
WAN_INTERFACE_ADDRESS="$(ip --json address show "${WAN_INTERFACE_NAME}" | jq -r '.[0].addr_info[] | select(.family == "inet6" and .scope == "global" and .mngtmpaddr == true) | .local')"
log_dhcp "Using WAN_INTERFACE_ADDRESS ${WAN_INTERFACE_ADDRESS}"
AFTR_ADDRESS="$(dig "@${NAME_SERVER}" -b "${WAN_INTERFACE_ADDRESS}" AAAA "${AFTR_NAME}" +short | head -1)"
log_dhcp "Resolved AFTR_NAME ${AFTR_NAME} to ${AFTR_ADDRESS}"
# Check if there is already a tunnel interface
if TUNNEL_INTERFACE_CONFIG="$(ip --json link show "${TUNNEL_INTERFACE_NAME}")"; then
TUNNEL_INTERFACE_OPERSTATE="$(echo "${TUNNEL_INTERFACE_CONFIG}" | jq -r '.[0].operstate')"
TUNNEL_INTERFACE_ORIGIN_ADDRESS="$(echo "${TUNNEL_INTERFACE_CONFIG}" | jq -r '.[0].address')"
TUNNEL_INTERFACE_REMOTE_ADDRESS="$(echo "${TUNNEL_INTERFACE_CONFIG}" | jq -r '.[0].broadcast')"
# Reconfigure tunnel interface, if not already in state we want
if [[ "${TUNNEL_INTERFACE_ORIGIN_ADDRESS}" != "${WAN_INTERFACE_ADDRESS}" || "${TUNNEL_INTERFACE_REMOTE_ADDRESS}" != "${AFTR_ADDRESS}" || "${TUNNEL_INTERFACE_OPERSTATE}" != "UNKNOWN" ]]; then
log_tunnel "Bad configuration, fixing tunnel parameter"
ip tunnel change "${TUNNEL_INTERFACE_NAME}" mode ipip6 local "${WAN_INTERFACE_ADDRESS}" remote "${AFTR_ADDRESS}"
ip link set "$TUNNEL_INTERFACE_NAME" up
else
log_tunnel "Tunnel already configured"
fi
else
log_tunnel "Setting up DS-Lite tunnel"
ip tunnel add "${TUNNEL_INTERFACE_NAME}" mode ipip6 local "${WAN_INTERFACE_ADDRESS}" remote "${AFTR_ADDRESS}"
ip link set "$TUNNEL_INTERFACE_NAME" up
fi
log_tunnel "Setting default route"
ip route replace default dev "${TUNNEL_INTERFACE_NAME}"
log_tunnel "Tunnel setup finished"

View File

@@ -14,7 +14,6 @@ final: prev: {
chromium-incognito = final.callPackage ./chromium-incognito {};
convert-flac-dir-to-mp3 = final.callPackage ./convert-flac-dir-to-mp3 {};
curl-timings = final.callPackage ./curl-timings {};
ds-lite-dhcpcd-hook = final.callPackage ./ds-lite-dhcpcd-hook {};
factorio-launcher = final.callPackage ./factorio-launcher {};
feeds-dir = final.callPackage ./feeds-dir {};
generate-blocked-prefixes = final.callPackage ./generate-blocked-prefixes {};

View File

@@ -1,20 +0,0 @@
final: prev:
prev.dhcpcd.overrideAttrs (finalAttrs: prevAttrs: {
configureFlags = [
"--sysconfdir=/etc/ds-lite-dhcpcd"
"--localstatedir=/var"
"--disable-fork"
"--disable-privsep"
"--dbdir=/var/lib/ds-lite-dhcpcd"
"--rundir=/var/run/ds-lite-dhcpcd"
"--with-default-hostname=ds-lite"
"--disable-ipv4"
"--disable-arp"
"--disable-arpping"
"--disable-ipv4ll"
"--disable-ntp"
];
})

View File

@@ -1,5 +1,4 @@
final: prev: {
dino = import ./dino.nix final prev;
ds-lite-dhcpcd = import ./ds-lite-dhcpcd.nix final prev;
xmppc = import ./xmppc.nix final prev;
}

View File

@@ -11,7 +11,6 @@
./cybercluster-vm
./desktop
./dn42-router
./ds-lite
./fem-net
./firefox
./gpg-ssh

View File

@@ -1,150 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.profiles.clerie.ds-lite;
dsLiteDhcpcdConfig = ''
allowinterfaces ${cfg.wanInterfaceName} ${concatMapStringsSep " " (interface: interface.name) cfg.lanInterfaces}
option dhcp6_name_servers
option dhcp6_aftr_name
waitip 6
ipv6only
ipv6ra_noautoconf
noipv6rs
interface ${cfg.wanInterfaceName}
ipv6ra_autoconf
ipv6rs
ia_pd 1/::/48 ${concatMapStringsSep " " (interface: "${interface.name}/${toString interface.sla_id}/${toString interface.prefix_len}") cfg.lanInterfaces}
${concatMapStrings (interface: ''
interface ${interface.name}
nolink
'') cfg.lanInterfaces}
'';
dsLiteDhcpcdConfigFile = pkgs.writeTextFile {
name = "dhcpcd.conf";
text = dsLiteDhcpcdConfig;
};
dsLiteDhcpcdHookWrapperFile = pkgs.writeShellScript "ds-lite-dhcpcd-hook-wrapper" ''
DS_LITE_WAN_INTERFACE_NAME=${lib.escapeShellArg cfg.wanInterfaceName};
export DS_LITE_WAN_INTERFACE_NAME
DS_LITE_TUNNEL_INTERFACE_NAME=${lib.escapeShellArg cfg.tunnelInterfaceName};
export DS_LITE_TUNNEL_INTERFACE_NAME
exec ${lib.getExe pkgs.ds-lite-dhcpcd-hook}
'';
in {
options.profiles.clerie.ds-lite = {
enable = mkEnableOption "DS-Lite setup";
wanInterfaceName = mkOption {
type = types.str;
description = "Interface with IPv6 connectivity to provider";
};
tunnelInterfaceName = mkOption {
type = types.str;
description = "Interface with IPv4 connectivity to provider";
};
lanInterfaces = mkOption {
type = with types; listOf (submodule ({ ... }: {
options = {
name = mkOption {
type = types.str;
};
sla_id = mkOption {
type = types.ints.unsigned;
};
prefix_len = mkOption {
type = types.ints.between 48 128;
};
};
}));
default = [];
description = "Interfaces to provisn with an IPv6 prefix";
};
};
config = mkIf cfg.enable {
systemd.services.ds-lite-dhcpcd = {
description = "DS-Lite dhcpcd";
wantedBy = [ "multi-user.target" ];
environment = {
};
serviceConfig = {
Type = "simple";
User = "ds-lite";
Group = "ds-lite";
StateDirectory = "ds-lite-dhcpcd";
RuntimeDirectory = "ds-lite-dhcpcd";
ExecStart = "${pkgs.ds-lite-dhcpcd}/bin/dhcpcd --ipv6only --nobackground --config ${dsLiteDhcpcdConfigFile} --script ${dsLiteDhcpcdHookWrapperFile}";
Restart = "always";
AmbientCapabilities = [
"CAP_NET_ADMIN"
"CAP_NET_RAW"
"CAP_NET_BIND_SERVICE"
];
ReadWritePaths = [
"/proc/sys/net/ipv6"
];
DeviceAllow = "";
LockPersonality = true;
MemoryDenyWriteExecute = true;
PrivateDevices = true;
PrivateMounts = true;
PrivateTmp = true;
PrivateUsers = false;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = "tmpfs"; # allow exceptions to be added to ReadOnlyPaths, etc.
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectProc = "invisible";
ProtectSystem = "strict";
RemoveIPC = true;
RestrictAddressFamilies = [
"AF_UNIX"
"AF_INET"
"AF_INET6"
"AF_NETLINK"
"AF_PACKET"
];
RestrictNamespaces = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
SystemCallFilter = [
"@system-service"
"~@keyring"
"~@memlock"
"~@mount"
];
SystemCallArchitectures = "native";
UMask = "0027";
};
};
users.users.ds-lite = {
isSystemUser = true;
group = "ds-lite";
};
users.groups.ds-lite = { };
};
}