stability is near?

This commit is contained in:
L-Nafaryus 2023-06-15 11:05:31 +05:00
parent 82045cb546
commit 5c5ba91aa7
19 changed files with 1807 additions and 226 deletions

View File

@ -35,7 +35,7 @@
(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;;indent-guides ; highlighted indent columns
indent-guides ; highlighted indent columns
ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
@ -87,8 +87,8 @@
:tools
;;ansible
biblio ; Writes a PhD for you (citation needed)
;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv
debugger ; FIXME stepping through code, to help you add bugs
direnv
;;docker
;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
@ -151,7 +151,7 @@
;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
(nix +lsp) ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
org ; organize your plain life in plain text
;;php ; perl's insecure younger brother

1655
config/zsh/.p10k.zsh Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,31 @@
function _cache {
(( $+commands[$1] )) || return 1
local cache_dir="$XDG_CACHE_HOME/${SHELL##*/}"
local cache="$cache_dir/$1"
if [[ ! -f $cache || ! -s $cache ]]; then
echo "Caching $1"
mkdir -p $cache_dir
"$@" >$cache
chmod 600 $cache
fi
if [[ -o interactive ]]; then
source $cache || rm -f $cache
fi
(( $+commands[$1] )) || return 1
local cache_dir="$XDG_CACHE_HOME/${SHELL##*/}"
local cache="$cache_dir/$1"
if [[ ! -f $cache || ! -s $cache ]]; then
echo "Caching $1"
mkdir -p $cache_dir
"$@" >$cache
chmod 600 $cache
fi
if [[ -o interactive ]]; then
source $cache || rm -f $cache
fi
}
function _source {
for file in "$@"; do
[ -r $file ] && source $file
done
for file in "$@"; do
[ -r $file ] && source $file
done
}
# Be more restrictive with permissions; no one has any business reading things
# that don't belong to them.
if (( EUID != 0 )); then
umask 027
umask 027
else
# Be even less permissive if root.
umask 077
umask 077
fi
# Auto-generated by my nix config

View File

@ -4,8 +4,8 @@ source $ZDOTDIR/config.zsh
# NOTE ZGEN_DIR and ZGEN_SOURCE are forward-declared in modules/shell/zsh.nix
# NOTE Using zgenom because zgen is no longer maintained
if [ ! -d "$ZGEN_DIR" ]; then
echo "Installing jandamm/zgenom"
git clone https://github.com/jandamm/zgenom "$ZGEN_DIR"
echo "Installing jandamm/zgenom"
git clone https://github.com/jandamm/zgenom "$ZGEN_DIR"
fi
source $ZGEN_DIR/zgenom.zsh
@ -14,39 +14,36 @@ source $ZGEN_DIR/zgenom.zsh
zgenom autoupdate
if ! zgenom saved; then
echo "Initializing zgenom"
rm -f $ZDOTDIR/*.zwc(N) \
$XDG_CACHE_HOME/zsh/*(N) \
$ZGEN_INIT.zwc
echo "Initializing zgenom"
rm -f $ZDOTDIR/*.zwc(N) \
$XDG_CACHE_HOME/zsh/*(N) \
$ZGEN_INIT.zwc
# NOTE Be extra careful about plugin load order, or subtle breakage can
# emerge. This is the best order I've sussed out for these plugins.
zgenom load junegunn/fzf shell
zgenom load jeffreytse/zsh-vi-mode
zgenom load zdharma-continuum/fast-syntax-highlighting
zgenom load zsh-users/zsh-completions src
zgenom load zsh-users/zsh-autosuggestions
zgenom load zsh-users/zsh-history-substring-search
zgenom load romkatv/powerlevel10k powerlevel10k
zgenom load hlissner/zsh-autopair autopair.zsh
# NOTE Be extra careful about plugin load order, or subtle breakage can emerge
zgenom load junegunn/fzf shell
zgenom load zdharma-continuum/fast-syntax-highlighting
zgenom load zsh-users/zsh-completions src
zgenom load zsh-users/zsh-autosuggestions
zgenom load zsh-users/zsh-history-substring-search
zgenom load romkatv/powerlevel10k powerlevel10k
zgenom save
zgenom compile $ZDOTDIR
zgenom save
zgenom compile $ZDOTDIR
fi
## Bootstrap interactive sessions
if [[ $TERM != dumb ]]; then
autoload -Uz compinit && compinit -u -d $ZSH_CACHE/zcompdump
autoload -Uz compinit && compinit -u -d $ZSH_CACHE/zcompdump
source $ZDOTDIR/keybinds.zsh
source $ZDOTDIR/completion.zsh
source $ZDOTDIR/aliases.zsh
source $ZDOTDIR/keybinds.zsh
source $ZDOTDIR/completion.zsh
source $ZDOTDIR/aliases.zsh
source $ZDOTDIR/.p10k.zsh
# Auto-generated by nixos
_source $ZDOTDIR/extra.zshrc
# If you have host-local configuration, put it here
_source $ZDOTDIR/local.zshrc
# Auto-generated by nixos
_source $ZDOTDIR/extra.zshrc
# If you have host-local configuration, put it here
_source $ZDOTDIR/local.zshrc
_cache fasd --init posix-alias zsh-{hook,{c,w}comp{,-install}}
autopair-init
_cache fasd --init posix-alias zsh-{hook,{c,w}comp{,-install}}
fi

View File

@ -70,15 +70,15 @@ fi
autoload -U zmv
function take {
mkdir "$1" && cd "$1";
mkdir "$1" && cd "$1";
}; compdef take=mkdir
function zman {
PAGER="less -g -I -s '+/^ "$1"'" man zshall;
PAGER="less -g -I -s '+/^ "$1"'" man zshall;
}
# Create a reminder with human-readable durations, e.g. 15m, 1h, 40s, etc
function r {
local time=$1; shift
sched "$time" "notify-send --urgency=critical 'Reminder' '$@'; ding";
}; compdef r=sched
function remind {
local time=$1; shift
sched "$time" "notify-send --urgency=critical 'Reminder' '$@'; ding";
}; compdef remind=sched

View File

@ -56,18 +56,18 @@ zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-va
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
# Complete hostnames from ssh files too
zstyle -e ':completion:*:hosts' hosts 'reply=(
${=${=${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//\]:[0-9]*/ }//,/ }//\[/ }
${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}}
${=${=${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//\]:[0-9]*/ }//,/ }//\[/ }
${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}}
)'
# Don't complete uninteresting users
zstyle ':completion:*:users' ignored-patterns \
adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
mailman mailnull mldonkey mysql nagios \
named netdump news nfsnobody nobody 'nixbld*' nscd ntp nut nx openvpn \
operator pcap postfix postgres privoxy pulse pvm quagga radvd \
rpc rpcuser rpm shutdown squid sshd sync 'systemd-*' uucp vcsa xfs '_*'
adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
mailman mailnull mldonkey mysql nagios \
named netdump news nfsnobody nobody 'nixbld*' nscd ntp nut nx openvpn \
operator pcap postfix postgres privoxy pulse pvm quagga radvd \
rpc rpcuser rpm shutdown squid sshd sync 'systemd-*' uucp vcsa xfs '_*'
# ... unless we really want to.
zstyle '*' single-ignored show
# Ignore multiple entries.

View File

@ -1,36 +0,0 @@
#compdef hey
_hey_dispatch () {
local cmd="$@"
local offset=$#
CURRENT=$((CURRENT-$offset))
words=($cmd "${words[$((2 + offset)),-1]}")
_$cmd
}
_hey_command_list () {
hey | sed '1,/Available commands:/d' | awk '{ print $1 }'
}
_hey () {
local -a commands
IFS=$'\n' commands=($(_hey_command_list))
if (( CURRENT == 2 )); then
_describe -t commands "hey commands" commands
return
fi
integer ret=1
case ${words[2]} in
ch|channel) _hey_dispatch nix-channel ;;
b|build) _hey_dispatch nix-build ;;
ch|check) _hey_dispatch nix flake check ;;
sh|show) _hey_dispatch nix flake show ;;
s|search) _hey_dispatch nix search nixpkgs ;;
-*) _hey_dispatch nix-env ;;
*) _message "Command not found: ${words[2]}" ;;
esac
return ret
}
_hey

View File

@ -1,9 +1,9 @@
# Stop TRAMP (in Emacs) from hanging or term/shell from echoing back commands
if [[ $TERM == dumb || -n $INSIDE_EMACS ]]; then
unsetopt zle prompt_cr prompt_subst
whence -w precmd >/dev/null && unfunction precmd
whence -w preexec >/dev/null && unfunction preexec
PS1='$ '
unsetopt zle prompt_cr prompt_subst
whence -w precmd >/dev/null && unfunction precmd
whence -w preexec >/dev/null && unfunction preexec
PS1='$ '
fi
## Plugins
@ -11,20 +11,16 @@ fi
# we handle compinit ourselves...
export ZGEN_AUTOLOAD_COMPINIT=0
# zsh-vi-mode
export ZVM_INIT_MODE=sourcing
export ZVM_VI_INSERT_ESCAPE_BINDKEY=jk
# fasd
export _FASD_DATA="$XDG_CACHE_HOME/fasd"
export _FASD_VIMINFO="$XDG_CACHE_HOME/viminfo"
# fzf
if (( $+commands[fd] )); then
export FZF_DEFAULT_OPTS="--reverse --ansi"
export FZF_DEFAULT_COMMAND="fd ."
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd -t d . $HOME"
export FZF_DEFAULT_OPTS="--reverse --ansi"
export FZF_DEFAULT_COMMAND="fd ."
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd -t d . $HOME"
fi

View File

@ -1,65 +0,0 @@
# Other conveniences
bindkey -M viins '^a' beginning-of-line
bindkey -M viins '^d' push-line-or-edit
# Up arrow:
bindkey '\e[A' history-substring-search-up
bindkey '\eOA' history-substring-search-up
# Down arrow:
bindkey '\e[B' history-substring-search-down
bindkey '\eOB' history-substring-search-down
# C-z to toggle current process (background/foreground)
fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg"
zle accept-line
else
zle push-input
zle clear-screen
fi
}
zle -N fancy-ctrl-z
bindkey '^Z' fancy-ctrl-z
if (( $+commands[fzf] )); then
bindkey '^R' fzf-history-widget
fi
# Omni-Completion
if (( $+commands[fasd] )); then
bindkey -M viins '^x^f' fasd-complete-f # C-x C-f to do fasd-complete-f (only files)
bindkey -M viins '^x^d' fasd-complete-d # C-x C-d to do fasd-complete-d (only directories)
fi
# Completing words in buffer in tmux
if [ -n "$TMUX" ]; then
_tmux_pane_words() {
local expl
local -a w
if [[ -z "$TMUX_PANE" ]]; then
_message "not running inside tmux!"
return 1
fi
w=( ${(u)=$(tmux capture-pane \; show-buffer \; delete-buffer)} )
_wanted values expl 'words from current tmux pane' compadd -a w
}
zle -C tmux-pane-words-prefix complete-word _generic
zle -C tmux-pane-words-anywhere complete-word _generic
bindkey -M viins '^x^n' tmux-pane-words-prefix
bindkey -M viins '^x^o' tmux-pane-words-anywhere
zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' completer _tmux_pane_words
zstyle ':completion:tmux-pane-words-(prefix|anywhere):*' ignore-line current
zstyle ':completion:tmux-pane-words-anywhere:*' matcher-list 'b:=* m:{A-Za-z}={a-zA-Z}'
fi
# Vim's C-x C-l in zsh
history-beginning-search-backward-then-append() {
zle history-beginning-search-backward
zle vi-add-eol
}
zle -N history-beginning-search-backward-then-append
bindkey -M viins '^x^l' history-beginning-search-backward-then-append

View File

@ -15,33 +15,33 @@ with lib.custom;
# Configure nix and nixpkgs
environment.variables.NIXPKGS_ALLOW_UNFREE = "1";
nix =
let
filteredInputs = filterAttrs (n: _: n != "self") inputs;
nixPathInputs = mapAttrsToList (n: v: "${n}=${v}") filteredInputs;
registryInputs = mapAttrs (_: v: { flake = v; }) filteredInputs;
in {
package = pkgs.nixFlakes;
extraOptions = "experimental-features = nix-command flakes";
nixPath = nixPathInputs ++ [
"nixpkgs-overlays=${config.dotfiles.dir}/overlays"
"dotfiles=${config.dotfiles.dir}"
];
registry = registryInputs // { dotfiles.flake = inputs.self; };
settings = {
substituters = [
"https://nix-community.cachix.org"
let
filteredInputs = filterAttrs (n: _: n != "self") inputs;
nixPathInputs = mapAttrsToList (n: v: "${n}=${v}") filteredInputs;
registryInputs = mapAttrs (_: v: { flake = v; }) filteredInputs;
in {
package = pkgs.nixFlakes;
extraOptions = "experimental-features = nix-command flakes";
nixPath = nixPathInputs ++ [
"nixpkgs-overlays=${config.dotfiles.dir}/overlays"
"dotfiles=${config.dotfiles.dir}"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
auto-optimise-store = true;
registry = registryInputs // { dotfiles.flake = inputs.self; };
settings = {
substituters = [
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
auto-optimise-store = true;
};
gc = {
automatic = mkDefault true;
dates = mkDefault "weekly";
options = mkDefault "--delete-older-than 14d";
};
};
gc = {
automatic = mkDefault true;
dates = mkDefault "weekly";
options = mkDefault "--delete-older-than 14d";
};
};
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
system.stateVersion = "22.11";
@ -76,5 +76,6 @@ with lib.custom;
curl
gnumake
unzip
cachix
];
}

24
flake.lock generated
View File

@ -29,11 +29,11 @@
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1686109285,
"narHash": "sha256-VeKVr7TQdJMEQLTPCA0hfusG3N6JMOTZZUYfMx0B8Ho=",
"lastModified": 1686133476,
"narHash": "sha256-RCkGMdQ9oivH4bdEwQDyFEIP7bQmdPahTFtBw5rVuyk=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "fe83f47d0a8240ec1d81928705f6b02dc722fbbd",
"rev": "d80c21d639094ecc95f5ea437a141090499384d0",
"type": "github"
},
"original": {
@ -120,11 +120,11 @@
]
},
"locked": {
"lastModified": 1685999310,
"narHash": "sha256-gaRMZhc7z4KeU/xS3IWv3kC+WhVcAXOLXXGKLe5zn1Y=",
"lastModified": 1686142265,
"narHash": "sha256-IP0xPa0VYqxCzpqZsg3iYGXarUF+4r2zpkhwdHy9WsM=",
"owner": "rycee",
"repo": "home-manager",
"rev": "28614ed7a1e3ace824c122237bdc0e5e0b62c5c3",
"rev": "39c7d0a97a77d3f31953941767a0822c94dc01f5",
"type": "github"
},
"original": {
@ -255,11 +255,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1686025136,
"narHash": "sha256-yd/Lr6RjjeyF7PpA+TpFT4E5LZeDyiMLVJUXIWxB4Rs=",
"lastModified": 1686089707,
"narHash": "sha256-LTNlJcru2qJ0XhlhG9Acp5KyjB774Pza3tRH0pKIb3o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "22467e240f390f029d6c745ce031f0ffbdc40916",
"rev": "af21c31b2a1ec5d361ed8050edd0303c31306397",
"type": "github"
},
"original": {
@ -301,11 +301,11 @@
},
"nur": {
"locked": {
"lastModified": 1686112478,
"narHash": "sha256-WUhnIru2MooIDkYBTl/L2O5x0j8o5PP96yfjVYpS5g4=",
"lastModified": 1686143635,
"narHash": "sha256-BmsQRuHNoOIQl9Zv/aettlJUt366HoRW1xQnI8n3C64=",
"owner": "nix-community",
"repo": "NUR",
"rev": "9fa0698ec12a7b685b9978691d3b5ed505611f72",
"rev": "b54d94d6eb99231590921225e1601705b97aa968",
"type": "github"
},
"original": {

View File

@ -2,12 +2,21 @@
with builtins;
with lib;
{
networking.extraHosts = ''
192.168.156.1 router.home
networking = {
extraHosts = ''
192.168.156.1 router.home
192.168.156.35 elnafo.home
'';
firewall = {
enable = true;
allowedTCPPorts = [ 80 443 ];
#allowedUDPPortRanges = [
# { from = 4000; to = 4007; }
# { from = 8000; to = 8010; }
#];
};
};
# Hosts
192.168.1156.28 elnafo.home
'';
## Location config -- since Toronto is my 127.0.0.1
time.timeZone = mkDefault "Asia/Yekaterinburg";

View File

@ -17,6 +17,7 @@
communication = {
discord.enable = true;
};
documents.enable = true;
editors = {
vscodium.enable = true;
};
@ -43,9 +44,9 @@
editors = {
default = "nvim";
emacs = {
enable = true;
doom.enable = true;
};
enable = true;
doom.enable = true;
};
vim.enable = true;
};
shell = {
@ -54,9 +55,11 @@
gnupg.enable = true;
tmux.enable = true;
zsh.enable = true;
taskwarrior.enable = true;
};
services = {
ssh.enable = true;
nginx.enable = true;
};
};

View File

@ -13,7 +13,7 @@ in {
discord
(makeDesktopItem {
name = "discord-x11";
desktopName = "Discord";
desktopName = "Discord XWayland";
genericName = "Discord via xwayland";
icon = "discord";
exec = "${discord}/bin/discord --use-gl=desktop";

View File

@ -17,8 +17,13 @@ in {
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
displayManager.gdm.enable = false;
displayManager.lightdm.enable = true;
displayManager.gdm.wayland = false;
desktopManager.gnome.enable = true;
#autorun = false;
#displayManager.startx.enable = true;
};
};

View File

@ -42,6 +42,8 @@ in {
sqlite
# :lang latex & :lang org (latex previews)
texlive.combined.scheme-medium
# :lang nix
nixfmt
];
env.PATH = [ "$XDG_CONFIG_HOME/emacs/bin" ];

View File

@ -39,7 +39,7 @@ with lib.custom;
in {
inherit name;
description = "L-Nafaryus";
extraGroups = [ "wheel" ];
extraGroups = [ "wheel" "networkmanager" ];
isNormalUser = true;
home = "/home/${name}";
group = "users";

View File

@ -0,0 +1,14 @@
{ config, options, lib, pkgs, ... }:
with lib;
with lib.custom;
let
cfg = config.modules.shell.taskwarrior;
in {
options.modules.shell.taskwarrior = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
user.packages = [ pkgs.taskwarrior ];
};
}

View File

@ -40,7 +40,7 @@ in {
zsh
nix-zsh-completions
bat
nnn
nnn
exa
fasd
fd