-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
86 lines (73 loc) · 1.9 KB
/
default.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
{ config, pkgs, lib, sources, ... }:
with lib;
with builtins;
{
imports = [ ./modules ];
system = {
configurationRevision = getEnv "CKIE_CONFIG_REV";
nixos.revision = sources.nixpkgs.rev;
};
_module.args.sources = import ./nix/sources.nix;
time.timeZone = "Israel";
boot.loader.efi.canTouchEfiVariables = true;
boot.tmp.cleanOnBoot = true;
boot.tmp.useTmpfs = true;
networking.networkmanager.enable = true;
networking.firewall.logRefusedConnections =
false; # The joys of being on the public IPv4(?) internet
users.mutableUsers = false;
users.users.root = {
hashedPassword = (import ./secrets/unix-password.nix).root;
};
# Nasty obscure EBUSY errors will come without this
security.pam.loginLimits = [{
domain = "*";
type = "soft";
item = "nofile"; # max FD count
value = "unlimited";
}];
# Prune the journal to avoid this:
# $ du -sh /var/log/journal/
# 4.1G /var/log/journal/
services.journald.extraConfig = ''
SystemMaxUse=2G
MaxFileSec=40day
'';
environment.systemPackages = with pkgs; [
vim
wget
btop
ripgrep
smartmontools
sl # a reminder to not go too fast
]; # More in modules/big.nix. Don't add a lot!
cookie = {
# Daemons
services = {
ssh.enable = true;
tailscale.enable = mkDefault true;
};
# Etc
wireguard.enable = config.cookie.state.bootable;
binary-caches.enable = true;
nix.enable = true;
cookie-overlay.enable = true;
ipban.enable = true;
};
home-manager.users.ckie = { nixosConfig, pkgs, ... }: {
# for hmporter support
home.sessionVariables = rec {
TZ = let tz = nixosConfig.time.timeZone; in if tz == null then "" else tz;
EDITOR = "vim";
VISUAL = EDITOR;
};
cookie = {
shell = {
enable = true;
bash = true;
fish = true;
};
nixpkgs-config.enable = true;
};
};
}