2021-01-30 21:14:20 +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-02-01 16:24:38 +01:00
|
|
|
|
{ config, lib, pkgs, ... }:
|
2021-01-30 21:14:20 +01:00
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
imports =
|
|
|
|
|
[
|
|
|
|
|
# Include the results of the hardware scan.
|
|
|
|
|
./hardware-configuration.nix
|
2021-01-31 16:37:58 +01:00
|
|
|
|
# Include my services
|
|
|
|
|
./services
|
2021-01-30 21:14:20 +01:00
|
|
|
|
];
|
|
|
|
|
|
2021-02-05 16:11:06 +01:00
|
|
|
|
nix = {
|
|
|
|
|
package = pkgs.nixFlakes;
|
|
|
|
|
extraOptions = ''
|
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-30 21:14:20 +01:00
|
|
|
|
# Use the GRUB 2 boot loader.
|
|
|
|
|
boot.loader.grub.enable = true;
|
|
|
|
|
boot.loader.grub.version = 2;
|
|
|
|
|
# Define on which hard drive you want to install Grub.
|
|
|
|
|
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
|
|
|
|
|
|
|
|
|
|
networking.hostName = "porthos"; # Define your hostname.
|
|
|
|
|
networking.domain = "test.belanyi.fr"; # Define your domain.
|
|
|
|
|
|
|
|
|
|
# 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.bond0.useDHCP = true;
|
|
|
|
|
networking.interfaces.bonding_masters.useDHCP = true;
|
|
|
|
|
networking.interfaces.dummy0.useDHCP = true;
|
|
|
|
|
networking.interfaces.erspan0.useDHCP = true;
|
|
|
|
|
networking.interfaces.eth0.useDHCP = true;
|
|
|
|
|
networking.interfaces.eth1.useDHCP = true;
|
|
|
|
|
networking.interfaces.gre0.useDHCP = true;
|
|
|
|
|
networking.interfaces.gretap0.useDHCP = true;
|
|
|
|
|
networking.interfaces.ifb0.useDHCP = true;
|
|
|
|
|
networking.interfaces.ifb1.useDHCP = true;
|
|
|
|
|
networking.interfaces.ip6tnl0.useDHCP = true;
|
|
|
|
|
networking.interfaces.sit0.useDHCP = true;
|
|
|
|
|
networking.interfaces.teql0.useDHCP = true;
|
|
|
|
|
networking.interfaces.tunl0.useDHCP = true;
|
|
|
|
|
|
|
|
|
|
# Select internationalisation properties.
|
|
|
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
|
|
|
|
|
2021-02-04 18:26:52 +01:00
|
|
|
|
users.mutableUsers = false; # I want it to be declarative.
|
|
|
|
|
|
2021-02-04 22:00:04 +01:00
|
|
|
|
# Define user accounts and passwords.
|
2021-02-04 18:26:52 +01:00
|
|
|
|
users.users.root.hashedPassword = lib.fileContents ./secrets/users/root/password.txt;
|
2021-01-30 21:14:20 +01:00
|
|
|
|
users.users.ambroisie = {
|
2021-02-04 22:00:04 +01:00
|
|
|
|
hashedPassword = lib.fileContents ./secrets/users/ambroisie/password.txt;
|
|
|
|
|
description = "Bruno BELANYI";
|
2021-01-30 21:14:20 +01:00
|
|
|
|
isNormalUser = true;
|
|
|
|
|
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
2021-01-31 18:10:22 +01:00
|
|
|
|
openssh.authorizedKeys.keys = with builtins; let
|
|
|
|
|
contents = readDir ./ssh;
|
|
|
|
|
names = attrNames contents;
|
|
|
|
|
files = filter (name: contents.${name} == "regular") names;
|
|
|
|
|
keys = map (basename: readFile (./ssh + "/${basename}")) files;
|
|
|
|
|
in
|
|
|
|
|
keys;
|
2021-01-30 21:14:20 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
|
# $ nix search wget
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
git
|
|
|
|
|
git-crypt
|
|
|
|
|
mosh
|
|
|
|
|
vim
|
|
|
|
|
wget
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# List services that you want to enable:
|
2021-01-31 16:56:44 +01:00
|
|
|
|
my.services = {
|
2021-01-31 17:46:46 +01:00
|
|
|
|
# Gitea forge
|
|
|
|
|
gitea.enable = true;
|
2021-02-03 22:07:11 +01:00
|
|
|
|
# Meta-indexers
|
|
|
|
|
indexers = {
|
|
|
|
|
jackett.enable = true;
|
|
|
|
|
nzbhydra.enable = true;
|
|
|
|
|
};
|
2021-01-31 22:31:04 +01:00
|
|
|
|
# Jellyfin media server
|
|
|
|
|
jellyfin.enable = true;
|
2021-01-31 16:56:44 +01:00
|
|
|
|
# Matrix backend and Element chat front-end
|
2021-02-04 16:46:39 +01:00
|
|
|
|
matrix = {
|
|
|
|
|
enable = true;
|
|
|
|
|
secret = lib.fileContents ./secrets/matrix/secret.txt;
|
|
|
|
|
};
|
2021-02-01 11:44:21 +01:00
|
|
|
|
# Nextcloud self-hosted cloud
|
|
|
|
|
nextcloud = {
|
|
|
|
|
enable = true;
|
|
|
|
|
password = lib.fileContents ./secrets/nextcloud/password.txt;
|
|
|
|
|
};
|
2021-01-31 22:32:30 +01:00
|
|
|
|
# The whole *arr software suite
|
|
|
|
|
pirate.enable = true;
|
2021-02-04 18:28:05 +01:00
|
|
|
|
# Regular backups
|
|
|
|
|
postgresql-backup.enable = true;
|
2021-02-06 12:11:55 +01:00
|
|
|
|
# An IRC client daemon
|
|
|
|
|
quassel.enable = true;
|
2021-02-05 19:59:25 +01:00
|
|
|
|
# RSS provider for websites that do not provide any feeds
|
|
|
|
|
rss-bridge.enable = true;
|
2021-02-01 16:25:34 +01:00
|
|
|
|
# Usenet client
|
|
|
|
|
sabnzbd.enable = true;
|
2021-02-01 14:25:12 +01:00
|
|
|
|
# Torrent client and webui
|
|
|
|
|
transmission = {
|
|
|
|
|
enable = true;
|
|
|
|
|
username = "Ambroisie";
|
2021-02-01 16:24:38 +01:00
|
|
|
|
password = lib.fileContents ./secrets/transmission/password.txt;
|
2021-02-01 14:25:12 +01:00
|
|
|
|
};
|
2021-01-31 16:56:44 +01:00
|
|
|
|
};
|
|
|
|
|
|
2021-01-30 21:14:20 +01:00
|
|
|
|
programs.gnupg.agent = {
|
|
|
|
|
enable = true;
|
|
|
|
|
enableSSHSupport = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
programs.mosh.enable = true; # Opens the relevant UDP ports.
|
|
|
|
|
|
|
|
|
|
# Enable the OpenSSH daemon.
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
services.openssh.permitRootLogin = "no";
|
|
|
|
|
services.openssh.passwordAuthentication = false;
|
|
|
|
|
|
|
|
|
|
# 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 = "20.09"; # Did you read the comment?
|
2021-02-01 15:34:48 +01:00
|
|
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true; # Because I don't care *that* much.
|
2021-01-30 21:14:20 +01:00
|
|
|
|
}
|