mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
refactor: restructure project to remove profiles, users, ...
This commit is contained in:
parent
cb3ae5f434
commit
53655a05fc
177 changed files with 544 additions and 2877 deletions
12
home/shell/bitw.nix
Normal file
12
home/shell/bitw.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ config, pkgs, meta, lib, ... }: {
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
package = lib.mkIf (meta.trusted ? secrets) (pkgs.writeShellScriptBin "bitw" ''${pkgs.rbw-bitw}/bin/bitw -p gpg://${config.kw.secrets.repo.bitw.source} "$@"'');
|
||||
settings = {
|
||||
email = "kat@kittywit.ch";
|
||||
base_url = "https://vault.kittywit.ch";
|
||||
identity_url = null;
|
||||
lock_timeout = 3600;
|
||||
};
|
||||
};
|
||||
}
|
||||
6
home/shell/direnv.nix
Normal file
6
home/shell/direnv.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ config, ... }: {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
||||
11
home/shell/exa.nix
Normal file
11
home/shell/exa.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ config, pkgs, ... }: {
|
||||
home.packages = [ pkgs.exa ];
|
||||
|
||||
programs.zsh.shellAliases = {
|
||||
exa = "exa --time-style long-iso";
|
||||
ls = "exa -G";
|
||||
la = "exa -Ga";
|
||||
ll = "exa -l";
|
||||
lla = "exa -lga";
|
||||
};
|
||||
}
|
||||
10
home/shell/fzf.nix
Normal file
10
home/shell/fzf.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, pkgs, lib, ... }: {
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
programs.zsh.plugins = lib.optional (pkgs.hostPlatform == pkgs.buildPlatform) ({
|
||||
name = "fzf-tab";
|
||||
src = "${pkgs.zsh-fzf-tab}/share/fzf-tab";
|
||||
});
|
||||
}
|
||||
29
home/shell/git.nix
Normal file
29
home/shell/git.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
gitAndTools.gitRemoteGcrypt
|
||||
git-crypt
|
||||
git-revise
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
package = pkgs.gitAndTools.gitFull;
|
||||
enable = true;
|
||||
userName = "Kat Inskip";
|
||||
userEmail = "kat@inskip.me";
|
||||
extraConfig = {
|
||||
init = { defaultBranch = "main"; };
|
||||
protocol.gcrypt.allow = "always";
|
||||
annex = {
|
||||
autocommit = false;
|
||||
backend = "BLAKE2B512";
|
||||
synccontent = true;
|
||||
};
|
||||
};
|
||||
signing = {
|
||||
key = "0xE8DDE3ED1C90F3A0";
|
||||
signByDefault = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
21
home/shell/inputrc.nix
Normal file
21
home/shell/inputrc.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ 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";
|
||||
}
|
||||
31
home/shell/packages.nix
Normal file
31
home/shell/packages.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ config, pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
# disk usage
|
||||
duc-cli
|
||||
# nix formatting
|
||||
nixpkgs-fmt
|
||||
# show type of files
|
||||
file
|
||||
# command monitoring
|
||||
progress
|
||||
pv
|
||||
# cat but better
|
||||
bat
|
||||
# ls replacement
|
||||
exa
|
||||
# sed replacement
|
||||
sd
|
||||
# find replacement
|
||||
fd
|
||||
# ripgrep / grep replacement
|
||||
ripgrep
|
||||
# remote tmux
|
||||
tmate
|
||||
# remote utilities
|
||||
socat
|
||||
rsync
|
||||
wget
|
||||
dnsutils
|
||||
whois
|
||||
];
|
||||
}
|
||||
39
home/shell/rink.nix
Normal file
39
home/shell/rink.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
#rink-readline TODO: wait for fix
|
||||
rink
|
||||
];
|
||||
|
||||
xdg.configFile."rink/config.toml".text = lib.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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
26
home/shell/ssh.nix
Normal file
26
home/shell/ssh.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ meta, config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
controlMaster = "auto";
|
||||
controlPersist = "10m";
|
||||
hashKnownHosts = true;
|
||||
compression = true;
|
||||
matchBlocks =
|
||||
let
|
||||
common = {
|
||||
forwardAgent = true;
|
||||
extraOptions = {
|
||||
RemoteForward =
|
||||
"/run/user/1000/gnupg/S.gpg-agent /run/user/1000/gnupg/S.gpg-agent.extra";
|
||||
};
|
||||
port = 62954;
|
||||
};
|
||||
in
|
||||
(lib.foldAttrList (map
|
||||
(network:
|
||||
lib.mapAttrs (_: v: { hostname = v.domain; } // common) (lib.filterAttrs (_: v: v.enable) (lib.mapAttrs (_: v: v.network.addresses.${network}) meta.network.nodes.nixos))
|
||||
) [ "private" "public" ]));
|
||||
};
|
||||
}
|
||||
6
home/shell/starship.nix
Normal file
6
home/shell/starship.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ config, ... }: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
||||
50
home/shell/tmux.nix
Normal file
50
home/shell/tmux.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.zsh.shellAliases = {
|
||||
tt = "tmux new -AD -s";
|
||||
};
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
terminal = "tmux-256color";
|
||||
keyMode = "vi";
|
||||
baseIndex = 1;
|
||||
extraConfig = with lib.mapAttrs (_: v: "colour${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
|
||||
'';
|
||||
};
|
||||
}
|
||||
16
home/shell/z.nix
Normal file
16
home/shell/z.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ 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"
|
||||
]);
|
||||
};
|
||||
}
|
||||
98
home/shell/zsh.nix
Normal file
98
home/shell/zsh.nix
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions
|
||||
zsh-completions
|
||||
];
|
||||
|
||||
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 lib.hasSuffix "darwin" pkgs.stdenv.system then ''
|
||||
eval $(dircolors)
|
||||
'' else ''
|
||||
''}
|
||||
PROMPT_EOL_MARK='''
|
||||
ZSH_TAB_TITLE_ADDITIONAL_TERMS='kitty'
|
||||
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
|
||||
'';
|
||||
shellAliases = lib.mkMerge [
|
||||
{
|
||||
nixdirfmt = "nixpkgs-fmt $(fd -e nix)";
|
||||
dmesg = "dmesg -HP";
|
||||
hg = "history 0 | rg";
|
||||
}
|
||||
(lib.mkIf (lib.hasSuffix "linux" pkgs.stdenv.system) {
|
||||
sys = "systemctl";
|
||||
sysu = "systemctl --user";
|
||||
walls = "journalctl _SYSTEMD_INVOCATION_ID=$(systemctl show -p InvocationID --value konawall.service --user) -o json | jq -r '.MESSAGE'";
|
||||
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}";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue