nixos-config/rpi4.nix

94 lines
2.1 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
2020-10-03 16:23:36 +02:00
./modules/cfdyndns.nix
./services/syncthing/rpi4.nix
2020-10-06 17:41:56 +02:00
./services/jellyfin.nix
2020-10-03 16:32:06 +02:00
./services/home-assistant.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 = "felschr@pm.me";
};
services.custom.cfdyndns = {
enable = true;
email = "felschr@pm.me";
apikeyFile = "/etc/nixos/secrets/cfdyndns-apikey";
records = [ "home.felschr.com" ];
};
2020-10-03 16:32:06 +02:00
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
virtualHosts = {
"home.felschr.com" = {
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;
extraGroups = [ "wheel" "audio" "disk" ];
shell = pkgs.zsh;
openssh.authorizedKeys.keyFiles = [ ./key ];
2020-09-27 14:27:25 +02:00
};
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
users.felschr = import ./home/felschr-rpi4.nix;
};
# only change this when specified in release notes
system.stateVersion = "20.09";
system.autoUpgrade.enable = true;
}