users/guest: init and add steam
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m22s

This commit is contained in:
2025-08-22 21:04:58 +01:00
parent 269e9d20bf
commit df7d5f3f93
4 changed files with 103 additions and 4 deletions

8
flake.lock generated
View File

@@ -1143,11 +1143,11 @@
"secrets": { "secrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1753994653, "lastModified": 1755887038,
"narHash": "sha256-kVd17w6oo9dbZfgZXMMPEssspp8vAr32G5U8VnfuIFc=", "narHash": "sha256-HoEMwFfR3rwNxwJjFCbj3rfW8k6EabHuMJAZOwsT95c=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "e0cb8c5b8de3f61fbef13c80219715f2e3e5ffb5", "rev": "9e47b557087ebde3a30c9f97189d110c29d144fd",
"revCount": 39, "revCount": 40,
"type": "git", "type": "git",
"url": "ssh://git@git.vimium.com/jordan/nix-secrets.git" "url": "ssh://git@git.vimium.com/jordan/nix-secrets.git"
}, },

View File

@@ -18,6 +18,7 @@ in
./hardware-configuration.nix ./hardware-configuration.nix
./disko-config.nix ./disko-config.nix
../desktop.nix ../desktop.nix
../../users/guest
]; ];
nixpkgs = { nixpkgs = {
@@ -72,6 +73,8 @@ in
capSysAdmin = true; capSysAdmin = true;
}; };
programs.steam.enable = true;
environment = { environment = {
systemPackages = [ pkgs.wine ]; systemPackages = [ pkgs.wine ];
sessionVariables.WINE_BIN = getExe pkgs.wine; sessionVariables.WINE_BIN = getExe pkgs.wine;

View File

@@ -0,0 +1,30 @@
{
pkgs,
...
}:
{
home.packages = with pkgs; [
gamescope
steam
];
systemd.user.services.steam-big-picture = {
Unit = {
Description = "Steam Big Picture in Gamescope";
After = [
"graphical.target"
"default.target"
];
};
Service = {
ExecStart = ''
${pkgs.gamescope}/bin/gamescope --rt --backend drm --steam -- \
${pkgs.steam}/bin/steam -pipewire-dmabuf -tenfoot
'';
Restart = "always";
};
Install = {
WantedBy = [ "default.target" ];
};
};
}

66
users/guest/default.nix Normal file
View File

@@ -0,0 +1,66 @@
{
config,
pkgs,
lib,
...
}:
let
inherit (lib)
optional
;
name = "guest";
hostFile = ./. + "/${config.networking.hostName}.nix";
in
{
users.users.${name} = {
description = "Guest";
extraGroups = [
"audio"
"input"
"render"
"video"
];
group = "users";
isNormalUser = true;
shell = pkgs.zsh;
};
home-manager.users.${name} = {
imports = [
./common/optional/graphical/steam.nix
{
home.persistence."/state" = {
directories = [
".local/state/wireplumber"
];
};
home.persistence."/persist" = {
directories = [
".config/gamescope"
".local/share/icons"
".local/share/Steam"
".local/share/vulkan"
".steam"
];
};
}
]
++ optional (builtins.pathExists hostFile) hostFile;
home = {
username = name;
};
xdg.enable = true;
};
services.getty = {
autologinOnce = true;
autologinUser = "guest";
};
# Workaround: https://github.com/nix-community/home-manager/issues/7166
systemd.services."home-manager-${name}".serviceConfig = {
RemainAfterExit = "yes";
};
}