diff --git a/configuration.nix b/configuration.nix index 35ce780..e8cd4b4 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,26 +1,29 @@ -{ config, pkgs, lib, ... }: { - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ./nix-settings.nix - ./users - ./.luks-swap.nix - ./fonts.nix - ./extra - ./core - ./dev - ./games - ./hardware - ./system - ]; +{ config, pkgs, lib, ... }: +let + settings = import ./settings.nix; +in +{ + imports = [ + ./hardware-configuration.nix # Include the results of the hardware scan. + ./nix-settings.nix # nix related config + ./users + ./.luks-swap.nix + ./fonts.nix # system wide font settings + ./extra # extra packages + ./core # core system components + ./dev # development stuff + ./games # games + ./hardware # hardware specific settings + ./system # system components such as kernel + ]; - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It's perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.11"; # Did you read the comment? + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It's perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = settings.stateVersion; # Did you read the comment? hardware.opengl.enable = true; @@ -52,9 +55,6 @@ # Configure console keymap console.keyMap = "de"; - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = (with pkgs; [ @@ -91,27 +91,8 @@ # SCSI driver sg3_utils - - wineWowPackages.stable - winetricks ]); - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Or disable the firewall altogether. - # networking.firewall.enable = false; - environment.sessionVariables = rec { # rust CARGO_TERM_COLOR = "always"; diff --git a/dev/default.nix b/dev/default.nix index db23c29..0b85135 100644 --- a/dev/default.nix +++ b/dev/default.nix @@ -10,5 +10,6 @@ in ++ lib.optionals settings.dev.latex [ ./latex.nix ] ++ lib.optionals settings.dev.dotnet [ ./dotnet.nix ] ++ lib.optionals settings.dev.python3.enable [ ./python3.nix ] - ++ lib.optionals settings.virtualisation.waydroid [ ./waydroid.nix ]; + ++ lib.optionals settings.virtualisation.waydroid [ ./waydroid.nix ] + ++ lib.optionals settings.virtualisation.wine.enable [ ./wine.nix ]; } diff --git a/dev/wine.nix b/dev/wine.nix new file mode 100644 index 0000000..03c98c9 --- /dev/null +++ b/dev/wine.nix @@ -0,0 +1,31 @@ +{ pkgs, lib, config, ... }: +let + settings = import ./../settings.nix; +in +{ + config = lib.mkMerge [ + # optionally enable native wine for wayland + (lib.mkIf settings.virtualisation.wine.wayland { + environment.systemPackages = (with pkgs; [ + # native wayland support (unstable) + wineWowPackages.waylandFull + ]); + }) + + # if wayland is off, use package for Xorg + (lib.mkIf (!settings.virtualisation.wine.wayland) { + environment.systemPackages = (with pkgs; [ + # support both 32- and 64-bit applications + wineWowPackages.stagingFull + ]); + }) + + # winetricks + (lib.mkIf settings.virtualisation.wine.winetricks { + environment.systemPackages = (with pkgs; [ + # winetricks (works for all versions of wine) + winetricks + ]); + }) + ]; +} diff --git a/settings.nix b/settings.nix index 5494755..59283b2 100644 --- a/settings.nix +++ b/settings.nix @@ -1,4 +1,7 @@ -with import {}; { +with import {}; +{ + stateVersion = "23.11"; + hardware = { # support for GPUs amdgpu = true; @@ -42,6 +45,11 @@ with import {}; { virt-manager = true; }; waydroid = false; + wine = { + enable = true; + wayland = false; + winetricks = true; + }; }; dev = { platformio = true;