dotfiles

My PC Dotfiles & Website

modules/apps/wine.nix (1010B)


 1## Wine Configuration ##
 2_: {
 3  flake.modules = {
 4    nixos.wine = {
 5      config,
 6      lib,
 7      pkgs,
 8      ...
 9    }: let
10      pkg = config.apps.wine;
11    in {
12      options.apps.wine = lib.mkOption {
13        description = "Package to use for 'wine'";
14        type = lib.types.package;
15        default = pkgs.wineWow64Packages.stagingFull;
16      };
17
18      config = {
19        services.samba.enable = true;
20        hardware.xpadneo.enable = true;
21        hardware.graphics.enable32Bit = true;
22
23        environment.systemPackages = with pkgs.wine // pkgs; (
24          map
25          (
26            name:
27              if (name.override.__functionArgs ? wine)
28              then name.override {wine = pkg;}
29              else name
30          )
31          [
32            pkg
33            winetricks
34            playonlinux
35          ]
36        );
37      };
38    };
39
40    homeManager.wine = _: {
41      home.persist.directories = [
42        ".wine"
43        ".cache/wine"
44        ".cache/winetricks"
45      ];
46    };
47  };
48}