Skip to content

Instantly share code, notes, and snippets.

@kalbasit
Created July 18, 2018 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kalbasit/5146cc76a92677702f451edfc4aba4df to your computer and use it in GitHub Desktop.
Save kalbasit/5146cc76a92677702f451edfc4aba4df to your computer and use it in GitHub Desktop.
{ config, stdenv, pkgs, lib, ... }:
stdenv.mkDerivation rec {
name = "i3-config";
phases = lib.mkMerge [
"installPhase"
"fixupPhase"
(lib.mkIf (config.networking.hostname == "hades") "hadesFixes")
];
src = ./.;
installPhase = ''
install -d -m755 $out/userHome/.config/i3
cp -dr $src/bin $out/bin
substitute $src/config $out/userHome/.config/i3/config \
--subst-var-by brightnessctl_bin ${pkgs.brightnessctl}/bin/brightnessctl \
--subst-var-by charles_bin ${pkgs.charles}/bin/charles \
--subst-var-by i3lock_bin ${pkgs.i3lock}/bin/i3lock \
--subst-var-by i3status_bin ${pkgs.i3status}/bin/i3status \
--subst-var-by notify-send_bin ${pkgs.libnotify}/bin/notify-send \
--subst-var-by pactl_bin ${pkgs.pulseaudio}/bin/pactl \
--subst-var-by rbrowser_bin ${pkgs.rbrowser}/bin/rbrowser \
--subst-var-by rofi_bin ${pkgs.rofi}/bin/rofi \
--subst-var-by slack_bin ${pkgs.slack}/bin/slack \
--subst-var-by alacritty_bin ${pkgs.alacritty}/bin/alacritty
'';
hadesFixes = ''
substituteInPlace $out/userHome/.config/i3/config \
--subst-var-by int_monitor eDP1 \
--subst-var-by int_mode 1920x1080 \
--subst-var-by int_scale 1x1 \
--subst-var-by ext_monitor DP-1-2
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment