mirror of
https://github.com/nix-community/home-manager
synced 2024-09-05 10:56:31 +02:00
33 lines
687 B
Nix
33 lines
687 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
dag = config.lib.dag;
|
|
|
|
result = let
|
|
sorted = dag.topoSort config.tested.dag;
|
|
data = map (e: "${e.name}:${e.data}") sorted.result;
|
|
in concatStringsSep "\n" data + "\n";
|
|
|
|
in {
|
|
options.tested.dag = mkOption { type = hm.types.dagOf types.str; };
|
|
|
|
config = {
|
|
tested = mkMerge [
|
|
{ dag.after = "after"; }
|
|
{ dag.before = dag.entryBefore [ "after" ] "before"; }
|
|
{ dag.between = dag.entryBetween [ "after" ] [ "before" ] "between"; }
|
|
];
|
|
|
|
home.file."result.txt".text = result;
|
|
|
|
nmt.script = ''
|
|
assertFileContent \
|
|
home-files/result.txt \
|
|
${./dag-merge-result.txt}
|
|
'';
|
|
};
|
|
}
|