196 lines
5.6 KiB
Nix
196 lines
5.6 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
imports =
|
|
[ # Include the results of the hardware scan.
|
|
./hardware-configuration.nix
|
|
];
|
|
|
|
# Bootloader.
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
# Set NIX_PATH to use nixpkgs deployed with krops
|
|
environment.variables.NIX_PATH = lib.mkForce "/var/src";
|
|
|
|
networking = {
|
|
hostName = "arachnide"; # Define your hostname.
|
|
# Pick only one of the below networking options.
|
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
|
interfaces.enp1s0.ipv4.addresses = [ {
|
|
address = "192.168.36.9";
|
|
prefixLength = 24;
|
|
} ];
|
|
interfaces.enp3s0.ipv4.addresses = [ {
|
|
address = "10.0.0.1";
|
|
prefixLength = 24;
|
|
} ];
|
|
defaultGateway = "192.168.36.1";
|
|
nameservers = [ "80.67.169.12" "80.67.169.40" "2001:910:800::12" "2001:910:800::40" ];
|
|
enableIPv6 = true;
|
|
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" ];
|
|
privateKeyFile = "/var/src/secrets/wg-private.key";
|
|
|
|
peers = [
|
|
{
|
|
publicKey = "cUmp55I20JEhxr+RMmOsX+6U9kcDiAq3grnvzjQ642w=";
|
|
allowedIPs = [ "0.0.0.0/0" "::/0" ];
|
|
endpoint = "vpn.lab12.fr:51812";
|
|
persistentKeepalive = 15;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
|
|
# Configure network proxy if necessary
|
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
|
|
|
# Enable networking using networkmanager
|
|
# networking.networkmanager.enable = true;
|
|
|
|
|
|
|
|
# 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 keymap in X11
|
|
services.xserver.xkb = {
|
|
layout = "fr";
|
|
variant = "";
|
|
};
|
|
|
|
# Configure console keymap
|
|
console.keyMap = "fr";
|
|
|
|
# Define a user account. Don't forget to set a password with 'passwd'.
|
|
users.users.douzeb = {
|
|
isNormalUser = true;
|
|
description = "douze baie";
|
|
extraGroups = [ "networkmanager" "wheel" ];
|
|
packages = with pkgs; [];
|
|
};
|
|
|
|
# Passwordless sudo for members of the wheel group
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
# Allow unfree packages
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
environment.shellAliases = {
|
|
tm = "tmux new -A -s shared" ;
|
|
ll = "ls -al";
|
|
};
|
|
|
|
|
|
# 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
|
|
memtester
|
|
# Useful podman development tools
|
|
#dive # look into docker image layers
|
|
podman-tui # status of containers in the terminal
|
|
#aardvark-dns
|
|
#docker-compose # start group of containers for dev
|
|
#podman-compose # start group of containers for dev
|
|
mosh
|
|
dig
|
|
mtr
|
|
];
|
|
|
|
programs.neovim = {
|
|
enable = true;
|
|
viAlias = true;
|
|
vimAlias = true;
|
|
};
|
|
|
|
|
|
# Some programs need SUID wrappers, can be configured further or are
|
|
# started in user sessions.
|
|
# programs.mtr.enable = true;
|
|
# programs.gnupg.agent = {
|
|
# enable = true;
|
|
# enableSSHSupport = true;
|
|
# };
|
|
|
|
# List services that you want to enable:
|
|
|
|
# Enable the OpenSSH daemon.
|
|
services.openssh.enable = true;
|
|
services.openssh.ports = [ 144 ];
|
|
services.openssh.settings = {
|
|
PermitRootLogin = "no";
|
|
PasswordAuthentication = false;
|
|
KbdInteractiveAuthentication = false;
|
|
};
|
|
|
|
boot.kernel.sysctl = {
|
|
"net.ipv4.ip_forward" = 1;
|
|
"net.ipv6.conf.all.forwarding" = 1;
|
|
};
|
|
|
|
# Open ports in the firewall.
|
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
# Or disable the firewall altogether.
|
|
# networking.firewall.enable = false;
|
|
networking.firewall.allowedTCPPorts = [ 80 144 443 ];
|
|
networking.firewall.allowedUDPPorts = [ 53 ];
|
|
networking.firewall.allowedUDPPortRanges = [
|
|
{ from = 60000; to = 61000; }
|
|
];
|
|
|
|
virtualisation.containers.enable = true;
|
|
virtualisation.podman = {
|
|
enable = true;
|
|
|
|
# Create a `docker` alias for podman, to use it as a drop-in replacement
|
|
dockerCompat = true;
|
|
|
|
# Required for containers under podman-compose to be able to talk to each other.
|
|
defaultNetwork.settings.dns_enabled = true;
|
|
};
|
|
#virtualisation.oci-containers.containers = {
|
|
# nixos = {
|
|
# image = "nix:latest"
|
|
# extraOptions = [ "--network=host" ];
|
|
# };
|
|
#};
|
|
|
|
|
|
# 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?
|
|
|
|
}
|