use flatpak to sandbox steam and bottles

This commit is contained in:
Christoph Cullmann 2023-10-22 17:35:45 +02:00
parent 8df38b9ca6
commit b3a54745cc

View file

@ -212,31 +212,65 @@ in
aspellDicts.en aspellDicts.en
borgbackup borgbackup
btop btop
calibre
chromium chromium
clamav clamav
clinfo clinfo
config.boot.kernelPackages.perf config.boot.kernelPackages.perf
efibootmgr efibootmgr
emacs
falkon
fdupes fdupes
ffmpeg
file file
filelight filelight
gimp
gitFull gitFull
glxinfo glxinfo
go
gptfdisk gptfdisk
heaptrack
hotspot
hugo
hunspellDicts.de_DE hunspellDicts.de_DE
hunspellDicts.en_US hunspellDicts.en_US
inetutils inetutils
kate
kcachegrind
kcalc
keychain
kmail
kompare
konsole konsole
konversation
krita
libjxl
libreoffice
libva-utils libva-utils
lsof lsof
mc mc
neochat
nixos-install-tools nixos-install-tools
nmap
nvme-cli nvme-cli
okteta
okular
p7zip p7zip
parted parted
pciutils pciutils
pulseaudio
qmk
tcl
texlive.combined.scheme-small
tigervnc
tk
tokodon
unrar unrar
unzip unzip
usbutils
valgrind
vlc
vscodium
vulkan-tools vulkan-tools
wayland-utils wayland-utils
zsh zsh
@ -272,6 +306,14 @@ in
# firefox needs programs.firefox.enable here but no systemPackages entry to have icon and work # firefox needs programs.firefox.enable here but no systemPackages entry to have icon and work
programs.firefox.enable = true; programs.firefox.enable = true;
# Flatpak to sandbox Steam, Bottles and Co.
#
# flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# flatpak install --user flathub com.usebottles.bottles
# flatpak install --user flathub com.valvesoftware.Steam
#
services.flatpak.enable = true;
# allow keyboard configure tools to work # allow keyboard configure tools to work
hardware.keyboard.qmk.enable = true; hardware.keyboard.qmk.enable = true;
@ -305,10 +347,9 @@ in
}; };
}; };
# 64-bit GL # OpenGL
hardware.opengl.enable = true;
hardware.opengl.driSupport = true; hardware.opengl.driSupport = true;
# proper lutris gaming for 32-bit stuff
hardware.opengl.driSupport32Bit = true; hardware.opengl.driSupport32Bit = true;
# virus scanner, we only want the updater running # virus scanner, we only want the updater running
@ -321,6 +362,9 @@ in
# let's get SSD status # let's get SSD status
services.smartd.enable = true; services.smartd.enable = true;
# dconf is needed for gtk, see https://nixos.wiki/wiki/KDE
programs.dconf.enable = true;
# ensure cron and Co. can send mails # ensure cron and Co. can send mails
programs.msmtp = { programs.msmtp = {
enable = true; enable = true;
@ -350,28 +394,49 @@ in
}; };
}; };
# use ZSH per default # use ZSH per default with a proper config
users.defaultUserShell = pkgs.zsh; users.defaultUserShell = pkgs.zsh;
# nice zsh config
programs.zsh = { programs.zsh = {
# zsh wanted # zsh wanted
enable = true; enable = true;
# some env vars I want in all of my shells # some env vars I want in all of my shells
shellInit = "export MOZ_ENABLE_WAYLAND=1; export POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true;"; shellInit = ''
export MOZ_ENABLE_WAYLAND=1
export POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share
'';
# great prompt # great prompt
promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme; if [ -f ~/.p10k.zsh ]; then source ~/.p10k.zsh; fi;"; promptInit = ''
source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme
if [ -f ~/.p10k.zsh ]; then
source ~/.p10k.zsh;
fi
'';
# aliases
shellAliases = {
ll = "ls -l";
# system build/update/cleanup
update = "sudo nixos-rebuild switch";
upgrade = "sudo nixos-rebuild switch --upgrade";
gc = "sudo nix-collect-garbage --delete-older-than 7d";
verify = "sudo nix --extra-experimental-features nix-command store verify --all";
optimize = "sudo nix --extra-experimental-features nix-command store optimise";
# ssh around in the local network
kuro = "ssh kuro.fritz.box";
kuroroot = "ssh root@kuro.fritz.box";
mini = "ssh mini.fritz.box";
miniroot = "ssh root@mini.fritz.box";
neko = "ssh neko.fritz.box";
nekoroot = "ssh root@neko.fritz.box";
};
}; };
# we want steam for gaming # enable VirtualBox for the main user
programs.steam.enable = true;
# dconf is needed for gtk, see https://nixos.wiki/wiki/KDE
programs.dconf.enable = true;
# enable VirtualBox
virtualisation.virtualbox.host.enable = true; virtualisation.virtualbox.host.enable = true;
users.extraGroups.vboxusers.members = [ "cullmann" ]; users.extraGroups.vboxusers.members = [ "cullmann" ];
@ -405,12 +470,7 @@ in
home.stateVersion = "22.11"; home.stateVersion = "22.11";
# generate the shell config # generate the shell config
programs.zsh = { programs.zsh.enable = true;
enable = true;
shellAliases = {
ll = "ls -l";
};
};
}; };
# #
@ -438,114 +498,17 @@ in
# initial version # initial version
home.stateVersion = "22.11"; home.stateVersion = "22.11";
# extra packages, stuff for work/kde/...
home.packages = with pkgs; [
calibre
emacs
falkon
ffmpeg
gimp
go
heaptrack
hotspot
hugo
kate
kcachegrind
kcalc
keychain
kmail
kompare
konversation
krita
libjxl
libreoffice
neochat
nmap
okteta
okular
pulseaudio
qmk
tcl
texlive.combined.scheme-small
tigervnc
tk
tokodon
usbutils
valgrind
vlc
vscodium
xorg.xhost
];
# https://github.com/nix-community/nix-direnv
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
# generate the shell config # generate the shell config
programs.zsh = { programs.zsh.enable = true;
enable = true;
shellAliases = {
ll = "ls -l";
# system build/update/cleanup
update = "sudo nixos-rebuild switch";
upgrade = "sudo nixos-rebuild switch --upgrade";
gc = "sudo nix-collect-garbage --delete-older-than 7d";
verify = "sudo nix --extra-experimental-features nix-command store verify --all";
optimize = "sudo nix --extra-experimental-features nix-command store optimise";
# ssh around in the local network
kuro = "ssh kuro.fritz.box";
kuroroot = "ssh root@kuro.fritz.box";
mini = "ssh mini.fritz.box";
miniroot = "ssh root@mini.fritz.box";
neko = "ssh neko.fritz.box";
nekoroot = "ssh root@neko.fritz.box";
};
};
# enable keychain # enable keychain
programs.keychain = { programs.keychain = {
enable = true; enable = true;
keys = [ "id_ed25519" ]; keys = [ "id_ed25519" ];
}; };
};
# # https://github.com/nix-community/nix-direnv
# sandbox user for games programs.direnv.enable = true;
# programs.direnv.nix-direnv.enable = true;
users.users.sandbox = {
# hard code UID for stability over machines
uid = 1001;
# normal user
isNormalUser = true;
# dummy sand box name for Windows games and Co.
description = "Sand Box";
};
home-manager.users.sandbox = { pkgs, ... }: {
# initial version
home.stateVersion = "22.11";
# extra packages, stuff for games
home.packages = with pkgs; [
bottles
lutris
protonup-qt
sqlitebrowser
wine64
xdotool
];
# generate the shell config
programs.zsh = {
enable = true;
shellAliases = {
ll = "ls -l";
};
};
}; };
} }