2021-01-27 18:22:02 +01:00
|
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
|
|
|
|
2021-01-30 18:11:02 +01:00
|
|
|
|
{ config, lib, pkgs, ... }:
|
2021-02-14 13:42:43 +01:00
|
|
|
|
let
|
|
|
|
|
secrets = config.my.secrets;
|
|
|
|
|
in
|
2021-01-27 18:22:02 +01:00
|
|
|
|
{
|
|
|
|
|
imports =
|
|
|
|
|
[ # Include the results of the hardware scan.
|
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Use the GRUB 2 boot loader.
|
|
|
|
|
boot.loader.grub.enable = true;
|
|
|
|
|
boot.loader.grub.version = 2;
|
|
|
|
|
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
|
|
|
|
|
|
|
|
|
|
networking.hostName = "poseidon"; # Define your hostname.
|
2021-01-27 21:49:03 +01:00
|
|
|
|
networking.domain = "alarsyo.net";
|
2021-01-27 18:22:02 +01:00
|
|
|
|
|
|
|
|
|
# Set your time zone.
|
|
|
|
|
time.timeZone = "Europe/Paris";
|
|
|
|
|
|
|
|
|
|
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
|
|
|
|
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
|
|
|
|
# replicates the default behaviour.
|
|
|
|
|
networking.useDHCP = false;
|
|
|
|
|
networking.interfaces.eno1.ipv4.addresses = [
|
|
|
|
|
{
|
|
|
|
|
address = "163.172.11.110";
|
|
|
|
|
prefixLength = 24;
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
networking.defaultGateway = {
|
|
|
|
|
address = "163.172.11.1";
|
|
|
|
|
interface = "eno1";
|
|
|
|
|
};
|
|
|
|
|
networking.nameservers = [
|
|
|
|
|
"62.210.16.6"
|
|
|
|
|
"62.210.16.7"
|
|
|
|
|
];
|
2021-02-22 18:59:37 +01:00
|
|
|
|
my.networking.externalInterface = "eno1";
|
2021-01-27 18:22:02 +01:00
|
|
|
|
|
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
|
# $ nix search wget
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
2021-01-27 18:26:59 +01:00
|
|
|
|
bat
|
2021-01-27 18:22:02 +01:00
|
|
|
|
fish
|
|
|
|
|
git
|
2021-02-13 20:32:37 +01:00
|
|
|
|
gnupg
|
2021-01-27 18:22:02 +01:00
|
|
|
|
htop
|
2021-02-13 20:32:37 +01:00
|
|
|
|
pinentry-curses
|
2021-01-29 15:29:30 +01:00
|
|
|
|
ripgrep
|
2021-01-27 18:26:59 +01:00
|
|
|
|
stow
|
2021-01-27 18:22:02 +01:00
|
|
|
|
tmux
|
|
|
|
|
vim
|
|
|
|
|
wget
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Some programs need SUID wrappers, can be configured further or are
|
|
|
|
|
# started in user sessions.
|
2021-03-16 15:23:17 +01:00
|
|
|
|
programs = {
|
|
|
|
|
fish.enable = true;
|
|
|
|
|
gnupg.agent = {
|
|
|
|
|
enable = true;
|
|
|
|
|
enableSSHSupport = true;
|
|
|
|
|
pinentryFlavor = "curses";
|
|
|
|
|
};
|
|
|
|
|
mosh.enable = true;
|
2021-02-13 20:32:37 +01:00
|
|
|
|
};
|
2021-01-27 18:22:02 +01:00
|
|
|
|
|
|
|
|
|
# List services that you want to enable:
|
2021-01-27 21:49:03 +01:00
|
|
|
|
my.services = {
|
2021-01-31 00:31:43 +01:00
|
|
|
|
bitwarden_rs = {
|
|
|
|
|
enable = true;
|
|
|
|
|
privatePort = 8081;
|
|
|
|
|
websocketPort = 3012;
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-30 18:11:02 +01:00
|
|
|
|
borg-backup = {
|
|
|
|
|
enable = true;
|
2021-02-14 13:42:43 +01:00
|
|
|
|
repo = secrets.borg-backup-repo;
|
2021-01-30 18:11:02 +01:00
|
|
|
|
};
|
2021-01-30 21:14:27 +01:00
|
|
|
|
|
2021-02-22 15:07:29 +01:00
|
|
|
|
fail2ban = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
2021-02-02 16:55:19 +01:00
|
|
|
|
gitea = {
|
|
|
|
|
enable = true;
|
|
|
|
|
privatePort = 8082;
|
|
|
|
|
};
|
|
|
|
|
|
2021-02-19 21:21:35 +01:00
|
|
|
|
jellyfin = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-30 21:14:27 +01:00
|
|
|
|
miniflux = {
|
|
|
|
|
enable = true;
|
2021-02-14 13:42:43 +01:00
|
|
|
|
adminCredentialsFile = "${../../secrets/miniflux-admin-credentials.secret}";
|
2021-01-30 21:14:27 +01:00
|
|
|
|
privatePort = 8080;
|
|
|
|
|
};
|
|
|
|
|
|
2021-02-02 01:20:31 +01:00
|
|
|
|
matrix = {
|
|
|
|
|
enable = true;
|
2021-02-14 13:42:43 +01:00
|
|
|
|
registration_shared_secret = secrets.matrix-registration-shared-secret;
|
2021-02-02 01:20:31 +01:00
|
|
|
|
};
|
2021-01-30 21:14:27 +01:00
|
|
|
|
|
2021-01-27 21:49:03 +01:00
|
|
|
|
monitoring = {
|
2021-01-27 20:55:16 +01:00
|
|
|
|
enable = true;
|
2021-01-27 21:49:03 +01:00
|
|
|
|
useACME = true;
|
2021-01-27 22:01:27 +01:00
|
|
|
|
domain = "monitoring.${config.networking.domain}";
|
2021-01-27 20:55:16 +01:00
|
|
|
|
};
|
2021-01-30 22:15:33 +01:00
|
|
|
|
|
2021-03-23 19:31:59 +01:00
|
|
|
|
nextcloud = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-30 22:15:33 +01:00
|
|
|
|
postgresql-backup = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
2021-02-19 22:29:04 +01:00
|
|
|
|
|
2021-03-16 17:46:25 +01:00
|
|
|
|
tgv = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
2021-02-19 22:29:04 +01:00
|
|
|
|
transmission = {
|
|
|
|
|
enable = true;
|
|
|
|
|
username = "alarsyo";
|
|
|
|
|
password = secrets.transmission-password;
|
|
|
|
|
};
|
2021-02-22 18:59:37 +01:00
|
|
|
|
|
|
|
|
|
wireguard = {
|
|
|
|
|
enable = true;
|
|
|
|
|
iface = "wg";
|
|
|
|
|
port = 51820;
|
|
|
|
|
|
|
|
|
|
net = {
|
|
|
|
|
v4 = {
|
|
|
|
|
subnet = "10.0.0";
|
|
|
|
|
mask = 24;
|
|
|
|
|
};
|
|
|
|
|
v6 = {
|
|
|
|
|
subnet = "fd42:42:42";
|
|
|
|
|
mask = 64;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
2021-01-27 20:55:16 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
security.acme.acceptTerms = true;
|
|
|
|
|
security.acme.email = "antoine97.martin@gmail.com";
|
|
|
|
|
|
2021-01-27 18:22:02 +01:00
|
|
|
|
# Enable the OpenSSH daemon.
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
services.openssh.permitRootLogin = "no";
|
|
|
|
|
services.openssh.passwordAuthentication = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boot.supportedFilesystems = [ "btrfs" ];
|
|
|
|
|
}
|