Skip to content

Commit

Permalink
add my.sfeed.package option
Browse files Browse the repository at this point in the history
  • Loading branch information
tejing1 committed Dec 6, 2024
1 parent ab39cf6 commit 198a45e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions homeModules/sfeed/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
inherit (lib) concatMapStringsSep escapeShellArgs escapeShellArg
optionalString optionalAttrs splitString mapAttrsToList groupBy'
nameValuePair removeSuffix unique filterAttrs makeBinPath
mkEnableOption mkOption mkIf;
mkEnableOption mkPackageOption mkOption mkIf;
inherit (lib.types) attrsOf submodule str ints float listOf package nullOr submoduleWith;
inherit (pkgs) resholve;

Expand Down Expand Up @@ -335,6 +335,7 @@ in
{
options = putopt {
enable = mkEnableOption "sfeed";
package = mkPackageOption pkgs "sfeed" {};
update.averagedelay = mkOption {
type = ints.positive;
default = 600;
Expand Down Expand Up @@ -362,26 +363,22 @@ in
};

config = mkIf cfg.enable {
home.packages = builtins.attrValues {
inherit (pkgs)
sfeed
;
};
home.packages = [ cfg.package ];

home.file.".sfeed/sfeedrc".source = sfeedrc;

systemd.user.services.sfeed_update = {
Unit.Description = "news feed updater";
Service.Environment = [ "PATH=${makeBinPath (attrValues {
sfeed = cfg.package;
inherit (pkgs)
sfeed
curl
glibc # for iconv
findutils # for xargs
coreutils
;
})}" ];
Service.ExecStart = "${pkgs.sfeed}/bin/sfeed_update";
Service.ExecStart = "${cfg.package}/bin/sfeed_update";
};
systemd.user.timers.sfeed_update = {
Unit.Description = "news feed update timer";
Expand Down

0 comments on commit 198a45e

Please sign in to comment.