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