diff options
author | Robert Helgesson <robert@rycee.net> | 2017-12-02 19:15:13 +0100 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2017-12-26 17:27:21 +0100 |
commit | f0d207f3807c2111532d361c71047e1883595f3a (patch) | |
tree | 8d5ba305fdbad1e3ee9e761573746c4b27ecf10d /modules/services/window-managers | |
parent | 7dd09cecda0ea9a84a831259a37609c92fd86652 (diff) |
Add dag library to `config.lib`
Also replace all imports of `dag.nix` by the entry in `config.lib`.
Diffstat (limited to 'modules/services/window-managers')
-rw-r--r-- | modules/services/window-managers/i3.nix | 7 | ||||
-rw-r--r-- | modules/services/window-managers/xmonad.nix | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/modules/services/window-managers/i3.nix b/modules/services/window-managers/i3.nix index 96842788ad6..a40f7462e9e 100644 --- a/modules/services/window-managers/i3.nix +++ b/modules/services/window-managers/i3.nix @@ -1,12 +1,13 @@ { config, lib, pkgs, ... }: with lib; -with import ../../lib/dag.nix { inherit lib; }; let cfg = config.xsession.windowManager.i3; + dag = config.lib.dag; + startupModule = types.submodule { options = { command = mkOption { @@ -621,7 +622,7 @@ in xsession.windowManager.command = "${cfg.package}/bin/i3"; xdg.configFile."i3/config".source = configFile; - home.activation.checkI3 = dagEntryBefore [ "linkGeneration" ] '' + home.activation.checkI3 = dag.entryBefore [ "linkGeneration" ] '' if ! cmp --quiet \ "${configFile}" \ "${config.xdg.configHome}/i3/config"; then @@ -629,7 +630,7 @@ in fi ''; - home.activation.reloadI3 = dagEntryAfter [ "linkGeneration" ] '' + home.activation.reloadI3 = dag.entryAfter [ "linkGeneration" ] '' if [[ -v i3Changed && -v DISPLAY ]]; then echo "Reloading i3" ${cfg.package}/bin/i3-msg reload 1>/dev/null diff --git a/modules/services/window-managers/xmonad.nix b/modules/services/window-managers/xmonad.nix index 660a609659e..d4643b09168 100644 --- a/modules/services/window-managers/xmonad.nix +++ b/modules/services/window-managers/xmonad.nix @@ -1,12 +1,13 @@ { config, lib, pkgs, ... }: with lib; -with import ../../lib/dag.nix { inherit lib; }; let cfg = config.xsession.windowManager.xmonad; + dag = config.lib.dag; + xmonad = pkgs.xmonad-with-packages.override { ghcWithPackages = cfg.haskellPackages.ghcWithPackages; packages = self: @@ -90,13 +91,13 @@ in (mkIf (cfg.config != null) { home.file.".xmonad/xmonad.hs".source = cfg.config; - home.activation.checkXmonad = dagEntryBefore [ "linkGeneration" ] '' + home.activation.checkXmonad = dag.entryBefore [ "linkGeneration" ] '' if ! cmp --quiet "${cfg.config}" "$HOME/.xmonad/xmonad.hs"; then xmonadChanged=1 fi ''; - home.activation.applyXmonad = dagEntryAfter [ "linkGeneration" ] '' + home.activation.applyXmonad = dag.entryAfter [ "linkGeneration" ] '' if [[ -v xmonadChanged ]]; then echo "Recompiling xmonad" ${config.xsession.windowManager.command} --recompile |