-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add nix flake support #73
Conversation
You will have to explain what "this" does because I think most of us, myself included, are not familiar with NixOS's packaging. I do not understand what the code snippet is doing.
I do not understand how this works. Normally (as in for non-immutable distros) when something is copied as your user into a writable location, the ownership goes to the user doing the copy, is Nix different in this regard? Is there something else that is different about Nix affecting this issue?
I agree what we could/should not execute anything if run as root and add a message about it but I don't see how it is connected to the issue above as the issue is unclear to me. I would like some clarifications about these things, it can help us figure out what should be handled by umu itself and what should be part of packaging. Also feel free to explain them in detail as I think most people are not familiar with the intricacies of NixOS. |
Thanks for this contribution, and I'm very open to having a Flake included. I'll have to look into how it works in a bit though, and I don't think anyone from the team is very familiar with NixOS either.
Yes, the launcher (umu_run.py) and the wrapper script (umu-run) should easily be able to handle this case -- not running as root. Also, are file permissions not able to be set in the Flake file? The launcher copies files via copy which respects the file permissions mode, so if permissions are properly setup during packaging phase then we can avoid having to display that message. |
so I'll make two comments first one explaining what each file does since well why not I'll start with the first comment umu= {
url = "git+https://github.com/beh-10257/umu-launcher-nix/?dir=packaging\/nix&submodules=1";
inputs.nixpkgs.follows = "nixpkgs";
}; disclaimer (I am using my repo since this is not merged yet) and next they should add this somewhere in their flake { inputs, ... }:
{
environment.systemPackages = [
inputs.umu.packages.${pkgs.system}.umu
];
} it basically goes to the umu input and takes the umu package \ ${pkgs.system} translates to x86_64-linux aka the architecture of the package next I'll explain what the files commited to this repo do inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
}; this says to the flake to use the unstable version of nixpkgs next in flake.nix we have this line {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";
}
dontUseMesonConfigure = true;
dontUseNinjaBuild = true;
dontUseNinjaInstall = true;
dontUseNinjaCheck = true;
configureScript = "./configure.sh"; all other variables are self explanatory right ?? (basically nix is stupid and I have to tell him not to do stuff automatically)
anyway yeah that link brings me here: https://nix.dev/guides/faq#how-to-run-non-nix-executables thats the next variable in flake.nix, another package and I named the variable umu-run ldPath = lib.optionals stdenv.is64bit [ "/lib64" ] ++ [ "/lib32" ];
exportLDPath = ''
export LD_LIBRARY_PATH=${lib.concatStringsSep ":" ldPath}''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
''; this basically adds /lib64:/lib32: to the start of that variable (this is basically stolen on how steam is packaged in nix)
anyway next next runScript = writeShellScript "umu-env" ''
${exportLDPath}
${package}/bin/umu-run "$@"
''; the ${package} here is the path to umu-package aka anyway now the problem we have is this {
description = "umu universal game launcher";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
umu-launcher = {
flake = false;
url="git+https://github.com/Open-Wine-Components/umu-launcher?submodules=1";
};
};
outputs = { self, nixpkgs, umu-launcher }:
let
umu-package = nixpkgs.legacyPackages.x86_64-linux.callPackage ./umu-launcher.nix { umu-launcher=umu-launcher; };
in
let
umu-run = nixpkgs.legacyPackages.x86_64-linux.callPackage ./umu-run.nix { package=umu-package; };
in{
packages.x86_64-linux.umu-run = umu-run;
#packages.x86_64-linux.umu-package = umu-package;
};
} this will basically remove umu-run from PATH but also basically |
Thank you for the very detailed description, personally I will need to read it a few times to comprehend it. In the meantime, one easy to fix issue that I missed before is that we already use the |
@loathingKernel done |
So if I understand correctly the issue is that Nix, doesn't have the |
- The latest release of UMU-Proton will always be checked and set for the user. The directory compatibilitytools.d will be used as the fallback in case the user is offline. Moreover, the cache ~/.cache/umu will no longer be used to save the archives, so users can safely remove them.
- Related to #73 (comment) - The traceback outputted to the console would look confusing when the program raises a SystemExit since it would be re-raised as an Exeption, which would print the same error twice. Moreover, the try-except block didn't quite read well for the other handled cases either because of the sys.exit statements, so in some of those cases just log them
- In this case, the launcher only checks ~/.local/share/umu and never the parent of the root directory
so should I edit if I will at which section should I add this |
IMHO, a new section after |
- Related to #73
Add support for immutable distributions
There's many ways to go about it in the README. If it were me, I'd combine the Installing and Installing as user section to a make section then have the next section be NixOS. For example: InstallmakeNixOS |
…into behe-main
formal but this is enough for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me content-wise. Only nitpick is that since #75 is merged in main
now, if it would be possible to rebase the changes on it, it would result in a cleaner hsitory. This isn't a blocker though as we could also squash-merge, it's up to you.
@loathingKernel I mean I think I already did so
|
@beh-10257 Before I merge this, to clarify again, you weren't able to get man pages to work? |
@beh-10257 Thanks for your contribution! I'll be closing this as its been merged at 81707ad |
@R1kaB3rN no |
this fixes my issue here: #71
so what are my questions
am I allowed to add a section about how to use this
basically just something like this
and also possibly a bug since well it will accur in other immutable distros basically now umu copies read only files from /usr/share to .local/share/umu it seems those files can't be modified obviously same with
.local/share/Steam/
so instead of throwing an error
some users will just naivly run it as root
just give the user a message saying
run
chmod -R u+w .local/share/Steam/
chmod -R u+w .local/share/umu/
thats all and thanks
also about that other paricipant well I was stupid enough to put whatever in
"user.name" and "user.email"
so yeah here we are
sorry I have no idea how to fix this mess before creating this