2024-12-19 12:56:45 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
2024-12-18 21:54:04 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
imports =
|
2024-12-19 14:52:34 +00:00
|
|
|
[
|
2024-12-18 21:54:04 +00:00
|
|
|
./hardware-configuration.nix
|
2024-12-19 14:47:58 +00:00
|
|
|
/var/src/modules/nixin.nix
|
|
|
|
/var/src/modules/users.nix
|
2024-12-18 21:54:04 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Bootloader.
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "arachnide"; # Define your hostname.
|
2024-12-19 16:14:56 +00:00
|
|
|
# primary network interface, connected to WAN through a router
|
2024-12-18 21:54:04 +00:00
|
|
|
interfaces.enp1s0.ipv4.addresses = [ {
|
|
|
|
address = "192.168.36.9";
|
|
|
|
prefixLength = 24;
|
|
|
|
} ];
|
2024-12-19 16:14:56 +00:00
|
|
|
defaultGateway = "192.168.36.1";
|
|
|
|
# secondary network interface connected to a private local network
|
2024-12-18 21:54:04 +00:00
|
|
|
interfaces.enp3s0.ipv4.addresses = [ {
|
|
|
|
address = "10.0.0.1";
|
|
|
|
prefixLength = 24;
|
|
|
|
} ];
|
|
|
|
nameservers = [ "80.67.169.12" "80.67.169.40" "2001:910:800::12" "2001:910:800::40" ];
|
|
|
|
enableIPv6 = true;
|
2024-12-19 16:14:56 +00:00
|
|
|
# wireguard VPN to be reachable from internet
|
2024-12-18 21:54:04 +00:00
|
|
|
wg-quick.interfaces = {
|
|
|
|
wg0 = {
|
|
|
|
address = [ "192.168.12.2/32" "2a01:4f9:1a:9a05::2/128" ];
|
|
|
|
dns = [ "80.67.169.12" "80.67.169.40" "2001:910:800::12" "2001:910:800::40" ];
|
2024-12-19 12:25:04 +00:00
|
|
|
privateKeyFile = "/var/src/secrets/wg-private.key";
|
2024-12-18 21:54:04 +00:00
|
|
|
|
|
|
|
peers = [
|
|
|
|
{
|
|
|
|
publicKey = "cUmp55I20JEhxr+RMmOsX+6U9kcDiAq3grnvzjQ642w=";
|
|
|
|
allowedIPs = [ "0.0.0.0/0" "::/0" ];
|
|
|
|
endpoint = "vpn.lab12.fr:51812";
|
|
|
|
persistentKeepalive = 15;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-12-19 16:14:56 +00:00
|
|
|
# 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.
|
|
|
|
# Or disable the firewall altogether.
|
|
|
|
# networking.firewall.enable = false;
|
|
|
|
networking.firewall.allowedTCPPorts = [ 80 144 443 ];
|
|
|
|
#networking.firewall.allowedUDPPorts = [ 53 ];
|
|
|
|
# allow UDP port range for mosh
|
|
|
|
networking.firewall.allowedUDPPortRanges = [
|
|
|
|
{ from = 60000; to = 61000; }
|
|
|
|
];
|
|
|
|
|
2024-12-18 21:54:04 +00:00
|
|
|
# Set your time zone.
|
|
|
|
time.timeZone = "Etc/UTC";
|
|
|
|
|
|
|
|
# Select internationalisation properties.
|
|
|
|
i18n.defaultLocale = "fr_FR.UTF-8";
|
|
|
|
|
|
|
|
i18n.extraLocaleSettings = {
|
|
|
|
LC_ADDRESS = "fr_FR.UTF-8";
|
|
|
|
LC_IDENTIFICATION = "fr_FR.UTF-8";
|
|
|
|
LC_MEASUREMENT = "fr_FR.UTF-8";
|
|
|
|
LC_MONETARY = "fr_FR.UTF-8";
|
|
|
|
LC_NAME = "fr_FR.UTF-8";
|
|
|
|
LC_NUMERIC = "fr_FR.UTF-8";
|
|
|
|
LC_PAPER = "fr_FR.UTF-8";
|
|
|
|
LC_TELEPHONE = "fr_FR.UTF-8";
|
|
|
|
LC_TIME = "fr_FR.UTF-8";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Configure console keymap
|
|
|
|
console.keyMap = "fr";
|
|
|
|
|
|
|
|
# Allow unfree packages
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
# $ nix search wget
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
|
|
|
git
|
|
|
|
wget
|
|
|
|
tmux
|
|
|
|
htop
|
|
|
|
mosh
|
|
|
|
dig
|
|
|
|
mtr
|
|
|
|
];
|
|
|
|
|
|
|
|
programs.neovim = {
|
|
|
|
enable = true;
|
|
|
|
viAlias = true;
|
|
|
|
vimAlias = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
# settings for stateful data, like file locations and database versions
|
2024-12-19 12:25:04 +00:00
|
|
|
# on your system were taken. It's perfectly fine and recommended to leave
|
2024-12-18 21:54:04 +00:00
|
|
|
# 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?
|
|
|
|
}
|