hm: add ntfy everywhere

This commit is contained in:
Luke Granger-Brown 2021-03-28 23:08:02 +00:00
parent 0b1ccae353
commit a3ed8a6da3
2 changed files with 38 additions and 0 deletions

View file

@ -3,6 +3,19 @@ let
inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
in
{
imports = [ ./ntfy.nix ];
programs.ntfy = {
enable = true;
settings = {
backends = [ "pushover" ];
pushover = {
user_key = depot.ops.secrets.pushover.userKey;
api_token = depot.ops.secrets.pushover.tokens.depot;
};
};
};
home.username = "lukegb";
home.homeDirectory = if isDarwin then "/Users/lukegb" else "/home/lukegb";
home.file = {

View file

@ -0,0 +1,25 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.ntfy;
format = pkgs.formats.yaml { };
configFile = format.generate "ntfy.yml" cfg.settings;
in
{
options.programs.ntfy = {
enable = mkEnableOption "ntfy";
settings = mkOption {
default = {};
type = types.submodule {
freeformType = format.type;
};
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.ntfy ];
xdg.configFile."ntfy/ntfy.yml" = mkIf (cfg.settings != { }) { source = configFile; };
};
}