Split out hm/common
I went nuclear...
This commit is contained in:
parent
033f411060
commit
4412180b3a
157
hm/common.nix
157
hm/common.nix
|
@ -1,33 +1,15 @@
|
||||||
{ pkgs, config, lib, ... }:
|
{ pkgs, config, lib, ... }:
|
||||||
{
|
{
|
||||||
|
programs = {
|
||||||
nixpkgs.config.allowUnfree = true;
|
home-manager.enable = true;
|
||||||
nix = {
|
bat = {
|
||||||
package = lib.mkDefault pkgs.nixFlakes;
|
enable = true;
|
||||||
settings = {
|
config = {
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
theme = "base16";
|
||||||
warn-dirty = false;
|
style = "full";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
bash.shellAliases = {
|
||||||
programs =
|
|
||||||
let
|
|
||||||
# TODO Those directory creations should probably done on home-manager activation
|
|
||||||
commonSessionVariables = {
|
|
||||||
TIME_STYLE = "+%Y-%m-%d %H:%M:%S";
|
|
||||||
# Less colors
|
|
||||||
LESS = "-R";
|
|
||||||
LESS_TERMCAP_mb = "$(echo $'\\E[1;31m')"; # begin blink
|
|
||||||
LESS_TERMCAP_md = "$(echo $'\\E[1;36m')"; # begin bold
|
|
||||||
LESS_TERMCAP_me = "$(echo $'\\E[0m')"; # reset bold/blink
|
|
||||||
LESS_TERMCAP_so = "$(echo $'\\E[01;44;33m')"; # begin reverse video
|
|
||||||
LESS_TERMCAP_se = "$(echo $'\\E[0m')"; # reset reverse video
|
|
||||||
LESS_TERMCAP_us = "$(echo $'\\E[1;32m')"; # begin underline
|
|
||||||
LESS_TERMCAP_ue = "$(echo $'\\E[0m')"; # reset underline
|
|
||||||
# Fzf
|
|
||||||
FZF_COMPLETION_OPTS = "${lib.strings.concatStringsSep " " config.programs.fzf.fileWidgetOptions}";
|
|
||||||
};
|
|
||||||
commonShellAliases = {
|
|
||||||
# Replacement commands
|
# Replacement commands
|
||||||
# ls = "lsd"; # lsd is suuuper slow for large directories
|
# ls = "lsd"; # lsd is suuuper slow for large directories
|
||||||
cat = "bat -pp";
|
cat = "bat -pp";
|
||||||
|
@ -57,14 +39,7 @@
|
||||||
s = "sudo -s -E";
|
s = "sudo -s -E";
|
||||||
|
|
||||||
|
|
||||||
# Give additional config to those programs, and not have them in my path
|
|
||||||
bower = "bower --config.storage.packages=${config.xdg.cacheHome}/bower/packages --config.storage.registry=${config.xdg.cacheHome}/bower/registry --config.storage.links=${config.xdg.cacheHome}/bower/links";
|
|
||||||
iftop = "iftop -c ${config.xdg.configHome}/iftoprc";
|
|
||||||
lmms = "lmms --config ${config.xdg.configHome}/lmmsrc.xml";
|
|
||||||
|
|
||||||
# Preference
|
# Preference
|
||||||
vi = "nvim";
|
|
||||||
vim = "nvim";
|
|
||||||
wol = "wakeonlan"; # TODO Really, isn't wol better? Also wtf Arch aliases to pass because neither is installed anyways x)
|
wol = "wakeonlan"; # TODO Really, isn't wol better? Also wtf Arch aliases to pass because neither is installed anyways x)
|
||||||
mutt = "neomutt";
|
mutt = "neomutt";
|
||||||
|
|
||||||
|
@ -83,50 +58,6 @@
|
||||||
pw = ''${pkgs.pwgen}/bin/pwgen 32 -y''; # Generate passwords. ln((26*2+10)**32)/ln(2) ≅ 190 bits of entropy
|
pw = ''${pkgs.pwgen}/bin/pwgen 32 -y''; # Generate passwords. ln((26*2+10)**32)/ln(2) ≅ 190 bits of entropy
|
||||||
newestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | tail'';
|
newestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | tail'';
|
||||||
oldestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | head'';
|
oldestFile = ''${pkgs.findutils}/bin/find -type f -printf '%T+ %p\n' | sort | head'';
|
||||||
tracefiles = ''${pkgs.strace}/bin/strace -f -t -e trace=file'';
|
|
||||||
};
|
|
||||||
historySize = 100000;
|
|
||||||
historyFile = "${config.xdg.stateHome}/shell_history";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
|
|
||||||
home-manager.enable = true;
|
|
||||||
bash = {
|
|
||||||
enable = true;
|
|
||||||
bashrcExtra = ''
|
|
||||||
shopt -s expand_aliases
|
|
||||||
shopt -s histappend
|
|
||||||
'';
|
|
||||||
sessionVariables = commonSessionVariables;
|
|
||||||
historySize = historySize;
|
|
||||||
historyFile = historyFile;
|
|
||||||
historyFileSize = historySize;
|
|
||||||
historyControl = [ "erasedups" "ignoredups" "ignorespace" ];
|
|
||||||
shellAliases = commonShellAliases // config.frogeye.shellAliases;
|
|
||||||
};
|
|
||||||
zsh = {
|
|
||||||
enable = true;
|
|
||||||
enableAutosuggestions = true;
|
|
||||||
enableCompletion = true;
|
|
||||||
syntaxHighlighting.enable = true;
|
|
||||||
historySubstringSearch.enable = true;
|
|
||||||
initExtra = builtins.readFile ./zshrc.sh;
|
|
||||||
defaultKeymap = "viins";
|
|
||||||
history = {
|
|
||||||
size = historySize;
|
|
||||||
save = historySize;
|
|
||||||
path = historyFile;
|
|
||||||
expireDuplicatesFirst = true;
|
|
||||||
};
|
|
||||||
sessionVariables = commonSessionVariables;
|
|
||||||
shellAliases = commonShellAliases // config.frogeye.shellAliases;
|
|
||||||
};
|
|
||||||
bat = {
|
|
||||||
enable = true;
|
|
||||||
config = {
|
|
||||||
theme = "base16";
|
|
||||||
style = "full";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
lsd = {
|
lsd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -152,22 +83,6 @@
|
||||||
enableZshIntegration = true;
|
enableZshIntegration = true;
|
||||||
# UPST This thing put stuff in .dircolors when it actually doesn't have to
|
# UPST This thing put stuff in .dircolors when it actually doesn't have to
|
||||||
};
|
};
|
||||||
powerline-go = {
|
|
||||||
enable = true;
|
|
||||||
modules = [ "user" "host" "venv" "cwd" "perms" "git" ];
|
|
||||||
modulesRight = [ "jobs" "exit" "duration" "load" ];
|
|
||||||
settings = {
|
|
||||||
colorize-hostname = true;
|
|
||||||
max-width = 25;
|
|
||||||
cwd-max-dir-size = 10;
|
|
||||||
duration = "$( test -n \"$__TIMER\" && echo $(( $EPOCHREALTIME - $\{__TIMER:-EPOCHREALTIME})) || echo 0 )";
|
|
||||||
# UPST Implement this properly in home-manager, would allow for bash support
|
|
||||||
};
|
|
||||||
extraUpdatePS1 = ''
|
|
||||||
unset __TIMER
|
|
||||||
echo -en "\033]0; $USER@$HOST $PWD\007"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
gpg.enable = true;
|
gpg.enable = true;
|
||||||
fzf = {
|
fzf = {
|
||||||
|
@ -178,12 +93,6 @@
|
||||||
# TODO Above not working... not really used either?
|
# TODO Above not working... not really used either?
|
||||||
# file and friends are not in PATH by default... so here we want aboslute paths, which means those won't get reloaded. Meh.
|
# file and friends are not in PATH by default... so here we want aboslute paths, which means those won't get reloaded. Meh.
|
||||||
};
|
};
|
||||||
nix-index = {
|
|
||||||
# For non-NixOS systems
|
|
||||||
enable = false; # TODO Index is impossible to generate, should use https://github.com/nix-community/nix-index-database
|
|
||||||
# but got no luck without flakes
|
|
||||||
enableZshIntegration = true;
|
|
||||||
};
|
|
||||||
less.enable = true;
|
less.enable = true;
|
||||||
nixvim.enable = true;
|
nixvim.enable = true;
|
||||||
readline = {
|
readline = {
|
||||||
|
@ -218,21 +127,6 @@
|
||||||
translate-shell.enable = true; # TODO Cool config?
|
translate-shell.enable = true; # TODO Cool config?
|
||||||
password-store.enable = true;
|
password-store.enable = true;
|
||||||
};
|
};
|
||||||
xdg = {
|
|
||||||
configFile = {
|
|
||||||
"iftoprc" = {
|
|
||||||
text = ''
|
|
||||||
port-resolution: no
|
|
||||||
promiscuous: no
|
|
||||||
port-display: on
|
|
||||||
link-local: yes
|
|
||||||
use-bytes: yes
|
|
||||||
show-totals: yes
|
|
||||||
log-scale: yes
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
home = {
|
home = {
|
||||||
activation = {
|
activation = {
|
||||||
# Prevent Virtualbox from creating a "VirtualBox VMs" folder in $HOME
|
# Prevent Virtualbox from creating a "VirtualBox VMs" folder in $HOME
|
||||||
|
@ -272,11 +166,6 @@
|
||||||
tldr
|
tldr
|
||||||
neofetch
|
neofetch
|
||||||
|
|
||||||
# nix utils
|
|
||||||
nix-diff
|
|
||||||
nix-tree
|
|
||||||
nix-output-monitor
|
|
||||||
|
|
||||||
# remote
|
# remote
|
||||||
wget
|
wget
|
||||||
curl
|
curl
|
||||||
|
@ -291,16 +180,6 @@
|
||||||
duperemove
|
duperemove
|
||||||
compsize
|
compsize
|
||||||
|
|
||||||
# local monitoring
|
|
||||||
htop
|
|
||||||
iotop
|
|
||||||
iftop
|
|
||||||
lsof
|
|
||||||
strace
|
|
||||||
pv
|
|
||||||
progress
|
|
||||||
speedtest-cli
|
|
||||||
|
|
||||||
# toolbox
|
# toolbox
|
||||||
sox
|
sox
|
||||||
imagemagick
|
imagemagick
|
||||||
|
@ -312,28 +191,16 @@
|
||||||
];
|
];
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
# Favourite commands
|
# Favourite commands
|
||||||
PAGER = "less";
|
|
||||||
EDITOR = "nvim";
|
|
||||||
|
|
||||||
# Extra config
|
# Extra config
|
||||||
BOOT9_PATH = "${config.xdg.dataHome}/citra-emu/sysdata/boot9.bin";
|
|
||||||
CCACHE_CONFIGPATH = "${config.xdg.configHome}/ccache.conf";
|
|
||||||
# INPUTRC = "${config.xdg.configHome}/inputrc"; # UPST Will use programs.readline, but doesn't allow path setting
|
# INPUTRC = "${config.xdg.configHome}/inputrc"; # UPST Will use programs.readline, but doesn't allow path setting
|
||||||
LESSHISTFILE = "${config.xdg.stateHome}/lesshst";
|
|
||||||
NODE_REPL_HISTORY = "${config.xdg.cacheHome}/node_repl_history";
|
|
||||||
# TODO I think we're not using the urxvt daemon on purpose?
|
|
||||||
# TODO this should be desktop only, as a few things are too.
|
|
||||||
SQLITE_HISTFILE = "${config.xdg.stateHome}/sqlite_history";
|
SQLITE_HISTFILE = "${config.xdg.stateHome}/sqlite_history";
|
||||||
YARN_DISABLE_SELF_UPDATE_CHECK = "true"; # This also disable the creation of a ~/.yarnrc file
|
|
||||||
} // lib.optionalAttrs config.frogeye.desktop.xorg {
|
|
||||||
# Favourite commands
|
|
||||||
VISUAL = "nvim";
|
|
||||||
|
|
||||||
# Extra config
|
# Bash/ZSH only?
|
||||||
RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed
|
TIME_STYLE = "+%Y-%m-%d %H:%M:%S";
|
||||||
# XAUTHORITY = "${config.xdg.configHome}/Xauthority"; # Disabled as this causes lock-ups with DMs
|
# Fzf
|
||||||
|
FZF_COMPLETION_OPTS = "${lib.strings.concatStringsSep " " config.programs.fzf.fileWidgetOptions}";
|
||||||
};
|
};
|
||||||
# TODO Session variables only get reloaded on login I think.
|
|
||||||
sessionPath = [
|
sessionPath = [
|
||||||
"${config.home.homeDirectory}/.local/bin"
|
"${config.home.homeDirectory}/.local/bin"
|
||||||
"${config.home.homeDirectory}/.config/dotfiles/hm/scripts" # Not Nix path otherwise it gets converted into store,
|
"${config.home.homeDirectory}/.config/dotfiles/hm/scripts" # Not Nix path otherwise it gets converted into store,
|
||||||
|
|
|
@ -10,7 +10,12 @@
|
||||||
./git
|
./git
|
||||||
./gpg
|
./gpg
|
||||||
./homealone.nix
|
./homealone.nix
|
||||||
|
./monitoring
|
||||||
|
./nix
|
||||||
|
./pager
|
||||||
|
./prompt
|
||||||
./rebuild
|
./rebuild
|
||||||
|
./shell
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
./style.nix
|
./style.nix
|
||||||
./tmux
|
./tmux
|
||||||
|
|
|
@ -10,12 +10,6 @@ in
|
||||||
./qutebrowser.nix
|
./qutebrowser.nix
|
||||||
];
|
];
|
||||||
config = lib.mkIf config.frogeye.desktop.xorg {
|
config = lib.mkIf config.frogeye.desktop.xorg {
|
||||||
frogeye.shellAliases = {
|
|
||||||
noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise'';
|
|
||||||
beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null'';
|
|
||||||
|
|
||||||
x = "startx ${config.home.homeDirectory}/${config.xsession.scriptPath}; logout";
|
|
||||||
};
|
|
||||||
xsession = {
|
xsession = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# Not using config.xdg.configHome because it needs to be $HOME-relative paths and path manipulation is hard
|
# Not using config.xdg.configHome because it needs to be $HOME-relative paths and path manipulation is hard
|
||||||
|
@ -80,6 +74,14 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
bash.shellAliases = {
|
||||||
|
noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise'';
|
||||||
|
beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null'';
|
||||||
|
|
||||||
|
x = "startx ${config.home.homeDirectory}/${config.xsession.scriptPath}; logout";
|
||||||
|
|
||||||
|
lmms = "lmms --config ${config.xdg.configHome}/lmmsrc.xml";
|
||||||
|
};
|
||||||
# Backup terminal
|
# Backup terminal
|
||||||
urxvt = {
|
urxvt = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -291,6 +293,9 @@ in
|
||||||
MPD_PORT = "${toString config.services.mpd.network.port}";
|
MPD_PORT = "${toString config.services.mpd.network.port}";
|
||||||
ALSA_PLUGIN_DIR = "${pkgs.alsa-plugins}/lib/alsa-lib"; # Fixes an issue with sox (Cannot open shared library libasound_module_pcm_pulse.so)
|
ALSA_PLUGIN_DIR = "${pkgs.alsa-plugins}/lib/alsa-lib"; # Fixes an issue with sox (Cannot open shared library libasound_module_pcm_pulse.so)
|
||||||
# UPST Patch this upstream like: https://github.com/NixOS/nixpkgs/blob/216b111fb87091632d077898df647d1438fc2edb/pkgs/applications/audio/espeak-ng/default.nix#L84
|
# UPST Patch this upstream like: https://github.com/NixOS/nixpkgs/blob/216b111fb87091632d077898df647d1438fc2edb/pkgs/applications/audio/espeak-ng/default.nix#L84
|
||||||
|
|
||||||
|
RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed
|
||||||
|
# XAUTHORITY = "${config.xdg.configHome}/Xauthority"; # Disabled as this causes lock-ups with DMs
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
13
hm/dev/c.nix
13
hm/dev/c.nix
|
@ -11,11 +11,9 @@
|
||||||
"ddd"
|
"ddd"
|
||||||
"ghidra"
|
"ghidra"
|
||||||
];
|
];
|
||||||
shellAliases = {
|
|
||||||
gdb = "gdb -x ${config.xdg.configHome}/gdbinit";
|
|
||||||
};
|
};
|
||||||
};
|
home = {
|
||||||
home.packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
binwalk
|
binwalk
|
||||||
ccache
|
ccache
|
||||||
clang
|
clang
|
||||||
|
@ -23,6 +21,13 @@
|
||||||
ddd
|
ddd
|
||||||
gdb
|
gdb
|
||||||
];
|
];
|
||||||
|
sessionVariables = {
|
||||||
|
CCACHE_CONFIGPATH = "${config.xdg.configHome}/ccache.conf";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
programs.bash.shellAliases = {
|
||||||
|
gdb = "gdb -x ${config.xdg.configHome}/gdbinit";
|
||||||
|
};
|
||||||
programs.nixvim.extraPlugins = [ pkgs.vimPlugins.nvim-dap ]; # Debug Adapter Protocol client
|
programs.nixvim.extraPlugins = [ pkgs.vimPlugins.nvim-dap ]; # Debug Adapter Protocol client
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
"ccache.conf" = {
|
"ccache.conf" = {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
./c.nix
|
./c.nix
|
||||||
./common.nix
|
./common.nix
|
||||||
./go.nix
|
./go.nix
|
||||||
|
./node.nix
|
||||||
./python.nix
|
./python.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
21
hm/dev/node.nix
Normal file
21
hm/dev/node.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# Untested post-nix
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkIf config.frogeye.dev.node {
|
||||||
|
frogeye = {
|
||||||
|
direnv = {
|
||||||
|
npm_config_cache = "${config.xdg.cacheHome}/npm";
|
||||||
|
YARN_CACHE_FOLDER = "${config.xdg.cacheHome}/yarn";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
home = {
|
||||||
|
sessionVariables = {
|
||||||
|
NODE_REPL_HISTORY = "${config.xdg.cacheHome}/node_repl_history";
|
||||||
|
YARN_DISABLE_SELF_UPDATE_CHECK = "true"; # This also disable the creation of a ~/.yarnrc file
|
||||||
|
};
|
||||||
|
};
|
||||||
|
programs.bash.shellAliases = {
|
||||||
|
bower = "bower --config.storage.packages=${config.xdg.cacheHome}/bower/packages --config.storage.registry=${config.xdg.cacheHome}/bower/registry --config.storage.links=${config.xdg.cacheHome}/bower/links";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,11 +1,6 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
{
|
{
|
||||||
config = lib.mkIf config.frogeye.dev.python {
|
config = lib.mkIf config.frogeye.dev.python {
|
||||||
frogeye = {
|
|
||||||
shellAliases = {
|
|
||||||
ipython = "ipython --no-confirm-exit --pdb";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
home = {
|
home = {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
python3
|
python3
|
||||||
|
@ -15,6 +10,9 @@
|
||||||
PYTHONSTARTUP = "${config.xdg.configHome}/pythonstartup.py";
|
PYTHONSTARTUP = "${config.xdg.configHome}/pythonstartup.py";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
programs.bash.shellAliases = {
|
||||||
|
ipython = "ipython --no-confirm-exit --pdb";
|
||||||
|
};
|
||||||
programs.nixvim.plugins.lsp.servers.pylsp = {
|
programs.nixvim.plugins.lsp.servers.pylsp = {
|
||||||
# Python
|
# Python
|
||||||
enable = config.frogeye.dev.python;
|
enable = config.frogeye.dev.python;
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
config = lib.mkIf config.frogeye.gaming {
|
config = lib.mkIf config.frogeye.gaming {
|
||||||
# Using config.nixpkgs.<something> creates an infinite recursion,
|
# Using config.nixpkgs.<something> creates an infinite recursion,
|
||||||
# but the above might not be correct in case of cross-compiling?
|
# but the above might not be correct in case of cross-compiling?
|
||||||
home.packages = with pkgs; [
|
home = {
|
||||||
|
packages = with pkgs; [
|
||||||
# gaming
|
# gaming
|
||||||
yuzu-mainline
|
yuzu-mainline
|
||||||
minecraft
|
minecraft
|
||||||
|
@ -11,5 +12,9 @@
|
||||||
|
|
||||||
steam # Common pitfall: https://github.com/NixOS/nixpkgs/issues/86506#issuecomment-623746883
|
steam # Common pitfall: https://github.com/NixOS/nixpkgs/issues/86506#issuecomment-623746883
|
||||||
];
|
];
|
||||||
|
sessionVariables = {
|
||||||
|
BOOT9_PATH = "${config.xdg.dataHome}/citra-emu/sysdata/boot9.bin";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,11 +9,9 @@
|
||||||
GRADLE_USER_HOME = "${config.xdg.cacheHome}/gradle";
|
GRADLE_USER_HOME = "${config.xdg.cacheHome}/gradle";
|
||||||
MIX_ARCHIVES = "${config.xdg.cacheHome}/mix/archives";
|
MIX_ARCHIVES = "${config.xdg.cacheHome}/mix/archives";
|
||||||
MONO_GAC_PREFIX = "${config.xdg.cacheHome}/mono";
|
MONO_GAC_PREFIX = "${config.xdg.cacheHome}/mono";
|
||||||
npm_config_cache = "${config.xdg.cacheHome}/npm";
|
|
||||||
PARALLEL_HOME = "${config.xdg.cacheHome}/parallel";
|
PARALLEL_HOME = "${config.xdg.cacheHome}/parallel";
|
||||||
TERMINFO = "${config.xdg.configHome}/terminfo";
|
TERMINFO = "${config.xdg.configHome}/terminfo";
|
||||||
WINEPREFIX = "${config.xdg.stateHome}/wineprefix/default";
|
WINEPREFIX = "${config.xdg.stateHome}/wineprefix/default";
|
||||||
YARN_CACHE_FOLDER = "${config.xdg.cacheHome}/yarn";
|
|
||||||
};
|
};
|
||||||
junkhome = [
|
junkhome = [
|
||||||
"adb"
|
"adb"
|
||||||
|
@ -25,7 +23,6 @@
|
||||||
"wpa_cli"
|
"wpa_cli"
|
||||||
# TODO Maybe we can do something about node-gyp
|
# TODO Maybe we can do something about node-gyp
|
||||||
];
|
];
|
||||||
shellAliases = lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) config.frogeye.junkhome);
|
|
||||||
};
|
};
|
||||||
home = {
|
home = {
|
||||||
activation.createDirenvFolders = lib.hm.dag.entryAfter [ "writeBoundary" ]
|
activation.createDirenvFolders = lib.hm.dag.entryAfter [ "writeBoundary" ]
|
||||||
|
@ -35,6 +32,7 @@
|
||||||
|
|
||||||
sessionVariables = config.frogeye.direnv;
|
sessionVariables = config.frogeye.direnv;
|
||||||
};
|
};
|
||||||
|
programs.bash.shellAliases = lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) config.frogeye.junkhome);
|
||||||
};
|
};
|
||||||
options.frogeye = {
|
options.frogeye = {
|
||||||
direnv = lib.mkOption {
|
direnv = lib.mkOption {
|
||||||
|
|
35
hm/monitoring/default.nix
Normal file
35
hm/monitoring/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
htop
|
||||||
|
iftop
|
||||||
|
iotop
|
||||||
|
lsof
|
||||||
|
progress
|
||||||
|
pv
|
||||||
|
speedtest-cli
|
||||||
|
strace
|
||||||
|
];
|
||||||
|
programs.bash.shellAliases = {
|
||||||
|
iftop = "iftop -c ${config.xdg.configHome}/iftoprc";
|
||||||
|
tracefiles = ''${pkgs.strace}/bin/strace -f -t -e trace=file'';
|
||||||
|
};
|
||||||
|
xdg = {
|
||||||
|
configFile = {
|
||||||
|
"iftoprc" = {
|
||||||
|
text = ''
|
||||||
|
port-resolution: no
|
||||||
|
promiscuous: no
|
||||||
|
port-display: on
|
||||||
|
link-local: yes
|
||||||
|
use-bytes: yes
|
||||||
|
show-totals: yes
|
||||||
|
log-scale: yes
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
24
hm/nix/default.nix
Normal file
24
hm/nix/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
nix-diff
|
||||||
|
nix-tree
|
||||||
|
nix-output-monitor
|
||||||
|
];
|
||||||
|
programs.nix-index = {
|
||||||
|
# For non-NixOS systems
|
||||||
|
enable = false; # TODO Index is impossible to generate, should use https://github.com/nix-community/nix-index-database
|
||||||
|
# but got no luck without flakes
|
||||||
|
enableZshIntegration = true;
|
||||||
|
};
|
||||||
|
nix = {
|
||||||
|
package = lib.mkDefault pkgs.nixFlakes;
|
||||||
|
settings = {
|
||||||
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
warn-dirty = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
}
|
19
hm/pager/default.nix
Normal file
19
hm/pager/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
home = {
|
||||||
|
sessionVariables = {
|
||||||
|
PAGER = "less";
|
||||||
|
LESSHISTFILE = "${config.xdg.stateHome}/lesshst";
|
||||||
|
LESS = "-R";
|
||||||
|
LESS_TERMCAP_mb = "$(echo $'\\E[1;31m')"; # begin blink
|
||||||
|
LESS_TERMCAP_md = "$(echo $'\\E[1;36m')"; # begin bold
|
||||||
|
LESS_TERMCAP_me = "$(echo $'\\E[0m')"; # reset bold/blink
|
||||||
|
LESS_TERMCAP_se = "$(echo $'\\E[0m')"; # reset reverse video
|
||||||
|
LESS_TERMCAP_so = "$(echo $'\\E[01;44;33m')"; # begin reverse video
|
||||||
|
LESS_TERMCAP_ue = "$(echo $'\\E[0m')"; # reset underline
|
||||||
|
LESS_TERMCAP_us = "$(echo $'\\E[1;32m')"; # begin underline
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
hm/prompt/default.nix
Normal file
21
hm/prompt/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
{
|
||||||
|
config = lib.mkIf config.programs.less.enable {
|
||||||
|
programs.powerline-go = {
|
||||||
|
enable = true;
|
||||||
|
modules = [ "user" "host" "venv" "cwd" "perms" "git" ];
|
||||||
|
modulesRight = [ "jobs" "exit" "duration" "load" ];
|
||||||
|
settings = {
|
||||||
|
colorize-hostname = true;
|
||||||
|
max-width = 25;
|
||||||
|
cwd-max-dir-size = 10;
|
||||||
|
duration = "$( test -n \"$__TIMER\" && echo $(( $EPOCHREALTIME - $\{__TIMER:-EPOCHREALTIME})) || echo 0 )";
|
||||||
|
# UPST Implement this properly in home-manager, would allow for bash support
|
||||||
|
};
|
||||||
|
extraUpdatePS1 = ''
|
||||||
|
unset __TIMER
|
||||||
|
echo -en "\033]0; $USER@$HOST $PWD\007"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
38
hm/shell/default.nix
Normal file
38
hm/shell/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.programs.bash;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs = {
|
||||||
|
bash = {
|
||||||
|
enable = true;
|
||||||
|
bashrcExtra = ''
|
||||||
|
shopt -s expand_aliases
|
||||||
|
shopt -s histappend
|
||||||
|
'';
|
||||||
|
historySize = 100000;
|
||||||
|
historyFile = "${config.xdg.stateHome}/shell_history";
|
||||||
|
historyFileSize = 100000;
|
||||||
|
# TODO Check out Atuin
|
||||||
|
historyControl = [ "erasedups" "ignoredups" "ignorespace" ];
|
||||||
|
};
|
||||||
|
zsh = {
|
||||||
|
enable = true;
|
||||||
|
enableAutosuggestions = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
syntaxHighlighting.enable = true;
|
||||||
|
historySubstringSearch.enable = true;
|
||||||
|
initExtra = builtins.readFile ./zshrc.sh;
|
||||||
|
defaultKeymap = "viins";
|
||||||
|
history = {
|
||||||
|
size = cfg.historySize;
|
||||||
|
save = cfg.historyFileSize;
|
||||||
|
path = cfg.historyFile;
|
||||||
|
expireDuplicatesFirst = true;
|
||||||
|
};
|
||||||
|
shellAliases = cfg.shellAliases;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -27,6 +27,15 @@ in
|
||||||
{
|
{
|
||||||
# config = lib.mkIf config.programs.nixvim.enable { # Somehow this is infinite recursion?
|
# config = lib.mkIf config.programs.nixvim.enable { # Somehow this is infinite recursion?
|
||||||
config = {
|
config = {
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = "nvim";
|
||||||
|
} // lib.optionalAttrs config.frogeye.desktop.xorg {
|
||||||
|
VISUAL = "nvim";
|
||||||
|
};
|
||||||
|
programs.bash.shellAliases = {
|
||||||
|
vi = "nvim";
|
||||||
|
vim = "nvim";
|
||||||
|
};
|
||||||
programs.nixvim = {
|
programs.nixvim = {
|
||||||
# Setting a custom base16 theme via nixvim is required so feline works, and
|
# Setting a custom base16 theme via nixvim is required so feline works, and
|
||||||
# because stylix makes a config that otherwise only works with dark
|
# because stylix makes a config that otherwise only works with dark
|
||||||
|
|
17
options.nix
17
options.nix
|
@ -36,25 +36,12 @@
|
||||||
c = lib.mkEnableOption "C/C++ dev stuff";
|
c = lib.mkEnableOption "C/C++ dev stuff";
|
||||||
docker = lib.mkEnableOption "Docker dev stuff";
|
docker = lib.mkEnableOption "Docker dev stuff";
|
||||||
fpga = lib.mkEnableOption "FPGA dev stuff";
|
fpga = lib.mkEnableOption "FPGA dev stuff";
|
||||||
go = lib.mkEnableOption "Python dev stuff";
|
go = lib.mkEnableOption "Go dev stuff";
|
||||||
|
node = lib.mkEnableOption "NodeJS dev stuff";
|
||||||
perl = lib.mkEnableOption "Perl dev stuff";
|
perl = lib.mkEnableOption "Perl dev stuff";
|
||||||
php = lib.mkEnableOption "PHP dev stuff";
|
php = lib.mkEnableOption "PHP dev stuff";
|
||||||
python = lib.mkEnableOption "Python dev stuff";
|
python = lib.mkEnableOption "Python dev stuff";
|
||||||
};
|
};
|
||||||
shellAliases = lib.mkOption { # TODO Just use bash option and copy it for zsh
|
|
||||||
default = { };
|
|
||||||
example = lib.literalExpression ''
|
|
||||||
{
|
|
||||||
ll = "ls -l";
|
|
||||||
".." = "cd ..";
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
description = ''
|
|
||||||
An attribute set that maps aliases (the top level attribute names in
|
|
||||||
this option) to command strings or directly to build outputs.
|
|
||||||
'';
|
|
||||||
type = lib.types.attrsOf lib.types.str;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
Loading…
Reference in a new issue