photoprism-test-vm/configuration.nix

96 lines
2.2 KiB
Nix
Raw Normal View History

2024-11-03 16:17:02 +01:00
{ lib, pkgs, inputs, ... }:
2024-10-08 23:50:47 +02:00
2024-11-03 12:53:28 +01:00
let address = "129.199.146.101";
in
2024-10-08 23:50:47 +02:00
{
2024-10-09 17:07:27 +02:00
imports = [
./hardware.nix
2024-11-03 12:53:28 +01:00
# NOTE: For now, only deploy the bare minimum
2024-11-03 16:14:19 +01:00
./photoprism.nix
./immich.nix
];
2024-10-08 23:50:47 +02:00
# Bootloader.
boot.loader.systemd-boot.enable = true;
networking.hostName = "photoprism";
disko.devices = import ./disko.nix;
2024-11-03 16:14:19 +01:00
deployment.targetHost = address;
2024-10-08 23:50:47 +02:00
# Set your time zone.
time.timeZone = "Europe/Paris";
environment.systemPackages = with pkgs; [ neovim ];
services.openssh = {
enable = true;
settings = { PasswordAuthentication = false; };
};
2024-10-08 23:50:47 +02:00
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDMBW7rTtfZL9wtrpCVgariKdpN60/VeAzXkh9w3MwbO julien@enigma"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKrijwPlb7KQkYPLznMPVzPPT69cLzhEsJzZi9tmxzTh cst1@x270"
2024-10-08 23:50:47 +02:00
];
security.acme.acceptTerms = true;
security.acme.defaults.email = "webmaster@nixos.org";
networking.firewall.allowedTCPPorts = [ 22 80 443 8007 ];
2024-10-08 23:50:47 +02:00
networking.firewall.allowedUDPPorts = [ ];
networking.useNetworkd = true;
systemd.network = {
config.routeTables = {
he = 100;
mwan = 110;
};
networks = {
"10-ens18" = {
name = "ens18";
networkConfig = {
Description = "ENS uplink";
Address = [ "129.199.146.101/24" ];
Gateway = "129.199.146.254";
LLDP = true;
};
};
2024-10-08 23:50:47 +02:00
};
};
2024-10-14 14:53:27 +02:00
# TODO: switch to unixsockets if supported
services.nginx = {
enable = true;
2024-11-03 16:58:43 +01:00
recommendedTlsSettings = true;
recommendedOptimisation = true;
2024-10-14 14:53:27 +02:00
recommendedGzipSettings = true;
2024-11-03 16:58:43 +01:00
recommendedProxySettings = true;
clientMaxBodySize = "500m";
2024-10-14 14:53:27 +02:00
};
2024-11-03 16:58:05 +01:00
nix = {
2024-11-03 16:17:02 +01:00
settings = {
trusted-users = [ "@wheel" "root" "nix-ssh" ];
auto-optimise-store = true;
};
#package = pkgs.nixUnstable;
extraOptions = let
empty_registry = builtins.toFile "empty-flake-registry.json"
''{"flakes":[],"version":2}'';
in ''
experimental-features = nix-command flakes
flake-registry = ${empty_registry}
builders-use-substitutes = true
'';
registry.nixpkgs.flake = inputs.nixpkgs;
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
};
2024-10-14 14:53:27 +02:00
system.stateVersion = "24.05";
2024-10-08 23:50:47 +02:00
}