feat(home): Implement dev-config disable
This commit is contained in:
parent
d08d05450d
commit
dd9897f38b
1 changed files with 113 additions and 86 deletions
199
home/default.nix
199
home/default.nix
|
@ -21,96 +21,123 @@ in
|
|||
}
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Direnv
|
||||
programs.direnv.enable = true;
|
||||
programs.direnv.nix-direnv.enable = true;
|
||||
# ls replacement
|
||||
programs.eza.enable = true;
|
||||
programs.eza.enableAliases = true;
|
||||
programs.eza.git = true;
|
||||
programs.eza.icons = true;
|
||||
# GnuPG
|
||||
programs.gpg.enable = true;
|
||||
programs.gpg.homedir = "${config.xdg.dataHome}/gnupg";
|
||||
# Git
|
||||
programs.git.enable = true;
|
||||
programs.git.difftastic.enable = true;
|
||||
programs.git.difftastic.background = "dark";
|
||||
programs.git.lfs.enable = true;
|
||||
programs.git.extraConfig.init.defaultBranch = "main";
|
||||
# Better conflicts (also shows parent commit state)
|
||||
programs.git.extraConfig.merge.conflictStyle = "zdiff3";
|
||||
# Do not create merge commits when pulling (rebase but abort on conflict)
|
||||
programs.git.extraConfig.pull.ff = "only";
|
||||
# Use `--set-upstream` if the remote does not have the branch
|
||||
programs.git.extraConfig.push.autoSetupRemote = true;
|
||||
# If there are uncommitted changes, stash them before rebasing
|
||||
programs.git.extraConfig.rebase.autoStash = true;
|
||||
programs.lazygit.enable = true;
|
||||
# Mail client
|
||||
programs.himalaya.enable = true;
|
||||
# Another shell
|
||||
programs.nushell.enable = true;
|
||||
# Password manager
|
||||
programs.password-store.enable = true;
|
||||
programs.password-store.package = pkgs.pass-nodmenu;
|
||||
programs.password-store.settings.PASSWORD_STORE_DIR = "${config.xdg.dataHome}/pass";
|
||||
# SSH
|
||||
programs.ssh.enable = true;
|
||||
# cd replacement
|
||||
programs.zoxide.enable = true;
|
||||
# Shell
|
||||
programs.zsh.enable = true;
|
||||
programs.zsh.enableAutosuggestions = true;
|
||||
programs.zsh.enableCompletion = true;
|
||||
programs.zsh.autocd = true;
|
||||
programs.zsh.dotDir = ".config/zsh";
|
||||
programs.zsh.history.path = "${config.xdg.dataHome}/zsh/zsh_history";
|
||||
programs.zsh.syntaxHighlighting.enable = true;
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf cfg.enable {
|
||||
# Direnv
|
||||
programs.direnv.enable = true;
|
||||
programs.direnv.nix-direnv.enable = true;
|
||||
# ls replacement
|
||||
programs.eza.enable = true;
|
||||
programs.eza.enableAliases = true;
|
||||
programs.eza.git = true;
|
||||
programs.eza.icons = true;
|
||||
# GnuPG
|
||||
programs.gpg.enable = true;
|
||||
programs.gpg.homedir = "${config.xdg.dataHome}/gnupg";
|
||||
# Mail client
|
||||
programs.himalaya.enable = true;
|
||||
# Another shell
|
||||
programs.nushell.enable = true;
|
||||
# Password manager
|
||||
programs.password-store.enable = true;
|
||||
programs.password-store.package = pkgs.pass-nodmenu;
|
||||
programs.password-store.settings.PASSWORD_STORE_DIR = "${config.xdg.dataHome}/pass";
|
||||
# SSH
|
||||
programs.ssh.enable = true;
|
||||
# cd replacement
|
||||
programs.zoxide.enable = true;
|
||||
# Shell
|
||||
programs.zsh.enable = true;
|
||||
programs.zsh.enableAutosuggestions = true;
|
||||
programs.zsh.enableCompletion = true;
|
||||
programs.zsh.autocd = true;
|
||||
programs.zsh.dotDir = ".config/zsh";
|
||||
programs.zsh.history.path = "${config.xdg.dataHome}/zsh/zsh_history";
|
||||
programs.zsh.syntaxHighlighting.enable = true;
|
||||
|
||||
# GPG Agent
|
||||
services.gpg-agent.enable = true;
|
||||
services.gpg-agent.maxCacheTtl = 86400;
|
||||
services.gpg-agent.pinentryFlavor = if config.jhome.gui.enable then "qt" else "curses";
|
||||
services.gpg-agent.extraConfig = "allow-preset-passphrase";
|
||||
# Spotifyd
|
||||
services.spotifyd.enable = true;
|
||||
services.spotifyd.settings.global.device_name = config.jhome.hostName;
|
||||
services.spotifyd.settings.global.device_type = "computer";
|
||||
services.spotifyd.settings.global.backend = "pulseaudio";
|
||||
services.spotifyd.settings.global.zeroconf_port = 2020;
|
||||
# GPG Agent
|
||||
services.gpg-agent.enable = true;
|
||||
services.gpg-agent.maxCacheTtl = 86400;
|
||||
services.gpg-agent.pinentryFlavor = if config.jhome.gui.enable then "qt" else "curses";
|
||||
services.gpg-agent.extraConfig = "allow-preset-passphrase";
|
||||
# Spotifyd
|
||||
services.spotifyd.enable = true;
|
||||
services.spotifyd.settings.global.device_name = config.jhome.hostName;
|
||||
services.spotifyd.settings.global.device_type = "computer";
|
||||
services.spotifyd.settings.global.backend = "pulseaudio";
|
||||
services.spotifyd.settings.global.zeroconf_port = 2020;
|
||||
|
||||
home.stateVersion = "22.11";
|
||||
home.stateVersion = "22.11";
|
||||
|
||||
# Extra packages
|
||||
home.packages = [
|
||||
pkgs.gopass
|
||||
pkgs.sshfs
|
||||
pkgs.gitoxide
|
||||
pkgs.xplr
|
||||
] ++ devcfg.extraPackages ++ lib.optionals devcfg.rust.enable ([ pkgs.rustup ] ++ devcfg.rust.extraPackages);
|
||||
# Extra packages
|
||||
home.packages = [
|
||||
pkgs.gopass
|
||||
pkgs.sshfs
|
||||
pkgs.gitoxide
|
||||
pkgs.xplr
|
||||
];
|
||||
|
||||
# Extra variables
|
||||
home.sessionVariables.CARGO_HOME = "${config.xdg.dataHome}/cargo";
|
||||
home.sessionVariables.RUSTUP_HOME = "${config.xdg.dataHome}/rustup";
|
||||
home.sessionVariables.GOPATH = "${config.xdg.dataHome}/go";
|
||||
# Extra variables
|
||||
home.sessionVariables = {
|
||||
CARGO_HOME = "${config.xdg.dataHome}/cargo";
|
||||
RUSTUP_HOME = "${config.xdg.dataHome}/rustup";
|
||||
GOPATH = "${config.xdg.dataHome}/go";
|
||||
};
|
||||
home.shellAliases = {
|
||||
# Verbose Commands
|
||||
cp = "cp --verbose";
|
||||
ln = "ln --verbose";
|
||||
mv = "mv --verbose";
|
||||
mkdir = "mkdir --verbose";
|
||||
rename = "rename --verbose";
|
||||
rm = "rm --verbose";
|
||||
# Add Color
|
||||
grep = "grep --color=auto";
|
||||
ip = "ip --color=auto";
|
||||
# Use exa/eza
|
||||
tree = "eza --tree";
|
||||
};
|
||||
|
||||
# Verbose Commands
|
||||
home.shellAliases.cp = "cp --verbose";
|
||||
home.shellAliases.ln = "ln --verbose";
|
||||
home.shellAliases.mv = "mv --verbose";
|
||||
home.shellAliases.mkdir = "mkdir --verbose";
|
||||
home.shellAliases.rename = "rename --verbose";
|
||||
# Add Color
|
||||
home.shellAliases.grep = "grep --color=auto";
|
||||
home.shellAliases.ip = "ip --color=auto";
|
||||
# Use exa/eza
|
||||
home.shellAliases.tree = "eza --tree";
|
||||
# XDG directories
|
||||
xdg.enable = true;
|
||||
xdg.userDirs.enable = true;
|
||||
xdg.userDirs.createDirectories = true;
|
||||
})
|
||||
(lib.mkIf (cfg.enable && devcfg.enable) {
|
||||
home = {
|
||||
sessionVariables.MANPAGER = lib.optionalString devcfg.neovimAsManPager "nvim -c 'Man!' -o -";
|
||||
packages = devcfg.extraPackages
|
||||
++ lib.optionals devcfg.rust.enable ([ pkgs.rustup ] ++ devcfg.rust.extraPackages);
|
||||
};
|
||||
|
||||
# XDG directories
|
||||
xdg.enable = true;
|
||||
xdg.userDirs.enable = true;
|
||||
xdg.userDirs.createDirectories = true;
|
||||
};
|
||||
# Git
|
||||
programs.git = {
|
||||
enable = true;
|
||||
difftastic.enable = true;
|
||||
difftastic.background = "dark";
|
||||
lfs.enable = true;
|
||||
# Add diff to the commit message editor
|
||||
extraConfig.commit.verbose = true;
|
||||
# Improve submodule diff
|
||||
extraConfig.diff.submodule = "log";
|
||||
# Set the default branch name for new branches
|
||||
extraConfig.init.defaultBranch = "main";
|
||||
# Better conflicts (also shows parent commit state)
|
||||
extraConfig.merge.conflictStyle = "zdiff3";
|
||||
# Do not create merge commits when pulling (rebase but abort on conflict)
|
||||
extraConfig.pull.ff = "only";
|
||||
# Use `--set-upstream` if the remote does not have the branch
|
||||
extraConfig.push.autoSetupRemote = true;
|
||||
# If there are uncommitted changes, stash them before rebasing
|
||||
extraConfig.rebase.autoStash = true;
|
||||
# If there are fixup! commits, squash them while rebasing
|
||||
extraConfig.rebase.autoSquash = true;
|
||||
# Enable ReReRe (Reuse Recovered Resolution) auto resolve previously resolved conflicts
|
||||
extraConfig.rerere.enabled = true;
|
||||
# Improve submodule status
|
||||
extraConfig.status.submoduleSummary = true;
|
||||
};
|
||||
programs.lazygit.enable = true;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue