aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2024-04-05 09:40:38 +0200
committerKarel Kočí <cynerd@email.cz>2024-04-05 09:40:38 +0200
commit5a367139ad660808366a941de1e42a72c1606ce6 (patch)
tree540818637ee58fa41f55efdd0e6f6322af9e0a7f /nixos/modules
parenta9738a94e009610163e3c49e9686c12051917af7 (diff)
downloadnixos-personal-5a367139ad660808366a941de1e42a72c1606ce6.tar.gz
nixos-personal-5a367139ad660808366a941de1e42a72c1606ce6.tar.bz2
nixos-personal-5a367139ad660808366a941de1e42a72c1606ce6.zip
Multiple improvements
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/default.nix22
-rw-r--r--nixos/modules/wifi-spt.nix12
-rw-r--r--nixos/modules/wireguad.nix2
3 files changed, 25 insertions, 11 deletions
diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix
index ea2acb3..c47228b 100644
--- a/nixos/modules/default.nix
+++ b/nixos/modules/default.nix
@@ -1,10 +1,16 @@
-{lib}: let
+{
+ lib,
+ default_modules ? [],
+}: let
inherit (builtins) readDir;
- inherit (lib) filterAttrs hasSuffix mapAttrs' nameValuePair removeSuffix;
+ inherit (lib) filterAttrs hasSuffix attrValues mapAttrs' nameValuePair removeSuffix;
+
+ modules =
+ mapAttrs'
+ (fname: _: nameValuePair (removeSuffix ".nix" fname) (./. + ("/" + fname)))
+ (filterAttrs (
+ n: v:
+ v == "regular" && n != "default.nix" && hasSuffix ".nix" n
+ ) (readDir ./.));
in
- mapAttrs'
- (fname: _: nameValuePair (removeSuffix ".nix" fname) (./. + ("/" + fname)))
- (filterAttrs (
- n: v:
- v == "regular" && n != "default.nix" && hasSuffix ".nix" n
- ) (readDir ./.))
+ modules // {default.imports = attrValues modules ++ default_modules;}
diff --git a/nixos/modules/wifi-spt.nix b/nixos/modules/wifi-spt.nix
index 11554a7..669439d 100644
--- a/nixos/modules/wifi-spt.nix
+++ b/nixos/modules/wifi-spt.nix
@@ -102,7 +102,7 @@ in {
mode = "wpa2-sha256";
wpaPasswordFile = "/run/secrets/hostapd-TurrisRules.pass";
};
- settings = {
+ settings = mkIf is2g {
ieee80211w = 0;
wpa_key_mgmt = mkForce "WPA-PSK"; # force use without sha256
};
@@ -123,7 +123,10 @@ in {
systemd.network.networks = mkMerge [
(mkIf (cnf.ar9287.interface != null) {
"lan-${cnf.ar9287.interface}" = {
- matchConfig.Name = cnf.ar9287.interface;
+ matchConfig = {
+ Name = cnf.ar9287.interface;
+ WLANInterfaceType = "ap";
+ };
networkConfig.Bridge = "brlan";
bridgeVLANs = [
{
@@ -149,7 +152,10 @@ in {
})
(mkIf (cnf.qca988x.interface != null) {
"lan-${cnf.qca988x.interface}" = {
- matchConfig.Name = cnf.qca988x.interface;
+ matchConfig = {
+ Name = cnf.qca988x.interface;
+ WLANInterfaceType = "ap";
+ };
networkConfig.Bridge = "brlan";
bridgeVLANs = [
{
diff --git a/nixos/modules/wireguad.nix b/nixos/modules/wireguad.nix
index ca28818..f52c95e 100644
--- a/nixos/modules/wireguad.nix
+++ b/nixos/modules/wireguad.nix
@@ -79,6 +79,8 @@ in {
networkConfig = {
Address = "${config.cynerd.hosts.wg."${hostName}"}/24";
IPForward = is_endpoint;
+ DNS = mkIf (hostName != "dean") ["10.0.20.30" "10.0.20.31"];
+ Domains = mkIf (hostName != "dean") "~elektroline.cz";
};
routes =
(optional (hostName != "lipwig") {