stockholm/makefu/3modules/awesome-extra.nix

46 lines
1.3 KiB
Nix
Raw Normal View History

2016-04-17 00:03:15 +00:00
{config, lib, pkgs, ... }:
2016-10-20 18:54:38 +00:00
with import <stockholm/lib>;
2016-04-17 00:03:15 +00:00
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 : {
2017-08-06 18:28:00 +00:00
postFixup = let
2016-04-17 00:03:15 +00:00
rclua = pkgs.substituteAll {
src = cfg.baseConfig;
2017-08-06 18:28:00 +00:00
modkey = cfg.modkey;
# inherit (cfg) modkey;
amixer = "${pkgs.alsaUtils}/bin/amixer";
xlock = "${pkgs.xlockmore}/bin/xlock";
xbacklight = "${pkgs.xorg.xbacklight}/bin/xbacklight";
2016-04-17 00:03:15 +00:00
};
in "cp ${rclua} $out/etc/xdg/awesome/rc.lua";
});
};
};
in out