mirror of
https://github.com/srid/nixos-config.git
synced 2026-05-11 17:36:07 +08:00
Refactor home-manager modules
This commit is contained in:
parent
7cf7f4c3f1
commit
ba2be77a10
5 changed files with 28 additions and 30 deletions
|
|
@ -3,9 +3,9 @@ let
|
|||
package =
|
||||
#if pkgs.stdenv.isDarwin then
|
||||
# Upstream has broken mac package
|
||||
# pkgs.gitAndTools.gitFull.override { svnSupport = false; }
|
||||
# pkgs.gitFull.override { svnSupport = false; }
|
||||
#else
|
||||
pkgs.gitAndTools.git;
|
||||
pkgs.git;
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
|
|
@ -14,8 +14,16 @@ in
|
|||
|
||||
programs.git = {
|
||||
inherit package;
|
||||
# difftastic.enable = true;
|
||||
enable = true;
|
||||
delta = {
|
||||
enable = true;
|
||||
options = {
|
||||
navigate = true;
|
||||
light = false;
|
||||
side-by-side = true;
|
||||
line-numbers = true;
|
||||
};
|
||||
};
|
||||
userName = flake.config.me.fullname;
|
||||
userEmail = flake.config.me.email;
|
||||
aliases = {
|
||||
|
|
@ -28,13 +36,6 @@ in
|
|||
# p = "pull --rebase";
|
||||
pu = "push";
|
||||
};
|
||||
iniContent = {
|
||||
# Branch with most recent change comes first
|
||||
branch.sort = "-committerdate";
|
||||
# Remember and auto-resolve merge conflicts
|
||||
# https://git-scm.com/book/en/v2/Git-Tools-Rerere
|
||||
rerere.enabled = true;
|
||||
};
|
||||
ignores = [ "*~" "*.swp" ];
|
||||
lfs.enable = true;
|
||||
extraConfig = {
|
||||
|
|
@ -43,6 +44,12 @@ in
|
|||
#protocol.keybase.allow = "always";
|
||||
credential.helper = "store --file ~/.git-credentials";
|
||||
pull.rebase = "false";
|
||||
|
||||
# Branch with most recent change comes first
|
||||
branch.sort = "-committerdate";
|
||||
# Remember and auto-resolve merge conflicts
|
||||
# https://git-scm.com/book/en/v2/Git-Tools-Rerere
|
||||
rerere.enabled = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
envFile.source = ./env.nu;
|
||||
configFile.source = ./config.nu;
|
||||
inherit (config.home) shellAliases; # Our shell aliases are pretty simple
|
||||
shellAliases = config.home.shellAliases;
|
||||
environmentVariables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
enableNushellIntegration = true;
|
||||
settings = {
|
||||
gcloud.disabled = true;
|
||||
username = {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
escapeTime = 0;
|
||||
# Force tmux to use /tmp for sockets (WSL2 compat)
|
||||
secureSocket = false;
|
||||
mouse = true;
|
||||
clock24 = true;
|
||||
historyLimit = 50000;
|
||||
|
||||
plugins = with pkgs; [
|
||||
tmuxPlugins.better-mouse-mode
|
||||
|
|
@ -22,8 +25,6 @@
|
|||
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
|
||||
set-environment -g COLORTERM "truecolor"
|
||||
|
||||
# Mouse works as expected
|
||||
set-option -g mouse on
|
||||
# easy-to-remember split pane commands
|
||||
bind | split-window -h -c "#{pane_current_path}"
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
|
|
@ -36,19 +37,4 @@
|
|||
# FIXME: This causes tmate to hang.
|
||||
# extraConfig = config.xdg.configFile."tmux/tmux.conf".text;
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
# Open tmux for current project.
|
||||
(pkgs.writeShellApplication {
|
||||
name = "pux";
|
||||
runtimeInputs = [ pkgs.tmux ];
|
||||
text = ''
|
||||
PRJ="''$(zoxide query -i)"
|
||||
echo "Launching tmux for ''$PRJ"
|
||||
set -x
|
||||
cd "''$PRJ" && \
|
||||
exec tmux -S "''$PRJ".tmux attach
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
home.stateVersion = "22.11";
|
||||
home.stateVersion = "24.05";
|
||||
imports = [
|
||||
./all/tmux.nix
|
||||
./all/neovim
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue