Skip to content

Commit

Permalink
Add flake.nix to packaging
Browse files Browse the repository at this point in the history
Co-authored-by: behe <[email protected]>
  • Loading branch information
R1kaB3rN and beh-10257 committed Mar 29, 2024
1 parent 218fed9 commit 81707ad
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,26 @@ You will need to add `$HOME/.local/bin` in your `$PATH` to be able to run umu th
export PATH="$HOME/.local/bin:$PATH"
```

# Packages:
## NixOS
if you want to add umu-launcher as a flake add this to your inputs in flake.nix
```nix
inputs = {
umu= {
url = "git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging\/nix&submodules=1";
inputs.nixpkgs.follows = "nixpkgs";
};
}
```
and in your configuration.nix
```nix
{inputs, pkgs, ... }:
{
environment.systemPackages = [ inputs.umu.packages.${pkgs.system}.umu ];
}
```
if there is any problem with the flake feel free to open a bug report and tag any of the maintainers
> maintainers: @beh-10257
# Usage notes:

Expand Down
11 changes: 11 additions & 0 deletions packaging/nix/combine.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ env, package, symlinkJoin }:
symlinkJoin {
name = "umu-combine";
paths = [
env
package
];
postBuild = ''
rm $out/bin/umu-run
'';
}
27 changes: 27 additions & 0 deletions packaging/nix/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions packaging/nix/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
description = "umu universal game launcher";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
umu-package = nixpkgs.legacyPackages.x86_64-linux.callPackage ./umu-launcher.nix { umu-launcher=( builtins.toPath "${self}/../../"); };
umu-run = nixpkgs.legacyPackages.x86_64-linux.callPackage ./umu-run.nix { package=umu-package; };
in{
packages.x86_64-linux.umu = nixpkgs.legacyPackages.x86_64-linux.callPackage ./combine.nix { env=umu-run; package=umu-package; };
};
}
16 changes: 16 additions & 0 deletions packaging/nix/umu-launcher.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{stdenv , umu-launcher, pkgs, ...}:
stdenv.mkDerivation {
pname = "umu-launcher";
version = "0.1";
src = umu-launcher;
depsBuildBuild = [
pkgs.meson
pkgs.ninja
pkgs.scdoc
];
dontUseMesonConfigure = true;
dontUseNinjaBuild = true;
dontUseNinjaInstall = true;
dontUseNinjaCheck = true;
configureScript = "./configure.sh";
}
14 changes: 14 additions & 0 deletions packaging/nix/umu-run.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ package, lib,stdenv, buildFHSEnv, writeShellScript, ...}:
let
ldPath = lib.optionals stdenv.is64bit [ "/lib64" ] ++ [ "/lib32" ];
exportLDPath = ''
export LD_LIBRARY_PATH=${lib.concatStringsSep ":" ldPath}''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
'';
in
buildFHSEnv {
name = "umu";
runScript = writeShellScript "umu-env" ''
${exportLDPath}
${package}/bin/umu-run "$@"
'';
}

0 comments on commit 81707ad

Please sign in to comment.