nixos-config/modules/home-manager/profiles/dev.nix

161 lines
5.5 KiB
Nix
Raw Normal View History

2021-12-26 08:02:57 +00:00
# Arsenal for development (which is rare nowadays). ;p
# If you're looking for text editors, go to `./editors.nix`.
{ config, options, lib, pkgs, ... }:
let cfg = config.profiles.dev;
in {
options.profiles.dev = {
2021-12-26 08:02:57 +00:00
enable =
lib.mkEnableOption "foo-dogsquared's user-specific development setup";
shell.enable =
lib.mkEnableOption "configuration of foo-dogsquared's shell of choice";
2022-02-02 04:25:03 +00:00
extras.enable = lib.mkEnableOption "additional tools for development stuff";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
({
home.packages = with pkgs; [
2023-05-27 09:47:16 +00:00
dasel # Universal version of jq.
fzf # A fuzzy finder that enables fuzzy finding not furry finding, a common misconception.
gopass # An improved version of the password manager for hipsters.
2023-05-27 09:47:16 +00:00
lazygit # Git interface for the lazy who cannot be asked to add hunks properly.
lf # File manager in the terminal, really.
moar # More 'more'.
perl534Packages.vidir # Bulk rename for your organizing needs in the terminal.
2021-12-13 07:20:34 +00:00
tealdeer # An easy cop-out for basic help.
2023-05-27 09:47:16 +00:00
zellij # A modern tmux? Yeah, modern tmux.
# Coreutils replacement.
fd # Oh nice, a more reliable `find`.
ripgrep # On nice, a more reliable `grep`.
exa # Oh nice, a shinier `ls`.
];
2023-04-20 06:57:41 +00:00
# dog > sky dog > cat.
2023-04-20 06:57:41 +00:00
programs.bat = {
enable = true;
config = {
pager = "${lib.getBin pkgs.moar}/bin/moar";
theme = "base16";
style = "plain";
};
};
})
(lib.mkIf cfg.shell.enable {
programs.bash = {
enable = true;
2022-11-26 06:13:59 +00:00
historyControl = [ "erasedups" "ignoredups" "ignorespace" ];
historyIgnore = [
"cd"
"exit"
"lf"
"ls"
"nvim"
];
bashrcExtra = ''
2022-08-13 00:31:09 +00:00
function f() {
dir=''${1:-$PWD}
dest=$(${pkgs.fd}/bin/fd --type directory --ignore-vcs --base-directory "$dir" \
| ${pkgs.fzf}/bin/fzf --prompt "Go to directory ")
destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest")
2022-08-13 00:31:09 +00:00
[ "$dest" ] && cd "$destPrime"
}
2022-08-13 00:31:09 +00:00
function fh() {
dir=''${1:-$PWD}
dest=$(${pkgs.fd}/bin/fd --type directory --hidden --ignore-vcs --base-directory "$dir" \
| ${pkgs.fzf}/bin/fzf --prompt "Go to directory ")
destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest")
2022-08-13 00:31:09 +00:00
[ "$dest" ] && cd "$destPrime"
}
2022-08-13 00:31:09 +00:00
function ff() {
dir=''${1:-$PWD}
dest=$(${pkgs.fd}/bin/fd --ignore-vcs --base-directory "$dir" \
| ${pkgs.fzf}/bin/fzf --prompt "Open file ")
destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest")
if [ -d "$destPrime" ]; then
[ "$dest" ] && cd "$destPrime";
else
[ "$dest" ] && ${pkgs.xdg-utils}/bin/xdg-open "$destPrime";
fi
}
function ffh() {
dir=''${1:-$PWD}
dest=$(${pkgs.fd}/bin/fd --hidden --ignore-vcs --base-directory "$dir" \
| ${pkgs.fzf}/bin/fzf --prompt "Open file ")
destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest")
if [ -d "$destPrime" ]; then
[ "$dest" ] && cd "$destPrime";
else
[ "$dest" ] && ${pkgs.xdg-utils}/bin/xdg-open "$destPrime";
fi
}
function fm() {
${pkgs.man}/bin/man -k . \
| ${pkgs.fzf}/bin/fzf --multi --prompt "Open manpage(s) " \
| ${pkgs.gawk}/bin/awk '{ print $1 "." gensub(/[()]/, "", "g", $2) }' \
| ${pkgs.findutils}/bin/xargs man
}
'';
};
# Supercharging your shell history. Just don't forget to flush them out
# before doing questionable things.
2022-07-14 00:04:24 +00:00
programs.atuin = {
enable = true;
settings = {
search_mode = "fuzzy";
filter_mode = "global";
};
};
# virtualenv but for anything else.
programs.direnv = {
enable = true;
2022-10-18 11:52:30 +00:00
config.global = {
load_dotenv = true;
strict_env = true;
};
nix-direnv.enable = true;
};
2022-02-02 04:25:03 +00:00
# Learn teleportation in the filesystem.
programs.zoxide.enable = true;
# Some lazy bastard's shell prompt configuration.
programs.starship = {
enable = true;
2022-06-09 05:00:07 +00:00
settings = {
add_newline = false;
hostname = {
ssh_only = false;
trim_at = "";
};
};
};
})
2022-02-02 04:25:03 +00:00
(lib.mkIf cfg.extras.enable {
home.packages = with pkgs; [
act # Test your CI without embarrassing yourself repeatedly pushing into GitHub repos.
2022-04-30 12:30:22 +00:00
github-cli # So you don't have to use much of GitHub on the site, I guess.
hut # So you don't have to see much of Sourcehut's brutalist design, I guess.
hyperfine # Making sure your apps are not just fine but REEEEEEAAAAALY fine.
2022-04-30 12:30:22 +00:00
irssi # Communicate in the terminal like a normal person.
2023-05-02 04:33:15 +00:00
license-cli # A nice generator template for license files.
tree-sitter # The modern way of text highlighting.
treefmt # I like the tagline of this tool: "One CLI for formatting your code tree." (It rhymes somewhat.)
zenith # Very fanciful system dashboard.
2022-02-02 04:25:03 +00:00
];
})
]);
}