nixfiles/config/hosts/lain/configuration.nix

64 lines
1.7 KiB
Nix
Raw Normal View History

2024-03-27 23:39:09 +01:00
{ config, inputs, lib, pkgs, ... }: {
imports = [
../../common
2024-04-03 10:38:55 +02:00
../../profiles/rpi.nix
2024-03-27 23:39:09 +01:00
../../profiles/headless.nix
];
kyouma.deployment.targetHost = "192.168.178.171";
2024-03-27 23:39:09 +01:00
2024-04-03 10:38:55 +02:00
networking = {
hostName = "lain";
dhcpcd.enable = lib.mkForce true;
networkmanager.enable = true;
useDHCP = lib.mkForce true;
2024-03-27 23:39:09 +01:00
};
2024-04-03 10:38:55 +02:00
systemd.network.enable = lib.mkForce false;
2024-03-27 23:39:09 +01:00
nixpkgs.overlays = [
2024-04-03 10:38:55 +02:00
(self: super: { kodi-wayland = super.kodi-wayland.overrideAttrs { doInstallCheck = false; }; })
2024-03-27 23:39:09 +01:00
];
systemd.sockets."cec-client" = {
after = [ "dev-vchiq.device" ];
bindsTo = [ "dev-vchiq.device" ];
wantedBy = [ "sockets.target" ];
socketConfig = {
ListenFIFO = "/run/cec.fifo";
SocketGroup = "video";
SocketMode = "0660";
};
};
systemd.services."cec-client" = {
after = [ "dev-vchiq.device" ];
bindsTo = [ "dev-vchiq.device" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = ''${pkgs.libcec}/bin/cec-client -d 1'';
ExecStop = ''/bin/sh -c "echo q > /run/cec.fifo"'';
StandardInput = "socket";
StandardOutput = "journal";
Restart="no";
};
};
services.cage = {
enable = true;
2024-04-03 10:38:55 +02:00
environment = {
WLR_NO_HARDWARE_CURSORS = "1";
};
2024-03-27 23:39:09 +01:00
program = "${pkgs.kodi-wayland}/bin/kodi-standalone";
user = "kodi";
};
services.udev.extraRules = ''
# allow access to raspi cec device for video group (and optionally register it as a systemd device, used below)
KERNEL=="vchiq", GROUP="video", MODE="0660", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/vchiq"
'';
2024-04-03 10:38:55 +02:00
users = {
mutableUsers = lib.mkForce true;
users.kodi.extraGroups = [ "video" ];
extraUsers.kodi.isNormalUser = true;
};
2024-03-27 23:39:09 +01:00
}