refactor: statix, deadnix, alejandra

This commit is contained in:
Kat Inskip 2023-01-17 14:26:07 -05:00
parent 961ec369ba
commit 53eed4454d
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
57 changed files with 1296 additions and 963 deletions

View file

@ -1,7 +1,7 @@
{ config, pkgs, meta, lib, ... }: {
{pkgs, ...}: {
programs.rbw = {
enable = true;
package = lib.mkIf (meta.trusted ? secrets) (pkgs.writeShellScriptBin "bitw" ''${pkgs.rbw-bitw}/bin/bitw -p gpg://${config.secrets.repo.bitw.source} "$@"'');
package = pkgs.rbw-bitw;
settings = {
email = "kat@kittywit.ch";
base_url = "https://vault.kittywit.ch";

View file

@ -1,4 +1,4 @@
{ config, ... }: {
_: {
programs.direnv = {
enable = true;
enableZshIntegration = true;

View file

@ -1,5 +1,5 @@
{ config, pkgs, ... }: {
home.packages = [ pkgs.exa ];
{pkgs, ...}: {
home.packages = [pkgs.exa];
programs.zsh.shellAliases = {
exa = "exa --time-style long-iso";

View file

@ -1,9 +1,15 @@
{ config, pkgs, lib, ... }: {
{
pkgs,
lib,
...
}: let
inherit (lib.lists) optional;
in {
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.zsh.plugins = lib.optional (pkgs.hostPlatform == pkgs.buildPlatform) {
programs.zsh.plugins = optional (pkgs.hostPlatform == pkgs.buildPlatform) {
name = "fzf-tab";
src = "${pkgs.zsh-fzf-tab}/share/fzf-tab";
};

View file

@ -1,6 +1,4 @@
{ config, pkgs, lib, ... }:
{
{pkgs, ...}: {
home.packages = with pkgs; [
gitAndTools.git-remote-gcrypt
git-crypt
@ -13,7 +11,7 @@
userName = "Kat Inskip";
userEmail = "kat@inskip.me";
extraConfig = {
init = { defaultBranch = "main"; };
init = {defaultBranch = "main";};
protocol.gcrypt.allow = "always";
annex = {
autocommit = false;

View file

@ -1,6 +1,4 @@
{ config, ... }:
{
{config, ...}: {
xdg.configFile."inputrc".text = ''
set editing-mode vi
set keyseq-timeout 1

View file

@ -1,7 +1,6 @@
{ config, ... }: {
_: {
home.language = let
ca = "en_CA.UTF-8";
dk = "en_DK.UTF-8";
in {
base = ca;
ctype = ca;

View file

@ -1,9 +1,9 @@
{ config, pkgs, ... }: {
{pkgs, ...}: {
home.packages = with pkgs; [
# task managers
htop
btop
# disk usage
# disk usage
duc-cli
# nix formatting
nixpkgs-fmt

View file

@ -1,12 +1,16 @@
{ config, lib, pkgs, ... }:
{
pkgs,
lib,
...
}: let
inherit (lib) toTOML;
in {
home.packages = with pkgs; [
#rink-readline TODO: wait for fix
rink
];
xdg.configFile."rink/config.toml".text = lib.toTOML {
xdg.configFile."rink/config.toml".text = toTOML {
colors = {
enabled = true;
theme = "my_theme";

View file

@ -1,6 +1,4 @@
{ meta, config, pkgs, lib, ... }:
{
_: {
programs.ssh = {
enable = true;
controlMaster = "auto";

View file

@ -1,4 +1,4 @@
{ config, ... }: {
_: {
programs.starship = {
enable = true;
enableZshIntegration = true;

View file

@ -1,6 +1,10 @@
{ config, lib, pkgs, ... }:
{
lib,
pkgs,
...
}: let
inherit (lib.attrsets) mapAttrs;
in {
programs.zsh.shellAliases = {
tt = "tmux new -AD -s";
};
@ -9,7 +13,7 @@
terminal = "tmux-256color";
keyMode = "vi";
baseIndex = 1;
extraConfig = with lib.mapAttrs (_: v: "colour${toString v}") pkgs.base16.shell.shell256; ''
extraConfig = with mapAttrs (_: v: "colour${toString v}") pkgs.base16.shell.shell256; ''
# proper title handling
set -g set-titles on
set -g set-titles-string "#T"

View file

@ -1,4 +1,8 @@
{ config, pkgs, ... }: {
{
config,
pkgs,
...
}: {
# ensure .local/share/z is created
xdg.dataFile."z/.keep".text = "";
@ -6,11 +10,12 @@
localVariables = {
_Z_DATA = "${config.xdg.dataHome}/z/data";
};
plugins = map (plugin: (with pkgs.${plugin}; {
name = pname;
inherit src;
})) [
"zsh-z"
];
plugins =
map (plugin: (with pkgs.${plugin}; {
name = pname;
inherit src;
})) [
"zsh-z"
];
};
}

View file

@ -1,107 +1,114 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}: {
home.packages = with pkgs; [
# programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions
zsh-completions
];
home.packages = with pkgs; [
# programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions
zsh-completions
];
xdg.configFile."kattheme_immutable.json".text = builtins.toJSON rec {
default = config.base16.defaultSchemeName;
current = default;
};
xdg.configFile."kattheme_immutable.json".text = builtins.toJSON rec {
default = config.base16.defaultSchemeName;
current = default;
};
programs.zsh = {
enable = true;
enableSyntaxHighlighting = 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 'exa -1lb --color=always $realpath'
${lib.concatStringsSep "\n" (map (opt: "setopt ${opt}") zshOpts)}
bindkey '^ ' autosuggest-accept
${
if pkgs.hostPlatform.isDarwin
then ''
export PATH="''${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
''
else ""
}
'';
shellAliases = lib.mkMerge [
{
nixdirfmt = "nixpkgs-fmt $(fd -e nix)";
dmesg = "dmesg -HP";
hg = "history 0 | rg";
}
(lib.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; (map (plugin: plugin.zshPlugin) [
tab-title
vim-mode
evil-registers
]);
};
programs.zsh = {
enable = true;
enableSyntaxHighlighting = 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 'exa -1lb --color=always $realpath'
${lib.concatStringsSep "\n" (map (opt: "setopt ${opt}") zshOpts)}
bindkey '^ ' autosuggest-accept
${if pkgs.hostPlatform.isDarwin then ''
export PATH="''${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
'' else ""
}
'';
shellAliases = lib.mkMerge [
{
nixdirfmt = "nixpkgs-fmt $(fd -e nix)";
dmesg = "dmesg -HP";
hg = "history 0 | rg";
}
(lib.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; (map (plugin: plugin.zshPlugin) [
tab-title
vim-mode
evil-registers
]);
};
home.sessionVariables = {
XDG_DATA_HOME = "${config.xdg.dataHome}";
};
home.sessionVariables = {
XDG_DATA_HOME = "${config.xdg.dataHome}";
};
}