This commit is contained in:
Mateusz Słodkowicz 2025-05-18 11:17:59 +02:00
parent f4a22eb9a6
commit 0e60e2517f
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
4 changed files with 45 additions and 32 deletions

View File

@ -8,6 +8,7 @@
}: }:
{ {
imports = [ imports = [
(if mkkArg.isDecrypted then ./variables-private.nix else {})
# * NIX & NIXPKGS # * NIX & NIXPKGS
{ {
nixpkgs.config = { nixpkgs.config = {
@ -186,12 +187,6 @@
]; ];
} }
# * Args # * Args
(
let
in
{ {
options.konfig = lib.mkOption { default = { }; }; options.konfig = lib.mkOption { default = { }; };
config = { config = {
@ -212,12 +207,12 @@
arg = mkkArg; arg = mkkArg;
rootFlake = (builtins.getFlake mkkArg.configRootPath); rootFlake = (builtins.getFlake mkkArg.configRootPath);
vars = lib.mkDefault { }; vars = { };
}; };
_module.args.konfig = config.konfig; _module.args.konfig = config.konfig;
}; };
} }
)
# * common.nix END # * common.nix END
]; ];

View File

@ -44,9 +44,8 @@ in
mkkArg mkkArg
// { // {
current = (if isStable then stable else unstable); current = (if isStable then stable else unstable);
}
// {
isDecrypted = (isDecrypted (if isStable then stable else unstable).nixpkgs system); isDecrypted = (isDecrypted (if isStable then stable else unstable).nixpkgs system);
isStable = isStable;
} }
// extraArgs; // extraArgs;
}; };

View File

@ -18,6 +18,25 @@
# ** Network # ** Network
{ {
networking.hostName = "materusPC"; networking.hostName = "materusPC";
networking.useDHCP = lib.mkDefault true;
networking.wireless.iwd.enable = true;
networking.networkmanager.enable = true;
#networking.networkmanager.wifi.backend = "iwd";
networking.firewall.enable = true;
networking.firewall = {
logReversePathDrops = false;
# wireguard trips rpfilter up
extraCommands = ''
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport ${konfig.vars.wireguard.ports.materusPC} -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport ${konfig.vars.wireguard.ports.materusPC} -j RETURN
'';
extraStopCommands = ''
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport ${konfig.vars.wireguard.ports.materusPC} -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport ${konfig.vars.wireguard.ports.materusPC} -j RETURN || true
'';
};
} }
# ** Hardware # ** Hardware
# *** Filesystems # *** Filesystems

BIN
nix/variables-private.nix Normal file

Binary file not shown.