mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-26 18:16:13 +01:00
20d31a3990
Signed-off-by: Magic_RB <magic_rb@redalder.org>
46 lines
1.2 KiB
Nix
46 lines
1.2 KiB
Nix
{ pkgs, config, lib, ... }:
|
|
with lib;
|
|
let
|
|
nglib = config.magic_rb.pins.nixng.lib pkgs.stdenv.system;
|
|
cfg = config.magic_rb.programs.bash;
|
|
in
|
|
{
|
|
options.magic_rb.programs.bash = {
|
|
enable = mkEnableOption "Enable bash, the shell";
|
|
emacsclient-remote = mkOption {
|
|
description = "Enable emacsclient-remote and associated aliases";
|
|
type = types.bool;
|
|
default = true;
|
|
};
|
|
|
|
enableDirenv = mkEnableOption "Enable direnv";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = mkMerge [
|
|
(mkIf cfg.emacsclient-remote [
|
|
pkgs.magic_rb.emacsclient-remote
|
|
])
|
|
(mkIf cfg.enableDirenv [
|
|
pkgs.direnv
|
|
])
|
|
];
|
|
|
|
programs.direnv.enable = mkIf cfg.enableDirenv true;
|
|
programs.direnv.nix-direnv.enable = mkIf cfg.enableDirenv true;
|
|
programs.direnv.nix-direnv.enableFlakes = mkIf cfg.enableDirenv true;
|
|
|
|
home.file = {
|
|
".bashrc".source = nglib.writeSubstitutedFile {
|
|
name = ".bashrc";
|
|
file = ./bashrc;
|
|
substitutes = {
|
|
"exa" = "${pkgs.exa}";
|
|
"bat" = "${pkgs.bat}";
|
|
"direnvEnabled" = if cfg.enableDirenv then "true" else "false";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|