hm: add ntfy everywhere
This commit is contained in:
parent
0b1ccae353
commit
a3ed8a6da3
2 changed files with 38 additions and 0 deletions
|
@ -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 = {
|
||||
|
|
25
ops/nixos/lib/home-manager/ntfy.nix
Normal file
25
ops/nixos/lib/home-manager/ntfy.nix
Normal 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; };
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue