os/modules/terminal-life/default.nix

137 lines
3.5 KiB
Nix

{
lib,
config,
pkgs,
flake,
...
}:
let
psCfg = config.pub-solar;
cfg = config.pub-solar.terminal-life;
in
{
options.pub-solar.terminal-life = {
full = lib.mkOption {
description = ''
Enable a full version, which includes more nvim plugins and lsps.
'';
default = false;
type = lib.types.bool;
};
};
config = {
programs.command-not-found.enable = false;
programs.nix-index.enable = true;
# We do this manually in modules/terminal-life/bash/default.nix
# until https://github.com/nix-community/nix-index/pull/227 is merged
programs.nix-index.enableBashIntegration = false;
users.users."${psCfg.user.name}".packages =
with pkgs;
[
asciinema
bat
blesh
delta
eza
fd
jump
(nnn.overrideAttrs (o: {
patches = (o.patches or [ ]) ++ [ ./nnn/0001-feat-use-wasd-keybindings-for-jkli.patch ];
}))
powerline
ripgrep
screen
watson
]
++ (
if cfg.full then
[
binutils
jq
# Nix specific utilities
manix
nix-index
nix-tree
nix-inspect
nvd
nixpkgs-review
nix-update
nix-search-cli
]
else
[ ]
);
# Get completion for system packages
# https://nix-community.github.io/home-manager/options.xhtml#opt-programs.bash.enableCompletion
environment.pathsToLink = [ "/share/bash-completion" ];
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;
};
programs.bash = import ./bash {
inherit config;
inherit pkgs;
inherit lib;
inherit flake;
};
programs.fzf = import ./fzf {
inherit config;
inherit pkgs;
};
programs.neovim = import ./nvim {
inherit config;
inherit pkgs;
inherit lib;
};
# 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 = "";
# Generated with:
# docker run -it --name caddy-json-schema registry.greenbaum.cloud/gc/caddy-l4:2.5.2 caddy json-schema -output /srv/caddy_schema.json
xdg.dataFile."nvim/json-schemas/caddy_schema.json".source = .local/share/nvim/json-schemas/caddy_schema.json;
xdg.dataFile."nvim/templates/.keep".text = "";
programs.git = import ./git { };
xdg.configFile."git/config".text = import ./.config/git/config.nix {
inherit config;
inherit pkgs;
};
xdg.configFile."git/gitmessage".text = import ./.config/git/gitmessage.nix {
inherit config;
inherit pkgs;
};
xdg.configFile."git/global_gitignore".text = import ./.config/git/global_gitignore.nix {
inherit config;
inherit pkgs;
};
programs.direnv = import ./direnv { };
};
};
}