-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.nix
115 lines (99 loc) · 2.32 KB
/
common.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{ config, pkgs, ... }:
let
cfg = config.nielx;
in
{
imports =
[ ./nielx.nix
./packages_common.nix
];
nix = {
gc = {
automatic = true;
dates = "weekly";
};
settings.auto-optimise-store = true;
extraOptions = "experimental-features = nix-command flakes";
};
programs.ssh = {
startAgent = true;
extraConfig = "AddKeysToAgent yes"; # add keys on first ssh
agentTimeout = "24h";
askPassword = "${pkgs.ssh-askpass-fullscreen}/bin/ssh-askpass-fullscreen";
};
services.lorri.enable = true;
environment.systemPackages = [
pkgs.direnv
(pkgs.writeScriptBin "lorri-direnv-init" ''#!/bin/sh
echo 'eval "$(lorri direnv)"' > .envrc
direnv allow
'')
];
home-manager.useGlobalPkgs = true;
i18n.defaultLocale = "en_DK.UTF-8";
time.timeZone = "Europe/Copenhagen";
networking.hostName = cfg.hostname;
environment.etc."screenrc".text = ''
startup_message off
escape ^Ww
'';
programs.gnupg.agent = {
enable = true;
};
home-manager.users."${cfg.user}" = { pkgs, ... }: {
home.stateVersion = "18.09";
programs.bash = {
enable = true;
historySize = 50000;
};
home.file.".gnupg/gpg-agent.conf".text = ''
max-cache-ttl 86400
default-cache-ttl 86400
'';
programs.git = let
excludesFile = pkgs.writeText "global-gitignore" ''
.envrc
'';
in {
enable = true;
userName = cfg.fullName;
userEmail = cfg.email;
iniContent.pull.ff = "only";
signing = {
signByDefault = true;
key = cfg.gpgKey;
};
extraConfig = {
core = {
excludesfile = "${excludesFile}";
};
init = {
defaultBranch = "main";
};
};
};
};
programs.autojump.enable = true;
nielx = {
gpgKey = "38EEEBCE67324F19";
commonBash = ''
eval "$(direnv hook bash)"
if [ "$TERM" != "dumb" ]; then
ps1_date_color='1;34m'
ps1_prompt_color='${cfg.shellPromptColor}'
PS1="\[\033[$ps1_date_color\][\$(date +%R)] \[\033[$ps1_prompt_color\]\u@\h:\w\\$\[\033[0m\] "
fi
'';
commonShellAliases = {
".." = "cd ..";
"..." = "cd ../..";
"...." = "cd ../../..";
"....." = "cd ../../../..";
"mv" = "mv -n";
"dtrx" = "dtrx -n";
"duhst" = "du -hsc";
};
www.acmeSSL = true;
postfix_relayhost.enable = true;
};
}