porthos: split into modules
I have separated the modules into host-specific settings, and generic settings that ought to be shared by every host. I only have the 'porthos' host for now, but intend to also add my laptop 'aramis' at some point to this repository.
This commit is contained in:
parent
d1d33fd1d1
commit
3b148ad684
14 changed files with 224 additions and 178 deletions
15
porthos/boot.nix
Normal file
15
porthos/boot.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Boot configuration
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
# 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";
|
||||
|
||||
boot.initrd.availableKernelModules = [ "uhci_hcd" "ahci" "usbhid" ];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
}
|
||||
11
porthos/default.nix
Normal file
11
porthos/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Porthos specific settings
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./hardware.nix
|
||||
./networking.nix
|
||||
./services.nix
|
||||
];
|
||||
}
|
||||
20
porthos/hardware.nix
Normal file
20
porthos/hardware.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Hardware configuration
|
||||
{ lib, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
fileSystems."/" =
|
||||
{
|
||||
device = "/dev/disk/by-uuid/d89efc61-6b03-4190-b488-301c919e2431";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[{ device = "/dev/disk/by-uuid/1a261204-2e78-496f-8a8d-d29bfa770306"; }];
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||
}
|
||||
27
porthos/networking.nix
Normal file
27
porthos/networking.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Networking configuration
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "porthos"; # Define your hostname.
|
||||
networking.domain = "test.belanyi.fr"; # Define your domain.
|
||||
|
||||
|
||||
# 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;
|
||||
}
|
||||
57
porthos/services.nix
Normal file
57
porthos/services.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# Deployed services
|
||||
{ config, ... }:
|
||||
let
|
||||
my = config.my;
|
||||
in
|
||||
{
|
||||
# List services that you want to enable:
|
||||
my.services = {
|
||||
# Gitea forge
|
||||
gitea.enable = true;
|
||||
# Meta-indexers
|
||||
indexers = {
|
||||
jackett.enable = true;
|
||||
nzbhydra.enable = true;
|
||||
};
|
||||
# Jellyfin media server
|
||||
jellyfin.enable = true;
|
||||
# Matrix backend and Element chat front-end
|
||||
matrix = {
|
||||
enable = true;
|
||||
secret = my.secrets.matrix.secret;
|
||||
};
|
||||
# Nextcloud self-hosted cloud
|
||||
nextcloud = {
|
||||
enable = true;
|
||||
password = my.secrets.nextcloud.password;
|
||||
};
|
||||
# The whole *arr software suite
|
||||
pirate.enable = true;
|
||||
# Regular backups
|
||||
postgresql-backup.enable = true;
|
||||
# An IRC client daemon
|
||||
quassel.enable = true;
|
||||
# RSS provider for websites that do not provide any feeds
|
||||
rss-bridge.enable = true;
|
||||
# Usenet client
|
||||
sabnzbd.enable = true;
|
||||
# Torrent client and webui
|
||||
transmission = {
|
||||
enable = true;
|
||||
username = "Ambroisie";
|
||||
password = my.secrets.transmission.password;
|
||||
};
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue