make the i3 conf a bit portable

auto-flake-update
Yorick van Pelt 2016-09-17 15:21:02 +02:00
parent ef73effb57
commit 2ec5d12afe
2 changed files with 20 additions and 9 deletions

View File

@ -1,12 +1,17 @@
{pkgs ? import <nixpkgs> {}}:
let
inherit (pkgs) lib;
bin = pkgs.callPackage ./bin/default.nix {};
i3 = pkgs.callPackage ./i3/i3.nix {inherit (bin) brightness screenshot_public;};
in
{
ascanius = pkgs.symlinkJoin { paths = [i3]; name = "dotfiles-ascanius"; };
woodhouse = [];
i3 = with_lock: pkgs.callPackage ./i3/i3.nix {
inherit (bin) brightness screenshot_public;
inherit with_lock;
};
in lib.mapAttrs (k: paths:
pkgs.symlinkJoin { inherit paths; name = "dotfiles-${k}"; }
) {
ascanius = [(i3 true)];
woodhouse = [(i3 false)];
pennyworth = [];
frumar = [];
}

View File

@ -1,6 +1,7 @@
{writeTextDir, writeScript,
{writeTextDir, writeScript, lib,
rofi, xautolock, nitrogen, compton-git, i3status, i3-gaps
, i3lock-fancy, xset, alsaUtils, brightness, screenshot_public}:
, i3lock-fancy, xset, alsaUtils, brightness, screenshot_public,
with_lock ? true}:
let
locker = writeScript "dlock.sh" ''
@ -16,7 +17,7 @@ revert
in
writeTextDir "i3-config" ''
writeTextDir "i3-config" (''
# i3 config file (v4)
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@ -167,8 +168,13 @@ bar {
exec --no-startup-id ${nitrogen}/bin/nitrogen --restore
exec --no-startup-id ${compton-git}/bin/compton -c /home/yorick/dotfiles/x/compton.conf
'' + (lib.optionalString with_lock ''
exec --no-startup-id ${xautolock}/bin/xautolock -time 15 -locker ${locker} -lockaftersleep
'') + ''
bindsym XF86MonBrightnessUp exec ${brightness}/bin/brightness up 50
bindsym XF86MonBrightnessDown exec ${brightness}/bin/brightness down 50
bindsym XF86AudioLowerVolume exec ${alsaUtils}/bin/amixer set Master 1%-
@ -177,4 +183,4 @@ bindsym XF86AudioMute exec ${alsaUtils}/bin/amixer set Master toggle
bindsym $mod+Shift+s exec --no-startup-id ${screenshot_public}/bin/screenshot_public
''
'')