File tree Expand file tree Collapse file tree 3 files changed +60
-1
lines changed
Expand file tree Collapse file tree 3 files changed +60
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ lib.mkIf config.custom.profile.isWorkstation {
7171 pythonWithPackages
7272 pylyzer
7373 basedpyright
74- ty-bin
7574 zuban
7675 # other apps
7776 uv-apps
Original file line number Diff line number Diff line change 1+ { pkgs , ... } :
2+ {
3+ programs . ty = {
4+ enable = true ;
5+ package = pkgs . ty-bin ;
6+ # https://docs.astral.sh/ty/reference/configuration/
7+ settings = { } ;
8+ } ;
9+ }
Original file line number Diff line number Diff line change 1+ {
2+ pkgs ,
3+ config ,
4+ lib ,
5+ ...
6+ } :
7+ let
8+ inherit ( lib )
9+ mkEnableOption
10+ mkPackageOption
11+ mkOption
12+ literalExpression
13+ ;
14+
15+ tomlFormat = pkgs . formats . toml { } ;
16+ cfg = config . programs . ty ;
17+ in
18+ {
19+ meta . maintainers = with lib . maintainers ; [ mirkolenz ] ;
20+
21+ options . programs . ty = {
22+ enable = mkEnableOption "ty" ;
23+
24+ package = mkPackageOption pkgs "ty" { nullable = true ; } ;
25+
26+ settings = mkOption {
27+ type = tomlFormat . type ;
28+ default = { } ;
29+ example = literalExpression ''
30+ {
31+ rules.index-out-of-bounds = "ignore";
32+ }
33+ '' ;
34+ description = ''
35+ Configuration written to
36+ {file}`$XDG_CONFIG_HOME/ty/ty.toml`.
37+ See <https://docs.astral.sh/ty/configuration/>
38+ and <https://docs.astral.sh/ty/reference/configuration/>
39+ for more information.
40+ '' ;
41+ } ;
42+ } ;
43+
44+ config = lib . mkIf cfg . enable {
45+ home . packages = lib . mkIf ( cfg . package != null ) [ cfg . package ] ;
46+
47+ xdg . configFile . "ty/ty.toml" = lib . mkIf ( cfg . settings != { } ) {
48+ source = tomlFormat . generate "ty-config.toml" cfg . settings ;
49+ } ;
50+ } ;
51+ }
You can’t perform that action at this time.
0 commit comments