1
0
Fork 0
dotfiles/system/hosts/attic.nix

140 lines
3 KiB
Nix
Raw Normal View History

2023-04-04 13:10:18 +00:00
args@{ pkgs, config, lib, ... }:
2023-04-04 12:35:49 +00:00
let
2023-04-04 15:20:09 +00:00
secret = import ../../secret/hosts/attic.nix;
2023-04-04 12:35:49 +00:00
ssh-keys = import ../shared/ssh-keys.nix;
in
{
imports = [
../../hardware/hosts/attic.nix
../../agenix/hosts/attic/config.nix
../nixos/ssh.nix
../nixos/git.nix
2023-04-04 13:05:39 +00:00
2023-04-04 20:05:11 +00:00
../nixos/acme-attic.nix
../nixos/nginx.nix
2023-04-04 18:20:09 +00:00
(import ../nixos/atticd.nix (args // { inherit secret; }))
2023-04-04 15:20:09 +00:00
2023-04-08 22:37:43 +00:00
(import ../nixos/home-proxy.nix (args // { inherit secret; }))
2023-04-04 13:05:39 +00:00
../nixos/tailscale.nix
2023-04-04 12:35:49 +00:00
];
system.stateVersion = "22.11";
nix = {
package = pkgs.nixVersions.stable;
settings = {
auto-optimise-store = true;
substituters = [
"https://nix-community.cachix.org"
"https://wurzelpfropf.cachix.org"
"https://nifoc.cachix.org"
2023-04-05 11:12:40 +00:00
"https://attic.cache.daniel.sx/nifoc-systems"
2023-04-04 12:35:49 +00:00
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"wurzelpfropf.cachix.org-1:ilZwK5a6wJqVr7Fyrzp4blIEkGK+LJT0QrpWr1qBNq0="
"nifoc.cachix.org-1:ymuftq7RgN/lf/iWXFK8gpwDSAGFaGBeliWe9u6q8II="
2023-04-05 11:12:40 +00:00
"nifoc-systems:eDDqVP5BFR6/1KvXbF9oUL8JahDdmbrsYtxlQ57LOTU="
2023-04-04 12:35:49 +00:00
];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
extraOptions = ''
experimental-features = nix-command flakes
extra-platforms = aarch64-linux
keep-derivations = true
keep-outputs = true
2023-04-05 11:12:40 +00:00
post-build-hook = ${../../home/programs/scripts/attic-system-cache}
2023-04-04 12:35:49 +00:00
'';
};
2023-04-05 11:12:40 +00:00
environment.etc."nix/netrc".source = ../../secret/shared/nix-netrc;
2023-04-04 12:35:49 +00:00
boot = {
cleanTmpDir = true;
binfmt.emulatedSystems = [ "aarch64-linux" ];
};
zramSwap.enable = true;
networking = {
hostName = "attic";
useNetworkd = true;
2023-04-10 20:13:54 +00:00
extraHosts = ''
127.0.0.1 attic.cache.daniel.sx
'';
2023-04-04 12:35:49 +00:00
};
systemd.network = {
enable = true;
networks = {
"10-wan" = {
2023-04-04 20:05:11 +00:00
matchConfig.Name = "enp1s0";
2023-04-04 12:35:49 +00:00
networkConfig = {
DHCP = "ipv4";
Address = "2a01:4f8:c0c:fa14::1/64";
Gateway = "fe80::1";
};
linkConfig.RequiredForOnline = "routable";
ntp = [
"ntp1.hetzner.de"
"ntp2.hetzner.com"
"ntp3.hetzner.net"
];
};
"20-private" = {
matchConfig.Name = "enp7s0";
networkConfig = {
DHCP = "ipv4";
IPv6AcceptRA = false;
};
linkConfig.RequiredForOnline = "yes";
};
};
};
services.journald.extraConfig = ''
SystemMaxUse=1G
'';
documentation = {
nixos.enable = false;
doc.enable = false;
};
programs.fish.enable = true;
users.users = {
root = {
openssh.authorizedKeys.keys = [ ssh-keys.Hetzner ];
};
daniel = {
passwordFile = config.age.secrets.user-daniel-password.path;
isNormalUser = true;
home = "/home/daniel";
description = "Daniel";
extraGroups = [ "wheel" ];
shell = pkgs.fish;
openssh.authorizedKeys.keys = [ ssh-keys.Hetzner ];
};
};
}