From 875abade932d64c8e0c3a3076eb1abfee41ea032 Mon Sep 17 00:00:00 2001 From: foo-dogsquared Date: Sat, 25 Dec 2021 21:30:10 +0800 Subject: [PATCH] Add `modules.desktop.wine` option I'll experiment using Wine with NixOS. Let's just see how this goes. --- hosts/ni/default.nix | 1 + modules/nixos/desktop.nix | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/hosts/ni/default.nix b/hosts/ni/default.nix index b37c3ca8..1c7557e2 100644 --- a/hosts/ni/default.nix +++ b/hosts/ni/default.nix @@ -20,6 +20,7 @@ fonts.enable = true; hardware.enable = true; cleanup.enable = true; + wine.enable = true; }; dev = { enable = true; diff --git a/modules/nixos/desktop.nix b/modules/nixos/desktop.nix index 04fcbee6..87767860 100644 --- a/modules/nixos/desktop.nix +++ b/modules/nixos/desktop.nix @@ -14,6 +14,14 @@ in { hardware.enable = lib.mkEnableOption "the common hardware-related configuration"; cleanup.enable = lib.mkEnableOption "activation of cleanup services"; + wine = { + enable = lib.mkEnableOption "Wine and Wine-related tools"; + package = lib.mkOption { + type = lib.types.package; + description = "The Wine package to be used for related tools."; + default = pkgs.wineWowPackages.stable; + }; + }; }; config = lib.mkIf cfg.enable (lib.mkMerge [ @@ -130,5 +138,15 @@ in { }; }; }) + + # I try to avoid using Wine on NixOS because most of them uses FHS or something and I just want it to work but here goes. + (lib.mkIf cfg.wine.enable { + environment.systemPackages = with pkgs; + [ + cfg.wine.package # The star of the show. + winetricks # We do a little trickery with missing Windows runtimes. + bottles # PlayOnLinux but better. :) + ]; + }) ]); }