Merge remote-tracking branch 'mors/master'

This commit is contained in:
tv 2015-10-01 17:19:26 +02:00
commit 39d07cad03
12 changed files with 158 additions and 9 deletions

View File

@ -22,6 +22,7 @@
../2configs/retiolum.nix
../2configs/wordpress.nix
../2configs/bitlbee.nix
../2configs/firefoxPatched.nix
];
krebs.build = {

View File

@ -62,7 +62,7 @@ in {
imports = [
../3modules/per-user.nix
] ++ [
( createFirefoxUser "ff" [ "audio" ] [ pkgs.firefox ] )
( createFirefoxUser "ff" [ "audio" ] [ ] )
( createChromiumUser "cr" [ "audio" ] [ pkgs.chromium ] )
( createChromiumUser "fb" [ ] [ pkgs.chromium ] )
( createChromiumUser "gm" [ ] [ pkgs.chromium ] )

View File

@ -61,4 +61,8 @@ in {
xkbOptions = "caps:backspace";
};
services.logind.extraConfig = ''
HandleLidSwitch=ignore
'';
}

View File

@ -0,0 +1,58 @@
{ config, lib, pkgs, ... }:
let
lpkgs = import ../5pkgs { inherit pkgs; };
inherit (lib)
concatMapStrings
;
plugins = with lpkgs.firefoxPlugins; [
noscript
ublock
vimperator
];
copyXpi = plugin:
"cp ${plugin}/*.xpi $out/usr/lib/firefox-*/browser/extensions/";
preferences = pkgs.writeText "autoload.js" ''
pref('general.config.filename', 'firefox.cfg');
pref('general.config.obscure_value', 0);
'';
config = pkgs.writeText "firefox.cfg" ''
//
lockPref("app.update.enabled", false);
lockPref("extensions.update.enabled", false);
lockPref("autoadmin.global_config_url", "");
lockPref("extensions.checkUpdateSecurity", false);
lockPref("services.sync.enabled", false);
lockPref("browser.shell.checkDefaultBrowser", false);
lockPref("layout.spellcheckDefault", 0);
lockPref("app.update.auto", false);
lockPref("browser.newtabpage.enabled", false);
lockPref("noscript.firstRunRedirection", false);
lockPref("noscript.hoverUI", false);
lockPref("noscript.notify", false);
defaultPref("extensions.newAddons", false);
defaultPref("extensions.autoDisableScopes", 0);
defaultPref("plugin.scan.plid.all", false);
'';
in {
environment.systemPackages = [
(pkgs.lib.overrideDerivation pkgs.firefox-bin (original : {
installPhase = ''
${original.installPhase}
find $out/usr/lib
${concatMapStrings copyXpi plugins}
cd $out/usr/lib/firefox-*/
mkdir -p browser/defaults/preferences
cp ${preferences} browser/defaults/preferences/autoload.js
cp ${config} ./firefox.cfg
'';
}))
];
}

View File

@ -7,7 +7,6 @@
gnupg1compat
htop
i3lock
mc
mosh
mpv
pass

View File

@ -2,6 +2,11 @@
{
environment.systemPackages = with pkgs; [
texLive
(texLiveAggregationFun { paths = [
texLive
texLiveExtra
texLiveCMSuper
texLiveModerncv
];})
];
}

View File

@ -57,7 +57,7 @@
#exports
export EDITOR='vim'
export MANPAGER='most'
export PAGER='vim -'
export PAGER='vim -R -'
# export MANPAGER='sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | vim -R -c "set ft=man nonu nomod nolist" -'
#beautiful colors
@ -103,23 +103,21 @@
case $UID in
0)
username='%F{red}root%f'
username='%F{red}root%f '
;;
1337)
username=""
;;
*)
username='%F{blue}%n%f'
username='%F{blue}%n%f '
;;
esac
if test -n "$SSH_CLIENT"; then
PROMPT="$error$username@%F{magenta}%M%f %~ "
else
PROMPT="$error$username %~ "
PROMPT="$error$username%~ "
fi
'';
};
users.defaultUserShell = "/run/current-system/sw/bin/zsh";

View File

@ -8,4 +8,9 @@ rec {
bitlbee-dev = callPackage ./bitlbee-dev.nix {};
bitlbee-steam = callPackage ./bitlbee-steam.nix { inherit bitlbee-dev; };
bitlbee = callPackage ./bitlbee.nix { inherit bitlbee-steam; };
firefoxPlugins = {
noscript = callPackage ./firefoxPlugins/noscript.nix {};
ublock = callPackage ./firefoxPlugins/ublock.nix {};
vimperator = callPackage ./firefoxPlugins/vimperator.nix {};
};
}

View File

@ -0,0 +1,28 @@
{ fetchgit, stdenv, bash, zip }:
stdenv.mkDerivation rec {
name = "noscript";
id = "{73a6fe31-595d-460b-a920-fcc0f8843232}";
src = fetchgit {
url = "https://github.com/avian2/noscript";
rev = "c900a079793868bb080ab1e23522d29dc121b4c6";
sha256 = "1y06gh5a622yrsx0h7v92qnvdi97i54ln09zc1lvk8x430z5bdly";
};
buildInputs = [ zip ];
patchPhase = ''
substituteInPlace "version.sh" \
--replace "/bin/bash" "${bash}/bin/bash"
'';
buildPhase = ''
./makexpi.sh
'';
installPhase = ''
mkdir -p $out/
cp *.xpi $out/${id}.xpi
'';
}

View File

@ -0,0 +1 @@
/nix/store/gxr152p1bbgqcd839b0rckdd1h5cr886-vimperator

View File

@ -0,0 +1,31 @@
{ fetchgit, stdenv, bash, python, zip }:
stdenv.mkDerivation rec {
name = "ublock";
id = "{2b10c1c8-a11f-4bad-fe9c-1c11e82cac42}";
src = fetchgit {
url = "https://github.com/chrisaljoudi/uBlock";
rev = "a70a50052a7914cbf86d46a725812b98434d8c70";
sha256 = "1qfzy79f8x01i33x0m95k833z1jgxjwb8wvlr6fj6id1kxfvzh77";
};
buildInputs = [
zip
python
];
patchPhase = ''
substituteInPlace "tools/make-firefox.sh" \
--replace "/bin/bash" "${bash}/bin/bash"
'';
buildPhase = ''
tools/make-firefox.sh all
'';
installPhase = ''
mkdir -p $out/
cp dist/build/uBlock.firefox.xpi $out/${id}.xpi
'';
}

View File

@ -0,0 +1,19 @@
{ fetchgit, stdenv, zip }:
stdenv.mkDerivation rec {
name = "vimperator";
id = "vimperator@mozdev.org";
src = fetchgit {
url = "https://github.com/vimperator/vimperator-labs.git";
rev = "ba7d8e72516fdc22246748c8183d7bc90f6fb073";
sha256 = "0drz67qm5hxxzw699rswlpjkg4p2lfipx119pk1nyixrqblcsvq2";
};
buildInputs = [ zip ];
installPhase = ''
mkdir -p $out/
cp downloads/vimperator*.xpi $out/${id}.xpi
'';
}