added stateVersion to settings + wine in dev module

This commit is contained in:
Sven Vogel 2023-12-22 14:27:04 +01:00
parent 052ae88a78
commit 665a1c0264
4 changed files with 67 additions and 46 deletions

View File

@ -1,17 +1,20 @@
{ config, pkgs, lib, ... }: {
{ config, pkgs, lib, ... }:
let
settings = import ./settings.nix;
in
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
./nix-settings.nix
./hardware-configuration.nix # Include the results of the hardware scan.
./nix-settings.nix # nix related config
./users
./.luks-swap.nix
./fonts.nix
./extra
./core
./dev
./games
./hardware
./system
./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
@ -20,7 +23,7 @@
# 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?
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";

View File

@ -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 ];
}

31
dev/wine.nix Normal file
View File

@ -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
]);
})
];
}

View File

@ -1,4 +1,7 @@
with import <nixpkgs> {}; {
with import <nixpkgs> {};
{
stateVersion = "23.11";
hardware = {
# support for GPUs
amdgpu = true;
@ -42,6 +45,11 @@ with import <nixpkgs> {}; {
virt-manager = true;
};
waydroid = false;
wine = {
enable = true;
wayland = false;
winetricks = true;
};
};
dev = {
platformio = true;