fork/home-manager

git clone https://git.julia.blue/fork/home-manager

shimunbacon: add modulea88df2fb

master
839 B37 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.bacon;
8
9  settingsFormat = pkgs.formats.toml { };
10in {
11  meta.maintainers = [ hm.maintainers.shimunn ];
12
13  options.programs.bacon = {
14    enable = mkEnableOption "bacon, a background rust code checker";
15
16    settings = mkOption {
17      type = settingsFormat.type;
18      example = {
19        jobs.default = {
20          command = [ "cargo" "build" "--all-features" "--color" "always" ];
21          need_stdout = true;
22        };
23      };
24      description = ''
25        Bacon configuration.
26        For available settings see <https://dystroy.org/bacon/#global-preferences>.
27      '';
28    };
29  };
30
31  config = mkIf cfg.enable {
32    home.packages = [ pkgs.bacon ];
33
34    xdg.configFile."bacon/prefs.toml".source =
35      settingsFormat.generate "prefs.toml" cfg.settings;
36  };
37}