This commit is contained in:
Martin Benonisen 2025-01-12 14:40:40 +01:00
parent 87bb70fbcd
commit 6167781189
Signed by: mbeno
SSH Key Fingerprint: SHA256:iAzOA1WUAxocdh/WRWXcSg5nw2dJ1aDCvPuT+3ZjkwI
10 changed files with 167 additions and 78 deletions

34
flake.lock generated
View File

@ -7,27 +7,26 @@
]
},
"locked": {
"lastModified": 1733317578,
"narHash": "sha256-anN/LcP5IuqEARvhPETg1vnbyG3IQ0wdvSAYEJfIQzA=",
"lastModified": 1736508663,
"narHash": "sha256-ZOaGwa+WnB7Zn3YXimqjmIugAnHePdXCmNu+AHkq808=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "ad48eb25cd0b00ce730da00fa1f8e6e6c27b397d",
"rev": "2532b500c3ed2b8940e831039dcec5a5ea093afc",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1733212471,
"narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=",
"lastModified": 1736523798,
"narHash": "sha256-Xb8mke6UCYjge9kPR9o4P1nVrhk7QBbKv3xQ9cj7h2s=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "55d15ad12a74eb7d4646254e13638ad0c4128776",
"rev": "130595eba61081acde9001f43de3248d8888ac4a",
"type": "github"
},
"original": {
@ -52,20 +51,19 @@
},
"locked": {
"dir": "packaging/nix",
"lastModified": 1733037609,
"narHash": "sha256-HkS24indfMaQbVZ+9GY5BHc+rqPvh8htF0rWYhvgPKI=",
"ref": "refs/heads/main",
"rev": "e559e2e50999093c3e837d33886f9e14e34ead0a",
"revCount": 863,
"submodules": true,
"type": "git",
"url": "https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix"
"lastModified": 1735507919,
"narHash": "sha256-4cR4mk1660p3y8wnX0XbHSQh4KX0mbMn6/2YnALNt8o=",
"owner": "Open-Wine-Components",
"repo": "umu-launcher",
"rev": "59a82ea8cd284c7535bc06b8f6156abb7da96f6a",
"type": "github"
},
"original": {
"dir": "packaging/nix",
"submodules": true,
"type": "git",
"url": "https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix"
"owner": "Open-Wine-Components",
"repo": "umu-launcher",
"rev": "59a82ea8cd284c7535bc06b8f6156abb7da96f6a",
"type": "github"
}
}
},

View File

@ -5,25 +5,23 @@
# nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/master";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
umu = {
url = "git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging\/nix&submodules=1";
url = "github:Open-Wine-Components/umu-launcher/59a82ea8cd284c7535bc06b8f6156abb7da96f6a?dir=packaging/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# ...
# Optional - updates underlying without waiting for nix-citizen to update
};
outputs =
{
self,
nixpkgs,
home-manager,
...
{ self
, nixpkgs
, home-manager
, ...
}@inputs:
let
system = "x86_64-linux";

View File

@ -1,8 +1,8 @@
{
config,
pkgs,
lib,
...
{ config
, pkgs
, lib
, inputs
, ...
}:
{
# Enable OpenGL

View File

@ -1,31 +1,12 @@
{ config, pkgs, ... }:
{
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "nvidia";
};
nixpkgs.config.packageOverrides = pkgs: {
intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
};
hardware = {
enableRedistributableFirmware = true;
cpu.intel.updateMicrocode = true;
graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
vaapiVdpau
mangohud
nvidia-vaapi-driver
intel-media-driver
intel-vaapi-driver
libvdpau-va-gl
];
extraPackages32 = with pkgs.pkgsi686Linux; [
mangohud
intel-media-driver
intel-vaapi-driver
];
};
nvidia = {

View File

@ -1,9 +1,15 @@
{
config,
pkgs,
inputs,
...
{ config
, pkgs
, inputs
, ...
}:
let
inherit (pkgs.stdenv.hostPlatform) system;
umu = inputs.umu.packages.${system}.umu.override {
version = inputs.umu.shortRev;
truststore = true;
};
in
{
services.flatpak.enable = true;
programs.nix-ld.enable = true;
@ -42,11 +48,11 @@
magicOrExtension = ''\x7fELF....AI\x02'';
};
environment.systemPackages = with pkgs; [
(inputs.umu.packages.${pkgs.system}.umu.override { version = "${inputs.umu.shortRev}"; })
gfxreconstruct
glslang
(opera.override { proprietaryCodecs = true; })
spirv-cross
lsof
spirv-headers
spirv-tools
vulkan-extension-layer
@ -58,7 +64,6 @@
vulkan-validation-layers
vkdisplayinfo
vkd3d
bottles
vkd3d-proton
vk-bootstrap
lutris
@ -72,8 +77,6 @@
xdg-desktop-portal-gtk
google-chrome
zoom-us
# icu
# icu.dev
neovim
git
gnupg
@ -81,6 +84,7 @@
pinentry
rofi-rbw-x11
rbw
protontricks
nil
nixpkgs-fmt
curl
@ -89,6 +93,8 @@
usbutils
vim
wget
spotify
protonup
v4l-utils
nmap
wineWowPackages.stable

View File

@ -1,12 +1,18 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
pulseaudio
alsa-utils
];
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;
wireplumber = {
enable = true;
package = pkgs.wireplumber;
};
};
}

View File

@ -38,8 +38,6 @@
mumble
pavucontrol
unrar
protonup-qt
protonup-ng
mpv
pamixer
pinentry
@ -47,7 +45,6 @@
restic
ripgrep
sops
spotify
sshfs
expect
# k8s tools
@ -99,6 +96,7 @@
rustup
gcc
gnumake
(pkgs.callPackage ./vintagestory.nix { })
];
}

View File

@ -0,0 +1,108 @@
{
lib,
stdenv,
fetchurl,
makeWrapper,
makeDesktopItem,
copyDesktopItems,
xorg,
gtk2,
sqlite,
openal,
cairo,
libGLU,
SDL2,
freealut,
libglvnd,
pipewire,
libpulseaudio,
dotnet-runtime_8,
}:
stdenv.mkDerivation rec {
pname = "vintagestory";
version = "1.20.0-rc.6";
src = fetchurl {
url = "https://cdn.vintagestory.at/gamefiles/unstable/vs_client_linux-x64_${version}.tar.gz";
hash = "sha256-JxyQrZrAmMkUy28JUak0BHHpuGEb2fbxNrtOGVKGhOQ=";
};
nativeBuildInputs = [
makeWrapper
copyDesktopItems
];
buildInputs = [ dotnet-runtime_8 ];
runtimeLibs = lib.makeLibraryPath (
[
gtk2
sqlite
openal
cairo
libGLU
SDL2
freealut
libglvnd
pipewire
libpulseaudio
]
++ (with xorg; [
libX11
libXi
libXcursor
])
);
desktopItems = [
(makeDesktopItem {
name = "vintagestory";
desktopName = "Vintage Story";
exec = "vintagestory";
icon = "vintagestory";
comment = "Innovate and explore in a sandbox world";
categories = [ "Game" ];
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/share/vintagestory $out/bin $out/share/pixmaps $out/share/fonts/truetype
cp -r * $out/share/vintagestory
cp $out/share/vintagestory/assets/gameicon.xpm $out/share/pixmaps/vintagestory.xpm
cp $out/share/vintagestory/assets/game/fonts/*.ttf $out/share/fonts/truetype
runHook postInstall
'';
preFixup =
''
sed -i 's/net7.0/net8.0/' $out/share/vintagestory/Vintagestory.runtimeconfig.json
sed -i 's/7.0.0/8.0.11/' $out/share/vintagestory/Vintagestory.runtimeconfig.json
makeWrapper ${dotnet-runtime_8}/bin/dotnet $out/bin/vintagestory \
--prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
--add-flags $out/share/vintagestory/Vintagestory.dll
makeWrapper ${dotnet-runtime_8}/bin/dotnet $out/bin/vintagestory-server \
--prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
--add-flags $out/share/vintagestory/VintagestoryServer.dll
''
+ ''
find "$out/share/vintagestory/assets/" -not -path "*/fonts/*" -regex ".*/.*[A-Z].*" | while read -r file; do
local filename="$(basename -- "$file")"
ln -sf "$filename" "''${file%/*}"/"''${filename,,}"
done
'';
meta = with lib; {
description = "In-development indie sandbox game about innovation and exploration";
homepage = "https://www.vintagestory.at/";
license = licenses.unfree;
maintainers = with maintainers; [
artturin
gigglesquid
];
};
}

View File

@ -54,20 +54,6 @@ vim.api.nvim_create_autocmd("BufWritePre", {
end
})
-- LSP: expect
if executable('expect-language-server')
augroup lsp
autocmd!
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'expect',
\ 'cmd': {server_info->['expect-language-server']},
\ 'whitelist': ['expect'],
\ 'initialization_options': {
\ 'method': 'builtin',
\ },
\ })
augroup END
endif
-- LSP: nix
lspconfig.nil_ls.setup({

View File

@ -24,6 +24,14 @@
"editor.formatOnSave" = true;
"nix.enableLanguageServer" = true;
"nix.serverPath" = "nil";
"nix.formatterPath" = "nixfmt";
"nix.serverSettings" = {
"nil" = {
"formatting" = {
"command"= ["nixpkgs-fmt"];
};
};
};
};
};
}