diff options
author | aszlig <aszlig@redmoonstudios.org> | 2015-03-18 03:07:20 +0100 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2015-03-18 03:07:20 +0100 |
commit | 187c673adf3c6a9a7afd8934ee41df7941f28cbf (patch) | |
tree | 3dee57d93c9c8a5fe4b7bd855b1cf33728142acc /modules/user/aszlig/services/slim/default.nix | |
parent | 19e3e263610406fca8ca1ed6ecf283deb03d8334 (diff) |
modules: Move my modules into category dirs.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'modules/user/aszlig/services/slim/default.nix')
-rw-r--r-- | modules/user/aszlig/services/slim/default.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/user/aszlig/services/slim/default.nix b/modules/user/aszlig/services/slim/default.nix new file mode 100644 index 00000000..e5dea220 --- /dev/null +++ b/modules/user/aszlig/services/slim/default.nix @@ -0,0 +1,45 @@ +{ pkgs, config, lib, ... }: + +with lib; + +let + cfg = config.vuizvui.user.aszlig.services.slim; + randrHeads = config.services.xserver.xrandrHeads; +in { + options.vuizvui.user.aszlig.services.slim = { + enable = mkEnableOption "Vuizvui SLiM"; + }; + + config.services.xserver.displayManager.slim = mkIf cfg.enable { + enable = true; + theme = pkgs.stdenv.mkDerivation { + name = "nixos-theme-vuizvui"; + src = pkgs.slimThemes.nixosSlim; + phases = [ "unpackPhase" "patchPhase" "installPhase" ]; + patchPhase = let + headFactor = if randrHeads == [] then 1 else lib.length randrHeads; + centerLeft = 100 / (headFactor * 2); + in '' + ${pkgs.imagemagick}/bin/mogrify \ + -fill '#080010' -draw 'color 0,0 reset' \ + share/slim/themes/nixos-slim-testing/background.png + ${pkgs.imagemagick}/bin/mogrify \ + -negate -region 100x110+0+0 -negate -fill white -colorize 20% \ + share/slim/themes/nixos-slim-testing/panel.png + sed -i \ + -e 's/^\([a-z_]\+_x[^0-9]*\)[0-9]\+%/\1${toString centerLeft}%/' \ + share/slim/themes/nixos-slim-testing/slim.theme + cat >> share/slim/themes/nixos-slim-testing/slim.theme <<EOF + session_x ${toString centerLeft}% + msg_color #ffffff + username_color #ffffff + password_color #ffffff + input_color #ffffff + EOF + ''; + installPhase = '' + cp -R share/slim/themes/nixos-slim-testing "$out" + ''; + }; + }; +} |