2022-01-19 00:13:15 +00:00
|
|
|
|
{
|
2023-01-28 20:49:10 +00:00
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
pkgs,
|
|
|
|
|
profiles,
|
|
|
|
|
...
|
|
|
|
|
}: {
|
2022-01-19 00:13:15 +00:00
|
|
|
|
imports = [
|
|
|
|
|
# profiles.networking
|
|
|
|
|
#profiles.core
|
2023-01-28 20:49:10 +00:00
|
|
|
|
"${
|
|
|
|
|
fetchTarball {
|
|
|
|
|
url = "https://github.com/NixOS/nixos-hardware/archive/8f1bf828d8606fe38a02df312cf14546ae200a72.tar.gz";
|
|
|
|
|
sha256 = "11milap153g3f63fcrcv4777vd64f7wlfkk9p3kpxi6dqd2sxvh4";
|
2022-01-19 00:13:15 +00:00
|
|
|
|
}
|
|
|
|
|
}/raspberry-pi/4"
|
|
|
|
|
profiles.users.root # make sure to configure ssh keys
|
2022-01-31 16:51:42 +00:00
|
|
|
|
profiles.users.pub-solar
|
|
|
|
|
profiles.base-user
|
|
|
|
|
profiles.pub-solar-iso
|
2022-01-19 00:13:15 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
config = {
|
2022-09-06 09:31:55 +00:00
|
|
|
|
pub-solar.core.iso-options.enable = true;
|
2022-01-19 00:13:15 +00:00
|
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
|
"/" = {
|
|
|
|
|
device = "/dev/disk/by-label/NIXOS_SD";
|
|
|
|
|
fsType = "ext4";
|
2023-01-28 20:49:10 +00:00
|
|
|
|
options = ["noatime"];
|
2022-01-19 00:13:15 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2022-01-31 16:51:42 +00:00
|
|
|
|
environment.systemPackages = with pkgs; [
|
2023-01-28 20:49:10 +00:00
|
|
|
|
(kodi-gbm.withPackages (p: with p; [jellyfin netflix youtube]))
|
2022-01-31 16:51:42 +00:00
|
|
|
|
];
|
2022-01-19 00:13:15 +00:00
|
|
|
|
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
|
2022-01-31 16:51:42 +00:00
|
|
|
|
networking.firewall = {
|
2023-01-28 20:49:10 +00:00
|
|
|
|
allowedTCPPorts = [8080];
|
|
|
|
|
allowedUDPPorts = [8080];
|
2022-01-31 16:51:42 +00:00
|
|
|
|
};
|
2022-01-19 00:13:15 +00:00
|
|
|
|
|
|
|
|
|
security.sudo.extraConfig = lib.mkAfter ''
|
|
|
|
|
%wheel ALL=(ALL) NOPASSWD:ALL
|
|
|
|
|
'';
|
|
|
|
|
|
2022-01-31 16:51:42 +00:00
|
|
|
|
nix = {
|
|
|
|
|
autoOptimiseStore = true;
|
|
|
|
|
|
|
|
|
|
gc.automatic = true;
|
|
|
|
|
|
|
|
|
|
optimise.automatic = true;
|
|
|
|
|
|
|
|
|
|
useSandbox = true;
|
|
|
|
|
|
2023-01-28 20:49:10 +00:00
|
|
|
|
allowedUsers = ["@wheel"];
|
2022-01-31 16:51:42 +00:00
|
|
|
|
|
2023-01-28 20:49:10 +00:00
|
|
|
|
trustedUsers = ["root" "@wheel"];
|
2022-01-31 16:51:42 +00:00
|
|
|
|
|
|
|
|
|
extraOptions = ''
|
|
|
|
|
min-free = 536870912
|
|
|
|
|
keep-outputs = true
|
|
|
|
|
keep-derivations = true
|
|
|
|
|
fallback = true
|
|
|
|
|
'';
|
|
|
|
|
};
|
2022-01-19 00:13:15 +00:00
|
|
|
|
|
|
|
|
|
# Enable GPU acceleration
|
|
|
|
|
hardware.raspberry-pi."4".fkms-3d.enable = true;
|
|
|
|
|
|
2022-01-31 16:51:42 +00:00
|
|
|
|
# Define a user account for kodi
|
|
|
|
|
users.extraUsers.kodi.isNormalUser = true;
|
|
|
|
|
|
|
|
|
|
services.xserver = {
|
|
|
|
|
enable = true;
|
|
|
|
|
desktopManager.kodi.enable = true;
|
|
|
|
|
desktopManager.kodi.package = pkgs.kodi-gbm;
|
|
|
|
|
displayManager = {
|
|
|
|
|
autoLogin.enable = true;
|
|
|
|
|
autoLogin.user = "kodi";
|
|
|
|
|
};
|
|
|
|
|
};
|
2022-01-19 00:13:15 +00:00
|
|
|
|
|
|
|
|
|
hardware.pulseaudio.enable = true;
|
2022-01-31 16:51:42 +00:00
|
|
|
|
|
|
|
|
|
# custom raspi boot loader is already present
|
|
|
|
|
boot.loader.systemd-boot.enable = lib.mkForce false;
|
2023-03-27 16:06:49 +00:00
|
|
|
|
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_rpi4;
|
2022-07-08 12:13:41 +00:00
|
|
|
|
|
|
|
|
|
# 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 = "21.05"; # Did you read the comment?
|
2022-01-19 00:13:15 +00:00
|
|
|
|
};
|
|
|
|
|
}
|