1
0
mirror of https://github.com/nix-community/home-manager synced 2024-07-02 19:38:32 +02:00
Commit Graph

8 Commits

Author SHA1 Message Date
Naïm Favier
6311f4adc3
lib/types: make DAG entries mergeable
Removes the `uniq` constraint on `after` and `before` so that we can
merge multiple definitions for the same DAG entry:

    {
      dag = mkMerge [
        {
          foo = lib.hm.dag.entryBefore [ "bar" ] {
            # definition 1
          };
        }
        {
          foo = lib.hm.dag.entryBefore [ "qux" ] {
            # definition 2
          };
        }
        {
          foo = {
            # definition 3
          };
        }
      ];
    }

In this example `foo` will come before `bar` and `qux`.
2022-07-12 11:47:38 +02:00
Naïm Favier
8db712a6a2
types: fix dagOf behaviour with mkIf
This makes definitions like

    home.activation.foo = mkIf false "bar"

work, where previously they would complain about
`home.activation.foobar.data` being used but not defined.

The crucial part is that we don't call `convertAllToDags` in
`dagOf.merge`, because we need to process `mkIf`/`mkMerge` properties
first. So we let `attrEquivalent.merge` do its job normally, but give
it a type `dagEntryOf` that does the conversion.

Ideally this shouldn't require so much boilerplate; I'd like to
implement something like

    types.changeInto dagContentType elemType dagEntryAnywhere

in Nixpkgs.
2022-03-30 23:29:09 +02:00
Thiago Kenji Okada
3ccddfc48d
lib: remove top-level with lib 2021-10-31 08:50:53 +01:00
Robert Helgesson
e42e147b58
Remove some usage of config.lib.dag
The `lib.hm.dag` attribute set should always be preferred.
2021-05-09 12:13:31 +02:00
Robert Helgesson
45abf3d38a
Apply nixfmt on many files 2020-02-02 01:07:28 +01:00
Robert Helgesson
1397570eea
tests: use lib.hm.types instead of explicit import 2020-01-26 11:28:34 +01:00
Robert Helgesson
7f87329fca
home-environment: use DAG type in activation option 2020-01-16 00:16:35 +01:00
Robert Helgesson
6c127efb2d
lib: add type generators dagOf and listOrDagOf
Given an inner type, the former function generates a type that expect
DAG option values. The latter function is only present to temporarily
allow the `programs.ssh.matchBlocks` to keep accepting list values.
2020-01-16 00:16:09 +01:00