nixos/modules/shell/default.nix
Jake Hillion d9233021c7
All checks were successful
flake / flake (push) Successful in 2m9s
add enable options for modules/common/default
2024-04-27 13:46:06 +01:00

57 lines
1.1 KiB
Nix

{ pkgs, lib, config, ... }:
let
cfg = config.custom.shell;
in
{
imports = [
./update_scripts.nix
];
options.custom.shell = {
enable = lib.mkEnableOption "shell";
};
config = lib.mkIf cfg.enable {
custom.shell.update_scripts.enable = true;
users.defaultUserShell = pkgs.zsh;
environment.systemPackages = with pkgs; [ direnv ];
nix.settings = {
keep-outputs = true;
keep-derivations = true;
};
custom.impermanence.userExtraDirs.jake = [
".local/share/direnv"
];
programs.thefuck.enable = true;
programs.zsh = {
enable = true;
histSize = 1000000;
histFile = "$HOME/.zsh_history";
setOptions = [
"INC_APPEND_HISTORY"
"SHARE_HISTORY"
];
syntaxHighlighting = {
enable = true;
};
shellAliases = {
"nixos-rebuild" = "nixos-rebuild --flake \"/etc/nixos#${config.networking.fqdn}\"";
};
interactiveShellInit = with pkgs; ''
eval "$(${direnv}/bin/direnv hook zsh)"
source ${nix-direnv}/share/nix-direnv/direnvrc
'';
};
};
}