From 2af98f48fcb9b9a9d10635a326a72b82bd909b8c Mon Sep 17 00:00:00 2001 From: beh_10257 <77834479+beh-10257@users.noreply.github.com> Date: Tue, 22 Oct 2024 22:26:17 +0100 Subject: [PATCH] made the flake nicer and updated nixpkgs and make version follows what (#249) users are actually using an update after ages I guess a change at a time is better making version configurable hmmmm maybe maybe the right way to expose version nice AAAAAAAAAAAAAA wow debugging lets go I guess used the right rev just before a broken nixpkgs added bwrap yippie ?? probably hmmmmmmm trying to break it cleaning things up lets do this Co-authored-by: beh-10257 --- README.md | 2 +- packaging/nix/combine.nix | 6 +++--- packaging/nix/flake.lock | 6 +++--- packaging/nix/flake.nix | 14 ++++++++++---- packaging/nix/umu-launcher.nix | 7 ++++--- packaging/nix/umu-run.nix | 8 ++++++-- 6 files changed, 27 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index c66893b85..4479c9c0b 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ and in your `configuration.nix` ```nix {inputs, pkgs, ... }: { - environment.systemPackages = [ inputs.umu.packages.${pkgs.system}.umu ]; + environment.systemPackages = [ (inputs.umu.packages.${pkgs.system}.umu.override {version = "${inputs.umu.shortRev}";}) ]; } ``` diff --git a/packaging/nix/combine.nix b/packaging/nix/combine.nix index 3b3b28871..98ac3899b 100644 --- a/packaging/nix/combine.nix +++ b/packaging/nix/combine.nix @@ -1,9 +1,9 @@ -{ env, package, symlinkJoin }: +{ env, package, symlinkJoin,version }: symlinkJoin { name = "umu-run-bwrap"; paths = [ - env - package + (package.override {version = "${version}";}) + (env.override {version = "${version}";}) ]; postBuild = '' rm $out/bin/umu diff --git a/packaging/nix/flake.lock b/packaging/nix/flake.lock index eb18d153d..de41ba11a 100644 --- a/packaging/nix/flake.lock +++ b/packaging/nix/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1720657034, - "narHash": "sha256-nPhbeFdyN8yn+EXmnPcBWisoypndtQbNIhSKmAinv3E=", + "lastModified": 1729428082, + "narHash": "sha256-xb4/Y+Y7ZlkQaA5rXnrXplDzdt2Jfgdmar3+qkb56UA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "212defe037698e18fc9521dfe451779a8979844c", + "rev": "ca30f584e18024baf39c395001262ed936f27ebd", "type": "github" }, "original": { diff --git a/packaging/nix/flake.nix b/packaging/nix/flake.nix index 272830270..8dc27e3bf 100644 --- a/packaging/nix/flake.nix +++ b/packaging/nix/flake.nix @@ -1,7 +1,12 @@ { description = "umu universal game launcher"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nixpkgs = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixpkgs-unstable"; + }; }; outputs = { self, nixpkgs }: let @@ -10,11 +15,12 @@ in let pyth = nixpk.pkgs.python3; + version = "1.1.3"; in let - umu-package = nixpk.callPackage ./umu-launcher.nix { umu-launcher=umu-launcher-src; pyth1=pyth; }; - umu-run = nixpk.callPackage ./umu-run.nix { package=umu-package; }; + umu-launcher = nixpk.callPackage ./umu-launcher.nix { umu-launcher=umu-launcher-src; pyth1=pyth; version = "${version}"; }; + umu-run = nixpk.callPackage ./umu-run.nix { package=umu-launcher; version = "${version}"; }; in{ - packages.x86_64-linux.umu = nixpk.callPackage ./combine.nix { env=umu-run; package=umu-package; }; + packages.x86_64-linux.umu = nixpk.callPackage ./combine.nix { env=umu-run; package=umu-launcher; version = "${version}"; }; }; } diff --git a/packaging/nix/umu-launcher.nix b/packaging/nix/umu-launcher.nix index 74e3298b2..965203339 100644 --- a/packaging/nix/umu-launcher.nix +++ b/packaging/nix/umu-launcher.nix @@ -1,7 +1,7 @@ -{pyth1 ,python3Packages , umu-launcher, pkgs, ...}: +{pyth1 ,python3Packages , umu-launcher, pkgs,version, ...}: python3Packages.buildPythonPackage { - name = "umu-launcher"; - version = "1.1.3"; + pname = "umu-launcher"; + version = "${version}"; src = umu-launcher; pyproject = false; depsBuildBuild = [ @@ -22,6 +22,7 @@ python3Packages.buildPythonPackage { ]; propagatedBuildInputs = [ pyth1 + pkgs.bubblewrap pkgs.python3Packages.xlib pkgs.python3Packages.filelock ]; diff --git a/packaging/nix/umu-run.nix b/packaging/nix/umu-run.nix index 3055cf2a7..3fb0fdd8e 100644 --- a/packaging/nix/umu-run.nix +++ b/packaging/nix/umu-run.nix @@ -1,6 +1,10 @@ -{ package, buildFHSEnv, writeShellScript, ...}: -buildFHSEnv { +{ package, buildFHSEnv, writeShellScript,version, ...}: +buildFHSEnv{ name = "umu-run"; + version = "${version}"; + targetPkgs = pkgs: ([ + package + ]); runScript = writeShellScript "umu-run-shell" '' ${package}/bin/umu "$@" '';