SSH updates
This commit is contained in:
parent
74545072dd
commit
57090ccde1
12 changed files with 96 additions and 59 deletions
7
users/_common/home_manager/_home_manager.nix
Normal file
7
users/_common/home_manager/_home_manager.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ settings, pkgs, lib, ylib, ... } @ args: {
|
||||
home.stateVersion = "23.11";
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
home.username = settings.user.username;
|
||||
home.homeDirectory = "/home/${settings.user.username}";
|
||||
}
|
44
users/_common/home_manager/direnv.nix
Normal file
44
users/_common/home_manager/direnv.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{ settings, ... }:
|
||||
{
|
||||
##### I want to hide the output but couldn't get either of these to work
|
||||
# home.sessionVariables = {
|
||||
# DIRENV_LOG_FORMAT = "";
|
||||
# };
|
||||
# programs.zsh.initExtra = ''
|
||||
# copy_function() {
|
||||
# test -n "$(declare -f "$1")" || return
|
||||
# eval "''${_/$1/$2}"
|
||||
# }
|
||||
# copy_function _direnv_hook _direnv_hook__old
|
||||
# _direnv_hook() {
|
||||
# # old line
|
||||
# #_direnv_hook__old "$@" 2> >(grep -E -v '^direnv: (export)')
|
||||
|
||||
# # my new line
|
||||
# _direnv_hook__old "$@" 2> >(awk '{if (length >= 200) { sub("^direnv: export.*","direnv: export "NF" environment variables")}}1')
|
||||
|
||||
# # as suggested by user "radekh" above
|
||||
# wait
|
||||
|
||||
# # as suggested by user "Ic-guy" below if you're using bash > v4.4
|
||||
# # throws error for me on zsh
|
||||
# # wait $!
|
||||
# }
|
||||
# '';
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
config = {
|
||||
nix-direnv = true;
|
||||
global = {
|
||||
strict_env = true;
|
||||
load_dotenv = true;
|
||||
hide_env_diff = true;
|
||||
};
|
||||
whitelist = {
|
||||
prefix = [ "~/projects" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
58
users/_common/home_manager/git.nix
Normal file
58
users/_common/home_manager/git.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{ settings, ... }:
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userEmail = settings.user.git.email;
|
||||
userName = settings.user.git.name;
|
||||
|
||||
extraConfig = {
|
||||
core.pager = "cat";
|
||||
core.editor = "nvim";
|
||||
|
||||
pull.rebase = false;
|
||||
};
|
||||
|
||||
difftastic = {
|
||||
enable = true;
|
||||
background = "dark";
|
||||
};
|
||||
|
||||
# TODO move from common system? Need root user home managed too...
|
||||
# aliases: {}
|
||||
|
||||
ignores = [
|
||||
# --------------
|
||||
# Intellij
|
||||
# --------------
|
||||
"*.iml"
|
||||
# --------------
|
||||
# MAC OS
|
||||
# --------------
|
||||
".DS_Store"
|
||||
".AppleDouble"
|
||||
".LSOverride"
|
||||
# Icon must end with two \r
|
||||
"Icon"
|
||||
# Thumbnails
|
||||
"._*"
|
||||
# Files that might appear in the root of a volume
|
||||
".DocumentRevisions-V100"
|
||||
".fseventsd"
|
||||
".Spotlight-V100"
|
||||
".TemporaryItems"
|
||||
".Trashes"
|
||||
".VolumeIcon.icns"
|
||||
".com.apple.timemachine.donotpresent"
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
".AppleDB"
|
||||
".AppleDesktop"
|
||||
"Network Trash Folder"
|
||||
"Temporary Items"
|
||||
".apdisk"
|
||||
|
||||
# direnv things
|
||||
"/.direnv"
|
||||
];
|
||||
};
|
||||
}
|
15
users/_common/home_manager/ssh.nix
Normal file
15
users/_common/home_manager/ssh.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ age, ... }:
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
matchBlocks = {
|
||||
"github.com" = {
|
||||
identityFile = age.secrets.nix2github.path;
|
||||
};
|
||||
"bitbucket.org" = {
|
||||
identityFile = age.secrets.nix2bitbucket.path;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue