Skip to content

Commit

Permalink
nixos/nist-feed: init module
Browse files Browse the repository at this point in the history
  • Loading branch information
octodi committed Jan 29, 2024
1 parent f5d65aa commit c292f08
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
./programs/neovim.nix
./programs/nethoscope.nix
./programs/nexttrace.nix
./programs/nist-feed.nix
./programs/nix-index.nix
./programs/nix-ld.nix
./programs/nm-applet.nix
Expand Down
47 changes: 47 additions & 0 deletions nixos/modules/programs/nist-feed.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.programs.nist-feed;
in
{
options = {
programs.nist-feed = {
enable = mkEnableOption (mdDoc "NIST Feed notifies you about the newest published CVEs.");
package = mkPackageOption pkgs "nist-feed" { };
arguments = mkOption {
type = types.str;
default = "-l -s CRITICAL";
description = mdDoc ''lib.
Arguments to provide to NIST-Feed.
'';
};
};
};

config = mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
systemd.user.services.nist-feed = {
wantedBy = [ "default.target" ];
description = "NIST-Feed service";
path = [ pkgs.curl pkgs.busybox ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${cfg.package}/bin/nist-feed ${cfg.arguments}";
};
};

systemd.user.timers.nist-feed = {
wantedBy = [ "default.target" ];
description = "NIST-Feed timer";
timerConfig = {
Unit = "nist-feed.service";
OnCalendar = "*:0/2";
Persistent = "true";
};
};
};

meta.maintainers = with maintainers; [octodi];
}

0 comments on commit c292f08

Please sign in to comment.