Re: packaging of nix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 28, 2023 at 04:25:57AM -0000, Pratham Patel wrote:
> Hi!
> 
> At the moment, it's not possible to build a NixOS image that adheres to FHS. Therefore, we can either
> 
> 1. Add the FHS support to NixOS, which makes the whole thing about using NixOS moot. BUT, maybe we can hack our way around it like so? ([snippet source](https://github.com/balsoft/nixos-fhs-compat/blob/7a94f4c372e209d6db6bc92dc1c3559a2b27c20e/modules/fhs.nix#L21-L34))
> ```nix
> config = lib.mkIf config.environment.fhs.enable {
>   systemd.tmpfiles.rules = lib.optionals config.environment.fhs.linkExes [
>     "L+ /bin     - - - - /run/current-system/sw/bin"
>     "L+ /sbin    - - - - /run/current-system/sw/bin"
>     "L+ /usr/bin - - - - /run/current-system/sw/bin"
>   ] ++ lib.optionals config.environment.fhs.linkLibs ([
>     "L+ /lib     - - - - /etc/lsb/lib"
>     "L+ /lib64   - - - - /etc/lsb/lib"
>     "L+ /usr/lib - - - - /etc/lsb/lib"
>   ]);
>   environment.sessionVariables.LD_LIBRARY_PATH = lib.mkIf config.environment.fhs.linkLibs (lib.mkForce "/lib");
>   system.activationScripts.binsh = lib.mkIf config.environment.fhs.linkExes (lib.mkForce "");
>   system.activationScripts.usrbinenv = lib.mkIf config.environment.fhs.linkExes (lib.mkForce "");
> };
> ```

If those are tmpfiles rules, they'd be executed by systemd-tmpfiles
during boot, which is too late.

I'd probably be better to move this discussion to systemd-devel
mailing list so that other mkosi people see it.

> 2. Add non-FHS support to mkosi, which--if done correctly--might
> help with Guix too. This is just a thought, since I'm not sure how
> to approach this.

That's theoretically an option, but with my mkosi maintainer hat on,
I don't think we want to do this. We are able to evolve mkosi because
all the distros are treated almost the same. _Some_ custom logic is
needed, but this is mostly in the realm of package installation. This
has the advantage that people can add new functionality without having
knownledge of all supported distros. If we start adding code and logic
for different distros, then maintainership becomes much harder.
Also, systemd is all about FHS and standarized paths.

(We already had this problem with "custom" stuff: we added support
for PhotonOS and Gentoo, but when the people who were working on this
got busy with other things, it was very hard to maintain. Ultimately,
support for PhotonOS was dropped and support for Gentoo was marked
as unmaintained.)

> About Nix (the package manager), I would love to help with that,
> since most of the folks that want to try Nix might do a `sudo dnf
> install nix`.
Yes, that's the plan: install the package and play.

> I looked at your COPR and noticed the dist-git repo. Since I'm very
> new to the dist-git workflow, can you point me to the actual git
> repo for it? I'm looking for _unresolved_ issues that you (and other
> testers) have documented so far in the issue tracker.
I have a repo, but it's local. You can see the spec file here:
https://download.copr.fedorainfracloud.org/results/zbyszek/nixos/fedora-rawhide-x86_64/06606722-nix/nix.spec
There is nothing else: copr will download the Source archive listed
in the spec file and do a full build from that.

(To do a local build or modifications, I'd do something like this:

  git init nix
  cd nix
  wget https://download.copr.fedorainfracloud.org/results/zbyszek/nixos/fedora-rawhide-x86_64/06606722-nix/nix.spec
  git add nix.spec
  git commit nix.spec -m 'First version'
  git branch -m rawhide
  fedpkg local
)

> I'm dogfooding myself with Fedora on the Orange Pi 5 (custom image I
> built for myself) to improve the AArch64 experience and would love
> to report back with generic/arm-specific issues!
Nice!

Zbyszek
--
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux