feat(web/portefolio): adding the portefolio configuration to self host
This commit is contained in:
parent
def9e16c65
commit
54080cfa18
3 changed files with 71 additions and 0 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
../../modules/games/global.nix
|
../../modules/games/global.nix
|
||||||
../../services/discord.nix
|
../../services/discord.nix
|
||||||
../../services/games.nix
|
../../services/games.nix
|
||||||
|
../../services/web.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
|
|
@ -17,6 +18,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
service = {
|
service = {
|
||||||
|
web.portefolio = true;
|
||||||
minecraft = {
|
minecraft = {
|
||||||
enium-pv = false;
|
enium-pv = false;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
21
services/web.nix
Normal file
21
services/web.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ inputs, config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
portefolio = import ./web/portefolio.nix {
|
||||||
|
inherit inputs config pkgs lib;
|
||||||
|
};
|
||||||
|
cfg = config.service.web;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
portefolio
|
||||||
|
];
|
||||||
|
|
||||||
|
options.service.web = {
|
||||||
|
portefolio = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable the portefolio";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
48
services/web/portefolio.nix
Normal file
48
services/web/portefolio.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.service.web.portefolio;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nodejs
|
||||||
|
pnpm
|
||||||
|
];
|
||||||
|
users = {
|
||||||
|
groups.web_portefolio = {
|
||||||
|
name = "web_portefolio";
|
||||||
|
};
|
||||||
|
users.web_portefolio = {
|
||||||
|
description = "Utilisateur pour le bot BDE";
|
||||||
|
group = "web_portefolio";
|
||||||
|
home = "/opt/portefolio/";
|
||||||
|
isSystemUser = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
virtualHosts."raphael.parodi.pro" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
root = "/opt/portefolio/dist";
|
||||||
|
index = "index.html";
|
||||||
|
extraConfig = ''
|
||||||
|
try_files $uri /index.html;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
security.acme = {
|
||||||
|
acceptTerms = true;
|
||||||
|
email = "raphael@parodi.pro";
|
||||||
|
certs = {
|
||||||
|
"raphael.parodi.pro" = {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue