2022-08-09 19:14:56 +02:00
|
|
|
args@{ pkgs, lib, ... }:
|
2022-07-30 18:19:49 +02:00
|
|
|
|
2022-07-30 22:55:19 +02:00
|
|
|
let
|
2022-08-09 19:14:22 +02:00
|
|
|
inherit (lib) optionals;
|
|
|
|
|
2022-07-30 22:55:19 +02:00
|
|
|
secret = import ../../secret/hosts/sail.nix;
|
2022-07-31 20:33:19 +02:00
|
|
|
ssh-keys = import ../shared/ssh-keys.nix;
|
2022-07-30 22:55:19 +02:00
|
|
|
in
|
2022-07-30 18:19:49 +02:00
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
../../hardware/hosts/sail.nix
|
2023-02-05 17:51:04 +01:00
|
|
|
../../agenix/hosts/sail/config.nix
|
2022-07-30 19:49:04 +02:00
|
|
|
../nixos/ssh.nix
|
|
|
|
|
|
|
|
../nixos/git.nix
|
2022-11-29 15:17:23 +01:00
|
|
|
|
2023-03-05 23:02:49 +01:00
|
|
|
../nixos/acme-sail.nix
|
2023-03-05 23:51:30 +01:00
|
|
|
../nixos/nginx.nix
|
2023-03-05 23:02:49 +01:00
|
|
|
|
2023-02-27 17:53:15 +01:00
|
|
|
../nixos/atuin-sync.nix
|
2023-02-27 17:51:39 +01:00
|
|
|
|
2023-04-05 13:12:40 +02:00
|
|
|
../nixos/attic.nix
|
|
|
|
|
2023-02-15 22:04:11 +01:00
|
|
|
../nixos/anonymous-overflow.nix
|
2023-02-15 20:35:46 +01:00
|
|
|
|
2023-01-24 14:33:54 +01:00
|
|
|
(import ../nixos/freshrss.nix (args // { inherit secret; }))
|
|
|
|
|
2023-03-20 13:49:46 +01:00
|
|
|
../nixos/invidious.nix
|
|
|
|
|
2023-03-05 23:51:30 +01:00
|
|
|
(import ../nixos/libreddit.nix (args // { inherit secret; }))
|
2023-02-12 22:13:30 +01:00
|
|
|
|
2022-11-29 15:17:23 +01:00
|
|
|
(import ../nixos/mastodon.nix (args // { inherit secret; }))
|
|
|
|
|
2023-03-06 09:55:28 +01:00
|
|
|
(import ../nixos/nitter.nix (args // { inherit secret; }))
|
2023-02-13 19:44:04 +01:00
|
|
|
|
2023-02-18 20:54:15 +01:00
|
|
|
(import ../nixos/ntfy-sh.nix (args // { inherit secret; }))
|
|
|
|
|
2023-03-05 19:22:15 +01:00
|
|
|
../nixos/rimgo.nix
|
|
|
|
|
2023-02-05 23:25:57 +01:00
|
|
|
../nixos/synapse.nix
|
2022-11-29 15:17:23 +01:00
|
|
|
|
2023-03-06 12:06:59 +01:00
|
|
|
../nixos/websites-sail.nix
|
2022-12-01 15:51:08 +01:00
|
|
|
|
2023-04-04 15:05:39 +02:00
|
|
|
../nixos/tailscale.nix
|
2022-07-30 20:17:39 +02:00
|
|
|
|
2023-03-17 22:05:18 +01:00
|
|
|
../nixos/mosquitto.nix
|
|
|
|
|
2023-03-19 15:51:22 +01:00
|
|
|
../nixos/container.nix
|
2023-03-17 21:58:31 +01:00
|
|
|
../../container/weewx
|
2022-11-27 19:53:13 +01:00
|
|
|
../../container/matrix
|
2023-02-28 14:55:57 +01:00
|
|
|
../../container/proxitok
|
2022-07-30 18:19:49 +02:00
|
|
|
];
|
|
|
|
|
2022-12-25 22:13:07 +01:00
|
|
|
system.stateVersion = "22.11";
|
|
|
|
|
2022-07-30 18:19:49 +02:00
|
|
|
nix = {
|
2022-09-26 15:23:14 +02:00
|
|
|
package = pkgs.nixVersions.stable;
|
2022-07-30 18:19:49 +02:00
|
|
|
|
2022-08-05 11:37:45 +02:00
|
|
|
settings = {
|
|
|
|
auto-optimise-store = true;
|
2022-07-30 18:19:49 +02:00
|
|
|
|
2022-08-05 11:37:45 +02:00
|
|
|
substituters = [
|
|
|
|
"https://nix-community.cachix.org"
|
2023-03-01 14:34:08 +01:00
|
|
|
"https://wurzelpfropf.cachix.org"
|
2022-08-06 11:17:13 +02:00
|
|
|
"https://nifoc.cachix.org"
|
2023-04-05 13:12:40 +02:00
|
|
|
"https://attic.cache.daniel.sx/nifoc-systems"
|
2022-08-05 11:37:45 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
trusted-public-keys = [
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
2023-03-01 14:34:08 +01:00
|
|
|
"wurzelpfropf.cachix.org-1:ilZwK5a6wJqVr7Fyrzp4blIEkGK+LJT0QrpWr1qBNq0="
|
2022-08-06 11:17:13 +02:00
|
|
|
"nifoc.cachix.org-1:ymuftq7RgN/lf/iWXFK8gpwDSAGFaGBeliWe9u6q8II="
|
2023-04-05 13:12:40 +02:00
|
|
|
"nifoc-systems:eDDqVP5BFR6/1KvXbF9oUL8JahDdmbrsYtxlQ57LOTU="
|
2022-08-05 11:37:45 +02:00
|
|
|
];
|
|
|
|
};
|
2022-07-30 18:19:49 +02:00
|
|
|
|
2022-08-18 23:12:16 +02:00
|
|
|
gc = {
|
|
|
|
automatic = true;
|
|
|
|
dates = "weekly";
|
|
|
|
options = "--delete-older-than 14d";
|
|
|
|
};
|
|
|
|
|
2022-07-30 18:19:49 +02:00
|
|
|
extraOptions = ''
|
|
|
|
experimental-features = nix-command flakes
|
2022-08-07 17:54:05 +02:00
|
|
|
extra-platforms = aarch64-linux
|
2022-07-30 18:19:49 +02:00
|
|
|
keep-derivations = true
|
|
|
|
keep-outputs = true
|
2023-04-05 13:12:40 +02:00
|
|
|
post-build-hook = ${../../home/programs/scripts/attic-system-cache}
|
2022-07-30 18:19:49 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-04-05 13:12:40 +02:00
|
|
|
environment.etc."nix/netrc".source = ../../secret/shared/nix-netrc;
|
|
|
|
|
2022-08-07 17:54:05 +02:00
|
|
|
boot = {
|
|
|
|
cleanTmpDir = true;
|
|
|
|
|
|
|
|
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
|
|
|
};
|
2022-07-30 18:19:49 +02:00
|
|
|
|
|
|
|
zramSwap.enable = true;
|
|
|
|
|
2023-03-28 21:50:32 +02:00
|
|
|
networking = {
|
|
|
|
hostName = "sail";
|
|
|
|
useNetworkd = true;
|
|
|
|
};
|
|
|
|
|
2023-03-28 17:42:22 +02:00
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
networks = {
|
|
|
|
"10-wan" = {
|
|
|
|
matchConfig.Name = "enp1s0";
|
|
|
|
networkConfig = {
|
2023-03-28 18:25:45 +02:00
|
|
|
DHCP = "ipv4";
|
|
|
|
Address = "2a01:4f8:c2c:989c::1/64";
|
|
|
|
Gateway = "fe80::1";
|
2023-03-28 17:42:22 +02:00
|
|
|
};
|
|
|
|
linkConfig.RequiredForOnline = "routable";
|
|
|
|
|
|
|
|
ntp = [
|
|
|
|
"ntp1.hetzner.de"
|
|
|
|
"ntp2.hetzner.com"
|
|
|
|
"ntp3.hetzner.net"
|
2023-02-03 23:52:44 +01:00
|
|
|
];
|
|
|
|
};
|
2023-02-03 23:36:20 +01:00
|
|
|
|
2023-03-28 17:42:22 +02:00
|
|
|
"20-private" = {
|
|
|
|
matchConfig.Name = "enp7s0";
|
2023-03-28 18:14:46 +02:00
|
|
|
networkConfig = {
|
|
|
|
DHCP = "ipv4";
|
|
|
|
IPv6AcceptRA = false;
|
|
|
|
};
|
2023-03-28 19:20:58 +02:00
|
|
|
linkConfig.RequiredForOnline = "yes";
|
2023-03-28 17:42:22 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-07-31 15:21:51 +02:00
|
|
|
|
2022-12-01 22:48:43 +01:00
|
|
|
services.journald.extraConfig = ''
|
|
|
|
SystemMaxUse=1G
|
|
|
|
'';
|
|
|
|
|
2023-02-23 21:41:41 +01:00
|
|
|
documentation = {
|
|
|
|
nixos.enable = false;
|
|
|
|
doc.enable = false;
|
|
|
|
};
|
2022-10-24 13:19:23 +02:00
|
|
|
|
2022-08-01 12:24:30 +02:00
|
|
|
programs.fish.enable = true;
|
|
|
|
|
2022-07-31 20:33:19 +02:00
|
|
|
users.users = {
|
|
|
|
root = {
|
|
|
|
openssh.authorizedKeys.keys = [ ssh-keys.Hetzner ];
|
|
|
|
};
|
|
|
|
|
|
|
|
daniel = {
|
2022-12-01 22:48:43 +01:00
|
|
|
inherit (secret.users.daniel) hashedPassword;
|
2022-07-31 20:33:19 +02:00
|
|
|
isNormalUser = true;
|
|
|
|
home = "/home/daniel";
|
|
|
|
description = "Daniel";
|
|
|
|
extraGroups = [ "wheel" ];
|
2022-08-01 12:24:30 +02:00
|
|
|
shell = pkgs.fish;
|
2022-07-31 20:33:19 +02:00
|
|
|
openssh.authorizedKeys.keys = [ ssh-keys.Hetzner ];
|
|
|
|
};
|
|
|
|
};
|
2022-07-30 18:19:49 +02:00
|
|
|
}
|