add home-manager develop module

This commit is contained in:
xunuwu 2024-08-27 11:12:20 +00:00
parent 0e39c76c8d
commit 3e0154df22
No known key found for this signature in database
6 changed files with 63 additions and 3 deletions

5
home-modules/default.nix Normal file
View file

@ -0,0 +1,5 @@
{
flake.homeManagerModules = {
xun = import ./xun;
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./develop
];
}

View file

@ -0,0 +1,42 @@
{
pkgs,
config,
lib,
...
}: let
cfg = config.xun.develop;
in {
options.xun.develop = {
enable = lib.mkEnableOption "develop";
nix.enable = lib.mkEnableOption "nix";
tools.enable = lib.mkEnableOption "tools";
docs.enable = lib.mkEnableOption "man caches";
lsp.c.enable = lib.mkEnableOption "clangd";
};
config = let
config =
if cfg.enable
then {
nix.enable = true;
tools.enable = true;
docs.enable = true;
lsp.c.enable = true;
}
else cfg;
in
lib.mkMerge [
(lib.mkIf config.nix.enable {
home.packages = with pkgs; [nil alejandra];
})
(lib.mkIf config.tools.enable {
home.packages = with pkgs; [tokei];
})
(lib.mkIf config.lsp.c.enable {
home.packages = with pkgs; [clang-tools];
})
(lib.mkIf config.docs.enable {
programs.man.generateCaches = true;
})
];
}