Introduce a new overrideInputs on {default,shell}Nix #49

Closed
ckiee wants to merge 2 commits from ckiee/add-overrideInputs into master
ckiee commented 2023-01-01 21:44:54 +00:00 (Migrated from github.com)

This allows the user of this non-flake to have similar functionality to follows.

Example (default.nix):

nix-repl> (import ./.).default
«derivation /nix/store/axgvq22kyb8ymchzq1mjayms4jdl6ni6-ledc-0.1.0.drv»

nix-repl> ((import ./.).overrideInputs { nixpkgs = <nixpkgs>; }).default
«derivation /nix/store/r8zw693hpg91yx6f57hyx1gk4zdiq2lm-ledc-0.1.0.drv»

It's currently only able to override our flake's direct inputs. Sorry for the big diff.

This allows the user of this non-flake to have similar functionality to `follows`. Example (default.nix): ```nix nix-repl> (import ./.).default «derivation /nix/store/axgvq22kyb8ymchzq1mjayms4jdl6ni6-ledc-0.1.0.drv» nix-repl> ((import ./.).overrideInputs { nixpkgs = <nixpkgs>; }).default «derivation /nix/store/r8zw693hpg91yx6f57hyx1gk4zdiq2lm-ledc-0.1.0.drv» ``` It's currently only able to override our flake's direct inputs. Sorry for the big diff.
lheckemann (Migrated from github.com) approved these changes 2023-09-18 12:50:46 +00:00
lheckemann (Migrated from github.com) left a comment

Makes sense overall, and the diff isn't even that big when whitespace is ignored :)

Makes sense overall, and the diff isn't even that big when whitespace is ignored :)
lheckemann (Migrated from github.com) commented 2023-09-18 11:44:47 +00:00

Any particular reason to use mapAttrs' and not mapAttrs here?

Any particular reason to use `mapAttrs'` and not `mapAttrs` here?
lheckemann (Migrated from github.com) reviewed 2023-09-18 12:53:52 +00:00
lheckemann (Migrated from github.com) commented 2023-09-18 12:53:52 +00:00
                if (rootOverrides.${key} or null) != null then
```suggestion if (rootOverrides.${key} or null) != null then ```
ckiee commented 2023-09-18 14:12:35 +00:00 (Migrated from github.com)

@lheckemann some work continues in https://github.com/ElvishJerricco/flake-compat/tree/add-overrideInputs. i don't currently have the spoons for a review cycle, this may change by next week.

if you're looking for this to get merged, it'd probably be wise to make a PR against https://github.com/nix-community/flake-compat 💜

@lheckemann some work continues in https://github.com/ElvishJerricco/flake-compat/tree/add-overrideInputs. i don't currently have the spoons for a review cycle, this may change by next week. if you're looking for this to get merged, it'd probably be wise to make a PR against https://github.com/nix-community/flake-compat :purple_heart:
DavHau commented 2023-09-30 14:44:57 +00:00 (Migrated from github.com)

The current head of the PR is broken, it is missing inputs, no matter if overrideInputs is used or not.
Errror:

error: attribute 'nixpkgs_2' missing

       at /nix/store/dp0f4gy50va2lbrz970lx9v65qb4qv70-source/default.nix:159:20:

          158|               else
          159|                 if rootOverrides.${key} != null then
             |                    ^
          160|                   { type = "path";
       Did you mean nixpkgs?

The PR at the nix-community flake-compat does work fine

The current head of the PR is broken, it is missing inputs, no matter if overrideInputs is used or not. Errror: ``` error: attribute 'nixpkgs_2' missing at /nix/store/dp0f4gy50va2lbrz970lx9v65qb4qv70-source/default.nix:159:20: 158| else 159| if rootOverrides.${key} != null then | ^ 160| { type = "path"; Did you mean nixpkgs? ``` The [PR at the nix-community flake-compat](https://github.com/edolstra/flake-compat/pull/49) does work fine
jade closed this pull request 2024-05-03 02:57:54 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.