Move programs to modules

This commit is contained in:
2023-01-02 22:08:18 +00:00
parent 046eb42dd3
commit e45609ea4b
23 changed files with 586 additions and 250 deletions

21
modules/shell/fzf.nix Normal file
View File

@ -0,0 +1,21 @@
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.shell.fzf;
in {
options.modules.shell.fzf = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
bind
];
home.programs.fzf = {
enable = true;
enableZshIntegration = true;
defaultCommand = "fd --type f --hidden --follow --exclude .git";
};
};
}

34
modules/shell/git.nix Normal file
View File

@ -0,0 +1,34 @@
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.shell.git;
in {
options.modules.shell.git = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
home.programs.git = {
enable = true;
aliases = {
amend = "commit --amend";
lg = "log --color --graph --abbrev-commit --";
ls = "ls-files";
unadd = "reset HEAD";
undo-commit = "reset --soft \"HEAD^\"";
};
userEmail = "jordan@vimium.com";
userName = "Jordan Holt";
signing = {
key = "B8CFFF61F1CCF520";
signByDefault = true;
};
extraConfig = {
rebase.autosquash = true;
push.default = "current";
pull.rebase = true;
};
};
};
}

16
modules/shell/nnn.nix Normal file
View File

@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.shell.nnn;
in {
options.modules.shell.nnn = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
home.programs.nnn = {
enable = true;
};
};
}

35
modules/shell/zsh.nix Normal file
View File

@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.shell.zsh;
in {
options.modules.shell.zsh = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
zsh-autosuggestions
zsh-fast-syntax-highlighting
zsh-history-substring-search
];
home.programs.zsh = {
enable = true;
enableCompletion = true;
shellAliases = {
cp = "cp -iv";
mv = "mv -iv";
rm = "rm -v";
mkdir = "mkdir -v";
ls = "ls -h --color=auto --group-directories-first";
e = "nvim";
f = "nnn";
g = "git";
n = "nnn";
v = "nvim";
};
};
};
}