feat(server): forgejo config
This commit is contained in:
parent
3caac1a07e
commit
02c1a6d037
2 changed files with 55 additions and 3 deletions
|
|
@ -1,15 +1,25 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ ./disk-config.nix ];
|
imports = [
|
||||||
|
./disk-config.nix
|
||||||
|
./hardware-configuration.nix
|
||||||
|
(modulesPath + "/profiles/minimal.nix")
|
||||||
|
(modulesPath + "/profiles/headless.nix")
|
||||||
|
];
|
||||||
|
|
||||||
boot.loader.grub = {
|
boot.loader.grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
efiSupport = true;
|
efiSupport = true;
|
||||||
efiInstallAsRemovable = true;
|
efiInstallAsRemovable = true;
|
||||||
device = "nodev";
|
device = "nodev";
|
||||||
|
configurationLimit = 3;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
documentation.enable = false;
|
||||||
|
hardware.enableRedistributableFirmware = false;
|
||||||
|
fonts.fontconfig.enable = false;
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "netcup";
|
hostName = "netcup";
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
|
|
@ -93,16 +103,29 @@
|
||||||
|
|
||||||
services.forgejo = {
|
services.forgejo = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
user = "git";
|
||||||
|
group = "git";
|
||||||
settings = {
|
settings = {
|
||||||
server = {
|
server = {
|
||||||
DOMAIN = "git.barrettruth.com";
|
DOMAIN = "git.barrettruth.com";
|
||||||
ROOT_URL = "https://git.barrettruth.com/";
|
ROOT_URL = "https://git.barrettruth.com/";
|
||||||
HTTP_PORT = 3000;
|
HTTP_PORT = 3000;
|
||||||
|
SSH_DOMAIN = "git.barrettruth.com";
|
||||||
};
|
};
|
||||||
service.DISABLE_REGISTRATION = true;
|
service.DISABLE_REGISTRATION = true;
|
||||||
|
session.COOKIE_SECURE = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.users.git = {
|
||||||
|
isSystemUser = true;
|
||||||
|
home = "/var/lib/forgejo";
|
||||||
|
group = "git";
|
||||||
|
shell = "${pkgs.bash}/bin/bash";
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.git = { };
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
vim
|
vim
|
||||||
git
|
git
|
||||||
|
|
@ -119,8 +142,13 @@
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
options = "--delete-older-than 7d";
|
options = "--delete-older-than 3d";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nix.extraOptions = ''
|
||||||
|
min-free = ${toString (100 * 1024 * 1024)}
|
||||||
|
max-free = ${toString (1024 * 1024 * 1024)}
|
||||||
|
'';
|
||||||
|
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
24
hosts/netcup/hardware-configuration.nix
Normal file
24
hosts/netcup/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.ens3.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue