feat(networking): enable systemd-networkd
This commit is contained in:
parent
d8d4b29769
commit
61b899ecb6
6 changed files with 147 additions and 1 deletions
22
home/modules/seven/default.nix
Normal file
22
home/modules/seven/default.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
}
|
40
home/modules/seven/ntfy.nix
Normal file
40
home/modules/seven/ntfy.nix
Normal 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" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue