sheldon: add module
This commit is contained in:
parent
7560dc942a
commit
6732c71613
34
modules/programs/sheldon.nix
Normal file
34
modules/programs/sheldon.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.sheldon;
|
||||
tomlFormat = pkgs.formats.toml {};
|
||||
in {
|
||||
meta.maintainers = pkgs.sheldon.meta.maintainers;
|
||||
|
||||
options.programs.sheldon = {
|
||||
enable = mkEnableOption "sheldon";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.sheldon;
|
||||
defaultText = literalExpression "pkgs.sheldon";
|
||||
description = "The package to use for the sheldon binary.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.packages ];
|
||||
|
||||
xdg.configFile."sheldon/plugins.toml" = mkIf (cfg.settings != { }) {
|
||||
source = tomlFormat.generate "sheldon-config" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue