Compare commits

..

3 commits

Author SHA1 Message Date
a951a1e3fb thrall: Extract modules 2024-01-22 21:19:09 +01:00
5c1e8ea969 thrall: Extract timezone configuration 2024-01-21 10:52:56 +01:00
10843c1efc thrall: Extract haskell.nix config
- iohk public key and cache
2024-01-20 19:51:48 +01:00
5 changed files with 47 additions and 30 deletions

View file

@ -4,21 +4,19 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
extIface = "ens3"; authorityFromUrl = url:
ledgerVHost = "ledger.failco.de"; builtins.head (pkgs.lib.drop 1 (pkgs.lib.splitString "://" url));
in { in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/upgrade-pg-cluster.nix ../../modules/upgrade-pg-cluster.nix
../../modules/nix-config.nix ../../modules/nix-config.nix
../../modules/iohk.nix
../../modules/timezone.nix
../../modules/keybase.nix
../../modules/ssh.nix
]; ];
# Binary Cache for Haskell.nix
nix.settings.trusted-public-keys =
[ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
#nix.binaryCaches = [ "https://hydra.iohk.io" ];
# Use the GRUB 2 boot loader. # Use the GRUB 2 boot loader.
boot.loader.grub.enable = true; boot.loader.grub.enable = true;
# boot.loader.grub.efiSupport = true; # boot.loader.grub.efiSupport = true;
@ -28,9 +26,6 @@ in {
boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only
# boot.loader.systemd-boot.enable = true; # boot.loader.systemd-boot.enable = true;
# Set your time zone.
time.timeZone = "Europe/Berlin";
age.secrets = { age.secrets = {
mailPass.file = ../../secrets/mailPass.age; mailPass.file = ../../secrets/mailPass.age;
paperless-mail.file = ../../secrets/paperless-mail.age; paperless-mail.file = ../../secrets/paperless-mail.age;
@ -46,7 +41,8 @@ in {
# The global useDHCP flag is deprecated, therefore explicitly set to false here. # 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 # Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour. # replicates the default behaviour.
networking = { networking = let extIface = "ens3";
in {
hostName = "thrall"; hostName = "thrall";
domain = "failco.de"; domain = "failco.de";
wireless.enable = false; wireless.enable = false;
@ -145,14 +141,12 @@ in {
htop htop
tmux tmux
git git
#agenix.defaultPackage.x86_64-linux
restic # fast and secure backup restic # fast and secure backup
rclone rclone
]; ];
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
# started in user sessions. # started in user sessions.
# programs.mtr.enable = true;
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;
enableSSHSupport = true; enableSSHSupport = true;
@ -171,20 +165,15 @@ in {
# List services that you want to enable: # List services that you want to enable:
# depending on wireguard
services.kresd = { services.kresd = {
enable = true; enable = true;
listenPlain = [ "[::1]:53" "127.0.0.1:53" "10.0.0.1:53" ]; listenPlain = [ "[::1]:53" "127.0.0.1:53" "10.0.0.1:53" ];
}; };
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.lorri.enable = true; services.lorri.enable = true;
# configure backup via restic to gdrive # configure backup via restic to gdrive
services.restic.backups = { }; services.restic.backups = { };
services.keybase = { enable = true; };
services.nginx = { services.nginx = {
enable = true; enable = true;
@ -234,27 +223,31 @@ in {
}; };
# gitea # gitea
"git.failco.de" = { "${config.services.gitea.settings.server.DOMAIN}" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:3001/"; proxyPass = "http://127.0.0.1:${
toString config.services.gitea.settings.server.HTTP_PORT
}/";
proxyWebsockets = true; proxyWebsockets = true;
}; };
}; };
# paperless # paperless
"docs.failco.de" = { "${authorityFromUrl config.services.paperless.extraConfig.PAPERLESS_URL}" =
forceSSL = true; {
enableACME = true; forceSSL = true;
locations."/" = { enableACME = true;
proxyPass = "http://127.0.0.1:3002/"; locations."/" = {
proxyWebsockets = true; proxyPass =
"http://127.0.0.1:${toString config.services.paperless.port}/";
proxyWebsockets = true;
};
}; };
};
# hledger # hledger
"${ledgerVHost}" = { "${authorityFromUrl config.services.hledger-web.baseUrl}" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
basicAuthFile = config.age.secrets.hledger-web.path; basicAuthFile = config.age.secrets.hledger-web.path;
@ -305,7 +298,7 @@ in {
services.hledger-web = { services.hledger-web = {
enable = true; enable = true;
baseUrl = "https://${ledgerVHost}"; baseUrl = "https://ledger.failco.de";
port = 3003; port = 3003;
capabilities = { capabilities = {
view = true; view = true;

9
modules/iohk.nix Normal file
View file

@ -0,0 +1,9 @@
{ config, lib, pkgs, ... }:
{
# Binary Cache for Haskell.nix
nix.settings.trusted-public-keys =
[ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
nix.settings.substituters = lib.mkAfter [ "https://hydra.iohk.io" ];
}

5
modules/keybase.nix Normal file
View file

@ -0,0 +1,5 @@
{ config, lib, pkgs, ... }:
{
services.keybase.enable = true;
}

5
modules/ssh.nix Normal file
View file

@ -0,0 +1,5 @@
{ config, lib, pkgs, ... }:
{
services.openssh.enable = true;
}

5
modules/timezone.nix Normal file
View file

@ -0,0 +1,5 @@
{ config, lib, pkgs, ... }:
{
time.timeZone = lib.mkDefault "Europe/Berlin";
}