fix nix flake check

This commit is contained in:
mjallen18
2026-03-25 16:42:34 -05:00
parent 642cee5dc5
commit ccd413d273
28 changed files with 228 additions and 224 deletions

View File

@@ -16,27 +16,25 @@ in
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays =
[ ]
++ (
with pkgs.${namespace};
(
if (variant == "5") then
[
{
name = "pisound-pi5-overlay";
dtsFile = "${raspberrypi-overlays}/dtbs/raspberrypi-overlays/pisound-pi5-overlay.dts";
}
]
else
[
{
name = "pisound-overlay";
dtsFile = "${raspberrypi-overlays}/dtbs/raspberrypi-overlays/pisound-overlay.dts";
}
]
)
);
overlays = (
with pkgs.${namespace};
(
if (variant == "5") then
[
{
name = "pisound-pi5-overlay";
dtsFile = "${raspberrypi-overlays}/dtbs/raspberrypi-overlays/pisound-pi5-overlay.dts";
}
]
else
[
{
name = "pisound-overlay";
dtsFile = "${raspberrypi-overlays}/dtbs/raspberrypi-overlays/pisound-overlay.dts";
}
]
)
);
};
};
}

View File

@@ -16,28 +16,26 @@ in
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays =
[ ]
++ (
if (variant == "5") then
[
{
name = "disable-bt-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-bt-pi5-overlay.dts";
}
]
else
[
{
name = "disable-bt-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-bt-overlay.dts";
}
]
);
overlays = (
if (variant == "5") then
[
{
name = "disable-bt-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-bt-pi5-overlay.dts";
}
]
else
[
{
name = "disable-bt-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-bt-overlay.dts";
}
]
);
};
};
}

View File

@@ -19,7 +19,7 @@ let
render-kvs =
kvs:
let
render-kv = k: v: if isNull v.value then k else "${k}=${toString v.value}";
render-kv = k: v: if v.value == null then k else "${k}=${toString v.value}";
in
lib.attrsets.mapAttrsToList render-kv (lib.filterAttrs (_k: v: v.enable) kvs);

View File

@@ -451,8 +451,7 @@ in
};
nixpkgs.overlays =
[ ]
++ (
(
if cfg.variant == "5" then
[
(_final: prev: {
@@ -465,7 +464,7 @@ in
let
pageSizeFlag = "--with-lg-page";
in
(prev.lib.filter (flag: prev.lib.hasPrefix pageSizeFlag flag == false) old.configureFlags)
(prev.lib.filter (flag: !(prev.lib.hasPrefix pageSizeFlag flag)) old.configureFlags)
++ [ "${pageSizeFlag}=14" ];
});
})

View File

@@ -16,28 +16,26 @@ in
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays =
[ ]
++ (
if (variant == "5") then
[
{
name = "vc4-kms-v3d-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/vc4-kms-v3d-pi5-overlay.dts";
}
]
else
[
{
name = "vc4-fkms-v3d-pi4-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/vc4-fkms-v3d-pi4-overlay.dts";
}
]
);
overlays = (
if (variant == "5") then
[
{
name = "vc4-kms-v3d-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/vc4-kms-v3d-pi5-overlay.dts";
}
]
else
[
{
name = "vc4-fkms-v3d-pi4-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/vc4-fkms-v3d-pi4-overlay.dts";
}
]
);
};
};
}

View File

@@ -16,32 +16,30 @@ in
config = lib.mkIf cfg.enable {
hardware.deviceTree = {
overlays =
[ ]
++ (
if (variant == "5") then
[
{
name = "disable-wifi-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-wifi-pi5-overlay.dts";
}
]
else
[
{
name = "disable-wifi-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-wifi-overlay.dts";
}
{
name = "wifimac-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/wifimac-overlay.dts";
}
]
);
overlays = (
if (variant == "5") then
[
{
name = "disable-wifi-pi5-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-wifi-pi5-overlay.dts";
}
]
else
[
{
name = "disable-wifi-overlay";
dtsFile = "${
pkgs.${namespace}.raspberrypi-overlays
}/dtbs/raspberrypi-overlays/disable-wifi-overlay.dts";
}
{
name = "wifimac-overlay";
dtsFile = "${pkgs.${namespace}.raspberrypi-overlays}/dtbs/raspberrypi-overlays/wifimac-overlay.dts";
}
]
);
};
};
}

View File

@@ -11,15 +11,9 @@ in
imports = [ ./options.nix ];
config = lib.mkIf (cfg.enable && cfg.dashboards != [ ]) {
${namespace}.home.file = lib.genAttrs cfg.dashboards (
dashboard:
let
dashboardFile = "homeassistant/lovelace/${dashboard.title}.yaml";
in
{
text = lib.generators.toYAML { } dashboard;
force = true;
}
);
${namespace}.home.file = lib.genAttrs cfg.dashboards (dashboard: {
text = lib.generators.toYAML { } dashboard;
force = true;
});
};
}

View File

@@ -10,9 +10,6 @@ let
name = "crowdsec";
cfg = config.${namespace}.services.${name};
ntfyServer = "https://ntfy.mjallen.dev";
ntfyTopic = "crowdsec";
# Build the notification-http plugin binary from the crowdsec source.
# The nixpkgs crowdsec package omits all notification plugin binaries;
# we build just the http one we need.
@@ -223,30 +220,61 @@ let
# a nix store path via -c and never creates that file. Expose the full
# NixOS-generated config (which includes plugin_config via
# settings.general.plugin_config) at the well-known path.
environment.etc."crowdsec/config.yaml" =
let
execStart = builtins.elemAt config.systemd.services.crowdsec.serviceConfig.ExecStart 1;
configPath = builtins.head (builtins.match ".* -c ([^ ]+) .*" execStart);
in
{
source = configPath;
mode = "0440";
environment.etc = {
"crowdsec/config.yaml" =
let
execStart = builtins.elemAt config.systemd.services.crowdsec.serviceConfig.ExecStart 1;
configPath = builtins.head (builtins.match ".* -c ([^ ]+) .*" execStart);
in
{
source = configPath;
mode = "0440";
user = "crowdsec";
group = "crowdsec";
};
# ---------------------------------------------------------------------------
# ntfy notifications via the CrowdSec HTTP notification plugin
# ---------------------------------------------------------------------------
# Place the notification-http binary at the path the NixOS crowdsec module
# hardcodes for plugin_dir (/etc/crowdsec/plugins/). CrowdSec matches
# plugins by their filename — it expects "notification-http" for type=http.
"crowdsec/plugins/notification-http" = lib.mkIf cfg.ntfy.enable {
source = "${crowdsecHttpPlugin}/bin/notification-http";
mode = "0550";
user = "crowdsec";
group = "crowdsec";
};
# ---------------------------------------------------------------------------
# ntfy notifications via the CrowdSec HTTP notification plugin
# ---------------------------------------------------------------------------
# Place the notification-http binary at the path the NixOS crowdsec module
# hardcodes for plugin_dir (/etc/crowdsec/plugins/). CrowdSec matches
# plugins by their filename — it expects "notification-http" for type=http.
environment.etc."crowdsec/plugins/notification-http" = lib.mkIf cfg.ntfy.enable {
source = "${crowdsecHttpPlugin}/bin/notification-http";
mode = "0550";
user = "crowdsec";
group = "crowdsec";
# CrowdSec profiles.yaml: route every alert to the ntfy plugin.
# This replaces the default "do nothing" profile.
"crowdsec/profiles.yaml" = lib.mkIf cfg.ntfy.enable {
text = ''
name: default_ip_remediation
filters:
- Alert.Remediation == true && Alert.GetScope() == "Ip"
decisions:
- type: ban
duration: 4h
notifications:
- ntfy_plugin
on_success: break
---
name: default_range_remediation
filters:
- Alert.Remediation == true && Alert.GetScope() == "Range"
decisions:
- type: ban
duration: 4h
notifications:
- ntfy_plugin
on_success: break
'';
mode = "0440";
user = "crowdsec";
group = "crowdsec";
};
};
# The ntfy plugin config YAML (with credentials baked in) is managed as a
@@ -260,35 +288,6 @@ let
}"
];
# CrowdSec profiles.yaml: route every alert to the ntfy plugin.
# This replaces the default "do nothing" profile.
environment.etc."crowdsec/profiles.yaml" = lib.mkIf cfg.ntfy.enable {
text = ''
name: default_ip_remediation
filters:
- Alert.Remediation == true && Alert.GetScope() == "Ip"
decisions:
- type: ban
duration: 4h
notifications:
- ntfy_plugin
on_success: break
---
name: default_range_remediation
filters:
- Alert.Remediation == true && Alert.GetScope() == "Range"
decisions:
- type: ban
duration: 4h
notifications:
- ntfy_plugin
on_success: break
'';
mode = "0440";
user = "crowdsec";
group = "crowdsec";
};
};
};
in

View File

@@ -17,12 +17,12 @@ let
sops = {
secrets = {
"jallen-nas/matrix/client-id" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
owner = "matrix-synapse";
group = "matrix-synapse";
};
"jallen-nas/matrix/client-secret" = {
sopsFile = (lib.snowfall.fs.get-file "secrets/nas-secrets.yaml");
sopsFile = lib.snowfall.fs.get-file "secrets/nas-secrets.yaml";
owner = "matrix-synapse";
group = "matrix-synapse";
};
@@ -72,7 +72,7 @@ let
listeners = [
{
port = cfg.port;
inherit (cfg) port;
tls = false;
x_forwarded = true;
bind_addresses = [

View File

@@ -9,7 +9,6 @@ let
serverName = "sparky-fitness-server";
frontendName = "sparky-fitness";
dbName = "sparky-fitness-db";
serverCfg = config.${namespace}.services.${serverName};
frontendCfg = config.${namespace}.services.${frontendName};