Add basic directed acyclic graph data structure

Also make use of this instead of Nixpkgs's strings-with-deps library
in activation script generation.
This commit is contained in:
Robert Helgesson 2017-05-04 00:36:39 +02:00
parent 62a9a8fa3c
commit 8fab2a5d9b
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86
4 changed files with 153 additions and 22 deletions

View file

@ -1,6 +1,7 @@
{ config, lib, pkgs, ... }:
with lib;
with import ../lib/dag.nix;
let
@ -177,18 +178,19 @@ in
config = mkIf cfg.enable {
home.packages = [ pkgs.gnome3.gnome_terminal ];
home.activation.gnomeTerminal =
# The dconf service needs to be installed and prepared.
home.activation.gnomeTerminal = dagEntryAfter ["installPackages"] (
let
sf = pkgs.writeText "gnome-terminal.ini" (toINI (buildIniSet cfg));
dconfPath = "/org/gnome/terminal/legacy/";
in
# The dconf service needs to be installed and prepared.
stringAfter [ "installPackages" ] ''
''
if [[ -v DRY_RUN ]]; then
echo ${pkgs.gnome3.dconf}/bin/dconf load ${dconfPath} "<" ${sf}
else
${pkgs.gnome3.dconf}/bin/dconf load ${dconfPath} < ${sf}
fi
'';
''
);
};
}