c: Move into own file
This commit is contained in:
parent
881b22c9b2
commit
42bc007ed4
10 changed files with 182 additions and 134 deletions
|
@ -1,22 +1,4 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
direnv = {
|
||||
# Environment variables making programs stay out of $HOME, but also needing we create a directory for them
|
||||
CARGOHOME = "${config.xdg.cacheHome}/cargo"; # There are config in there that we can version if one want
|
||||
CCACHE_DIR = "${config.xdg.cacheHome}/ccache"; # The config file alone seems to be not enough
|
||||
DASHT_DOCSETS_DIR = "${config.xdg.cacheHome}/dash_docsets";
|
||||
GOPATH = "${config.xdg.cacheHome}/go";
|
||||
GRADLE_USER_HOME = "${config.xdg.cacheHome}/gradle";
|
||||
MIX_ARCHIVES = "${config.xdg.cacheHome}/mix/archives";
|
||||
MONO_GAC_PREFIX = "${config.xdg.cacheHome}/mono";
|
||||
npm_config_cache = "${config.xdg.cacheHome}/npm";
|
||||
PARALLEL_HOME = "${config.xdg.cacheHome}/parallel";
|
||||
TERMINFO = "${config.xdg.configHome}/terminfo";
|
||||
WINEPREFIX = "${config.xdg.stateHome}/wineprefix/default";
|
||||
YARN_CACHE_FOLDER = "${config.xdg.cacheHome}/yarn";
|
||||
# TODO Some of that stuff is not really relavant any more
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
@ -30,7 +12,6 @@ in
|
|||
|
||||
programs =
|
||||
let
|
||||
commonRc = lib.strings.concatLines (map (d: "mkdir -p ${d}") (builtins.attrValues direnv));
|
||||
# TODO Those directory creations should probably done on home-manager activation
|
||||
commonSessionVariables = {
|
||||
TIME_STYLE = "+%Y-%m-%d %H:%M:%S";
|
||||
|
@ -46,22 +27,6 @@ in
|
|||
# Fzf
|
||||
FZF_COMPLETION_OPTS = "${lib.strings.concatStringsSep " " config.programs.fzf.fileWidgetOptions}";
|
||||
};
|
||||
treatsHomeAsJunk = [
|
||||
# Programs that think $HOME is a reasonable place to put their junk
|
||||
# and don't allow the user to change those questionable choices
|
||||
"adb"
|
||||
"audacity"
|
||||
"binwalk" # Should use .config according to the GitHub code though
|
||||
"cabal" # TODO May have options but last time I tried it it crashed
|
||||
"cmake"
|
||||
"ddd"
|
||||
"ghidra"
|
||||
"itch"
|
||||
"simplescreenrecorder" # Easy fix https://github.com/MaartenBaert/ssr/blob/1556ae456e833992fb6d39d40f7c7d7c337a4160/src/Main.cpp#L252
|
||||
"vd"
|
||||
"wpa_cli"
|
||||
# TODO Maybe we can do something about node-gyp
|
||||
];
|
||||
commonShellAliases = {
|
||||
# Replacement commands
|
||||
ls = "lsd";
|
||||
|
@ -96,7 +61,6 @@ in
|
|||
|
||||
# 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";
|
||||
gdb = "gdb -x ${config.xdg.configHome}/gdbinit";
|
||||
iftop = "iftop -c ${config.xdg.configHome}/iftoprc";
|
||||
lmms = "lmms --config ${config.xdg.configHome}/lmmsrc.xml";
|
||||
|
||||
|
@ -122,9 +86,7 @@ in
|
|||
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'';
|
||||
tracefiles = ''${pkgs.strace}/bin/strace -f -t -e trace=file'';
|
||||
} // lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) treatsHomeAsJunk);
|
||||
# TODO Maybe make nixpkg wrapper instead? So it also works from dmenu
|
||||
# Could also accept my fate... Home-manager doesn't necessarily make it easy to put things out of the home directory
|
||||
};
|
||||
historySize = 100000;
|
||||
historyFile = "${config.xdg.stateHome}/shell_history";
|
||||
in
|
||||
|
@ -133,13 +95,10 @@ in
|
|||
home-manager.enable = true;
|
||||
bash = {
|
||||
enable = true;
|
||||
bashrcExtra = lib.strings.concatLines [
|
||||
commonRc
|
||||
''
|
||||
shopt -s expand_aliases
|
||||
shopt -s histappend
|
||||
''
|
||||
];
|
||||
bashrcExtra = ''
|
||||
shopt -s expand_aliases
|
||||
shopt -s histappend
|
||||
'';
|
||||
sessionVariables = commonSessionVariables;
|
||||
historySize = historySize;
|
||||
historyFile = historyFile;
|
||||
|
@ -153,10 +112,7 @@ in
|
|||
enableCompletion = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
historySubstringSearch.enable = true;
|
||||
initExtra = lib.strings.concatLines [
|
||||
commonRc
|
||||
(builtins.readFile ./zshrc.sh)
|
||||
];
|
||||
initExtra = builtins.readFile ./zshrc.sh;
|
||||
defaultKeymap = "viins";
|
||||
history = {
|
||||
size = historySize;
|
||||
|
@ -179,7 +135,8 @@ in
|
|||
settings = {
|
||||
size = "short";
|
||||
};
|
||||
colors = { # Base16 only, so it reuses the current theme.
|
||||
colors = {
|
||||
# Base16 only, so it reuses the current theme.
|
||||
date = { day-old = 4; hour-old = 6; older = 5; };
|
||||
git-status = { conflicted = 14; default = 13; deleted = 1; ignored = 13; modified = 3; new-in-index = 2; new-in-workdir = 2; renamed = 4; typechange = 3; unmodified = 13; };
|
||||
group = 6;
|
||||
|
@ -264,16 +221,6 @@ in
|
|||
};
|
||||
xdg = {
|
||||
configFile = {
|
||||
"ccache.conf" = {
|
||||
text = "ccache_dir = ${config.xdg.cacheHome}/ccache";
|
||||
};
|
||||
"gdbinit" = {
|
||||
text = ''
|
||||
define hook-quit
|
||||
set confirm off
|
||||
end
|
||||
'';
|
||||
};
|
||||
"iftoprc" = {
|
||||
text = ''
|
||||
port-resolution: no
|
||||
|
@ -390,7 +337,7 @@ in
|
|||
# Extra config
|
||||
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
|
||||
} // direnv;
|
||||
};
|
||||
# TODO Session variables only get reloaded on login I think.
|
||||
sessionPath = [
|
||||
"${config.home.homeDirectory}/.local/bin"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue