Compare commits

...

10 commits

Author SHA1 Message Date
57112d33a2 Cleanup: remove stale modules, improve libxml2 package, add wget dependency
- Remove old system-wide modules: modules/tibia.nix, modules/multimedia.nix
- libxml2-2.9: rename pname to libxml2-2-9 (avoid conflict), add meta
- Tibia module: add wget to home.packages (required for tibia-install)
- tibia-install: use wget directly (no fallback), since wget is now a dependency
2026-05-30 23:28:46 +02:00
1a2966e054 Refactor: czysta separacja system/user, moduł Tibii jako shared home-manager
[HermesAI]

Główne zmiany:

1. Separacja pakietów (best practice 2025+):
   - base.nix: tylko konfiguracja Nix-a (gc, flakes, allowUnfree), zero pakietów
   - home.nix: wszystkie pakiety użytkownika (brave, neovim, git, lutris, itd.)
   - NixOS modules (plasma.nix, gaming.nix): tylko enable serwisów, bez pakietów

2. Tibia jako shared home-manager module:
   - modules/home/tibia.nix — opcja programs.tibia.enable dostępna dla każdego usera
   - Rejestracja przez home-manager.sharedModules w flake.nix
   - packages/libxml2-2.9/ — osobny callPackage zamiast inline build
   - Nowe: tibia-install (pobiera launcher na świeżym systemie), .desktop entry
   - tibia-patch: check "already patched", quoted heredoc (bez expandowania $@)
   - Poprawiona ścieżka do tibia-client (store path przez ${...} zamiast /run/...)

3. Porządki:
   - Usunięte puste moduły (3dmodel, 3dprint, network, office) — pakiety w home.nix
   - hosts/nix-latitude/configuration.nix: usunięty duplikat hostname, packages z usera
   - flake.nix: home-manager spięty do nixos-unstable, usunięty brakujący host nix-gaming
   - .gitignore: result, .direnv, *.swp

UWAGA: Wymaga nix flake lock na maszynie NixOS po pull.
Nowy user: programs.tibia.enable = true w home.nix + tibia-install.
2026-05-30 23:18:50 +02:00
80c904edfd Autologin without password 2026-03-07 09:03:08 +01:00
35ab173c24 fix 2026-03-01 09:28:05 +01:00
9771242083 autologin without password 2026-03-01 09:27:21 +01:00
57c0d7237a add unzip 2026-03-01 09:27:12 +01:00
6c59fb3e17 VLC 2026-02-27 16:31:15 +01:00
6944ac33e3 reformat komentarzy, i plik desktop 2026-02-16 13:47:58 +01:00
8d1f5e59c3 reformat tibia.nix 2026-02-16 13:16:20 +01:00
9ec7c2631d Czyszczenie repo + keepass/nextcloud 2026-02-16 13:06:58 +01:00
28 changed files with 267 additions and 401 deletions

13
.gitignore vendored Normal file
View file

@ -0,0 +1,13 @@
# Nix build artifacts
result
result-*
# Direnv
.direnv
# IDE / edytory
.aider*
# Systemowe pliki tymczasowe
*.swp
*.swo

View file

@ -1,16 +1,18 @@
{ pkgs, ... }: { { pkgs, ... }: {
# Włączamy Flakes # === Włączamy Flakes ===
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
# paczki systemowe # === Automatyczne sprzątanie store ===
environment.systemPackages = with pkgs; [ nix.gc = {
neovim automatic = true;
git dates = "weekly";
openssh options = "--delete-older-than 30d";
wget };
tree
];
# === Optymalizacja store (deduplikacja) ===
nix.settings.auto-optimise-store = true;
# === Pozwalamy na niewolne pakiety ===
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
} }

View file

@ -1,61 +0,0 @@
{
description = "Modular NixOS config for gaming PC + office laptop";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
lib = nixpkgs.lib;
in {
nixosConfigurations = {
gaming-amd = lib.nixosSystem {
inherit system;
modules = [
./hosts/gaming-amd/configuration.nix
./modules/common/base.nix
./modules/common/networking.nix
./modules/common/users.nix
./modules/common/locale.nix
./modules/desktop/gaming.nix
./modules/services.steam.nix
];
};
laptop-office = lib.nixosSystem {
inherit system;
modules = [
./hosts/laptop-office/configuration.nix
./modules/common/base.nix
./modules/common/networking.nix
./modules/common/users.nix
./modules/common/locale.nix
./modules/desktop/office.nix
./modules/services/printing.nix
./modules/services/bluetooth.nix
];
};
};
homeConfigurations = {
gamer = home-manager.lib.homeManagerConfiguration {
inherit system;
modules = [
./home/gamer/home.nix
];
};
office = home-manager.lib.homeManagerConfiguration {
inherit system;
modules = [
./home/office/home.nix
];
};
};
};
}

View file

@ -1,11 +0,0 @@
{ config, pkgs, ... }: {
home.username = "gamer";
home.homeDirectory = "/home/gamer";
programs.git.enable = true;
programs.zsh.enable = true;
home.packages = with pkgs; [
discord obs-studio protonup-qt
];
}

View file

@ -1,11 +0,0 @@
{ config, pkgs, ... }: {
home.username = "office";
home.homeDirectory = "/home/office";
programs.git.enable = true;
programs.zsh.enable = true;
home.packages = with pkgs; [
libreoffice nextcloud-client zoom
];
}

View file

@ -1,3 +0,0 @@
{ config, pkgs, ... }: {
imports = [ ./hardware-configuration.nix ];
}

View file

@ -1,3 +0,0 @@
{ config, pkgs, ... }: {
imports = [ ./hardware-configuration.nix ];
}

View file

@ -1,4 +0,0 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [ vim git ];
services.openssh.enable = true;
}

View file

@ -1,4 +0,0 @@
{ ... }: {
i18n.defaultLocale = "pl_PL.UTF-8";
time.timeZone = "Europe/Warsaw";
}

View file

@ -1,3 +0,0 @@
{ ... }: {
networking.networkmanager.enable = true;
}

View file

@ -1,10 +0,0 @@
{ ... }: {
users.users.gamer = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
};
users.users.office = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
};
}

View file

@ -1,16 +0,0 @@
{ config, pkgs, ... }: {
services.xserver.enable = true;
services.xserver.desktopManager.gnome.enable = true;
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
hardware.cpu.amd.updateMicrocode = true;
environment.systemPackages = with pkgs; [
mangohud goverlay lutris vkBasalt
];
}

View file

@ -1,8 +0,0 @@
{ pkgs, ... }: {
services.xserver.enable = true;
services.xserver.desktopManager.plasma6.enable = true;
environment.systemPackages = with pkgs; [
libreoffice thunderbird okular
];
}

View file

@ -1,4 +0,0 @@
{ ... }: {
hardware.bluetooth.enable = true;
services.blueman.enable = true;
}

View file

@ -1,3 +0,0 @@
{ ... }: {
services.printing.enable = true;
}

View file

@ -1,8 +0,0 @@
{ pkgs, ... }: {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
environment.systemPackages = with pkgs; [ steam-run ];
}

View file

@ -2,48 +2,33 @@
description = "Konfiguracja wielu maszyn na raz"; description = "Konfiguracja wielu maszyn na raz";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Bleeding edge! nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager/nixos-unstable";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { self, nixpkgs, home-manager, ... }: outputs = { self, nixpkgs, home-manager, ... }:
let # pomocnicza funkcja let
mk_system = system: hostname: modules: nixpkgs.lib.nixosSystem { mk_system = system: hostname: modules: nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
{ networking.hostName = hostname; } { networking.hostName = hostname; }
# base configuration
./base.nix ./base.nix
# home manager
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.sharedModules = [ ./modules/home/tibia.nix ];
home-manager.users.sasza = import ./home.nix; home-manager.users.sasza = import ./home.nix;
} }
] ++ modules; ] ++ modules;
}; };
in { in {
nixosConfigurations = { nixosConfigurations = {
nix-latitude = mk_system "x86_64-linux" "nix-latitude" [ nix-latitude = mk_system "x86_64-linux" "nix-latitude" [
./hosts/nix-latitude/configuration.nix ./hosts/nix-latitude/configuration.nix
./modules/plasma.nix ./modules/plasma.nix
./modules/3dmodel.nix
#./modules/network.nix
#./modules/office.nix
./modules/tibia.nix
];
nix-gaming = mk_system "x86_64-linux" "nix-gaming" [
./hosts/nix-gaming/configuration.nix
./modules/plasma.nix
./modules/gaming.nix
./modules/network.nix
# ./modules/office.nix
./modules/3dmodel.nix
./modules/3dprint.nix
]; ];
}; };
}; };

View file

@ -3,18 +3,55 @@
home.homeDirectory = "/home/sasza"; home.homeDirectory = "/home/sasza";
home.packages = with pkgs; [ home.packages = with pkgs; [
# Przeglądarki
brave brave
# Narzędzia CLI
neovim
git
htop htop
glances glances
tree
wget
openssh
# Modelowanie 3D
openscad-unstable
# Druk 3D
orca-slicer
# Gry
lutris
# Sieć / VPN
eddie
wireguard-tools
qbittorrent
# Biuro
libreoffice-fresh
# KDE
kdePackages.kate
# Dodane z remote
file
keepassxc
nextcloud-client
tmux
unzip
vlc
]; ];
# Przykład prostej konfiguracji Git
programs.git = { programs.git = {
enable = true; enable = true;
settings.user.name = "Sasza Stanczew"; settings.user.name = "Sasza Stanczew";
settings.user.email = "sasza@stanczew.com"; settings.user.email = "sasza@stanczew.com";
}; };
programs.tibia.enable = true;
programs.home-manager.enable = true; programs.home-manager.enable = true;
home.stateVersion = "24.11"; home.stateVersion = "25.11";
} }

View file

@ -1,38 +1,25 @@
# 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, ... }: { config, pkgs, ... }:
{ {
imports = imports = [
[ # Include the results of the hardware scan. ./hardware-configuration.nix
./hardware-configuration.nix ];
];
# Bootloader. # Bootloader
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
# Use latest kernel. # Use latest kernel
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = "nix-latitude"; # 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 # Enable networking
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
# Set your time zone. # Timezone
time.timeZone = "Europe/Warsaw"; time.timeZone = "Europe/Warsaw";
# Select internationalisation properties. # Locale
i18n.defaultLocale = "pl_PL.UTF-8"; i18n.defaultLocale = "pl_PL.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
LC_ADDRESS = "pl_PL.UTF-8"; LC_ADDRESS = "pl_PL.UTF-8";
LC_IDENTIFICATION = "pl_PL.UTF-8"; LC_IDENTIFICATION = "pl_PL.UTF-8";
@ -45,45 +32,16 @@
LC_TIME = "pl_PL.UTF-8"; LC_TIME = "pl_PL.UTF-8";
}; };
# Configure console keymap # Console keymap
console.keyMap = "pl2"; console.keyMap = "pl2";
# Define a user account. Don't forget to set a password with passwd. # User account (pakiety w home-manager)
users.users.sasza = { users.users.sasza = {
isNormalUser = true; isNormalUser = true;
description = "Sasza Stanczew"; description = "Sasza Stanczew";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
kdePackages.kate
# thunderbird
];
}; };
# Some programs need SUID wrappers, can be configured further or are # State version
# started in user sessions. system.stateVersion = "25.11";
# 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 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. Its 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 = "25.11"; # Did you read the comment?
} }

View file

@ -1,7 +0,0 @@
{ pkgs, ... }: {
# paczki
environment.systemPackages = with pkgs; [
openscad-unstable
];
}

View file

@ -1,7 +0,0 @@
{ pkgs, ... }: {
# paczki
environment.systemPackages = with pkgs; [
orca-slicer
];
}

View file

@ -1,13 +1,9 @@
{ pkgs, ... }: { { pkgs, ... }: {
# Grafika AMD i Steam # Akceleracja grafiki (AMD/Intel)
hardware.graphics.enable = true; hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true; hardware.graphics.enable32Bit = true;
# Steam
programs.steam.enable = true; programs.steam.enable = true;
# paczki
environment.systemPackages = with pkgs; [
lutris
];
} }

147
modules/home/tibia.nix Normal file
View file

@ -0,0 +1,147 @@
{ config, pkgs, lib, ... }:
let
cfg = config.programs.tibia;
# Legacy libxml2 (2.9.x) — wymagany przez Tibię, usunięty z nixpkgs-unstable
libxml2_2_9 = pkgs.callPackage ../../packages/libxml2-2.9 { };
# Wspólne ścieżki bibliotek
tibiaLibPath = lib.makeLibraryPath [
pkgs.nss
pkgs.nspr
pkgs.libxkbfile
libxml2_2_9
];
# Helper: eksport LD_LIBRARY_PATH
exportLibs = ''
export LD_LIBRARY_PATH="${tibiaLibPath}:$LD_LIBRARY_PATH"
'';
# Wrapper dla właściwego clienta (uruchamiany przez Tibia package.json)
tibiaClientWrapper = pkgs.writeShellScriptBin "tibia-client" ''
#!/usr/bin/env bash
${exportLibs}
exec steam-run "$HOME/.local/share/CipSoft GmbH/Tibia/packages/Tibia/bin/client" "$@"
'';
# Patchuje package.json Tibii żeby używała wrappera zamiast surowego binary
tibiaPatcher = pkgs.writeShellScriptBin "tibia-patch" ''
#!/usr/bin/env bash
set -e
PKGDIR="$HOME/.local/share/CipSoft GmbH/Tibia/packages/Tibia"
PKGJSON="$PKGDIR/package.json"
LOCALWRAPPER="$PKGDIR/tibia-client-wrapper"
if [ ! -f "$PKGJSON" ]; then
echo "package.json not found run the launcher once first."
exit 0
fi
if grep -q "tibia-client-wrapper" "$PKGJSON" 2>/dev/null; then
echo "Already patched."
exit 0
fi
cat > "$LOCALWRAPPER" <<'TIBIA_WRAPPER'
#!/usr/bin/env bash
${exportLibs}
exec ${tibiaClientWrapper}/bin/tibia-client "$@"
TIBIA_WRAPPER
chmod +x "$LOCALWRAPPER"
sed -i 's#"executable": "bin/client"#"executable": "tibia-client-wrapper"#' "$PKGJSON"
echo "Tibia client patched to use tibia-client-wrapper."
'';
# Uruchamia launcher Tibii (pobrany ręcznie przez tibia-install)
tibiaLauncherWrapper = pkgs.writeShellScriptBin "tibia" ''
#!/usr/bin/env bash
set -e
LAUNCHER="$HOME/Gry/Tibia/Tibia"
if [ ! -x "$LAUNCHER" ]; then
echo "Tibia launcher not found at:"
echo " $LAUNCHER"
echo ""
echo "Run 'tibia-install' first, or download manually from:"
echo " https://www.tibia.com/download/"
exit 1
fi
tibia-patch
${exportLibs}
exec steam-run "$LAUNCHER"
'';
# Pomija launcher, odpala clienta bezpośrednio
tibiaDirect = pkgs.writeShellScriptBin "tibia-direct" ''
#!/usr/bin/env bash
CLIENT="$HOME/.local/share/CipSoft GmbH/Tibia/packages/Tibia/bin/client"
if [ ! -x "$CLIENT" ]; then
echo "Tibia client not found."
echo "Run 'tibia' once so the launcher downloads the client."
exit 1
fi
${exportLibs}
exec steam-run "$CLIENT"
'';
# Instaluje launcher Tibii na nowym systemie
tibiaInstall = pkgs.writeShellScriptBin "tibia-install" ''
#!/usr/bin/env bash
set -e
URL="https://static.tibia.com/download/tibia.x64.tar.gz"
DEST="$HOME/Gry/Tibia"
TMPDIR=$(mktemp -d)
trap "rm -rf $TMPDIR" EXIT
echo "Downloading Tibia launcher from $URL ..."
wget -q --show-progress -O "$TMPDIR/tibia.tar.gz" "$URL"
mkdir -p "$DEST"
tar xzf "$TMPDIR/tibia.tar.gz" -C "$DEST"
chmod +x "$DEST/Tibia"
echo ""
echo "Tibia launcher installed to: $DEST/Tibia"
echo "Run 'tibia' to start."
'';
# .desktop entry
tibiaDesktop = pkgs.makeDesktopItem {
name = "tibia";
exec = "tibia-direct";
desktopName = "Tibia";
comment = "Tibia MMORPG Client";
categories = [ "Game" ];
};
in {
options.programs.tibia = {
enable = lib.mkEnableOption "Tibia game client support";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
steam-run
libxml2_2_9
wget
tibiaClientWrapper
tibiaPatcher
tibiaLauncherWrapper
tibiaDirect
tibiaInstall
tibiaDesktop
];
};
}

View file

@ -1,9 +0,0 @@
{ pkgs, ... }: {
# paczki
environment.systemPackages = with pkgs; [
eddie
wireguard-tools
qbittorrent
];
}

View file

@ -1,7 +0,0 @@
{ pkgs, ... }: {
# paczki
environment.systemPackages = with pkgs; [
libreoffice-fresh
];
}

View file

@ -1,20 +1,23 @@
{ pkgs, ... }: { { pkgs, ... }: {
# Enable the X11 windowing system. # Enable X11 (można wyłączyć przy czystym Waylandzie)
# You can disable this if you're only using the Wayland session.
services.xserver.enable = true; services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment. # KDE Plasma 6 + SDDM z autologinem
services.displayManager.sddm.enable = true; services.displayManager.sddm.enable = true;
services.displayManager.autoLogin = {
enable = true;
user = "sasza";
};
services.desktopManager.plasma6.enable = true; services.desktopManager.plasma6.enable = true;
# Configure keymap in X11 # Polski układ klawiatury w X11
services.xserver.xkb = { services.xserver.xkb = {
layout = "pl"; layout = "pl";
variant = ""; variant = "";
}; };
# Enable sound with pipewire. # Dźwięk — PipeWire zamiast PulseAudio
services.pulseaudio.enable = false; services.pulseaudio.enable = false;
security.rtkit.enable = true; security.rtkit.enable = true;
services.pipewire = { services.pipewire = {
@ -22,23 +25,5 @@
alsa.enable = true; alsa.enable = true;
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = 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;
}; };
# paczki graficzne
environment.systemPackages = with pkgs; [
brave
];
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Install firefox.
# programs.firefox.enable = true;
} }

View file

@ -1,105 +0,0 @@
{ config, pkgs, lib, ... }:
let
# Inline legacy libxml2 (2.9.x) because modern Nixpkgs removed it
libxml2_2_9 = pkgs.stdenv.mkDerivation {
pname = "libxml2-2.9";
version = "2.9.14";
src = pkgs.fetchurl {
url = "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz";
sha256 = "sha256-YNdKJX0czsBHXnScui8hVZ5IE577pv8oIkNXx8eY3+4=";
};
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.zlib pkgs.xz ];
configureFlags = [
"--disable-static"
"--without-python"
];
enableParallelBuilding = true;
};
# Wrapper for the real client
tibiaClientWrapper = pkgs.writeShellScriptBin "tibia-client" ''
#!/usr/bin/env bash
export LD_LIBRARY_PATH="${pkgs.nss}/lib:${pkgs.libxkbfile}/lib:${pkgs.nspr}/lib:${libxml2_2_9}/lib:$LD_LIBRARY_PATH"
exec steam-run "$HOME/.local/share/CipSoft GmbH/Tibia/packages/Tibia/bin/client" "$@"
'';
# Script that patches Tibia's package.json
tibiaPatcher = pkgs.writeShellScriptBin "tibia-patch" ''
#!/usr/bin/env bash
set -e
PKGDIR="$HOME/.local/share/CipSoft GmbH/Tibia/packages/Tibia"
PKGJSON="$PKGDIR/package.json"
LOCALWRAPPER="$PKGDIR/tibia-client-wrapper"
if [ ! -f "$PKGJSON" ]; then
echo "package.json not found run the launcher once first."
exit 0
fi
# Create wrapper INSIDE the Tibia package directory
cat > "$LOCALWRAPPER" <<EOF
#!/usr/bin/env bash
export LD_LIBRARY_PATH="${pkgs.nss}/lib:${pkgs.libxkbfile}/lib:${pkgs.nspr}/lib:${libxml2_2_9}/lib:\$LD_LIBRARY_PATH"
exec /run/current-system/sw/bin/tibia-client "\$@"
EOF
chmod +x "$LOCALWRAPPER"
# Patch JSON to use the local wrapper (relative path!)
sed -i 's#"executable": "bin/client"#"executable": "tibia-client-wrapper"#' "$PKGJSON"
echo "Tibia client patched to use tibia-client-wrapper."
'';
tibiaLauncherWrapper = pkgs.writeShellScriptBin "tibia" ''
#!/usr/bin/env bash
set -e
LAUNCHER="$HOME/Gry/Tibia/Tibia"
if [ ! -x "$LAUNCHER" ]; then
echo "Tibia launcher not found at:"
echo " $LAUNCHER"
exit 1
fi
tibia-patch
export LD_LIBRARY_PATH="${pkgs.nss}/lib:${pkgs.libxkbfile}/lib:${pkgs.nspr}/lib:${libxml2_2_9}/lib:$LD_LIBRARY_PATH"
exec steam-run "$LAUNCHER"
'';
tibiaDirect = pkgs.writeShellScriptBin "tibia-direct" ''
#!/usr/bin/env bash
CLIENT="$HOME/.local/share/CipSoft GmbH/Tibia/packages/Tibia/bin/client"
if [ ! -x "$CLIENT" ]; then
echo "Tibia client not found."
echo "Run the official launcher once so it downloads the client."
exit 1
fi
export LD_LIBRARY_PATH="${pkgs.nss}/lib:${pkgs.libxkbfile}/lib:${pkgs.nspr}/lib:${libxml2_2_9}/lib:$LD_LIBRARY_PATH"
exec steam-run "$CLIENT"
'';
in
{
environment.systemPackages = [
pkgs.steam-run
libxml2_2_9
tibiaClientWrapper
tibiaPatcher
tibiaLauncherWrapper
tibiaDirect
];
}

27
packages/libxml2-2.9/default.nix vendored Normal file
View file

@ -0,0 +1,27 @@
{ stdenv, fetchurl, pkg-config, zlib, xz }:
stdenv.mkDerivation {
pname = "libxml2-2-9";
version = "2.9.14";
src = fetchurl {
url = "https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz";
sha256 = "sha256-YNdKJX0czsBHXnScui8hVZ5IE577pv8oIkNXx8eY3+4=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ zlib xz ];
configureFlags = [
"--disable-static"
"--without-python"
];
enableParallelBuilding = true;
meta = {
description = "Legacy libxml2 2.9.14, required by Tibia client";
homepage = "http://xmlsoft.org/";
license = stdenv.lib.licenses.mit;
};
}