fork/home-manager

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

florpepylint: add module (#2729)e39a9d01

master
910 B31 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.pylint;
8  listToValue = concatMapStringsSep ", " (generators.mkValueStringDefault { });
9  iniFormat = pkgs.formats.ini { inherit listToValue; };
10in {
11  meta.maintainers = [ hm.maintainers.florpe ];
12  options.programs.pylint = {
13    enable = mkEnableOption "the pylint Python linter";
14    package = mkOption {
15      type = types.package;
16      default = pkgs.python3Packages.pylint;
17      defaultText = literalExpression "pkgs.python3Packages.pylint";
18      description = "The pylint package to use.";
19    };
20    settings = mkOption {
21      type = iniFormat.type;
22      default = { };
23      defaultText = literalExpression "{}";
24      description = "The pylint configuration.";
25    };
26  };
27  config = mkIf cfg.enable {
28    home.packages = [ cfg.package ];
29    home.file.".pylintrc".source = iniFormat.generate "pylintrc" cfg.settings;
30  };
31}