nixos-config/rpi4.nix

103 lines
2.4 KiB
Nix
Raw Normal View History

2020-09-27 14:27:25 +02:00
{ config, pkgs, ... }:
2020-10-06 17:41:56 +02:00
with builtins; {
2020-09-27 14:27:25 +02:00
imports = [
# ./hardware/base.nix
2020-10-06 18:09:04 +02:00
./hardware/gpu-rpi4.nix
2020-09-27 14:27:25 +02:00
# ./system
./system/nix.nix
./system/i18n.nix
2021-05-11 21:26:18 +02:00
./system/networking.nix
2021-03-21 14:24:35 +01:00
./services/restic/rpi4.nix
./services/syncthing/rpi4.nix
2021-03-13 12:55:00 +01:00
./services/kodi.nix
2020-10-06 17:41:56 +02:00
./services/jellyfin.nix
2021-02-15 21:06:51 +01:00
./services/etebase.nix
# ./services/photoprism.nix # TODO not working on aarch64 due to tensorflow
2020-10-03 16:32:06 +02:00
./services/home-assistant.nix
2020-12-02 10:33:12 +01:00
./services/owntracks.nix
2020-09-27 14:27:25 +02:00
];
nixpkgs.config.allowUnfree = true;
# rpi4 base config
boot.loader.grub.enable = false;
boot.loader.raspberryPi.enable = true;
boot.loader.raspberryPi.version = 4;
boot.kernelPackages = pkgs.linuxPackages_rpi4;
2020-10-06 17:41:56 +02:00
boot.kernelParams = [ "console=ttyAMA0,115200" "console=tty1" ];
2020-10-03 16:25:05 +02:00
hardware.enableRedistributableFirmware = true;
2020-09-27 14:27:25 +02:00
2020-10-03 16:23:36 +02:00
networking.domain = "home.felschr.com";
2020-10-06 17:41:56 +02:00
networking.firewall.allowedTCPPorts = [ 80 443 ];
2020-10-03 16:23:36 +02:00
security.acme = {
acceptTerms = true;
email = "dev@felschr.com";
2020-10-03 16:23:36 +02:00
};
2020-11-14 11:16:08 +01:00
services.cfdyndns = {
2020-10-03 16:23:36 +02:00
enable = true;
email = "felschr@pm.me";
apikeyFile = "/etc/nixos/secrets/cfdyndns-apikey";
2021-02-16 16:51:10 +01:00
records = [
"*.home.felschr.com"
"home.felschr.com"
"owntracks.felschr.com"
2021-02-15 21:06:51 +01:00
"etebase.felschr.com"
];
2020-10-03 16:23:36 +02:00
};
2020-10-03 16:32:06 +02:00
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
virtualHosts = {
${config.networking.domain} = {
2020-10-03 16:32:06 +02:00
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:8123";
proxyWebsockets = true;
};
};
};
};
2020-09-27 14:27:25 +02:00
programs.zsh.enable = true;
services.openssh = {
enable = true;
challengeResponseAuthentication = false;
passwordAuthentication = false;
permitRootLogin = "no";
};
boot.initrd.network.ssh = {
enable = true;
2020-10-06 17:41:56 +02:00
authorizedKeys = [ (readFile "./key") ];
};
2020-09-27 14:27:25 +02:00
users.users.felschr = {
isNormalUser = true;
2021-05-27 12:38:34 +02:00
extraGroups = [ "wheel" "audio" "disk" "media" ];
2020-09-27 14:27:25 +02:00
shell = pkgs.zsh;
openssh.authorizedKeys.keyFiles = [ ./key ];
2020-09-27 14:27:25 +02:00
};
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
backupFileExtension = "backup";
2020-09-27 14:27:25 +02:00
users.felschr = import ./home/felschr-rpi4.nix;
};
# only change this when specified in release notes
system.stateVersion = "20.09";
}