summaryrefslogtreecommitdiffstats
path: root/makefu/3modules
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2016-05-09 11:27:06 +0200
committerlassulus <lass@aidsballs.de>2016-05-09 11:27:06 +0200
commite7528ccc2f366df381d6436ae2ad6781a9a0ace3 (patch)
tree59d65c08da8fdd297fe02ab8bb1486f420b4a17f /makefu/3modules
parentfb87c76112b1c4c8d48de8df78b5f46f2b750bdf (diff)
parent56ca7859fab1ad3c1a0a7b5ebf10140b218a60be (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/3modules')
-rw-r--r--makefu/3modules/awesome-extra.nix40
-rw-r--r--makefu/3modules/default.nix1
2 files changed, 41 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
diff --git a/makefu/3modules/default.nix b/makefu/3modules/default.nix
index 0a10b1532..853bdca04 100644
--- a/makefu/3modules/default.nix
+++ b/makefu/3modules/default.nix
@@ -5,6 +5,7 @@ _:
./snapraid.nix
./umts.nix
./taskserver.nix
+ ./awesome-extra.nix
];
}