dotfiles.nix (1316B)
1 { pkgs 2 , fetchFromGitHub 3 , fetchurl 4 , stdenv 5 , writeScript 6 , machineSessionCommands ? "" 7 }: 8 let 9 #dotfiles = pkgs.jb55-dotfiles; 10 bgimg = fetchurl { 11 url = "https://jb55.com/s/red-low-poly.png"; 12 sha256 = "e45cc45eb084d615babfae1aae703757c814d544e056f0627d175a6ab18b35ab"; 13 }; 14 impureSessionCommands = '' 15 #!${pkgs.bash}/bin/bash 16 '' + "\n" + machineSessionCommands; 17 sessionCommands = '' 18 #!${pkgs.bash}/bin/bash 19 ${pkgs.feh}/bin/feh --bg-fill ${bgimg} 20 ${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr 21 ${pkgs.autocutsel}/bin/autocutsel -fork -selection CLIPBOARD 22 ${pkgs.autocutsel}/bin/autocutsel -fork -selection PRIMARY 23 24 gpg-connect-agent /bye 25 GPG_TTY=$(tty) 26 export GPG_TTY 27 unset SSH_AGENT_PID 28 export SSH_AUTH_SOCK="/run/user/1000/gnupg/S.gpg-agent.ssh" 29 '' + "\n" + impureSessionCommands; 30 xinitrc = writeScript "xinitrc" sessionCommands; 31 xinitrc-refresh = writeScript "xinitrc-refresh" impureSessionCommands; 32 in stdenv.mkDerivation rec { 33 name = "jb55-config-${version}"; 34 version = "git-2015-01-13"; 35 36 phases = "installPhase"; 37 38 installPhase = '' 39 mkdir -p $out/bin 40 echo "user config at '$out'" 41 cp "${xinitrc}" $out/bin/xinitrc 42 cp "${xinitrc-refresh}" $out/bin/xinitrc-refresh 43 ln -s $out/bin/xinitrc $out/.xinitrc 44 ''; 45 }