Commit Graph

293 Commits

Author SHA1 Message Date
Pacman99
6d3ff629da fix issue with creating empty outputs 2021-04-17 17:50:31 -05:00
David Arnold
141f4481a0 update Readme with new exporters and builders 2021-04-16 13:48:34 -05:00
David Arnold
89af07f132 fmt 2021-04-16 13:48:34 -05:00
David Arnold
d1328b89f7 fixup 2021-04-16 13:48:34 -05:00
David Arnold
ffb08a1aa3 de-convolute code 2021-04-16 13:48:34 -05:00
David Arnold
57c6cdfb04 plain naming 2021-04-16 13:48:34 -05:00
David Arnold
ec402c6f5b let's be conservative: no default pkgs builder 2021-04-16 13:48:34 -05:00
David Arnold
431f9bd921 docs: modulesFromListExporter 2021-04-16 13:48:34 -05:00
David Arnold
a8023769f2 add: lib.builders.packagesFromOverlaysBuiderConstructer
Constructor, that with the help of channels dependency constructs a
packagesFromOverlaysBuilder that outputs all packages defined
in overlays that do not break flake checks.

Good for sharing binary cached packages. Any package that would
break nix flake check (e.g. because it is marked as broken) cannot
be shared via this mechanism, and the alternative via overlays has to be
used.
2021-04-16 13:48:34 -05:00
David Arnold
a02bd4ff6d add: lib.exporter.overlaysFromChanelsExporter
overlaysFromChanelsExporter generates a flat namsepaced overlay
attribute set that exports every overlay key from every channel
individually.

Good for users that want to pull in individual overlays and evaluate
them with their own dependencies.
2021-04-16 13:48:34 -05:00
David Arnold
25deb8a4b0 ref: move lib.modulesFromList -> lib.exporter.modulesFromListExporter
This prepares for adding additional exporters and builders in following
commits.

The implementation of modulesFromList is no changed in any way.
2021-04-16 13:48:34 -05:00
David Arnold
2532886799 clarify
Co-authored-by: Pacman99 <pachum99@myrdd.info>
2021-04-16 11:36:16 -05:00
David Arnold
d036da0000 add: specialArgs 2021-04-16 11:36:16 -05:00
Pacman99
242e97f343
Merge pull request #33 from Pacman99/unified-merge
Improve merging of host arguments and flake outputs
2021-04-16 09:20:24 -07:00
Pacman99
6c9872a2d7 improve merging of otherArguments 2021-04-15 23:40:18 -07:00
Pacman99
029eabe89b Don't use deprecated arguments in examples 2021-04-15 23:25:40 -07:00
Pacman99
98eb0cfff8 unified merge func to fold hosts and merge args 2021-04-15 19:37:50 -07:00
Gytis Ivaskevicius
c87df35ff6
Merge pull request #32 from gytis-ivaskevicius/bugfixes
Cleanup + a couple of little bugs
2021-04-15 20:17:31 +03:00
Gytis Ivaskevicius
e8561f24d8 Add Github Actions 2021-04-14 22:37:16 +03:00
Gytis Ivaskevicius
4b8349f75e Add dummy patch 2021-04-14 20:53:03 +03:00
Gytis Ivaskevicius
60c2c8e33d Cleanup 2021-04-14 20:48:02 +03:00
Gytis Ivaskevicius
0b101bd6b3
Merge pull request #31 from Pacman99/fold-hosts
use manual fold function for list of hosts
2021-04-14 12:24:34 +03:00
Pacman99
bb6f9769d3 use manual fold function for list of hosts
mapAttrs'/listToAttrs doesn't merge outputs properly
2021-04-14 00:42:33 -07:00
David Arnold
7a95ccdd06 attend feedback 2021-04-12 21:09:57 -05:00
David Arnold
6c2c8dbce7 fmt 2021-04-12 21:09:57 -05:00
Charlotte Van Petegem
a63efbafe6 Nixos modules should be functions 2021-04-12 21:09:57 -05:00
Charlotte Van Petegem
edb45e2987 Fix fully-featured host 2021-04-12 21:09:57 -05:00
Charlotte Van Petegem
66942263b5 Make nix flake show work on both example flakes 2021-04-12 21:09:57 -05:00
David Arnold
41e34984db fixup oversight from #22 2021-04-12 21:09:57 -05:00
David Arnold
b8e2e49a7a prepare examples for using as manual tests 2021-04-12 21:09:57 -05:00
David Arnold
efadbc576d fix: extraArgs is deprecated in favor of _module.args 2021-04-10 00:05:58 -05:00
David Arnold
c98ade2800 fix: wordings 2021-04-09 22:16:41 -05:00
Pacman99
f9e83a41ee add nix-darwin host example 2021-04-09 22:16:41 -05:00
Pacman99
ddcd703a0b allow custom config system builder and output 2021-04-09 22:16:41 -05:00
Pacman99
1dbf646cde rename nixosHosts -> hosts 2021-04-09 22:16:41 -05:00
David Arnold
6ee4bda081 fixups 2021-04-09 17:37:21 -05:00
David Arnold
4549a9a2d8 ref: profile -> hostAttrs
Rationale:

For internal coding purposes only the following attribute set does
not require an abstract name (such as `profile`). Moreover so, as
"profile" has a distinct legacy meaning in the nix ecosystem.
 {
    channelName = "...";
    system = "...";
    extraArgs = {};
    modules = [];
 };

Instead, this PR renames it to a banal and decribtive `hostAttrs`. This
naming does also better aling with the top level `defaultHostAttrs`.
2021-04-09 17:37:21 -05:00
David Arnold
a172f600d5 give unprominence to ergeHostAttrs 2021-04-09 17:37:21 -05:00
David Arnold
5bcd5c2fdb improve mergeHostAttrs readability
defaultTo was an awkward syntax. The goal is to intuitively understand
the merging semantics. Unfortunetly, unlike haskell, nix does not
provide the necesary language features, so add a little sugar to it.
2021-04-09 17:37:21 -05:00
David Arnold
8c7373a44c fixup lhs / rhs extraArgs mergin order 2021-04-09 17:37:21 -05:00
David Arnold
6f76f45230 update docs 2021-04-09 17:37:21 -05:00
David Arnold
2a2c505cf1 fix: defaultHostAttrs merging & validate API contract 2021-04-09 17:37:21 -05:00
David Arnold
01972fcfe8 fix: defaultHostAttrs merging
if both, defaultSystem and defaultHostAttrs.system are declared, which
should take precedence? And at any rate the other one becomes a no-op
api argument. Conditionally no-op api args are treacherous.

To avoid this sort of problems all args with an override semantic
need to be removed from top level. Currently this affects defaultSystem.

Note that since sharedModules and sharedExtraArgs have merge semantics,
they don't suffer this conflict, if both they are declared in both
places, at the very least non of them becomes a no-op.
2021-04-09 17:37:21 -05:00
David Arnold
72702fe119 Revert "Revert "Merge pull request #19 from Pacman99/default-hosts""
This reverts commit fe983e5a9c.
2021-04-09 17:37:21 -05:00
David Arnold
fe983e5a9c
Revert "Merge pull request #19 from Pacman99/default-hosts"
This reverts commit faa7855068, reversing
changes made to 8a593ca296.

```
  evalHostArgs =
    { channelName ? "nixpkgs"
    , modules ? []
    , system ? defaultSystem
    , extraArgs ? {}
    , ...
    }: defaultHostAttrs
      // { 
        inherit channelName system; 
        modules = sharedModules ++ modules;
        extraArgs = sharedExtraArgs // extraArgs;
      };

```

does not as intended.

- channelName would be "nixpkgs" even if a default is set.
2021-04-08 18:26:20 -05:00
Pacman99
9316860fba
Merge pull request #18 from Pacman99/set-options
Only set options if they exist
2021-04-08 10:12:04 -07:00
Pacman99
ccdb5f86b9 don't set options unless they exist 2021-04-08 10:07:10 -07:00
Pacman99
faa7855068
Merge pull request #19 from Pacman99/default-hosts
Add argument to set host defaults
Improve default handling overall
2021-04-08 09:48:06 -07:00
Pacman99
bfac117703 Add line to example demonstrating defaultHostAttrs 2021-04-08 09:45:58 -07:00
Pacman99
1dd54a394d eval host args with function to deal with defaults 2021-04-07 18:21:49 -07:00