Split home-manager config into modules
This commit is contained in:
69
nix/home.nix
69
nix/home.nix
@@ -34,70 +34,11 @@
|
|||||||
fira-code
|
fira-code
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.direnv.enable = true;
|
imports = [
|
||||||
programs.direnv.nix-direnv.enable = true;
|
./modules/git.nix
|
||||||
programs.direnv.stdlib = ''
|
./modules/direnv.nix
|
||||||
# From https://github.com/direnv/direnv/wiki/Customizing-cache-location
|
./modules/emacs.nix
|
||||||
: ''${XDG_CACHE_HOME:=$HOME/.cache}
|
];
|
||||||
declare -A direnv_layout_dirs
|
|
||||||
direnv_layout_dir() {
|
|
||||||
echo "''${direnv_layout_dirs[$PWD]:=$(
|
|
||||||
local path="''${PWD//[^a-zA-Z0-9]/-}"
|
|
||||||
echo "$XDG_CACHE_HOME/direnv/layouts/''${path:1}"
|
|
||||||
)}"
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
programs.emacs.enable = true;
|
|
||||||
programs.emacs.package = pkgs.emacs28NativeComp;
|
|
||||||
programs.emacs.extraPackages = epkgs: [ epkgs.vterm ];
|
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
aliases = {
|
|
||||||
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
|
|
||||||
};
|
|
||||||
extraConfig = {
|
|
||||||
user.name = "Tim McCarthy";
|
|
||||||
user.email = "thoomfish@gmail.com";
|
|
||||||
color.ui = true;
|
|
||||||
init.defaultBranch = "main";
|
|
||||||
push.default = "simple";
|
|
||||||
pull.rebase = true;
|
|
||||||
transfer.fsckobjects = true;
|
|
||||||
credential.helper = "store";
|
|
||||||
};
|
|
||||||
|
|
||||||
ignores = [
|
|
||||||
".DS_Store"
|
|
||||||
".projectile"
|
|
||||||
".idea"
|
|
||||||
"*.sw?"
|
|
||||||
"*.pyc"
|
|
||||||
".#*"
|
|
||||||
".nrepl-port"
|
|
||||||
".rebel_readline_history"
|
|
||||||
".auctex-auto"
|
|
||||||
"*.synctex.gz"
|
|
||||||
".ccls-cache"
|
|
||||||
".lein-repl-history"
|
|
||||||
"ompile_commands.json"
|
|
||||||
"*.egg-info"
|
|
||||||
".envrc"
|
|
||||||
".vscode"
|
|
||||||
".direnv"
|
|
||||||
".ipynb_checkpoints"
|
|
||||||
"nfer-out"
|
|
||||||
".cache"
|
|
||||||
];
|
|
||||||
|
|
||||||
includes = [
|
|
||||||
{
|
|
||||||
condition = "gitdir/i:~/SRI/";
|
|
||||||
contents.user.email = "tim.mccarthy@sri.com";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
16
nix/modules/direnv.nix
Normal file
16
nix/modules/direnv.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.direnv.enable = true;
|
||||||
|
programs.direnv.nix-direnv.enable = true;
|
||||||
|
programs.direnv.stdlib = ''
|
||||||
|
# From https://github.com/direnv/direnv/wiki/Customizing-cache-location
|
||||||
|
: ''${XDG_CACHE_HOME:=$HOME/.cache}
|
||||||
|
declare -A direnv_layout_dirs
|
||||||
|
direnv_layout_dir() {
|
||||||
|
echo "''${direnv_layout_dirs[$PWD]:=$(
|
||||||
|
local path="''${PWD//[^a-zA-Z0-9]/-}"
|
||||||
|
echo "$XDG_CACHE_HOME/direnv/layouts/''${path:1}"
|
||||||
|
)}"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
||||||
6
nix/modules/emacs.nix
Normal file
6
nix/modules/emacs.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.emacs.enable = true;
|
||||||
|
programs.emacs.package = pkgs.emacs28NativeComp;
|
||||||
|
programs.emacs.extraPackages = epkgs: [ epkgs.vterm ];
|
||||||
|
}
|
||||||
49
nix/modules/git.nix
Normal file
49
nix/modules/git.nix
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
aliases = {
|
||||||
|
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
|
||||||
|
};
|
||||||
|
extraConfig = {
|
||||||
|
user.name = "Tim McCarthy";
|
||||||
|
user.email = "thoomfish@gmail.com";
|
||||||
|
color.ui = true;
|
||||||
|
init.defaultBranch = "main";
|
||||||
|
push.default = "simple";
|
||||||
|
pull.rebase = true;
|
||||||
|
transfer.fsckobjects = true;
|
||||||
|
credential.helper = "store";
|
||||||
|
};
|
||||||
|
|
||||||
|
ignores = [
|
||||||
|
".DS_Store"
|
||||||
|
".projectile"
|
||||||
|
".idea"
|
||||||
|
"*.sw?"
|
||||||
|
"*.pyc"
|
||||||
|
".#*"
|
||||||
|
".nrepl-port"
|
||||||
|
".rebel_readline_history"
|
||||||
|
".auctex-auto"
|
||||||
|
"*.synctex.gz"
|
||||||
|
".ccls-cache"
|
||||||
|
".lein-repl-history"
|
||||||
|
"ompile_commands.json"
|
||||||
|
"*.egg-info"
|
||||||
|
".envrc"
|
||||||
|
".vscode"
|
||||||
|
".direnv"
|
||||||
|
".ipynb_checkpoints"
|
||||||
|
"nfer-out"
|
||||||
|
".cache"
|
||||||
|
];
|
||||||
|
|
||||||
|
includes = [
|
||||||
|
{
|
||||||
|
condition = "gitdir/i:~/SRI/";
|
||||||
|
contents.user.email = "tim.mccarthy@sri.com";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user