# Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). { # config, pkgs, ... }: { imports = [ ./code-server.nix ./tigervnc.nix ./hardware/hardware-configuration.nix ./hardware/realtek-r8125.nix ]; # Bootloader. # boot.loader.systemd-boot.enable = true; # managed by lanzaboote boot.loader.efi.canTouchEfiVariables = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; networking.hostName = "drivebystation-nix"; # 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"; # Enable networking networking.networkmanager.enable = true; # Set your time zone. time.timeZone = "Europe/Amsterdam"; # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; i18n.extraLocaleSettings = { LC_ADDRESS = "nl_NL.UTF-8"; LC_IDENTIFICATION = "nl_NL.UTF-8"; LC_MEASUREMENT = "nl_NL.UTF-8"; LC_MONETARY = "nl_NL.UTF-8"; LC_NAME = "nl_NL.UTF-8"; LC_NUMERIC = "nl_NL.UTF-8"; LC_PAPER = "nl_NL.UTF-8"; LC_TELEPHONE = "nl_NL.UTF-8"; LC_TIME = "nl_NL.UTF-8"; }; system.activationScripts."stremio-mpv-flatpak-patch" = { text = '' # 1. Provide the symlink where Stremio's player engine queries mkdir -p /usr/bin ln -sf /run/current-system/sw/bin/mpv /usr/bin/mpv # 2. Locate and patch the runtime server.js file inside the active Flatpak installation TARGET_FILE="/var/lib/flatpak/app/com.stremio.Stremio/current/active/files/opt/stremio/server.js" if [ -f "$TARGET_FILE" ]; then # Make sure the file is writable momentarily for the patch chmod +w "$TARGET_FILE" # Inject the flatpak-spawn sequence into the linux player profile sed -i 's|linux:{path:\["\/usr\/bin\/mpv"\]|linux:{path:["/usr/bin/flatpak-spawn"],args:["--host","/usr/bin/mpv"]|g' "$TARGET_FILE" sed -i 's|linux:{path:\["mpv"\]|linux:{path:["/usr/bin/flatpak-spawn"],args:["--host","/usr/bin/mpv"]|g' "$TARGET_FILE" # Restore permissions chmod -w "$TARGET_FILE" fi ''; }; services = { # Enable Gnome Session displayManager.gdm.enable = true; displayManager.sddm.enable = false; # displayManager.sddm.wayland.enable = true; displayManager.autoLogin = { enable = false; user = "andreas"; }; displayManager.cosmic-greeter.enable = false; displayManager.defaultSession = "gnome"; # Clear the sandbox restriction dynamically xserver = { enable = true; # Enable the deprecated X11 teletype terminal connection system. # Configure Display Manager displayManager = { lightdm.enable = false; }; # Configure keymap in X11 xkb = { layout = "us"; variant = "intl"; }; # Specify first device section to use nvidia GPU }; }; # services.xserver.displayManager.defaultSession = "gnome-x11"; # services.xserver.displayManager.autoLogin.enable = true; # services.xserver.displayManager.autoLogin.user = "andreas"; # systemd.services."getty@tty1".enable = false; # systemd.services."autovt@tty1".enable = false; programs.ssh.askPassword = "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass"; # Configure console keymap console.keyMap = "us-acentos"; # Enable CUPS to print documents. services.printing.enable = true; # Enable sound with pipewire. services.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; # If you want to use JACK applications, uncomment this jack.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 gamemode for game optimization programs.gamemode.enable = true; # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; # Install firefox. programs.firefox.enable = true; # Enable XWayland for X11 application compatibility programs.xwayland.enable = true; # docker virtualisation.docker = { enable = true; }; # Allow unfree packages nixpkgs.config.allowUnfree = true; # Enable --Akonadi--/ kde-pim for calendar backend programs.kde-pim.enable = true; services.dbus.enable = true; # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # wget (python3.withPackages (ps: with ps; [ websockets ])) sqlite javaPackages.compiler.openjdk25 javaPackages.compiler.openjdk21 qt6.qtwebengine qemu mpv krita ntfs3g htop rivalcfg blender freecad reaper discord betterdiscordctl ]; environment.etc."xdg/autostart/xwaylandvideobridge.desktop".text = '' [Desktop Entry] Hidden=true ''; services.udisks2.settings = { # Should fix mounting ntfs system partition - Did not work "udisks2.conf" = { defaults = { allow_mount_internal = true; allow_mount_system = true; }; }; }; services.gvfs.enable = true; # For file manager integration # Enable udev rules for SteelSeries devices (rivalcfg) services.udev.packages = [ pkgs.rivalcfg ]; # Disable iBus (not needed unless using Asian input methods) i18n.inputMethod = { enable = false; }; virtualisation.libvirtd = { enable = true; qemu = { package = pkgs.qemu; runAsRoot = true; swtpm.enable = true; vhostUserPackages = [ pkgs.virtiofsd ]; }; }; systemd.tmpfiles.rules = [ "L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware" ]; # 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; # Open ports in the . networking.firewall.allowedTCPPorts = [ 24800 #Synergy 53317 #localsend 3390 #rdp 9090 8000 40122 ]; networking.firewall.allowedUDPPorts = [ 24800 #Synergy 53317 #localsend 3390 #rdp 9090 8000 40122 ]; networking.firewall.trustedInterfaces = [ "virbr0" ]; networking.nat = { enable = true; internalInterfaces = [ "virbr0" ]; externalInterface = "enp75s0"; extraCommands = '' # MASQUERADE forwarded traffic to VM so it knows how to route back iptables -t nat -A nixos-nat-post -o virbr0 -j MASQUERADE ''; forwardPorts = [ { sourcePort = 9090; proto = "tcp"; destination = "192.168.122.113:9090"; } { sourcePort = 9090; proto = "udp"; destination = "192.168.122.113:9090"; } ]; }; services.mullvad-vpn = { enable = true; package = pkgs.mullvad-vpn; }; fonts = { packages = with pkgs; [ noto-fonts noto-fonts-color-emoji ]; fontconfig = { enable = true; defaultFonts = { sansSerif = [ "DejaVu Sans" "Noto Color Emoji" ]; serif = [ "DejaVu Serif" "Noto Color Emoji" ]; monospace = [ "DejaVu Sans Mono" "Noto Color Emoji" ]; emoji = [ "Noto Color Emoji" ]; }; }; }; # services.xrdp = { # enable = true; # openFirewall = true; # defaultWindowManager = "cinnamon-session"; # }; ### tigervnc services.tigervnc = { enable = false; users = { andreas = { localhost = false; # true for SSH-only }; }; }; ### tigervnc END # 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 = "26.05"; # Did you read the comment? }