This commit is contained in:
Constantin Gierczak--Galle 2024-11-21 18:40:50 +01:00
parent a5c1974e86
commit 271fa9ec35
No known key found for this signature in database
4 changed files with 54 additions and 30 deletions

View file

@ -1,7 +1,12 @@
# TODO: revamp to use the same framework as the other VMs
{ lib, pkgs, inputs, ... }:
{
pkgs,
inputs,
...
}:
let address = "129.199.146.101";
let
address = "129.199.146.101";
in
{
imports = [
@ -28,7 +33,9 @@ in
services.openssh = {
enable = true;
settings = { PasswordAuthentication = false; };
settings = {
PasswordAuthentication = false;
};
};
users.users.root.openssh.authorizedKeys.keys = [
@ -39,7 +46,12 @@ in
security.acme.acceptTerms = true;
security.acme.defaults.email = "webmaster@nixos.org";
networking.firewall.allowedTCPPorts = [ 22 80 443 8007 ];
networking.firewall.allowedTCPPorts = [
22
80
443
8007
];
networking.firewall.allowedUDPPorts = [ ];
networking.useNetworkd = true;
@ -75,23 +87,26 @@ in
nix = {
settings = {
trusted-users = [ "@wheel" "root" "nix-ssh" ];
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
'';
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}" ];
};
system.stateVersion = "24.05";
}

View file

@ -3,8 +3,14 @@
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules =
[ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
@ -13,4 +19,3 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -9,8 +9,7 @@
services.nginx.virtualHosts."immich.cgiga.fr" = {
enableACME = true;
forceSSL = true;
serverAliases = [];
serverAliases = [ ];
locations."/".proxyPass = "http://localhost:2283/";
};
}

View file

@ -1,6 +1,10 @@
{ lib, modulesPath, pkgs, ... }:
{
pkgs,
...
}:
let port = 2342;
let
port = 2342;
in
{
services.photoprism = {
@ -32,22 +36,23 @@ in
dataDir = "/data/mysql";
package = pkgs.mariadb;
ensureDatabases = [ "photoprism" ];
ensureUsers = [{
name = "photoprism";
ensurePermissions = {
"photoprism.*" = "ALL PRIVILEGES";
};
}];
ensureUsers = [
{
name = "photoprism";
ensurePermissions = {
"photoprism.*" = "ALL PRIVILEGES";
};
}
];
};
services.nginx.virtualHosts."photoprism.cgiga.fr" = {
enableACME = true;
forceSSL = true;
serverAliases = [];
serverAliases = [ ];
locations."/" = {
proxyPass = "http://localhost:${toString port}/";
proxyWebsockets = true;
};
};
}