updates; add forgejo
This commit is contained in:
parent
7d42965a0a
commit
e591a7a60c
3 changed files with 96 additions and 22 deletions
|
|
@ -2,7 +2,13 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
{ config, lib, pkgs, specialArgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
specialArgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
|
@ -18,7 +24,10 @@
|
||||||
# Bootloader and kernel
|
# Bootloader and kernel
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
boot.kernelParams = [ "vga=791" "nomodeset" ];
|
boot.kernelParams = [
|
||||||
|
"vga=791"
|
||||||
|
"nomodeset"
|
||||||
|
];
|
||||||
boot.kernel.sysctl = {
|
boot.kernel.sysctl = {
|
||||||
"net.ipv4.ip_forward" = 1;
|
"net.ipv4.ip_forward" = 1;
|
||||||
# "net.bridge.bridge-nf-call-iptables" = 1;
|
# "net.bridge.bridge-nf-call-iptables" = 1;
|
||||||
|
|
@ -36,14 +45,22 @@
|
||||||
# Networking
|
# Networking
|
||||||
networking.hostName = "nixos-server";
|
networking.hostName = "nixos-server";
|
||||||
networking.useDHCP = false;
|
networking.useDHCP = false;
|
||||||
networking.interfaces.eth0.ipv4.addresses = [{
|
networking.interfaces.eth0.ipv4.addresses = [
|
||||||
|
{
|
||||||
address = "192.168.69.69";
|
address = "192.168.69.69";
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
networking.defaultGateway = "192.168.69.1";
|
networking.defaultGateway = "192.168.69.1";
|
||||||
networking.nameservers = [ "1.1.1.1" ];
|
networking.nameservers = [ "1.1.1.1" ];
|
||||||
networking.firewall.enable = true;
|
networking.firewall.enable = true;
|
||||||
networking.firewall.allowedTCPPorts = [ 22 80 443 9000 ];
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
22
|
||||||
|
80
|
||||||
|
443
|
||||||
|
3000
|
||||||
|
9000
|
||||||
|
];
|
||||||
|
|
||||||
# Users
|
# Users
|
||||||
users.users.root = {
|
users.users.root = {
|
||||||
|
|
@ -86,7 +103,10 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
# Nix settings
|
# Nix settings
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
|
|
@ -112,8 +132,6 @@
|
||||||
#
|
#
|
||||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||||
|
|
||||||
|
|
||||||
system.configurationRevision = lib.mkIf (specialArgs.inputs.self ? rev) specialArgs.inputs.self.rev;
|
system.configurationRevision = lib.mkIf (specialArgs.inputs.self ? rev) specialArgs.inputs.self.rev;
|
||||||
system.stateVersion = "25.05"; # Did you read the comment?
|
system.stateVersion = "25.05"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
12
flake.lock
generated
12
flake.lock
generated
|
|
@ -20,11 +20,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752950548,
|
"lastModified": 1761907660,
|
||||||
"narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=",
|
"narHash": "sha256-kJ8lIZsiPOmbkJypG+B5sReDXSD1KGu2VEPNqhRa/ew=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c87b95e25065c028d31a94f06a62927d18763fdf",
|
"rev": "2fb006b87f04c4d3bdf08cfdbc7fab9c13d94a15",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -75,11 +75,11 @@
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750353031,
|
"lastModified": 1753541826,
|
||||||
"narHash": "sha256-Bx7DOPLhkr8Z60U9Qw4l0OidzHoqLDKQH5rDV5ef59A=",
|
"narHash": "sha256-foGgZu8+bCNIGeuDqQ84jNbmKZpd+JvnrL2WlyU4tuU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixos-vscode-server",
|
"repo": "nixos-vscode-server",
|
||||||
"rev": "4ec4859b12129c0436b0a471ed1ea6dd8a317993",
|
"rev": "6d5f074e4811d143d44169ba4af09b20ddb6937d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
68
services.nix
68
services.nix
|
|
@ -1,10 +1,20 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.forgejo;
|
||||||
|
srv = cfg.settings.server;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
defaults.email = "mail@kempinger.xyz"; # Replace with your email
|
defaults.email = "mail@kempinger.xyz";
|
||||||
|
certs."kempinger.at".domain = "*.kempinger.at";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.resolved.enable = true;
|
services.resolved.enable = true;
|
||||||
|
|
@ -17,18 +27,64 @@
|
||||||
virtualHosts."192.168.69.69" = {
|
virtualHosts."192.168.69.69" = {
|
||||||
default = true;
|
default = true;
|
||||||
root = "/srv/website/public_html";
|
root = "/srv/website/public_html";
|
||||||
locations."/" = { index = "index.html"; };
|
locations."/" = {
|
||||||
|
index = "index.html";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
# Optional: Add a domain-based virtual host
|
|
||||||
virtualHosts."kempinger.at" = {
|
virtualHosts."kempinger.at" = {
|
||||||
root = "/srv/website/public_html";
|
root = "/srv/website/public_html";
|
||||||
locations."/" = { index = "index.html"; };
|
locations."/" = {
|
||||||
|
index = "index.html";
|
||||||
|
};
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
};
|
};
|
||||||
|
virtualHosts.${cfg.settings.server.DOMAIN} = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
extraConfig = ''
|
||||||
|
client_max_body_size 512M;
|
||||||
|
'';
|
||||||
|
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.forgejo = {
|
||||||
|
enable = true;
|
||||||
|
database.type = "postgres";
|
||||||
|
# Enable support for Git Large File Storage
|
||||||
|
lfs.enable = true;
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
DOMAIN = "git.kempinger.at";
|
||||||
|
# You need to specify this to remove the port from URLs in the web UI.
|
||||||
|
ROOT_URL = "https://${srv.DOMAIN}/";
|
||||||
|
HTTP_PORT = 3000;
|
||||||
|
};
|
||||||
|
# You can temporarily allow registration to create an admin user.
|
||||||
|
service.DISABLE_REGISTRATION = true;
|
||||||
|
# Add support for actions, based on act: https://github.com/nektos/act
|
||||||
|
actions = {
|
||||||
|
ENABLED = true;
|
||||||
|
DEFAULT_ACTIONS_URL = "github";
|
||||||
|
};
|
||||||
|
# Sending emails is completely optional
|
||||||
|
# You can send a test email from the web UI at:
|
||||||
|
# Profile Picture > Site Administration > Configuration > Mailer Configuration
|
||||||
|
# mailer = {
|
||||||
|
# ENABLED = true;
|
||||||
|
# SMTP_ADDR = "mail.kempinger.at";
|
||||||
|
# FROM = "noreply@${srv.DOMAIN}";
|
||||||
|
# USER = "noreply@${srv.DOMAIN}";
|
||||||
|
# };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.vscode-server.enable = true;
|
# systemd.services.forgejo.preStart =
|
||||||
|
# ''
|
||||||
|
# ${lib.getExe cfg.package} admin user create --admin --email "root@localhost" --username crazychaoz --password temp123 || true
|
||||||
|
# '';
|
||||||
|
|
||||||
|
#services.vscode-server.enable = true;
|
||||||
|
|
||||||
# Virtualisation
|
# Virtualisation
|
||||||
virtualisation.docker = {
|
virtualisation.docker = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue