[boxy] Fix wayland and user setup

This commit is contained in:
2024-10-05 19:00:35 -07:00
parent d2ae7f8e11
commit 3477a3480f
3 changed files with 50 additions and 42 deletions

View File

@@ -55,13 +55,12 @@
system = "x86_64-linux"; system = "x86_64-linux";
modules = baseModules ++ [ modules = baseModules ++ [
./machines/boxy/configuration.nix ./machines/boxy/configuration.nix
# inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
# { {
# home-manager.users.johno = import ./home/home-default.nix; home-manager.users.johno = import ./home/home-default.nix;
# home-manager.extraSpecialArgs.customPkgs = home-manager.extraSpecialArgs.customPkgs =
# nixpkgs.legacyPackages."${system}".callPackage ./packages {}; nixpkgs.legacyPackages."${system}".callPackage ./packages {};
# customPkgs = nixpkgs.legacyPackages."${system}".callPackage ./packages {}; }
# }
]; ];
}; };
}; };

View File

@@ -17,8 +17,9 @@ with lib;
kodi = { kodi = {
enable = true; enable = true;
autologin = true; autologin = true;
wayland = false; wayland = true;
}; };
users.enable = true;
}; };
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
@@ -29,7 +30,7 @@ with lib;
hardware.graphics.enable = true; hardware.graphics.enable = true;
#services.displayManager.enable = mkForce false; services.displayManager.enable = mkForce false;
# This option defines the first version of NixOS you have installed on this particular machine, # This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.

View File

@@ -25,7 +25,8 @@ in
steam-library steam-library
youtube youtube
]); ]);
in mkIf cfg.enable { in mkIf cfg.enable
{
users.extraUsers.kodi.isNormalUser = true; users.extraUsers.kodi.isNormalUser = true;
networking.firewall = { networking.firewall = {
@@ -33,14 +34,21 @@ in
allowedUDPPorts = [ 8080 ]; allowedUDPPorts = [ 8080 ];
}; };
services = mkIf cfg.autologin { services = if cfg.autologin then mkMerge [
(mkIf cfg.wayland {
cage = mkIf cfg.wayland { cage = mkIf cfg.wayland {
user = "kodi"; user = "kodi";
program = "${kodiPkg}/bin/kodi-standalone"; program = "${kodiPkg}/bin/kodi-standalone";
enable = true; enable = true;
}; };
xserver = {
enable = false;
autorun = false;
};
})
xserver = mkIf (!cfg.wayland) { (mkIf (!cfg.wayland) {
xserver = {
enable = true; enable = true;
desktopManager.kodi = { desktopManager.kodi = {
enable = true; enable = true;
@@ -50,14 +58,14 @@ in
enable = true; enable = true;
greeter.enable = false; greeter.enable = false;
}; };
displayManager.sddm.enable = mkForce false;
}; };
displayManager = mkIf (!cfg.wayland) { displayManager = {
autoLogin.enable = true; autoLogin.enable = true;
autoLogin.user = "kodi"; autoLogin.user = "kodi";
defaultSession = "kodi"; defaultSession = "kodi";
sessionData.autologinSession = "kodi"; sessionData.autologinSession = "kodi";
}; };
}; })
] else {};
}; };
} }