From 46685e2ca03f1c27db3dd3421cf61016e9471727 Mon Sep 17 00:00:00 2001 From: vpochapuis Date: Wed, 27 Mar 2024 22:31:43 +0800 Subject: [PATCH] Add Docker and good wine config --- configuration.nix | 344 +++++++++++++++++++++++++--------------------- 1 file changed, 185 insertions(+), 159 deletions(-) diff --git a/configuration.nix b/configuration.nix index b5e1c4b..b091ed5 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,194 +4,220 @@ { config, pkgs, ... }: let - unstable = import - (builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/nixos-unstable) - # reuse the current configuration - { config = config.nixpkgs.config; }; +unstable = import +(builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/nixos-unstable) +# reuse the current configuration +{ config = config.nixpkgs.config; }; in { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - # audio prod musnix channel https://github.com/musnix/musnix - - ]; + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix +# audio prod musnix channel https://github.com/musnix/musnix + + ]; - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; +# Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; - boot.initrd.luks.devices."luks-54b7aa8e-f52b-47be-82d0-8a51264480af".device = "/dev/disk/by-uuid/54b7aa8e-f52b-47be-82d0-8a51264480af"; - networking.hostName = "vchapuis-taiwan-home-desktop"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + boot.initrd.luks.devices."luks-54b7aa8e-f52b-47be-82d0-8a51264480af".device = "/dev/disk/by-uuid/54b7aa8e-f52b-47be-82d0-8a51264480af"; + networking.hostName = "vchapuis-taiwan-home-desktop"; # Define your hostname. +# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; +# Configure network proxy if necessary +# networking.proxy.default = "http://user:password@proxy:port/"; +# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Enable networking - networking.networkmanager.enable = true; +# Enable networking + networking.networkmanager.enable = true; - # Set your time zone. - time.timeZone = "Asia/Taipei"; +# Set your time zone. + time.timeZone = "Asia/Taipei"; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; +# Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "zh_TW.UTF-8"; - LC_IDENTIFICATION = "zh_TW.UTF-8"; - LC_MEASUREMENT = "zh_TW.UTF-8"; - LC_MONETARY = "zh_TW.UTF-8"; - LC_NAME = "zh_TW.UTF-8"; - LC_NUMERIC = "zh_TW.UTF-8"; - LC_PAPER = "zh_TW.UTF-8"; - LC_TELEPHONE = "zh_TW.UTF-8"; - LC_TIME = "zh_TW.UTF-8"; - }; + i18n.extraLocaleSettings = { + LC_ADDRESS = "zh_TW.UTF-8"; + LC_IDENTIFICATION = "zh_TW.UTF-8"; + LC_MEASUREMENT = "zh_TW.UTF-8"; + LC_MONETARY = "zh_TW.UTF-8"; + LC_NAME = "zh_TW.UTF-8"; + LC_NUMERIC = "zh_TW.UTF-8"; + LC_PAPER = "zh_TW.UTF-8"; + LC_TELEPHONE = "zh_TW.UTF-8"; + LC_TIME = "zh_TW.UTF-8"; + }; - # Enable the X11 windowing system. - services.xserver.enable = true; - services.xserver.videoDrivers = [ "amdgpu" ]; - # Vulkan Support - hardware.opengl.driSupport = true; - hardware.opengl.driSupport32Bit = true; + i18n.inputMethod = { + enabled = "ibus"; + ibus.engines = with pkgs.ibus-engines; [ rime ]; + }; - # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; +# Enable the X11 windowing system. + services.xserver.enable = true; + services.xserver.videoDrivers = [ "amdgpu" ]; +# Vulkan Support + hardware.opengl.enable = true; + hardware.opengl.driSupport = true; + hardware.opengl.driSupport32Bit = true; - # Configure keymap in X11 - services.xserver = { - layout = "us"; - xkbVariant = "altgr-intl"; - }; +# Enable the GNOME Desktop Environment. + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; - # Enable CUPS to print documents. - services.printing.enable = true; +# Configure keymap in X11 + services.xserver = { + layout = "us"; + xkbVariant = "altgr-intl"; + }; - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = false; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - wireplumber.enable = true; - jack.enable = true; +# Enable CUPS to print documents. + services.printing.enable = true; - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; +# Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = false; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + wireplumber.enable = true; + jack.enable = true; - # Enable musnix - musnix.enable = true; +# use the example session manager (no others are packaged yet so this is enabled by default, +# no need to redefine it in your config for now) +#media-session.enable = true; + }; - # Enable ISO mounting - services.udisks2.enable = true; +# Enable musnix + musnix.enable = true; - # Virtualbox virtualization - virtualisation.virtualbox.host.enable = true; - users.extraGroups.vboxusers.members = [ "vchapuis" ]; - virtualisation.virtualbox.guest.enable = true; - virtualisation.virtualbox.guest.x11 = true; - virtualisation.virtualbox.host.enableExtensionPack = true; +# Enable ISO mounting + services.udisks2.enable = true; - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; + virtualisation = { + podman = { + enable = true; + +# Create a `docker` alias for podman, to use it as a drop-in replacement + dockerCompat = true; + +# Required for containers under podman-compose to be able to talk to each other. + defaultNetwork.settings.dns_enabled = true; + }; + virtualbox = { + host = { + enable = true; + enableExtensionPack = true; + }; + guest = { + enable = true; + x11 = true; + }; + }; + }; + users.extraGroups.vboxusers.members = [ "vchapuis" ]; + +# Enable touchpad support (enabled default in most desktopManager). +# services.xserver.libinput.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.vchapuis = { - isNormalUser = true; - description = "vchapuis"; - extraGroups = [ "networkmanager" "wheel" "audio" "wireshark"]; - - packages = with pkgs; [ - firefox-bin - pavucontrol - xorg.xeyes - element-desktop - neofetch - qjackctl - sonobus - blender-hip - gimp - inkscape - kdenlive - ardour - rustup - vscodium - gnome3.gnome-tweaks - yabridge - yabridgectl - # Using unstable wine ( >8.20) because of missing fix for running Kontakt 7 with hdpi screen - unstable.wineWowPackages.staging - unstable.winetricks - obs-studio - wireshark - libreoffice-qt - hunspell - vlc - samba4Full - - # thunderbird - ]; - }; +# Define a user account. Don't forget to set a password with ‘passwd’. + users.users.vchapuis = { + isNormalUser = true; + description = "vchapuis"; + extraGroups = [ "networkmanager" "wheel" "audio" "wireshark"]; - # Allow unfree packages - nixpkgs.config.allowUnfree = true; + packages = with pkgs; [ + firefox-bin + chromium + pavucontrol + xorg.xeyes + element-desktop + neofetch + qjackctl + sonobus + blender-hip + gimp + inkscape + kdenlive + ardour + rustup + vscodium + gnome3.gnome-tweaks + yabridge + yabridgectl +# Using unstable wine ( >8.20) because of missing fix for running Kontakt 7 with hdpi screen + unstable.wineWowPackages.staging + unstable.winetricks + obs-studio + wireshark + libreoffice-qt + hunspell + vlc + samba4Full + godot_4 + telegram-desktop + anydesk + +# thunderbird + ]; + }; + +# Allow unfree packages + nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - vim - wget - curl - git - gcc - ttf-tw-moe - noto-fonts-cjk-serif - ]; +# List packages installed in system profile. To search, run: +# $ nix search wget + environment.systemPackages = with pkgs; [ + vim + wget + curl + git + gcc + ttf-tw-moe + noto-fonts-cjk-serif + ]; - environment.etc."udisks2/mount_options.conf".text = '' [defaults] - udf_defaults=uid=$UID,gid=$GID,iocharset=utf8,unhide - ''; + environment.etc."udisks2/mount_options.conf".text = '' [defaults] + udf_defaults=uid=$UID,gid=$GID,iocharset=utf8,unhide + ''; - # 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; - # }; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server - }; +# 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; +# }; + programs.steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; - # List services that you want to enable: +# List services that you want to enable: - # Enable the OpenSSH daemon. - # services.openssh.enable = true; +# Enable the OpenSSH daemon. +# services.openssh.enable = true; - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; +# Open ports in the firewall. +# networking.firewall.allowedTCPPorts = [ ... ]; +# networking.firewall.allowedUDPPorts = [ ... ]; +# Or disable the firewall altogether. +# networking.firewall.enable = false; - # 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.05"; # 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 = "23.05"; # Did you read the comment? }