feat : bug

This commit is contained in:
Wateir 2025-12-23 17:53:37 +01:00
parent 23a6282e6d
commit 8586884e4a
7 changed files with 38 additions and 13 deletions

8
flake.lock generated
View file

@ -82,16 +82,16 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1766201043,
"narHash": "sha256-eplAP+rorKKd0gNjV3rA6+0WMzb1X1i16F5m5pASnjA=",
"lastModified": 1751274312,
"narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b3aad468604d3e488d627c0b43984eb60e75e782",
"rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.11",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}

View file

@ -2,13 +2,14 @@
description = "My homelab config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
agenix.url = "github:ryantm/agenix";
};
outputs = { self, nixpkgs, agenix, ... }:
let
system = "x86_64-linux";
lib = nixpkgs.lib;
mkHost = hostName: nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit hostName; };
@ -16,13 +17,18 @@
./configuration.nix
(./. + "/host/hard-${hostName}.nix")
agenix.nixosModules.default
{ networking.hostName = hostName; }
{
networking.hostName = hostName;
environment.systemPackages = [ agenix.packages.${system}.default ];
}
];
};
hosts = [
"ThinkCentre-Server-004"
"VPS-Server-005"
];
in {
nixosConfigurations = {
"ThinkCentre-Server-004" = mkHost "ThinkCentre-Server-004";
"VPS-Server-005" = mkHost "VPS-Server-005";
};
nixosConfigurations = lib.genAttrs hosts mkHost;
};
}

View file

@ -7,6 +7,7 @@ let
module.searxng.enable = true;
module.acme.enable = true;
module.newt.enable = true;
module.forgejo.enable = true;
};
};
in {

View file

@ -28,6 +28,7 @@ in {
./searXNG.nix
./roundcube.nix
./vaultWarden.nix
./forgejo.nix
];
options.module = {
@ -68,6 +69,14 @@ in {
};
};
forgejo = mkServiceOption {
desc = "Vaultwarden password manager";
extraOpts = {
externalPort = mkPortOption 3000;
internalPort = mkPortOption 8223;
};
};
searxng = mkServiceOption {
desc = "SearXNG meta-search engine";
extraOpts = { port = mkPortOption 1692; };

View file

@ -8,10 +8,10 @@ lib.mkIf config.module.forgejo.enable {
lfs.enable = true;
settings = {
server = {
DOMAIN = "git.example.com";
DOMAIN = "git.${config.module.domain}";
# You need to specify this to remove the port from URLs in the web UI.
ROOT_URL = "https://${srv.DOMAIN}/";
HTTP_PORT = 3000;
HTTP_PORT = 8222;
};
};
};

View file

@ -40,6 +40,15 @@ with lib;
};
};
})
(mkIf config.module.forgejo.enable {
"${config.module.hostName}-vault" = {
listen = [{ addr = "0.0.0.0"; port = config.module.forgejo.externalPort; }];
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.module.forgejo.internalPort}";
};
};
})
];
networking.firewall.allowedTCPPorts = concatLists [

View file

@ -1,6 +1,6 @@
{ config,lib,pkgs, ... }:
lib.mkIf config.module.roundcube.enable {
lib.mkIf config.module.searxng.enable {
services.searx = {
enable = true;
redisCreateLocally = true;