feat(networking): enable systemd-networkd

This commit is contained in:
Felix Schröter 2025-05-10 15:56:47 +02:00
parent d8d4b29769
commit 61b899ecb6
Signed by: felschr
GPG key ID: 671E39E6744C807D
6 changed files with 147 additions and 1 deletions

View file

@ -0,0 +1,22 @@
{ config, lib, ... }:
let
cfg = config.custom.seven;
in
{
imports = [ ./seven-ntfy.nix ];
options = {
custom.seven = {
enable = lib.mkEnableOption (lib.mdDoc "Seven");
ssh.enable = lib.mkEnableOption (lib.mdDoc "Seven SSH");
};
};
config = lib.mkIf cfg.enable {
programs.ssh.extraConfig = lib.mkIf cfg.ssh.enable ''
Host *.factory.secunet.com
User fschroeter
'';
};
}

View file

@ -0,0 +1,40 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.custom.seven.ntfy;
in
{
options = {
custom.seven.ntfy = {
enable = lib.mkEnableOption (lib.mdDoc "ntfy service for seven");
};
};
config = lib.mkIf cfg.enable {
systemd.user = {
services.ntfy = {
Unit = {
Description = "ntfy alert scubscription";
After = "network-online.target";
PartOf = [ "graphical-session.target" ];
};
Service =
let
topic = "https://grafana.factory.secunet.com/ntfy/alerts";
notify-send = lib.getExe pkgs.libnotify;
in
{
Environment = "PATH=${pkgs.bash}/bin:\${PATH}";
ExecStart = "${pkgs.ntfy-sh}/bin/ntfy sub ${topic} '${notify-send} \"$t\" \"$m\"'";
Restart = "always";
};
Install.WantedBy = [ "default.target" ];
};
};
};
}