Compare commits
No commits in common. "0a95d368e9a0fd5a376613fa845ad97779934fd2" and "a9d0694439598d2725ae37589b17cec057dd38b3" have entirely different histories.
0a95d368e9
...
a9d0694439
@ -6,23 +6,23 @@
|
||||
tracker.enable = false;
|
||||
};
|
||||
|
||||
environment.gnome.excludePackages = with pkgs; [
|
||||
baobab
|
||||
epiphany
|
||||
gnome-calendar
|
||||
environment.gnome.excludePackages = with pkgs.gnome; [
|
||||
pkgs.baobab
|
||||
pkgs.epiphany
|
||||
pkgs.gnome-calendar
|
||||
gnome-clocks
|
||||
gnome-console
|
||||
pkgs.gnome-console
|
||||
gnome-contacts
|
||||
gnome-logs
|
||||
gnome-maps
|
||||
gnome-music
|
||||
gnome-tour
|
||||
gnome-photos
|
||||
pkgs.gnome-tour
|
||||
pkgs.gnome-photos
|
||||
gnome-weather
|
||||
gnome-connections
|
||||
simple-scan
|
||||
yelp
|
||||
geary
|
||||
pkgs.gnome-connections
|
||||
pkgs.simple-scan
|
||||
pkgs.yelp
|
||||
pkgs.geary
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
@ -288,11 +288,11 @@
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1725432240,
|
||||
"narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=",
|
||||
"lastModified": 1725103162,
|
||||
"narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ad416d066ca1222956472ab7d0555a6946746a80",
|
||||
"rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -57,19 +57,22 @@
|
||||
ip46tables -t mangle -A forward-mangle -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1416
|
||||
'';
|
||||
|
||||
networking.dhcpcd-prefixdelegation = {
|
||||
enable = true;
|
||||
interfaces = {
|
||||
"ppp-dtagdsl" = {
|
||||
iaid = 1;
|
||||
interfaces = {
|
||||
"net-heimnetz" = {
|
||||
sla_id = 201;
|
||||
prefix_len = 64;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
networking.interfaces.net-heimnetz.useDHCP = true;
|
||||
|
||||
networking.dhcpcd = {
|
||||
enable = false;
|
||||
allowInterfaces = [
|
||||
"net-heimnetz"
|
||||
"ppp-dtagdsl"
|
||||
];
|
||||
wait = "ipv6";
|
||||
extraConfig = ''
|
||||
ipv6only
|
||||
noipv6rs
|
||||
interface ppp-dtagdsl
|
||||
ipv6rs
|
||||
ia_pd 1/::/56 net-heimnetz/201/64
|
||||
'';
|
||||
};
|
||||
|
||||
environment.etc."ppp/ipv6-up" = {
|
||||
|
@ -15,7 +15,7 @@
|
||||
lfs.enable = true;
|
||||
settings = {
|
||||
log = {
|
||||
LEVEL = "Warn";
|
||||
LEVEL = "Info";
|
||||
};
|
||||
database = {
|
||||
CHARSET = "utf8";
|
||||
@ -28,7 +28,7 @@
|
||||
server = {
|
||||
ROOT_URL = "https://git.clerie.de/";
|
||||
DOMAIN = "git.clerie.de";
|
||||
HTTP_ADDRESS = "::1";
|
||||
HTTP_ADDRESS = "127.0.0.1";
|
||||
HTTP_PORT = 3000;
|
||||
OFFLINE_MODE = true;
|
||||
LANDING_PAGE = "explore";
|
||||
@ -80,7 +80,7 @@
|
||||
forceSSL = true;
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://[::1]:3000";
|
||||
proxyPass = "http://localhost:3000";
|
||||
};
|
||||
};
|
||||
extraConfig = ''
|
||||
|
@ -8,7 +8,6 @@
|
||||
./clerie-firewall
|
||||
./clerie-gc-dir
|
||||
./clerie-system-upgrade
|
||||
./dhcpcd-prefixdelegation
|
||||
./minecraft-server
|
||||
./monitoring
|
||||
./nginx-port-forward
|
||||
|
@ -1,144 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.networking.dhcpcd-prefixdelegation;
|
||||
|
||||
downstreamInterfaceConfig = name: opts: "${name}${
|
||||
optionalString (opts.sla_id != null) "/${builtins.toString opts.sla_id}${
|
||||
optionalString (opts.prefix_len != null) "/${builtins.toString opts.prefix_len}${
|
||||
optionalString (opts.suffix != null) "/${opts.suffix}"
|
||||
}"
|
||||
}"
|
||||
}";
|
||||
|
||||
interfaceConfig = name: opts: ''
|
||||
interface ${name}
|
||||
ipv6rs
|
||||
ia_pd ${builtins.toString opts.iaid}${
|
||||
optionalString (opts.prefix != null) "/${opts.prefix}${
|
||||
optionalString (opts.prefix_len != null) "/${builtins.toString opts.prefix_len}"
|
||||
}"
|
||||
} ${concatMapStringsSep " " ({name, value}: downstreamInterfaceConfig name value) (attrsToList opts.interfaces)}
|
||||
'';
|
||||
|
||||
|
||||
dhcpcdConf = pkgs.writeText "dhcpcd.conf" ''
|
||||
duid
|
||||
noipv6rs
|
||||
waitip 6
|
||||
ipv6only
|
||||
|
||||
allowinterfaces ${concatStringsSep " " (builtins.attrNames cfg.interfaces)} ${concatMapStringsSep " " ({name, value}: concatStringsSep "" (builtins.attrNames value.interfaces)) (attrsToList cfg.interfaces)}
|
||||
|
||||
${concatMapStringsSep "\n" ({name, value}: interfaceConfig name value) (attrsToList cfg.interfaces)}
|
||||
'';
|
||||
|
||||
downstreamInterfaceOpts = { ... }: {
|
||||
options = {
|
||||
sla_id = mkOption {
|
||||
type = with types; nullOr ints.unsigned;
|
||||
default = null;
|
||||
};
|
||||
|
||||
prefix_len = mkOption {
|
||||
type = with types; nullOr ints.unsigned;
|
||||
default = null;
|
||||
};
|
||||
|
||||
suffix = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
interfaceOpts = { ... }: {
|
||||
options = {
|
||||
iaid = mkOption {
|
||||
type = with types; ints.unsigned;
|
||||
description = ''
|
||||
Request a delegated prefix with this IAID on this interface
|
||||
'';
|
||||
};
|
||||
|
||||
prefix = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
prefix_len = mkOption {
|
||||
type = with types; nullOr ints.unsigned;
|
||||
default = null;
|
||||
};
|
||||
|
||||
interfaces = mkOption {
|
||||
type = with types; attrsOf (submodule downstreamInterfaceOpts);
|
||||
default = {};
|
||||
description =''
|
||||
Interfaces to assign IPv6 prefixes to
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
options = {
|
||||
|
||||
networking.dhcpcd-prefixdelegation = {
|
||||
enable = mkEnableOption "dhcpcd for prefixdelegation";
|
||||
|
||||
interfaces = mkOption {
|
||||
type = with types; attrsOf (submodule interfaceOpts);
|
||||
default = {};
|
||||
description = ''
|
||||
Interfaces to request IPv6 prefixes from
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
environment.etc."dhcpcd.conf".source = dhcpcdConf;
|
||||
|
||||
systemd.services.dhcpcd-prefixdelegation = {
|
||||
description = "DHCP Client for IPv6 Prefix Delegation";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network.target" ];
|
||||
before = [ "network-online.target" ];
|
||||
|
||||
# Stopping dhcpcd during a reconfiguration is undesirable
|
||||
# because it brings down the network interfaces configured by
|
||||
# dhcpcd. So do a "systemctl restart" instead.
|
||||
stopIfChanged = false;
|
||||
|
||||
path = [ pkgs.dhcpcd ];
|
||||
|
||||
unitConfig.ConditionCapability = "CAP_NET_ADMIN";
|
||||
|
||||
serviceConfig =
|
||||
{ Type = "forking";
|
||||
PIDFile = "/run/dhcpcd/pid";
|
||||
RuntimeDirectory = "dhcpcd";
|
||||
ExecStart = "@${pkgs.dhcpcd}/sbin/dhcpcd dhcpcd --quiet --config ${dhcpcdConf}";
|
||||
ExecReload = "${pkgs.dhcpcd}/sbin/dhcpcd --rebind";
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
|
||||
users.users.dhcpcd = {
|
||||
isSystemUser = true;
|
||||
group = "dhcpcd";
|
||||
};
|
||||
users.groups.dhcpcd = {};
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user