os/modules/terminal-life/default.nix

100 lines
2.4 KiB
Nix

args@{
lib,
config,
pkgs,
flake,
...
}:
with lib; let
psCfg = config.pub-solar;
cfg = config.pub-solar.terminal-life;
in {
options.pub-solar.terminal-life = {
full = mkOption {
description = ''
Enable a full version, which includes more nvim plugins and lsps.
'';
default = false;
type = types.bool;
};
};
config = {
programs.command-not-found.enable = true;
users.users."${psCfg.user.name}".packages = with pkgs;
[
tealdeer
asciinema
blesh
eza
fd
ripgrep
(nnn.overrideAttrs (o: {
patches =
(o.patches or [])
++ [
./nnn/0001-feat-use-wasd-keybindings-for-jkli.patch
];
}))
p
powerline
screen
watson
jump
]
++ (
if cfg.full
then [
# Nix specific utilities
alejandra
manix
nix-index
nix-tree
nix-inspect
nvd
]
else []
);
home-manager.users."${psCfg.user.name}" = {
xdg.dataFile."scripts/base16.sh".source = .local/share/scripts/base16.sh;
programs.less = {
enable = true;
keys = ''
k forw-line
i back-line
K forw-scroll
I back-scroll
'';
};
# Starship is a fast and featureful shell prompt
# starship.toml has sane defaults that can be changed there
programs.starship = {
enable = true;
settings = import ./starship.toml.nix flake.self.theme.withHashtag;
};
programs.bash = import ./bash args;
programs.fzf = import ./fzf args;
programs.neovim = import ./nvim args;
# Ensure nvim backup directory gets created
# Workaround for E510: Can't make backup file (add ! to override)
xdg.dataFile."nvim/backup/.keep".text = "";
xdg.dataFile."nvim/json-schemas/.keep".text = "";
xdg.dataFile."nvim/templates/.keep".text = "";
programs.git = import ./git args;
xdg.configFile."git/config".text = import ./.config/git/config.nix args;
xdg.configFile."git/gitmessage".text = import ./.config/git/gitmessage.nix args;
xdg.configFile."git/global_gitignore".text = import ./.config/git/global_gitignore.nix args;
programs.direnv = import ./direnv args;
};
};
}