Skip to content

Commit

Permalink
Merge pull request #689 from cherryblossom000/patch-1
Browse files Browse the repository at this point in the history
docs: clarify how to use inputs with flakes
  • Loading branch information
LnL7 authored Jun 20, 2023
2 parents 1a625c1 + 1fc5d12 commit 1eab97f
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,30 @@ A minimal example of using an existing configuration.nix:
}
```

Inputs from the flake can also be passed to `darwinSystem`, these inputs are then
accessible as an argument, similar to pkgs and lib inside the configuration.
Inputs from the flake can also be passed to `darwinSystem`. These inputs are then
accessible as an argument `inputs`, similar to `pkgs` and `lib`, inside the configuration.

```nix
darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [ ... ];
modules = [ ./configuration.nix ];
inputs = { inherit darwin dotfiles nixpkgs; };
}
# in configuration.nix:
{ pkgs, lib, inputs }:
# inputs.darwin, inputs.dotfiles, and inputs.nixpkgs can be accessed here
```

Alternatively, `specialArgs` could be used:

```nix
darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [ ./configuration.nix ];
specialArgs = { inherit darwin dotfiles nixpkgs; };
}
# in configuration.nix:
{ pkgs, lib, darwin, dotfiles, nixpkgs }:
```

Since the installer doesn't work with flakes out of the box yet, nix-darwin will need to
Expand Down

0 comments on commit 1eab97f

Please sign in to comment.