Skip to content

Commit

Permalink
feat(nixosProfiles): add coding suites
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Oct 17, 2023
1 parent deb3736 commit fd9c224
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 20 deletions.
15 changes: 14 additions & 1 deletion docs/org/nixosProfiles.org
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,29 @@ let
in
with presets; {
minimal = [ shell.default ];

default = [
self.minimal
self.mathematic
coding.nickel
coding.yaml
coding.conf
coding.bash
coding.d2
coding.nix
];

full = [
self.default
{
config.omnibus.coding = {
bash.lsp = true;
nickel.lsp = true;
typst.lsp = true;
conf.lsp = true;
};
}
];

mathematic = [ coding.typst ];
}
#+end_src
Expand Down
2 changes: 1 addition & 1 deletion tests/nixos/expr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ in
// lib.optionalAttrs trace {
nixosConfiguration = out.nixosConfiguration [
out.outputs.nixosProfiles.default.presets.boot
(out.outputs.nixosProfiles.default.dev { }).default
(out.outputs.nixosProfiles.default.dev { }).coding
];

homeConfiguration =
Expand Down
5 changes: 5 additions & 0 deletions units/nixos/nixosModules/omnibus/coding/bash.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
options = with lib; {
lsp = mkEnableOption (lib.mdDoc "Whether to enable languageServer support");
};
}
5 changes: 5 additions & 0 deletions units/nixos/nixosModules/omnibus/coding/conf.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
options = with lib; {
lsp = mkEnableOption (lib.mdDoc "Whether to enable languageServer support");
};
}
5 changes: 5 additions & 0 deletions units/nixos/nixosModules/omnibus/coding/nickel.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
options = with lib; {
lsp = mkEnableOption (lib.mdDoc "Whether to enable languageServer support");
};
}
5 changes: 5 additions & 0 deletions units/nixos/nixosModules/omnibus/coding/typst.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
options = with lib; {
lsp = mkEnableOption (lib.mdDoc "Whether to enable languageServer support");
};
}
15 changes: 14 additions & 1 deletion units/nixos/nixosProfiles/dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,29 @@ let
in
with presets; {
minimal = [ shell.default ];

default = [
self.minimal
self.mathematic
coding.nickel
coding.yaml
coding.conf
coding.bash
coding.d2
coding.nix
];

coding = [
self.default
{
config.omnibus.coding = {
bash.lsp = true;
nickel.lsp = true;
typst.lsp = true;
conf.lsp = true;
};
}
];

mathematic = [ coding.typst ];
}
# coding:1 ends here
18 changes: 13 additions & 5 deletions units/nixos/nixosProfiles/presets/coding/bash.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
nodePackages.bash-language-server
shellcheck
];
pkgs,
config,
omnibus,
...
}:
let
cfg = config.omnibus.coding.bash;
in
{
imports = [ omnibus.nixosModules.omnibus.coding.bash ];
environment.systemPackages =
with pkgs;
[ shellcheck ] ++ lib.optionals cfg.lsp [ nodePackages.bash-language-server ];
}
14 changes: 14 additions & 0 deletions units/nixos/nixosProfiles/presets/coding/conf.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
pkgs,
config,
omnibus,
...
}:
let
cfg = config.omnibus.coding.conf;
in
{
imports = [ omnibus.nixosModules.omnibus.coding.conf ];
environment.systemPackages =
with pkgs; lib.optionals conf.lsp [ yaml-language-server ];
}
13 changes: 9 additions & 4 deletions units/nixos/nixosProfiles/presets/coding/nickel.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
pkgs,
inputs,
omnibus,
config,
lib,
}:
let
inherit
Expand All @@ -10,10 +12,13 @@ let
])
nickel
;
cfg = config.omnibus.coding.nickel;
in
{
environment.systemPackages = [
(nickel.packages.${pkgs.system}.default or inputs.nickel.default)
(nickel.packages.${pkgs.system}.lsp-nls or inputs.nickel.lsp-nls)
];
imports = [ omnibus.nixosModules.omnibus.coding.nickel ];
environment.systemPackages =
[ (nickel.packages.${pkgs.system}.default or inputs.nickel.default) ]
++ lib.optional cfg.lsp [
(nickel.packages.${pkgs.system}.lsp-nls or inputs.nickel.lsp-nls)
];
}
11 changes: 7 additions & 4 deletions units/nixos/nixosProfiles/presets/coding/typst.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
pkgs,
inputs,
omnibus,
lib,
config,
}:
let
inherit
Expand All @@ -11,10 +13,11 @@ let
typst
;
pkgs' = pkgs.appendOverlays [ typst.overlays.default ];
cfg = config.omnibus.coding.typst;
in
{
environment.systemPackages = [
pkgs'.typst-lsp
pkgs'.typst
];
imports = [ omnibus.nixosModules.omnibus.coding.typst ];
environment.systemPackages =
[ pkgs'.typst ]
++ lib.optionals cfg.lsp [ pkgs'.typst-lsp ];
}
4 changes: 0 additions & 4 deletions units/nixos/nixosProfiles/presets/coding/yaml.nix

This file was deleted.

0 comments on commit fd9c224

Please sign in to comment.