treewide: implement auto importing for modules
Reduce maintenance burden and increase efficiency by automatically importing modules following a specific convention. Co-authored-by: awwpotato <awwpotato@voidq.com> Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
fefeb0e928
commit
4fca600cb1
461 changed files with 72 additions and 474 deletions
62
modules/programs/fuzzel/default.nix
Normal file
62
modules/programs/fuzzel/default.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
inherit (lib)
|
||||
literalExpression
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
mkIf
|
||||
;
|
||||
|
||||
cfg = config.programs.fuzzel;
|
||||
|
||||
iniFormat = pkgs.formats.ini { };
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.Scrumplex ];
|
||||
|
||||
options.programs.fuzzel = {
|
||||
enable = mkEnableOption "fuzzel";
|
||||
|
||||
package = mkPackageOption pkgs "fuzzel" { nullable = true; };
|
||||
|
||||
settings = mkOption {
|
||||
type = iniFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
main = {
|
||||
terminal = "''${pkgs.foot}/bin/foot";
|
||||
layer = "overlay";
|
||||
};
|
||||
colors.background = "ffffffff";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration for fuzzel written to
|
||||
{file}`$XDG_CONFIG_HOME/fuzzel/fuzzel.ini`. See
|
||||
{manpage}`fuzzel.ini(5)` for a list of available options.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "programs.fuzzel" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
xdg.configFile."fuzzel/fuzzel.ini" = mkIf (cfg.settings != { }) {
|
||||
source = iniFormat.generate "fuzzel.ini" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue