105 lines
3 KiB
Nix
105 lines
3 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
imports =
|
|
[
|
|
./hardware-configuration.nix
|
|
/var/src/modules/nixin-base.nix
|
|
/var/src/modules/users.nix
|
|
/var/src/modules/wireguard-client.nix
|
|
/var/src/modules/reverse-proxy.nix
|
|
/var/src/modules/nginx.nix
|
|
/var/src/modules/nixin-web.nix
|
|
/var/src/modules/forgejo.nix
|
|
/var/src/modules/forgejo-runner.nix
|
|
];
|
|
|
|
# Bootloader.
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
networking = {
|
|
hostName = "arachnide"; # Define your hostname.
|
|
# primary network interface, connected to WAN through a router
|
|
interfaces.enp1s0.ipv4.addresses = [ {
|
|
address = "192.168.36.9";
|
|
prefixLength = 24;
|
|
} ];
|
|
defaultGateway = "192.168.36.1";
|
|
# secondary network interface connected to a private local network
|
|
interfaces.enp3s0.ipv4.addresses = [ {
|
|
address = "10.0.0.1";
|
|
prefixLength = 24;
|
|
} ];
|
|
};
|
|
|
|
nixin.wg.client = {
|
|
ipv4 = "192.168.12.2/32";
|
|
ipv6 = "2a01:4f9:1a:9a05::2/128";
|
|
};
|
|
|
|
nixin.web = {
|
|
domain = "nixin.lab12.fr";
|
|
http-port = 8081;
|
|
};
|
|
|
|
nixin.forge = {
|
|
http-port = 8082;
|
|
domain = "forge.lab12.fr";
|
|
smtp-addr = "lab12.org";
|
|
smtp-user = "mr.robot@lab12.org";
|
|
smtp-from = "no-reply@lab12.org";
|
|
smtp-pwd-file = toString <secrets/smtp>;
|
|
#smtp-pwd = let
|
|
# pwd = builtins.readFile <secrets/smtp>;
|
|
#in lib.strings.trim pwd;
|
|
admin-email = "sysadmin@lab12.fr";
|
|
admin-user = "operator";
|
|
admin-pwd = let
|
|
pwd = builtins.readFile <secrets/forgejo>;
|
|
in lib.strings.trim pwd;
|
|
};
|
|
|
|
nixin.forge-runner = {
|
|
token-file = "/etc/forgejo/runner.token";
|
|
#token = let
|
|
# pwd = builtins.readFile <secrets/forgejo-runner-token>;
|
|
#in lib.strings.trim pwd;
|
|
url = "https://forge.lab12.fr";
|
|
};
|
|
|
|
|
|
# Enable ip forwarding to route packets for the local network connected to enp3s0
|
|
boot.kernel.sysctl = {
|
|
"net.ipv4.ip_forward" = 1;
|
|
"net.ipv6.conf.all.forwarding" = 1;
|
|
};
|
|
|
|
# Open ports in the firewall.
|
|
networking.firewall.allowedTCPPorts = [ 80 144 443 ];
|
|
#networking.firewall.allowedUDPPorts = [ 53 ];
|
|
# allow UDP port range for mosh
|
|
networking.firewall.allowedUDPPortRanges = [
|
|
{ from = 60000; to = 61000; }
|
|
];
|
|
# Or disable the firewall altogether.
|
|
# networking.firewall.enable = false;
|
|
|
|
# Configure console keymap
|
|
console.keyMap = "fr";
|
|
|
|
# Allow unfree packages
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
mtr
|
|
];
|
|
|
|
# This value determines the NixOS release from which the default
|
|
# settings for stateful data, like file locations and database versions
|
|
# on your system were taken. It's perfectly fine and recommended to leave
|
|
# this value at the release version of the first install of this system.
|
|
# Before changing this value read the documentation for this option
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
system.stateVersion = "24.05"; # Did you read the comment?
|
|
}
|