summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configs/earlyoom.nix10
-rw-r--r--configs/hw/AO753.nix3
-rw-r--r--configs/hw/winmax2.nix3
-rw-r--r--configs/hw/x220.nix3
-rw-r--r--configs/pulse.nix2
-rw-r--r--configs/xserver/default.nix2
-rw-r--r--modules/ejabberd/default.nix16
-rw-r--r--modules/hw.nix15
-rw-r--r--pkgs/haskell/xmonad-tv/src/main.hs3
-rw-r--r--systems/alnus/config.nix7
-rw-r--r--systems/mu/config.nix4
-rw-r--r--systems/querel/config.nix3
-rw-r--r--systems/xu/config.nix1
13 files changed, 34 insertions, 38 deletions
diff --git a/configs/earlyoom.nix b/configs/earlyoom.nix
new file mode 100644
index 0000000..1249c7a
--- /dev/null
+++ b/configs/earlyoom.nix
@@ -0,0 +1,10 @@
+{ lib, ... }: {
+ services.earlyoom.enable = true;
+ systemd.services.earlyoom.environment.EARLYOOM_ARGS = lib.mkForce (toString [
+ "-m 5"
+ "-s 10"
+ "-r 0"
+ "--prefer '(^|/)chromium$'"
+ ]);
+
+}
diff --git a/configs/hw/AO753.nix b/configs/hw/AO753.nix
index ea58c01..5e91564 100644
--- a/configs/hw/AO753.nix
+++ b/configs/hw/AO753.nix
@@ -41,7 +41,4 @@
'';
krebs.nixpkgs.allowUnfreePredicate = pkg: packageName pkg == "broadcom-sta";
-
- tv.hw.screens.primary.width = 1366;
- tv.hw.screens.primary.height = 768;
}
diff --git a/configs/hw/winmax2.nix b/configs/hw/winmax2.nix
index 4bcd6f1..8af5511 100644
--- a/configs/hw/winmax2.nix
+++ b/configs/hw/winmax2.nix
@@ -41,7 +41,4 @@
'';
tv.lidControl.enable = true;
-
- tv.hw.screens.primary.width = 2560;
- tv.hw.screens.primary.height = 1600;
}
diff --git a/configs/hw/x220.nix b/configs/hw/x220.nix
index 352040d..323be01 100644
--- a/configs/hw/x220.nix
+++ b/configs/hw/x220.nix
@@ -83,7 +83,4 @@
services.xserver = {
videoDriver = "intel";
};
-
- tv.hw.screens.primary.width = lib.mkDefault 1366;
- tv.hw.screens.primary.height = lib.mkDefault 768;
}
diff --git a/configs/pulse.nix b/configs/pulse.nix
index 9c317ae..815c309 100644
--- a/configs/pulse.nix
+++ b/configs/pulse.nix
@@ -75,7 +75,7 @@ in
];
};
- hardware.pulseaudio = {
+ services.pulseaudio = {
inherit support32Bit;
};
diff --git a/configs/xserver/default.nix b/configs/xserver/default.nix
index 884a982..88c1afb 100644
--- a/configs/xserver/default.nix
+++ b/configs/xserver/default.nix
@@ -6,13 +6,11 @@
user = config.krebs.build.user;
xmonad.pkg = pkgs.haskellPackages.xmonad-tv.overrideAttrs (_: {
au = {
- XMONAD_BUILD_SCREEN_WIDTH = 1920;
XMONAD_BUILD_TERM_FONT_WIDTH = 10;
XMONAD_BUILD_TERM_FONT = "xft:Input Mono:size=12:style=Regular";
XMONAD_BUILD_TERM_PADDING = 2;
};
}.${config.krebs.build.host.name} or {
- XMONAD_BUILD_SCREEN_WIDTH = 1366;
XMONAD_BUILD_TERM_FONT_WIDTH = 6;
XMONAD_BUILD_TERM_FONT = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1";
XMONAD_BUILD_TERM_PADDING = 2;
diff --git a/modules/ejabberd/default.nix b/modules/ejabberd/default.nix
index 02c060d..9607741 100644
--- a/modules/ejabberd/default.nix
+++ b/modules/ejabberd/default.nix
@@ -131,6 +131,9 @@ in {
systemd.services.ejabberd = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
+ environment = {
+ HOME = cfg.stateDir;
+ };
reloadTriggers = [
config.environment.etc."ejabberd/ejabberd.yaml".source
config.environment.etc."ejabberd/ejabberdctl.cfg".source
@@ -139,6 +142,17 @@ in {
ExecStartPre = [
"${pkgs.coreutils}/bin/ln -s \${CREDENTIALS_DIRECTORY} /tmp/credentials"
"${gen-dhparam} ${cfg.stateDir}/dhfile"
+ (pkgs.writeDash "ejabberd-ensure-PREVIOUS.LOG" ''
+ set -efu
+ cd ${cfg.stateDir}
+ if ! test -e PREVIOUS.LOG; then
+ if test -f LATEST.LOG; then
+ ${pkgs.coreutils}/bin/ln LATEST.LOG PREVIOUS.LOG
+ else
+ ${pkgs.coreutils}/bin/touch PREVIOUS.LOG
+ fi
+ fi
+ '')
];
ExecStart = "${cfg.pkgs.ejabberd}/bin/ejabberdctl foreground";
ExecStop = [
@@ -155,7 +169,7 @@ in {
PrivateDevices = true;
PrivateTmp = true;
SyslogIdentifier = "ejabberd";
- StateDirectory = "ejabberd";
+ StateDirectory = lib.removePrefix "/var/lib/" cfg.stateDir;
User = "ejabberd";
DynamicUser = true;
TimeoutSec = 60;
diff --git a/modules/hw.nix b/modules/hw.nix
deleted file mode 100644
index 653b04f..0000000
--- a/modules/hw.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{ lib, mylib, ... }: let
- local.types.screen = lib.types.submodule {
- options.width = lib.mkOption {
- type = mylib.types.uint;
- };
- options.height = lib.mkOption {
- type = mylib.types.uint;
- };
- };
-in {
- options.tv.hw.screens = lib.mkOption {
- type = lib.types.attrsOf local.types.screen;
- default = {};
- };
-}
diff --git a/pkgs/haskell/xmonad-tv/src/main.hs b/pkgs/haskell/xmonad-tv/src/main.hs
index c843a2c..711f9eb 100644
--- a/pkgs/haskell/xmonad-tv/src/main.hs
+++ b/pkgs/haskell/xmonad-tv/src/main.hs
@@ -73,7 +73,8 @@ mainNoArgs = do
myMasterDelta <- readEnv' (1 / 20) "XMONAD_MASTER_DELTA" :: IO Rational
myMasterWidth <- readEnv' (1 / 2) "XMONAD_MASTER_WIDTH" :: IO Rational
myScreenGaps <- readEnv' [] "XMONAD_SCREEN_GAPS" :: IO [Int]
- myScreenWidth <- readEnv "XMONAD_SCREEN_WIDTH" :: IO Dimension
+ myScreenWidth <-
+ bracket (getEnv "DISPLAY" >>= openDisplay) closeDisplay (return . widthOfScreen . defaultScreenOfDisplay)
handleShutdownEvent <- newShutdownEventHandler
config <-
ewmhExtra
diff --git a/systems/alnus/config.nix b/systems/alnus/config.nix
index 8af12fe..a3d1e9a 100644
--- a/systems/alnus/config.nix
+++ b/systems/alnus/config.nix
@@ -1,6 +1,7 @@
{ config, lib, pkgs, ... }: {
imports = [
../../configs/hw/x220.nix
+ ../../configs/earlyoom.nix
../../configs/exim-retiolum.nix
../../configs/retiolum.nix
];
@@ -48,12 +49,6 @@
networking.networkmanager.enable = true;
- services.earlyoom.enable = true;
- services.earlyoom.freeMemThreshold = 5;
- systemd.services.earlyoom.environment.EARLYOOM_ARGS = toString [
- "--prefer '^(Web Content|Privileged Cont)$'" # firefox tabs
- ];
-
services.libinput.enable = false;
services.xserver = {
diff --git a/systems/mu/config.nix b/systems/mu/config.nix
index b3d3e99..f9debe4 100644
--- a/systems/mu/config.nix
+++ b/systems/mu/config.nix
@@ -38,8 +38,6 @@
nixpkgs.config.allowUnfree = true;
hardware.opengl.driSupport32Bit = true;
- hardware.pulseaudio.enable = true;
-
hardware.enableRedistributableFirmware = true;
boot.loader.efi.canTouchEfiVariables = true;
@@ -98,6 +96,8 @@
pkgs.xorg.fontschumachermisc
];
+ services.pulseaudio.enable = true;
+
services.xserver.enable = true;
services.xserver.xkb.layout = "de";
services.xserver.xkb.options = "eurosign:e";
diff --git a/systems/querel/config.nix b/systems/querel/config.nix
index 08ad71c..dff928e 100644
--- a/systems/querel/config.nix
+++ b/systems/querel/config.nix
@@ -49,7 +49,6 @@
};
hardware.enableRedistributableFirmware = true;
- hardware.pulseaudio.enable = true;
i18n.defaultLocale = "de_DE.UTF-8";
@@ -57,6 +56,8 @@
programs.ssh.startAgent = false;
+ services.pulseaudio.enable = true;
+
services.xserver.enable = true;
services.xserver.layout = "de";
services.xserver.xkbOptions = "eurosign:e";
diff --git a/systems/xu/config.nix b/systems/xu/config.nix
index 603d0d4..abf433c 100644
--- a/systems/xu/config.nix
+++ b/systems/xu/config.nix
@@ -4,6 +4,7 @@
imports = [
../../configs/autotether.nix
../../configs/hw/x220.nix
+ ../../configs/earlyoom.nix
../../configs/exim-retiolum.nix
../../configs/gitconfig.nix
../../configs/gitrepos.nix