users/guest: init and add steam
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m22s
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m22s
This commit is contained in:
30
users/guest/common/optional/graphical/steam.nix
Normal file
30
users/guest/common/optional/graphical/steam.nix
Normal 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
66
users/guest/default.nix
Normal 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";
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user