❄️ Dotfiles and NixOS configurations
1{
2 inputs,
3 pkgs,
4 ...
5}: {
6 imports = [
7 inputs.srvos.darwinModules.server
8 ../common/openssh.nix
9 ../common/remote-build-provider.nix
10 ];
11
12 system.stateVersion = 5;
13
14 programs.zsh.enable = true;
15 programs.zsh.enableCompletion = false;
16 programs.bash.enable = true;
17 programs.bash.completion.enable = true;
18
19 nix = {
20 package = pkgs.nix;
21 settings = {
22 "extra-experimental-features" = [
23 "nix-command"
24 "flakes"
25 ];
26 max-jobs = 4;
27 cores = 2;
28 };
29
30 gc = {
31 automatic = true;
32 interval = {
33 Minute = 15;
34 };
35 options = let
36 gbFree = 50;
37 in "--max-freed $((${toString gbFree} * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))";
38 };
39 # If we drop below 20GiB during builds, free 20GiB
40 extraOptions = ''
41 min-free = ${toString (30 * 1024 * 1024 * 1024)}
42 max-free = ${toString (50 * 1024 * 1024 * 1024)}
43 '';
44 };
45}