mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
Refactors, konawall-py for darwin, sumireko update to Sonoma
This commit is contained in:
parent
091ddb5b91
commit
bc61d82487
151 changed files with 691 additions and 792 deletions
16
home/profiles/shell/bitw.nix
Normal file
16
home/profiles/shell/bitw.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
pkgs,
|
||||
tree,
|
||||
...
|
||||
}: {
|
||||
programs.rbw = {
|
||||
enable = false;
|
||||
package = pkgs.rbw-bitw;
|
||||
settings = {
|
||||
inherit (tree.home.user.data) email;
|
||||
base_url = "https://vault.kittywit.ch";
|
||||
identity_url = null;
|
||||
lock_timeout = 3600;
|
||||
};
|
||||
};
|
||||
}
|
||||
6
home/profiles/shell/direnv.nix
Normal file
6
home/profiles/shell/direnv.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
||||
6
home/profiles/shell/eza.nix
Normal file
6
home/profiles/shell/eza.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
enableAliases = true;
|
||||
};
|
||||
}
|
||||
16
home/profiles/shell/fzf.nix
Normal file
16
home/profiles/shell/fzf.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
pkgs,
|
||||
std,
|
||||
...
|
||||
}: let
|
||||
inherit (std) list;
|
||||
in {
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
programs.zsh.plugins = list.optional (pkgs.hostPlatform == pkgs.buildPlatform) {
|
||||
name = "fzf-tab";
|
||||
src = "${pkgs.zsh-fzf-tab}/share/fzf-tab";
|
||||
};
|
||||
}
|
||||
31
home/profiles/shell/git.nix
Normal file
31
home/profiles/shell/git.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
pkgs,
|
||||
tree,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
gitAndTools.git-remote-gcrypt
|
||||
git-crypt
|
||||
git-revise
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
inherit (tree.home.user.data) userName userEmail;
|
||||
package = pkgs.gitAndTools.gitFull;
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
init = {defaultBranch = "main";};
|
||||
protocol.gcrypt.allow = "always";
|
||||
merge.conflictstyle = "diff3";
|
||||
annex = {
|
||||
autocommit = false;
|
||||
backend = "BLAKE2B512";
|
||||
synccontent = true;
|
||||
};
|
||||
};
|
||||
signing = {
|
||||
inherit (tree.home.user.data) key;
|
||||
signByDefault = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
19
home/profiles/shell/inputrc.nix
Normal file
19
home/profiles/shell/inputrc.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{config, ...}: {
|
||||
xdg.configFile."inputrc".text = ''
|
||||
set editing-mode vi
|
||||
set keyseq-timeout 1
|
||||
set mark-symlinked-directories on
|
||||
set completion-prefix-display-length 8
|
||||
set show-all-if-ambiguous on
|
||||
set show-all-if-unmodified on
|
||||
set visible-stats on
|
||||
set colored-stats on
|
||||
set bell-style audible
|
||||
set meta-flag on
|
||||
set input-meta on
|
||||
set convert-meta off
|
||||
set output-meta on
|
||||
'';
|
||||
|
||||
home.sessionVariables.INPUTRC = "${config.xdg.configHome}/inputrc";
|
||||
}
|
||||
18
home/profiles/shell/lc.nix
Normal file
18
home/profiles/shell/lc.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
_: {
|
||||
home.language = let
|
||||
ca = "en_CA.UTF-8";
|
||||
in {
|
||||
base = ca;
|
||||
ctype = ca;
|
||||
time = ca;
|
||||
numeric = ca;
|
||||
collate = ca;
|
||||
monetary = ca;
|
||||
messages = ca;
|
||||
paper = ca;
|
||||
name = ca;
|
||||
address = ca;
|
||||
telephone = ca;
|
||||
measurement = ca;
|
||||
};
|
||||
}
|
||||
34
home/profiles/shell/packages.nix
Normal file
34
home/profiles/shell/packages.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
# task managers
|
||||
htop
|
||||
btop
|
||||
# disk usage
|
||||
duc-cli
|
||||
# nix formatting
|
||||
nixpkgs-fmt
|
||||
# show type of files
|
||||
file
|
||||
# command monitoring
|
||||
pv
|
||||
# cat but better
|
||||
bat
|
||||
# sed replacement
|
||||
sd
|
||||
# sops
|
||||
sops
|
||||
# find replacement
|
||||
fd
|
||||
# ripgrep / grep replacement
|
||||
ripgrep
|
||||
# rename with sed
|
||||
rename
|
||||
# remote tmux
|
||||
tmate
|
||||
# remote utilities
|
||||
socat
|
||||
rsync
|
||||
wget
|
||||
whois
|
||||
];
|
||||
}
|
||||
42
home/profiles/shell/rink.nix
Normal file
42
home/profiles/shell/rink.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
pkgs,
|
||||
std,
|
||||
...
|
||||
}: let
|
||||
inherit (std) serde;
|
||||
in {
|
||||
home.packages = with pkgs; [
|
||||
rink
|
||||
];
|
||||
|
||||
xdg.configFile."rink/config.toml".text = serde.toTOML {
|
||||
colors = {
|
||||
enabled = true;
|
||||
theme = "my_theme";
|
||||
};
|
||||
currency = {
|
||||
cache_duration = "1h";
|
||||
enabled = true;
|
||||
endpoint = "https://rinkcalc.app/data/currency.json";
|
||||
timeout = "2s";
|
||||
};
|
||||
rink = {
|
||||
long_output = true;
|
||||
prompt = "> ";
|
||||
};
|
||||
themes = {
|
||||
my_theme = {
|
||||
date_time = "default";
|
||||
doc_string = "italic";
|
||||
error = "red";
|
||||
number = "default";
|
||||
plain = "default";
|
||||
pow = "default";
|
||||
prop_name = "cyan";
|
||||
quantity = "dimmed cyan";
|
||||
unit = "cyan";
|
||||
user_input = "bold";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
9
home/profiles/shell/ssh.nix
Normal file
9
home/profiles/shell/ssh.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
_: {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
controlMaster = "auto";
|
||||
controlPersist = "10m";
|
||||
hashKnownHosts = true;
|
||||
compression = true;
|
||||
};
|
||||
}
|
||||
12
home/profiles/shell/starship.nix
Normal file
12
home/profiles/shell/starship.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{pkgs, ...}: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
settings = {
|
||||
"custom.kubeprompt" = {
|
||||
command = ''${pkgs.kubeprompt}/bin/kubeprompt -f default'';
|
||||
when = ''test "$KUBECONFIG" '';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
54
home/profiles/shell/tmux.nix
Normal file
54
home/profiles/shell/tmux.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
std,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (std) set;
|
||||
in {
|
||||
programs.zsh.shellAliases = {
|
||||
tt = "tmux new -AD -s";
|
||||
};
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
terminal = "tmux-256color";
|
||||
keyMode = "vi";
|
||||
baseIndex = 1;
|
||||
extraConfig = with set.map (_: v: "colour${builtins.toString v}") pkgs.base16.shell.shell256; ''
|
||||
# proper title handling
|
||||
set -g set-titles on
|
||||
set -g set-titles-string "#T"
|
||||
set -ga terminal-overrides ",xterm-256color:Tc"
|
||||
|
||||
# modes
|
||||
setw -g clock-mode-colour colour8
|
||||
setw -g mode-style 'fg=${base07} bg=${base02} bold'
|
||||
|
||||
# panes
|
||||
set -g pane-border-style 'fg=${base06} bg=${base02}'
|
||||
set -g pane-active-border-style 'bg=${base0D} fg=${base07}'
|
||||
|
||||
# statusbar
|
||||
set -g status-position bottom
|
||||
set -g status-justify left
|
||||
set -g status-style 'bg=${base00} fg=${base06}'
|
||||
set -g status-left '#[fg=${base06} bg=${base01}] #S@#h '
|
||||
set -g status-right '#[fg=${base07},bg=${base01}] %F #[fg=${base07},bg=${base02}] %H:%M:%S %Z '
|
||||
set -g status-right-length 50
|
||||
set -g status-left-length 20
|
||||
|
||||
setw -g window-status-current-style 'fg=${base07} bg=${base0D} bold'
|
||||
setw -g window-status-current-format ' #I#[fg=${base07}]:#[fg=${base07}]#W#[fg=${base07}]#F '
|
||||
|
||||
setw -g window-status-style 'fg=${base06} bg=${base03}'
|
||||
setw -g window-status-format ' #I#[fg=${base07}]:#[fg=${base06}]#W#[${base06}]#F '
|
||||
|
||||
setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'
|
||||
|
||||
# messages
|
||||
set -g message-style 'fg=colour232 bg=colour16 bold'
|
||||
|
||||
# mouse
|
||||
set -g mouse on
|
||||
'';
|
||||
};
|
||||
}
|
||||
21
home/profiles/shell/z.nix
Normal file
21
home/profiles/shell/z.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# ensure .local/share/z is created
|
||||
xdg.dataFile."z/.keep".text = "";
|
||||
|
||||
programs.zsh = {
|
||||
localVariables = {
|
||||
_Z_DATA = "${config.xdg.dataHome}/z/data";
|
||||
};
|
||||
plugins =
|
||||
map (plugin: (with pkgs.${plugin}; {
|
||||
name = pname;
|
||||
inherit src;
|
||||
})) [
|
||||
"zsh-z"
|
||||
];
|
||||
};
|
||||
}
|
||||
121
home/profiles/shell/zsh.nix
Normal file
121
home/profiles/shell/zsh.nix
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
std,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkMerge mkIf;
|
||||
inherit (std) string list serde;
|
||||
in {
|
||||
home.packages = with pkgs; [
|
||||
# programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions
|
||||
zsh-completions
|
||||
fortune
|
||||
neofetch
|
||||
ponysay
|
||||
];
|
||||
|
||||
xdg.configFile."kattheme_immutable.json".text = serde.toJSON rec {
|
||||
default = config.base16.defaultSchemeName;
|
||||
current = default;
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
enableAutosuggestions = true;
|
||||
initExtra = let
|
||||
zshOpts = [
|
||||
"auto_pushd"
|
||||
"pushd_ignore_dups"
|
||||
"pushdminus"
|
||||
"rmstarsilent"
|
||||
"nonomatch"
|
||||
"long_list_jobs"
|
||||
"interactivecomments"
|
||||
"append_history"
|
||||
"hist_ignore_space"
|
||||
"hist_verify"
|
||||
"inc_append_history"
|
||||
"nosharehistory"
|
||||
"nomenu_complete"
|
||||
"auto_menu"
|
||||
"no_auto_remove_slash"
|
||||
"complete_in_word"
|
||||
"always_to_end"
|
||||
"nolistbeep"
|
||||
"autolist"
|
||||
"listrowsfirst"
|
||||
];
|
||||
in ''
|
||||
${
|
||||
if pkgs.hostPlatform.isLinux
|
||||
then ''
|
||||
eval $(dircolors -b | sd "\*#=00;90" "*\#=00;90")
|
||||
''
|
||||
else ''
|
||||
''
|
||||
}
|
||||
PROMPT_EOL_MARK='''
|
||||
ZSH_TAB_TITLE_ADDITIONAL_TERMS='wezterm'
|
||||
ZSH_TAB_TITLE_ENABLE_FULL_COMMAND=true
|
||||
zmodload -i zsh/complist
|
||||
h=()
|
||||
if [[ -r ~/.ssh/config ]]; then
|
||||
h=($h ''${''${''${(@M)''${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
|
||||
fi
|
||||
if [[ $#h -gt 0 ]]; then
|
||||
zstyle ':completion:*:ssh:*' hosts $h
|
||||
zstyle ':completion:*:slogin:*' hosts $h
|
||||
fi
|
||||
unset h
|
||||
u=(root ${config.home.username})
|
||||
zstyle ':completion:*:ssh:*' users $u
|
||||
unset u
|
||||
zstyle ':completion:*:*:*:*:*' menu select
|
||||
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
||||
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
|
||||
zstyle ':completion:*:complete:pass:*:*' matcher 'r:|[./_-]=** r:|=*' 'l:|=* r:|=*'
|
||||
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1lb --color=always $realpath'
|
||||
${string.concatSep "\n" (map (opt: "setopt ${opt}") zshOpts)}
|
||||
bindkey '^ ' autosuggest-accept
|
||||
${
|
||||
if pkgs.hostPlatform.isDarwin
|
||||
then ''
|
||||
export PATH="''${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
||||
''
|
||||
else ""
|
||||
}
|
||||
'';
|
||||
shellAliases = mkMerge [
|
||||
{
|
||||
nixdirfmt = "nixpkgs-fmt $(fd -e nix)";
|
||||
dmesg = "dmesg -HP";
|
||||
hg = "history 0 | rg";
|
||||
}
|
||||
(mkIf pkgs.hostPlatform.isLinux {
|
||||
sys = "systemctl";
|
||||
sysu = "systemctl --user";
|
||||
logu = "journalctl --user";
|
||||
log = "journalctl";
|
||||
lg = "log --no-pager | rg";
|
||||
})
|
||||
];
|
||||
localVariables = {
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=3,bold";
|
||||
ZSH_AUTOSUGGEST_USE_ASYNC = 1;
|
||||
};
|
||||
plugins = with pkgs.zsh-plugins; (list.map (plugin: plugin.zshPlugin) [
|
||||
tab-title
|
||||
vim-mode
|
||||
evil-registers
|
||||
]);
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
XDG_DATA_HOME = "${config.xdg.dataHome}";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue