Working on modularizing stuff, again
This commit is contained in:
parent
b698ce3485
commit
9ba5f8fdf0
32 changed files with 1481 additions and 88 deletions
48
modules/shell/default.nix
Normal file
48
modules/shell/default.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
let
|
||||
inherit (lib.attrsets) attrValues;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
|
||||
cfg = config.modules.shell;
|
||||
in
|
||||
{
|
||||
options.modules.shell = let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) nullOr enum;
|
||||
in {
|
||||
default = mkOption {
|
||||
type = nullOr (enum ["fish" "zsh" "xonsh"]);
|
||||
default = null;
|
||||
description = "Default system shell";
|
||||
};
|
||||
corePkgs.enable = mkEnableOption "core shell packages";
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf (cfg.default != null) {
|
||||
users.defaultUserShell = pkgs."${cfg.default}";
|
||||
})
|
||||
|
||||
(mkIf cfg.corePkgs.enable {
|
||||
modules.shell.toolset = {
|
||||
btop.enable = true;
|
||||
fzf.enable = true;
|
||||
starship.enable = true;
|
||||
tmux.enable = true;
|
||||
};
|
||||
|
||||
hm.programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
config.whitelist.prefix = ["/home"];
|
||||
};
|
||||
|
||||
user.packages = attrValues {
|
||||
inherit (pkgs) any-nix-shell pwgen yt-dlp ripdrag yazi;
|
||||
inherit (pkgs) bat fd zoxide;
|
||||
|
||||
rgFull = pkgs.ripgrep.override {withPCRE2 = true;};
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue