mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
flameshot: extend module with package-option
This commit is contained in:
parent
8230decb3f
commit
8a16d62e95
1 changed files with 9 additions and 4 deletions
|
@ -6,8 +6,6 @@ let
|
|||
|
||||
cfg = config.services.flameshot;
|
||||
|
||||
package = pkgs.flameshot;
|
||||
|
||||
iniFormat = pkgs.formats.ini { };
|
||||
|
||||
iniFile = iniFormat.generate "flameshot.ini" cfg.settings;
|
||||
|
@ -18,6 +16,13 @@ in {
|
|||
options.services.flameshot = {
|
||||
enable = mkEnableOption "Flameshot";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.flameshot;
|
||||
defaultText = literalExpression "pkgs.flameshot";
|
||||
description = "Package providing <command>flameshot</command>.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = iniFormat.type;
|
||||
default = { };
|
||||
|
@ -41,7 +46,7 @@ in {
|
|||
lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ package ];
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile = mkIf (cfg.settings != { }) {
|
||||
"flameshot/flameshot.ini".source = iniFile;
|
||||
|
@ -60,7 +65,7 @@ in {
|
|||
|
||||
Service = {
|
||||
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||
ExecStart = "${package}/bin/flameshot";
|
||||
ExecStart = "${cfg.package}/bin/flameshot";
|
||||
Restart = "on-abort";
|
||||
|
||||
# Sandboxing.
|
||||
|
|
Loading…
Reference in a new issue