From d7202a1af149982326448b19e3b6a51dbde0f232 Mon Sep 17 00:00:00 2001 From: Jay Looney Date: Wed, 8 Oct 2025 11:14:36 -0500 Subject: [PATCH] feat: add calibre and game virtualization --- hosts/titanium/game-emulation.nix | 57 +++++++++++++++++++ modules/nixos/desktop/calibre.nix | 27 +++++++++ .../{desktop.nix => desktop/default.nix} | 0 3 files changed, 84 insertions(+) create mode 100644 hosts/titanium/game-emulation.nix create mode 100644 modules/nixos/desktop/calibre.nix rename modules/nixos/{desktop.nix => desktop/default.nix} (100%) diff --git a/hosts/titanium/game-emulation.nix b/hosts/titanium/game-emulation.nix new file mode 100644 index 0000000..28b6c99 --- /dev/null +++ b/hosts/titanium/game-emulation.nix @@ -0,0 +1,57 @@ +{ config, lib, pkgs, ... }: +let + retroarchWithCores = ( + pkgs.retroarch.withCores ( + cores: with cores; [ + # Multi-Emulators + mame # Atari / Nintendo / Sega / etc. + + # Sega + genesis-plus-gx # Sega Genesis + + # Nintendo + mesen # NES + bsnes # Super Nintendo + mupen64plus # Nintendo 64 - Maybe simple64 some day. + dolphin # GameCube + mgba # GameBoy / Color / Advance + melonds # Nintendo DS + citra # Nintendo 3DS + + + # Sony + swanstation #duckstation # PlayStation + beetle-psx-hw + pcsx2 # PlayStation 2 -- Is actually "LRPS2" + #rpcs3 # PlayStation 3 + ppsspp # PlayStation Portable + + # Commodore + vice-x64 # C64 + ] + ) + ); +in +{ + environment.systemPackages = [ + retroarchWithCores + #pkgs.emulationstation-de + pkgs.gnome-bluetooth + ]; + + hardware.xone.enable = true; # Xbox Controller Driver + hardware.enableAllFirmware = true; + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General = { + Experimental = true; + FastConnectable = true; + }; + Policy = { + AutoEnable = true; + }; + }; + }; +} diff --git a/modules/nixos/desktop/calibre.nix b/modules/nixos/desktop/calibre.nix new file mode 100644 index 0000000..e4c1c6c --- /dev/null +++ b/modules/nixos/desktop/calibre.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: +{ + imports = []; + + options = { + zw-calibre = { + enable = lib.mkEnableOption "Enable Calibre"; + }; + }; + + config = { + config.allowUnfreePredigate = pkg: builtins.elem (lib.getName pkg) [ + "calibre" + "unrar" + ]; + + environment.systemPackages = with pkgs; [ + (calibre.override { + unrarSupport = true; + }) + unrar + ]; + + services.udisks2.enable = true; + }; + # NOTE: Consider adding https://github.com/nydragon/calibre-plugins +} diff --git a/modules/nixos/desktop.nix b/modules/nixos/desktop/default.nix similarity index 100% rename from modules/nixos/desktop.nix rename to modules/nixos/desktop/default.nix