summaryrefslogtreecommitdiffstats
path: root/makefu/3modules/awesome-extra.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-04-17 02:03:15 +0200
committermakefu <github@syntax-fehler.de>2016-04-17 02:03:15 +0200
commitbdce2137e713944e77b3e35f758c757a43a99d3e (patch)
treefb9693b6466601ce51e12b9f65492d026039ede1 /makefu/3modules/awesome-extra.nix
parent26e43d47a729df42ed81ac351ea7ba62cea5c102 (diff)
ma awesome: refactor into module
Diffstat (limited to 'makefu/3modules/awesome-extra.nix')
-rw-r--r--makefu/3modules/awesome-extra.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/makefu/3modules/awesome-extra.nix b/makefu/3modules/awesome-extra.nix
new file mode 100644
index 000000000..b12556486
--- /dev/null
+++ b/makefu/3modules/awesome-extra.nix
@@ -0,0 +1,40 @@
+{config, lib, pkgs, ... }:
+
+with config.krebs.lib;
+let
+ cfg = config.makefu.awesome;
+ out = {
+ options.makefu.awesome = api;
+ config = lib.mkIf cfg.enable imp;
+ };
+ api = {
+ enable = mkEnableOption "awesome custom config";
+ modkey = mkOption {
+ type = types.str;
+ description = "Modkey to be used";
+ default = "Mod4";
+ };
+ baseConfig = mkOption {
+ type = types.path;
+ description = ''
+ rc.lua file to be used as default
+ This module will use substituteAll to replace strings before writing to
+ /etc/xdg/awesome/rc.lua
+ '';
+ default = pkgs.awesomecfg.full;
+ };
+ };
+ imp = {
+ # TODO: configure display manager as well
+ nixpkgs.config.packageOverrides = pkgs: rec {
+ awesome = pkgs.stdenv.lib.overrideDerivation pkgs.awesome (oldAttrs : {
+ postFixup = let
+ rclua = pkgs.substituteAll {
+ src = cfg.baseConfig;
+ inherit (cfg) modkey;
+ };
+ in "cp ${rclua} $out/etc/xdg/awesome/rc.lua";
+ });
+ };
+ };
+in out