feat : bug
This commit is contained in:
parent
23a6282e6d
commit
8586884e4a
7 changed files with 38 additions and 13 deletions
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -82,16 +82,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766201043,
|
"lastModified": 1751274312,
|
||||||
"narHash": "sha256-eplAP+rorKKd0gNjV3rA6+0WMzb1X1i16F5m5pASnjA=",
|
"narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b3aad468604d3e488d627c0b43984eb60e75e782",
|
"rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-25.11",
|
"ref": "nixos-24.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
flake.nix
18
flake.nix
|
|
@ -2,13 +2,14 @@
|
||||||
description = "My homelab config";
|
description = "My homelab config";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||||
agenix.url = "github:ryantm/agenix";
|
agenix.url = "github:ryantm/agenix";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, agenix, ... }:
|
outputs = { self, nixpkgs, agenix, ... }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
lib = nixpkgs.lib;
|
||||||
mkHost = hostName: nixpkgs.lib.nixosSystem {
|
mkHost = hostName: nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit hostName; };
|
specialArgs = { inherit hostName; };
|
||||||
|
|
@ -16,13 +17,18 @@
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
(./. + "/host/hard-${hostName}.nix")
|
(./. + "/host/hard-${hostName}.nix")
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
{ networking.hostName = hostName; }
|
{
|
||||||
|
networking.hostName = hostName;
|
||||||
|
environment.systemPackages = [ agenix.packages.${system}.default ];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
hosts = [
|
||||||
|
"ThinkCentre-Server-004"
|
||||||
|
"VPS-Server-005"
|
||||||
|
];
|
||||||
|
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = lib.genAttrs hosts mkHost;
|
||||||
"ThinkCentre-Server-004" = mkHost "ThinkCentre-Server-004";
|
|
||||||
"VPS-Server-005" = mkHost "VPS-Server-005";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ let
|
||||||
module.searxng.enable = true;
|
module.searxng.enable = true;
|
||||||
module.acme.enable = true;
|
module.acme.enable = true;
|
||||||
module.newt.enable = true;
|
module.newt.enable = true;
|
||||||
|
module.forgejo.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ in {
|
||||||
./searXNG.nix
|
./searXNG.nix
|
||||||
./roundcube.nix
|
./roundcube.nix
|
||||||
./vaultWarden.nix
|
./vaultWarden.nix
|
||||||
|
./forgejo.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.module = {
|
options.module = {
|
||||||
|
|
@ -68,6 +69,14 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
forgejo = mkServiceOption {
|
||||||
|
desc = "Vaultwarden password manager";
|
||||||
|
extraOpts = {
|
||||||
|
externalPort = mkPortOption 3000;
|
||||||
|
internalPort = mkPortOption 8223;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
searxng = mkServiceOption {
|
searxng = mkServiceOption {
|
||||||
desc = "SearXNG meta-search engine";
|
desc = "SearXNG meta-search engine";
|
||||||
extraOpts = { port = mkPortOption 1692; };
|
extraOpts = { port = mkPortOption 1692; };
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ lib.mkIf config.module.forgejo.enable {
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
server = {
|
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.
|
# You need to specify this to remove the port from URLs in the web UI.
|
||||||
ROOT_URL = "https://${srv.DOMAIN}/";
|
ROOT_URL = "https://${srv.DOMAIN}/";
|
||||||
HTTP_PORT = 3000;
|
HTTP_PORT = 8222;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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 [
|
networking.firewall.allowedTCPPorts = concatLists [
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{ config,lib,pkgs, ... }:
|
{ config,lib,pkgs, ... }:
|
||||||
|
|
||||||
lib.mkIf config.module.roundcube.enable {
|
lib.mkIf config.module.searxng.enable {
|
||||||
services.searx = {
|
services.searx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
redisCreateLocally = true;
|
redisCreateLocally = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue