GMKtec G3 (Intel N100) replacing the old Ubuntu media PC on VLAN 31. Hyprland compositor with Kodi on workspace 1 and Firefox on workspace 2, greetd auto-login, PipeWire audio, VA-API hardware decode, and NFS mount for media from NAS. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
115 lines
2.3 KiB
Nix
115 lines
2.3 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
|
|
let
|
|
kodiPkg = pkgs.kodi-wayland.withPackages (p: [
|
|
p.jellycon
|
|
p.sendtokodi
|
|
p.inputstream-adaptive
|
|
]);
|
|
|
|
hyprlandConfig = pkgs.writeText "hyprland.conf" ''
|
|
# Monitor — auto-detect, native resolution
|
|
monitor = , preferred, auto, 1
|
|
|
|
# Launch Kodi and Firefox on login
|
|
exec-once = ${lib.getExe' kodiPkg "kodi"}
|
|
exec-once = ${lib.getExe pkgs.firefox}
|
|
|
|
# Workspace rules — Kodi on 1, Firefox on 2
|
|
windowrulev2 = workspace 1 silent, class:^(kodi)$
|
|
windowrulev2 = workspace 2 silent, class:^(firefox)$
|
|
windowrulev2 = fullscreen, class:^(kodi)$
|
|
windowrulev2 = fullscreen, class:^(firefox)$
|
|
|
|
# Start on workspace 1 (Kodi)
|
|
workspace = 1, default:true
|
|
|
|
# Switch workspaces with Super+1/2
|
|
bind = SUPER, 1, workspace, 1
|
|
bind = SUPER, 2, workspace, 2
|
|
|
|
# No gaps, no borders — TV setup
|
|
general {
|
|
gaps_in = 0
|
|
gaps_out = 0
|
|
border_size = 0
|
|
}
|
|
|
|
decoration {
|
|
rounding = 0
|
|
}
|
|
|
|
# Disable animations for snappy switching
|
|
animations {
|
|
enabled = false
|
|
}
|
|
|
|
misc {
|
|
# Disable Hyprland logo/splash
|
|
disable_hyprland_logo = true
|
|
disable_splash_rendering = true
|
|
}
|
|
'';
|
|
|
|
launchHyprland = pkgs.writeShellApplication {
|
|
name = "launch-hyprland";
|
|
runtimeInputs = [ pkgs.hyprland ];
|
|
text = ''
|
|
export XDG_SESSION_TYPE=wayland
|
|
exec Hyprland --config ${hyprlandConfig}
|
|
'';
|
|
};
|
|
in
|
|
{
|
|
# Hyprland compositor
|
|
programs.hyprland.enable = true;
|
|
|
|
# greetd for auto-login into Hyprland
|
|
services.greetd = {
|
|
enable = true;
|
|
settings = {
|
|
default_session = {
|
|
command = lib.getExe launchHyprland;
|
|
user = "kodi";
|
|
};
|
|
};
|
|
};
|
|
|
|
# Kodi user
|
|
users.users.kodi = {
|
|
isNormalUser = true;
|
|
home = "/home/kodi";
|
|
group = "kodi";
|
|
extraGroups = [
|
|
"video"
|
|
"audio"
|
|
"input"
|
|
];
|
|
};
|
|
users.groups.kodi = { };
|
|
|
|
# Packages available on the system
|
|
environment.systemPackages = [
|
|
kodiPkg
|
|
pkgs.firefox
|
|
pkgs.yt-dlp
|
|
];
|
|
|
|
# PipeWire for audio (HDMI passthrough support)
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
pulse.enable = true;
|
|
};
|
|
|
|
# Allow VA-API hardware decode in Firefox
|
|
environment.sessionVariables = {
|
|
MOZ_ENABLE_WAYLAND = "1";
|
|
LIBVA_DRIVER_NAME = "iHD";
|
|
};
|
|
}
|