Add base wine container

I figured out how to get wine working on Nix, and it works surprisingly
well, however I'd like to avoid programs from writing wherever they want
and don't want to rely on a solution like firejail.

As it turns out, systemd-nspawn containers enable us to run wine applications
in a reasonably private container without access to neither the files of the
host nor its internet connection.
This commit is contained in:
Donovan Glover 2023-06-03 15:29:49 -04:00
parent a22b9355dd
commit 6985903631
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

50
containers/wine.nix Normal file
View File

@ -0,0 +1,50 @@
{
containers.wine = {
autoStart = true;
privateNetwork = true;
bindMounts = {
"/home/user" = {
hostPath = "/home/user/containers/wine";
isReadOnly = false;
};
};
config = { pkgs, lib, ... }: {
programs = {
fish.enable = true;
neovim.enable = true;
starship.enable = true;
};
users = {
defaultUserShell = pkgs.fish;
mutableUsers = false;
allowNoPasswordLogin = true;
users.user = {
isNormalUser = true;
home = "/home/user";
};
};
environment = {
shells = with pkgs; [ fish ];
variables = {
TERM = "xterm-kitty";
};
defaultPackages = [ ];
};
environment.systemPackages = with pkgs; [
kitty
wine-staging
winetricks
];
system.stateVersion = "22.11";
};
};
}