Skip to content

eiwd: init at 2.8-1#208844

Merged
Artturin merged 10 commits intomasterfrom
unknown repository
Nov 3, 2023
Merged

eiwd: init at 2.8-1#208844
Artturin merged 10 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jan 3, 2023

Description of changes

eiwd is iwd, minus the dbus dependency. It consists of iwd, plus:

  • a bunch of #ifdef HAVE_DBUS lines added, and autoconfery to enable it
  • name resolution defaults to resolvconf instead of systemd (one-line change)
  • inability to access /etc/resolv.conf is not a fatal error (one-line change)
  • ell is vendored as a submodule to ensure consistent versions

That's it.

You control eiwd by simply editing files in its state directory, which it monitors for changes via inotify().

I use this to manage the wifi card on my daily-driver laptop (aarch64-linux) and it has been a huge improvement over wpa_supplicant. It works very well under runit (soon to be replaced with s6). My only complaint is the cryptic filenames used for SSIDs which contain characters other than [A-Za-z0-9 _-].

Things done
  • Inspected git diff against upstream git.kernel.org/.../{iwd,ell}
    • enumerated differences from iwd (see bulleted list above)
    • confirmed there are no shenanigans
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Jan 3, 2023
@ghost ghost changed the title eiwd: init at 2.0-1 eiwd: init at 2.4-1 Apr 24, 2023
@ghost
Copy link
Copy Markdown
Author

ghost commented Apr 24, 2023

Would be really great if this could make the release...

@ghost
Copy link
Copy Markdown
Author

ghost commented Jul 1, 2023

Fixed merge conflict.

@ghost ghost changed the title eiwd: init at 2.4-1 eiwd: init at 2.6-1 Aug 5, 2023
@ghost ghost changed the title eiwd: init at 2.6-1 eiwd: init at 2.8-1 Oct 23, 2023
Adam Joseph added 9 commits October 22, 2023 18:12
eiwd is iwd, minus the dbus dependency.  It consists of iwd, plus:

- a bunch of `#ifdef HAVE_DBUS` lines added
- name resolution defaults to resolvconf instead of systemd
- inability to access /etc/resolv.conf is not a fatal error
- ell is vendored as a submodule to ensure consistent versions

That's it.

You control eiwd with ordinary UNIX signals and by simply editing
files in its state directory.
@ghost
Copy link
Copy Markdown
Author

ghost commented Oct 23, 2023

Moved into pkgs/by-name for easier rebasing.

"out" "doc"
] ++ lib.optionals enableManpages [
"man"
] ++ lib.optionals finalAttrs.doCheck [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
] ++ lib.optionals finalAttrs.doCheck [
] ++ lib.optionals finalAttrs.finalPackage.doCheck [

finalAttrs.finalPackage.doCheck contains the logic in mkDerivation so setting doCheck here will be unnecessary

Copy link
Copy Markdown
Author

@ghost ghost Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but you can't reference finalPackage in the definition of the package itself. It's infinite recursion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but not for outputs. mkDerivation is extra-strict in those. Go ahead try your suggestion; you'll get this:

Details
$ nix-instantiate . -A eiwd
error:
       … while calling a functor (an attribute set with a '__functor' attribute)
     at /git/pr/eiwd/init/lib/customisation.nix:174:34:

      173|
      174|     in if missingArgs == [] then makeOverridable f allArgs else abort error;
         |                                  ^
      175|

   … while evaluating a branch condition

     at /git/pr/eiwd/init/lib/customisation.nix:86:7:

       85|     in
       86|       if builtins.isAttrs result then
         |       ^
       87|         result // {

   (stack trace truncated; use '--show-trace' to show the full trace)

   error: infinite recursion encountered

   at «none»:0: (source not available)

nix@moore:/git/pr/eiwd/init$ nix-instantiate . -A eiwd --show-trace
error:
… while calling '_internalCallByNamePackageFile'

     at /git/pr/eiwd/init/pkgs/top-level/by-name-overlay.nix:55:36:

       54|   # Because at that point the code in ./stage.nix can be changed to not allow definitions in `all-packages.nix` to override ones from `pkgs/by-name` anymore and throw an error if that happens instead.
       55|   _internalCallByNamePackageFile = file: self.callPackage file { };
         |                                    ^
       56| }

   … from call site

     at /git/pr/eiwd/init/pkgs/top-level/by-name-overlay.nix:55:42:

       54|   # Because at that point the code in ./stage.nix can be changed to not allow definitions in `all-packages.nix` to override ones from `pkgs/by-name` anymore and throw an error if that happens instead.
       55|   _internalCallByNamePackageFile = file: self.callPackage file { };
         |                                          ^
       56| }

   … while calling 'callPackageWith'

     at /git/pr/eiwd/init/lib/customisation.nix:123:35:

      122|   */
      123|   callPackageWith = autoArgs: fn: args:
         |                                   ^
      124|     let

   … from call site

     at /git/pr/eiwd/init/lib/trivial.nix:430:7:

      429|     { # TODO: Should we add call-time "type" checking like built in?
      430|       __functor = self: f;
         |       ^
      431|       __functionArgs = args;

   … while calling anonymous lambda

     at /git/pr/eiwd/init/lib/customisation.nix:73:6:

       72|   makeOverridable = f: lib.setFunctionArgs
       73|     (origArgs: let
         |      ^
       74|       result = f origArgs;

   … from call site

     at /git/pr/eiwd/init/lib/customisation.nix:74:16:

       73|     (origArgs: let
       74|       result = f origArgs;
         |                ^
       75|

   … while calling anonymous lambda

     at /git/pr/eiwd/init/pkgs/by-name/ei/eiwd/package.nix:1:1:

        1| { lib
         | ^
        2| , stdenv

   … from call site

     at /git/pr/eiwd/init/pkgs/by-name/ei/eiwd/package.nix:12:1:

       11|
       12| stdenv.mkDerivation (finalAttrs: {
         | ^
       13|   pname = "eiwd";

   … while calling anonymous lambda

     at /git/pr/eiwd/init/pkgs/stdenv/generic/make-derivation.nix:548:3:

      547| in
      548|   fnOrAttrs:
         |   ^
      549|     if builtins.isFunction fnOrAttrs

   … from call site

     at /git/pr/eiwd/init/pkgs/stdenv/generic/make-derivation.nix:550:10:

      549|     if builtins.isFunction fnOrAttrs
      550|     then makeDerivationExtensible fnOrAttrs
         |          ^
      551|     else makeDerivationExtensibleConst fnOrAttrs

   … while calling 'makeDerivationExtensible'

     at /git/pr/eiwd/init/pkgs/stdenv/generic/make-derivation.nix:14:30:

       13|   # Based off lib.makeExtensible, with modifications:
       14|   makeDerivationExtensible = rattrs:
         |                              ^
       15|     let

   … from call site

     at /git/pr/eiwd/init/pkgs/stdenv/generic/make-derivation.nix:47:9:

       46|       finalPackage =
       47|         mkDerivationSimple overrideAttrs args;
         |         ^
       48|

   … while calling 'mkDerivationSimple'

     at /git/pr/eiwd/init/pkgs/stdenv/generic/make-derivation.nix:81:1:

       80| #   Explanation about derivations in general
       81| {
         | ^
       82|

   … from call site

     at /git/pr/eiwd/init/pkgs/stdenv/generic/make-derivation.nix:496:1:

      495|
      496| lib.extendDerivation
         | ^
      497|   validity.handled

   … while calling 'extendDerivation'

     at /git/pr/eiwd/init/lib/customisation.nix:197:43:

      196|      the derivation itself and check a given condition when evaluating. */
      197|   extendDerivation = condition: passthru: drv:
         |                                           ^
      198|     let

   … from call site

     at /git/pr/eiwd/init/pkgs/stdenv/generic/make-derivation.nix:545:4:

      544|    passthru)
      545|   (derivation (derivationArg // lib.optionalAttrs envIsExportable checkedEnv));
         |    ^
      546|

   … while calling anonymous lambda

     at /builtin/derivation.nix:5:1: (source not available)

   … from call site

     at /git/pr/eiwd/init/pkgs/by-name/ei/eiwd/package.nix:28:8:

       27|     "man"
       28|   ] ++ lib.optionals finalAttrs.finalPackage.doCheck [
         |        ^
       29|     "test"

   … while calling 'optionals'

     at /git/pr/eiwd/init/lib/lists.nix:375:5:

      374|     # List to return if condition is true
      375|     elems: if cond then elems else [];
         |     ^
      376|

   error: infinite recursion encountered

   at «none»:0: (source not available)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think outputs is extra-strict because technically you could have insane things like

outputs = [ "doCheck" ];

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words, finalAttrs.finalPackage is strict in outputs, because the attrnames of outputs become attrnames of finalPackage, and Nix attrsets are strict in their attrnames (lazy only in their attrvalues).

So outputs can't depend on finalAttrs.

@ghost ghost requested a review from Artturin November 3, 2023 06:24
@Artturin Artturin merged commit 9ac60d3 into NixOS:master Nov 3, 2023
@ghost ghost deleted the pr/eiwd/init branch November 3, 2023 21:26
@cafkafk cafkafk mentioned this pull request Nov 9, 2023
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant