From 24a3d380a367b0afd0899fc18c8a6cac39c526a3 Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 13 Aug 2022 20:47:06 +0200 Subject: [PATCH] add q3a for clients --- README.md | 5 +++++ flake.nix | 28 +++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9bec7c7 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Clients + +```bash +NIXPKGS_ALLOW_UNFREE=1 nix run --extra-experimental-features nix-command\ flakes --impure git+https://gitea.c3d2.de/astro/quakeflake +``` diff --git a/flake.nix b/flake.nix index a69c398..a373aa6 100644 --- a/flake.nix +++ b/flake.nix @@ -2,11 +2,19 @@ description = "Quake 3 Arena Dedicated Server"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/release-21.11"; + nixpkgs.url = "github:nixos/nixpkgs/release-22.05"; }; outputs = inputs@{ self, nixpkgs }: { + apps.x86_64-linux = rec { + q3a = { + type = "app"; + program = "${self.packages.x86_64-linux.q3a}/bin/q3a"; + }; + default = q3a; + }; + packages = builtins.mapAttrs (system: _: let inherit (self.nixosConfigurations) quakeserver; @@ -23,6 +31,24 @@ nix copy --to ssh://root@${remote} ${rootfs} ssh root@${remote} ${rootfs}/bin/switch-to-configuration switch ''; + + q3a = with nixpkgs.legacyPackages.${system}; buildEnv { + name = "q3a"; + paths = [ + quake3e + (runCommandNoCC "baseq3" {} '' + mkdir -p $out/lib/baseq3 + ln -s ${self.packages.${system}.isoBaseq3}/* $out/lib/baseq3/ + ln -s ${quake3pointrelease}/baseq3/* $out/lib/baseq3/ + ln -s ${quake3hires}/baseq3/* $out/lib/baseq3/ + '') + (writeScriptBin "q3a" '' + #! ${runtimeShell} -e + + exec $(dirname $0)/quake3e +set fs_basepath $(dirname $0)/../lib + '') + ]; + }; } // import ./pkgs/baseq3.nix (inputs // { inherit system; }) ) { x86_64-linux = true; };