Compare commits
No commits in common. "57112d33a22c5c72927567b099bbc27e8d0158c8" and "2ac7a5de52eda9d70983117dc650bc3ee979a4e5" have entirely different histories.
57112d33a2
...
2ac7a5de52
28 changed files with 401 additions and 267 deletions
13
.gitignore
vendored
13
.gitignore
vendored
|
|
@ -1,13 +0,0 @@
|
||||||
# Nix build artifacts
|
|
||||||
result
|
|
||||||
result-*
|
|
||||||
|
|
||||||
# Direnv
|
|
||||||
.direnv
|
|
||||||
|
|
||||||
# IDE / edytory
|
|
||||||
.aider*
|
|
||||||
|
|
||||||
# Systemowe pliki tymczasowe
|
|
||||||
*.swp
|
|
||||||
*.swo
|
|
||||||
20
base.nix
20
base.nix
|
|
@ -1,18 +1,16 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
# === Włączamy Flakes ===
|
# Włączamy Flakes
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
||||||
# === Automatyczne sprzątanie store ===
|
# paczki systemowe
|
||||||
nix.gc = {
|
environment.systemPackages = with pkgs; [
|
||||||
automatic = true;
|
neovim
|
||||||
dates = "weekly";
|
git
|
||||||
options = "--delete-older-than 30d";
|
openssh
|
||||||
};
|
wget
|
||||||
|
tree
|
||||||
|
];
|
||||||
|
|
||||||
# === Optymalizacja store (deduplikacja) ===
|
|
||||||
nix.settings.auto-optimise-store = true;
|
|
||||||
|
|
||||||
# === Pozwalamy na niewolne pakiety ===
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
61
copilot/flake.nix
Normal file
61
copilot/flake.nix
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
{
|
||||||
|
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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
11
copilot/home/gamer/home.nix
Normal file
11
copilot/home/gamer/home.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ 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
|
||||||
|
];
|
||||||
|
}
|
||||||
11
copilot/home/office/home.nix
Normal file
11
copilot/home/office/home.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ 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
|
||||||
|
];
|
||||||
|
}
|
||||||
3
copilot/hosts/gaming-amd/configuration.nix
Normal file
3
copilot/hosts/gaming-amd/configuration.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{ config, pkgs, ... }: {
|
||||||
|
imports = [ ./hardware-configuration.nix ];
|
||||||
|
}
|
||||||
3
copilot/hosts/laptop-office/configuration.nix
Normal file
3
copilot/hosts/laptop-office/configuration.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{ config, pkgs, ... }: {
|
||||||
|
imports = [ ./hardware-configuration.nix ];
|
||||||
|
}
|
||||||
4
copilot/modules/common/base.nix
Normal file
4
copilot/modules/common/base.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
environment.systemPackages = with pkgs; [ vim git ];
|
||||||
|
services.openssh.enable = true;
|
||||||
|
}
|
||||||
4
copilot/modules/common/locale.nix
Normal file
4
copilot/modules/common/locale.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{ ... }: {
|
||||||
|
i18n.defaultLocale = "pl_PL.UTF-8";
|
||||||
|
time.timeZone = "Europe/Warsaw";
|
||||||
|
}
|
||||||
3
copilot/modules/common/networking.nix
Normal file
3
copilot/modules/common/networking.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{ ... }: {
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
}
|
||||||
10
copilot/modules/common/users.nix
Normal file
10
copilot/modules/common/users.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{ ... }: {
|
||||||
|
users.users.gamer = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" "networkmanager" ];
|
||||||
|
};
|
||||||
|
users.users.office = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" "networkmanager" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
16
copilot/modules/desktop/gaming.nix
Normal file
16
copilot/modules/desktop/gaming.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
{ 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
|
||||||
|
];
|
||||||
|
}
|
||||||
8
copilot/modules/desktop/office.nix
Normal file
8
copilot/modules/desktop/office.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
services.xserver.enable = true;
|
||||||
|
services.xserver.desktopManager.plasma6.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
libreoffice thunderbird okular
|
||||||
|
];
|
||||||
|
}
|
||||||
4
copilot/modules/services/bluetooth.nix
Normal file
4
copilot/modules/services/bluetooth.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{ ... }: {
|
||||||
|
hardware.bluetooth.enable = true;
|
||||||
|
services.blueman.enable = true;
|
||||||
|
}
|
||||||
3
copilot/modules/services/printing.nix
Normal file
3
copilot/modules/services/printing.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{ ... }: {
|
||||||
|
services.printing.enable = true;
|
||||||
|
}
|
||||||
8
copilot/modules/services/steam.nix
Normal file
8
copilot/modules/services/steam.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
programs.steam = {
|
||||||
|
enable = true;
|
||||||
|
remotePlay.openFirewall = true;
|
||||||
|
dedicatedServer.openFirewall = true;
|
||||||
|
};
|
||||||
|
environment.systemPackages = with pkgs; [ steam-run ];
|
||||||
|
}
|
||||||
29
flake.nix
29
flake.nix
|
|
@ -2,33 +2,48 @@
|
||||||
description = "Konfiguracja wielu maszyn na raz";
|
description = "Konfiguracja wielu maszyn na raz";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Bleeding edge!
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/nixos-unstable";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager, ... }:
|
outputs = { self, nixpkgs, home-manager, ... }:
|
||||||
let
|
let # pomocnicza funkcja
|
||||||
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
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
41
home.nix
41
home.nix
|
|
@ -3,55 +3,18 @@
|
||||||
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 = "25.11";
|
home.stateVersion = "24.11";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,38 @@
|
||||||
|
# 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 =
|
||||||
./hardware-configuration.nix
|
[ # Include the results of the hardware scan.
|
||||||
];
|
./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;
|
||||||
|
|
||||||
# Timezone
|
# Set your time zone.
|
||||||
time.timeZone = "Europe/Warsaw";
|
time.timeZone = "Europe/Warsaw";
|
||||||
|
|
||||||
# Locale
|
# Select internationalisation properties.
|
||||||
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";
|
||||||
|
|
@ -32,16 +45,45 @@
|
||||||
LC_TIME = "pl_PL.UTF-8";
|
LC_TIME = "pl_PL.UTF-8";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Console keymap
|
# Configure console keymap
|
||||||
console.keyMap = "pl2";
|
console.keyMap = "pl2";
|
||||||
|
|
||||||
# User account (pakiety w home-manager)
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
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
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# State version
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
system.stateVersion = "25.11";
|
# 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 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 = "25.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
7
modules/3dmodel.nix
Normal file
7
modules/3dmodel.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
# paczki
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
openscad-unstable
|
||||||
|
];
|
||||||
|
}
|
||||||
7
modules/3dprint.nix
Normal file
7
modules/3dprint.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
# paczki
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
orca-slicer
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
# Akceleracja grafiki (AMD/Intel)
|
# Grafika AMD i Steam
|
||||||
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
|
||||||
|
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,147 +0,0 @@
|
||||||
{ 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
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
9
modules/network.nix
Normal file
9
modules/network.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
# paczki
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
eddie
|
||||||
|
wireguard-tools
|
||||||
|
qbittorrent
|
||||||
|
];
|
||||||
|
}
|
||||||
7
modules/office.nix
Normal file
7
modules/office.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
# paczki
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
libreoffice-fresh
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -1,23 +1,20 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
# Enable X11 (można wyłączyć przy czystym Waylandzie)
|
# Enable the X11 windowing system.
|
||||||
|
# You can disable this if you're only using the Wayland session.
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
|
|
||||||
# KDE Plasma 6 + SDDM z autologinem
|
# Enable the KDE Plasma Desktop Environment.
|
||||||
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;
|
||||||
|
|
||||||
# Polski układ klawiatury w X11
|
# Configure keymap in X11
|
||||||
services.xserver.xkb = {
|
services.xserver.xkb = {
|
||||||
layout = "pl";
|
layout = "pl";
|
||||||
variant = "";
|
variant = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Dźwięk — PipeWire zamiast PulseAudio
|
# Enable sound with pipewire.
|
||||||
services.pulseaudio.enable = false;
|
services.pulseaudio.enable = false;
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
|
|
@ -25,5 +22,23 @@
|
||||||
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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
105
modules/tibia.nix
Normal file
105
modules/tibia.nix
Normal file
|
|
@ -0,0 +1,105 @@
|
||||||
|
{ 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
27
packages/libxml2-2.9/default.nix
vendored
|
|
@ -1,27 +0,0 @@
|
||||||
{ 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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue