1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
{ config, lib, ... }: let cfg = config.gitignore; in { options.gitignore = { extra = lib.mkOption { type = lib.types.lines; default = ""; example = '' *.my-file-extension ''; }; }; config.dotfiles.gitignore = lib.mkIf (cfg.extra != "") { gitignore = lib.mkDefault false; text = '' ## Miscellaneous ${cfg.extra}; ''; }; }