feat(snipe-it): install snipe-it

This commit is contained in:
Khaïs COLIN 2024-08-18 14:13:08 +02:00
parent 9c0bf2a2df
commit 15eb4ea12f
4 changed files with 40 additions and 1 deletions

View file

@ -3,7 +3,9 @@
paths = [ paths = [
# server storage # server storage
"/var/lib/postgresql" "/var/lib/postgresql"
"/var/lib/mysql"
"/var/lib/sourcehut" "/var/lib/sourcehut"
"/var/lib/snipe-it"
# user storage # user storage
"/home" "/home"
]; ];

View file

@ -8,6 +8,7 @@
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./sourcehut.nix ./sourcehut.nix
./snipeit.nix
./borgbackup.nix ./borgbackup.nix
]; ];
@ -21,6 +22,8 @@
127.0.0.1 meta.sourcehut.nixos.local 127.0.0.1 meta.sourcehut.nixos.local
127.0.0.1 man.sourcehut.nixos.local 127.0.0.1 man.sourcehut.nixos.local
127.0.0.1 git.sourcehut.nixos.local 127.0.0.1 git.sourcehut.nixos.local
127.0.0.1 snipe-it.nixos.local
''; '';
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.

34
nixos/snipeit.nix Normal file
View file

@ -0,0 +1,34 @@
let
snipeit-fqdn = "snipe-it.nixos.local";
in
{ pkgs, ... }:
{
services.snipe-it = {
enable = true;
appKeyFile = "/etc/nixos/secrets/snipe-it/appkey";
appURL = "https://${snipeit-fqdn}";
hostName = snipeit-fqdn;
database = {
user = "snipeit";
};
nginx = {
sslCertificate = "/etc/nixos/secrets/certs/snipe-it.nixos.local.crt";
sslCertificateKey = "/etc/nixos/secrets/certs/snipe-it.nixos.local.key";
forceSSL = true;
kTLS = true;
};
};
services.mysql = {
enable = true;
package = pkgs.mariadb;
ensureUsers = [
{
name = "snipeit";
ensurePermissions = {
"snipeit.*" = "ALL PRIVILEGES";
};
}
];
ensureDatabases = [ "snipeit" ];
};
}

View file

@ -91,7 +91,7 @@ in
services.nginx = { services.nginx = {
enable = true; enable = true;
recommendedTlsSettings = false; recommendedTlsSettings = true;
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedGzipSettings = true; recommendedGzipSettings = true;
recommendedProxySettings = true; recommendedProxySettings = true;