Skip to content

Commit 81707ad

Browse files
R1kaB3rNbehe
andcommitted
Add flake.nix to packaging
Co-authored-by: behe <[email protected]>
1 parent 218fed9 commit 81707ad

File tree

6 files changed

+101
-0
lines changed

6 files changed

+101
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,26 @@ You will need to add `$HOME/.local/bin` in your `$PATH` to be able to run umu th
110110
export PATH="$HOME/.local/bin:$PATH"
111111
```
112112

113+
# Packages:
114+
## NixOS
115+
if you want to add umu-launcher as a flake add this to your inputs in flake.nix
116+
```nix
117+
inputs = {
118+
umu= {
119+
url = "git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging\/nix&submodules=1";
120+
inputs.nixpkgs.follows = "nixpkgs";
121+
};
122+
}
123+
```
124+
and in your configuration.nix
125+
```nix
126+
{inputs, pkgs, ... }:
127+
{
128+
environment.systemPackages = [ inputs.umu.packages.${pkgs.system}.umu ];
129+
}
130+
```
131+
if there is any problem with the flake feel free to open a bug report and tag any of the maintainers
132+
> maintainers: @beh-10257
113133
114134
# Usage notes:
115135

packaging/nix/combine.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{ env, package, symlinkJoin }:
2+
symlinkJoin {
3+
name = "umu-combine";
4+
paths = [
5+
env
6+
package
7+
];
8+
postBuild = ''
9+
rm $out/bin/umu-run
10+
'';
11+
}

packaging/nix/flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packaging/nix/flake.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
description = "umu universal game launcher";
3+
inputs = {
4+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5+
};
6+
outputs = { self, nixpkgs }:
7+
let
8+
umu-package = nixpkgs.legacyPackages.x86_64-linux.callPackage ./umu-launcher.nix { umu-launcher=( builtins.toPath "${self}/../../"); };
9+
umu-run = nixpkgs.legacyPackages.x86_64-linux.callPackage ./umu-run.nix { package=umu-package; };
10+
in{
11+
packages.x86_64-linux.umu = nixpkgs.legacyPackages.x86_64-linux.callPackage ./combine.nix { env=umu-run; package=umu-package; };
12+
};
13+
}

packaging/nix/umu-launcher.nix

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{stdenv , umu-launcher, pkgs, ...}:
2+
stdenv.mkDerivation {
3+
pname = "umu-launcher";
4+
version = "0.1";
5+
src = umu-launcher;
6+
depsBuildBuild = [
7+
pkgs.meson
8+
pkgs.ninja
9+
pkgs.scdoc
10+
];
11+
dontUseMesonConfigure = true;
12+
dontUseNinjaBuild = true;
13+
dontUseNinjaInstall = true;
14+
dontUseNinjaCheck = true;
15+
configureScript = "./configure.sh";
16+
}

packaging/nix/umu-run.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{ package, lib,stdenv, buildFHSEnv, writeShellScript, ...}:
2+
let
3+
ldPath = lib.optionals stdenv.is64bit [ "/lib64" ] ++ [ "/lib32" ];
4+
exportLDPath = ''
5+
export LD_LIBRARY_PATH=${lib.concatStringsSep ":" ldPath}''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
6+
'';
7+
in
8+
buildFHSEnv {
9+
name = "umu";
10+
runScript = writeShellScript "umu-env" ''
11+
${exportLDPath}
12+
${package}/bin/umu-run "$@"
13+
'';
14+
}

0 commit comments

Comments
 (0)