summaryrefslogtreecommitdiffstats
path: root/lass
diff options
context:
space:
mode:
Diffstat (limited to 'lass')
-rw-r--r--lass/1systems/cloudkrebs.nix1
-rw-r--r--lass/1systems/echelon.nix2
-rw-r--r--lass/1systems/helios.nix3
-rw-r--r--lass/1systems/mors.nix50
-rw-r--r--lass/1systems/prism.nix55
-rw-r--r--lass/1systems/shodan.nix26
-rw-r--r--lass/1systems/uriel.nix10
-rw-r--r--lass/2configs/binary-cache/client.nix9
-rw-r--r--lass/2configs/binary-cache/server.nix30
-rw-r--r--lass/2configs/binary-caches.nix13
-rw-r--r--lass/2configs/buildbot-standalone.nix34
-rw-r--r--lass/2configs/default.nix13
-rw-r--r--lass/2configs/gc.nix8
-rw-r--r--lass/2configs/git.nix15
-rw-r--r--lass/2configs/hw/tp-x220.nix54
-rw-r--r--lass/2configs/nixpkgs.nix2
-rw-r--r--lass/2configs/realwallpaper-server.nix32
-rw-r--r--lass/2configs/realwallpaper.nix29
-rw-r--r--lass/2configs/repo-sync.nix106
-rw-r--r--lass/2configs/websites/domsen.nix31
-rw-r--r--lass/2configs/wordpress.nix59
-rw-r--r--lass/2configs/xserver/default.nix3
-rw-r--r--lass/2configs/zsh.nix8
-rw-r--r--lass/3modules/default.nix1
-rw-r--r--lass/3modules/ejabberd/config.nix4
-rw-r--r--lass/3modules/ejabberd/default.nix18
-rw-r--r--lass/3modules/power-action.nix12
-rw-r--r--lass/3modules/umts.nix (renamed from lass/2configs/umts.nix)51
-rw-r--r--lass/5pkgs/default.nix4
-rw-r--r--lass/5pkgs/ejabberd/default.nix28
-rw-r--r--lass/5pkgs/q/default.nix185
-rw-r--r--lass/5pkgs/xmonad-lass.nix12
32 files changed, 634 insertions, 274 deletions
diff --git a/lass/1systems/cloudkrebs.nix b/lass/1systems/cloudkrebs.nix
index a3cc9d7b3..5aa35f5a7 100644
--- a/lass/1systems/cloudkrebs.nix
+++ b/lass/1systems/cloudkrebs.nix
@@ -13,7 +13,6 @@ in {
../2configs/retiolum.nix
../2configs/git.nix
../2configs/realwallpaper.nix
- ../2configs/realwallpaper-server.nix
../2configs/privoxy-retiolum.nix
{
networking.interfaces.enp2s1.ip4 = [
diff --git a/lass/1systems/echelon.nix b/lass/1systems/echelon.nix
index 97734a7bd..8d944ed40 100644
--- a/lass/1systems/echelon.nix
+++ b/lass/1systems/echelon.nix
@@ -11,7 +11,7 @@ in {
../2configs/default.nix
../2configs/exim-retiolum.nix
../2configs/retiolum.nix
- ../2configs/realwallpaper-server.nix
+ ../2configs/realwallpaper.nix
../2configs/privoxy-retiolum.nix
../2configs/git.nix
#../2configs/redis.nix
diff --git a/lass/1systems/helios.nix b/lass/1systems/helios.nix
index 10b00de47..51d2afe84 100644
--- a/lass/1systems/helios.nix
+++ b/lass/1systems/helios.nix
@@ -26,6 +26,9 @@ with builtins;
enable = true;
};
}
+ {
+ lass.power-action.battery = "BAT1";
+ }
];
krebs.build.host = config.krebs.hosts.helios;
diff --git a/lass/1systems/mors.nix b/lass/1systems/mors.nix
index 062e4c29d..d065d4dfa 100644
--- a/lass/1systems/mors.nix
+++ b/lass/1systems/mors.nix
@@ -3,6 +3,7 @@
{
imports = [
../.
+ ../2configs/hw/tp-x220.nix
../2configs/baseX.nix
../2configs/exim-retiolum.nix
../2configs/programs.nix
@@ -14,14 +15,9 @@
../2configs/elster.nix
../2configs/steam.nix
../2configs/wine.nix
- #../2configs/texlive.nix
- ../2configs/binary-caches.nix
- #../2configs/ircd.nix
../2configs/chromium-patched.nix
../2configs/git.nix
- #../2configs/wordpress.nix
../2configs/bitlbee.nix
- #../2configs/firefoxPatched.nix
../2configs/skype.nix
../2configs/teamviewer.nix
../2configs/libvirt.nix
@@ -29,7 +25,7 @@
../2configs/c-base.nix
../2configs/mail.nix
../2configs/krebs-pass.nix
- ../2configs/umts.nix
+ ../2configs/repo-sync.nix
{
#risk of rain port
krebs.iptables.tables.filter.INPUT.rules = [
@@ -58,16 +54,19 @@
# };
#}
{
+ lass.umts = {
+ enable = true;
+ modem = "/dev/serial/by-id/usb-Lenovo_F5521gw_38214921FBBBC7B0-if09";
+ initstrings = ''
+ Init1 = AT+CFUN=1
+ Init2 = AT+CGDCONT=1,"IP","pinternet.interkom.de","",0,0
+ '';
+ };
}
];
krebs.build.host = config.krebs.hosts.mors;
- networking.wireless.enable = true;
-
- hardware.enableAllFirmware = true;
- nixpkgs.config.allowUnfree = true;
-
boot = {
loader.grub.enable = true;
loader.grub.version = 2;
@@ -77,7 +76,6 @@
initrd.luks.cryptoModules = [ "aes" "sha512" "sha1" "xts" ];
initrd.availableKernelModules = [ "xhci_hcd" "ehci_pci" "ahci" "usb_storage" ];
#kernelModules = [ "kvm-intel" "msr" ];
- kernelModules = [ "msr" ];
};
fileSystems = {
"/" = {
@@ -168,22 +166,6 @@
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.4/power/control'
'';
- hardware.trackpoint = {
- enable = true;
- sensitivity = 220;
- speed = 0;
- emulateWheel = true;
- };
-
- services.xserver = {
- videoDriver = "intel";
- vaapiDrivers = [ pkgs.vaapiIntel ];
- deviceSection = ''
- Option "AccelMethod" "sna"
- BusID "PCI:0:2:0"
- '';
- };
-
environment.systemPackages = with pkgs; [
acronym
cac-api
@@ -214,15 +196,11 @@
};
};
- services.mongodb = {
- enable = true;
+ krebs.repo-sync.timerConfig = {
+ OnCalendar = "00:37";
};
- krebs.iptables = {
- tables = {
- filter.INPUT.rules = [
- { predicate = "-p tcp --dport 8000"; target = "ACCEPT"; precedence = 9001; }
- ];
- };
+ services.mongodb = {
+ enable = true;
};
}
diff --git a/lass/1systems/prism.nix b/lass/1systems/prism.nix
index 9a9bd4730..1eb81cd0a 100644
--- a/lass/1systems/prism.nix
+++ b/lass/1systems/prism.nix
@@ -1,5 +1,7 @@
{ config, lib, pkgs, ... }:
+with config.krebs.lib;
+
let
ip = config.krebs.build.host.nets.internet.ip4.addr;
@@ -19,14 +21,27 @@ in {
../2configs/privoxy-retiolum.nix
../2configs/radio.nix
../2configs/buildbot-standalone.nix
+ ../2configs/repo-sync.nix
+ ../2configs/binary-cache/server.nix
{
imports = [
../2configs/git.nix
- ( manageCerts [ "cgit.lassul.us" ])
- ];
- krebs.nginx.servers.cgit.server-names = [
- "cgit.lassul.us"
];
+ krebs.nginx.servers.cgit = {
+ server-names = [
+ "cgit.lassul.us"
+ ];
+ locations = [
+ (nameValuePair "/.well-known/acme-challenge" ''
+ root /var/lib/acme/challenges/cgit.lassul.us/;
+ '')
+ ];
+ ssl = {
+ enable = true;
+ certificate = "/var/lib/acme/cgit.lassul.us/fullchain.pem";
+ certificate_key = "/var/lib/acme/cgit.lassul.us/key.pem";
+ };
+ };
}
{
users.extraGroups = {
@@ -66,8 +81,6 @@ in {
}
{
- #boot.loader.gummiboot.enable = true;
- #boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub = {
devices = [
"/dev/sda"
@@ -110,10 +123,6 @@ in {
{
sound.enable = false;
}
- #{
- # #workaround for server dying after 6-7h
- # boot.kernelPackages = pkgs.linuxPackages_4_2;
- #}
{
nixpkgs.config.allowUnfree = true;
}
@@ -202,7 +211,7 @@ in {
}
{
imports = [
- ../2configs/realwallpaper-server.nix
+ ../2configs/realwallpaper.nix
];
krebs.nginx.servers."lassul.us".locations = [
(lib.nameValuePair "/wallpaper.png" ''
@@ -210,30 +219,6 @@ in {
'')
];
}
- {
- services.nix-serve = {
- enable = true;
- secretKeyFile = config.krebs.secret.files.nix-serve-key.path;
- };
- systemd.services.nix-serve = {
- requires = ["secret.service"];
- after = ["secret.service"];
- };
- krebs.secret.files.nix-serve-key = {
- path = "/run/secret/nix-serve.key";
- owner.name = "nix-serve";
- source-path = toString <secrets> + "/nix-serve.key";
- };
- krebs.nginx = {
- enable = true;
- servers.nix-serve = {
- server-names = [ "cache.prism.r" ];
- locations = lib.singleton (lib.nameValuePair "/" ''
- proxy_pass http://localhost:${toString config.services.nix-serve.port};
- '');
- };
- };
- }
];
krebs.build.host = config.krebs.hosts.prism;
diff --git a/lass/1systems/shodan.nix b/lass/1systems/shodan.nix
index 073d86790..96d64bda3 100644
--- a/lass/1systems/shodan.nix
+++ b/lass/1systems/shodan.nix
@@ -4,6 +4,7 @@ with builtins;
{
imports = [
../.
+ ../2configs/hw/tp-x220.nix
../2configs/baseX.nix
../2configs/git.nix
../2configs/exim-retiolum.nix
@@ -20,34 +21,10 @@ with builtins;
# };
# };
#}
- {
- #x220 config from mors
- #TODO: make x220 config file (or look in other user dir)
- hardware.trackpoint = {
- enable = true;
- sensitivity = 220;
- speed = 0;
- emulateWheel = true;
- };
-
- services.xserver = {
- videoDriver = "intel";
- vaapiDrivers = [ pkgs.vaapiIntel ];
- deviceSection = ''
- Option "AccelMethod" "sna"
- BusID "PCI:0:2:0"
- '';
- };
- }
];
krebs.build.host = config.krebs.hosts.shodan;
- networking.wireless.enable = true;
-
- hardware.enableAllFirmware = true;
- nixpkgs.config.allowUnfree = true;
-
boot = {
loader.grub.enable = true;
loader.grub.version = 2;
@@ -57,7 +34,6 @@ with builtins;
initrd.luks.cryptoModules = [ "aes" "sha512" "sha1" "xts" ];
initrd.availableKernelModules = [ "xhci_hcd" "ehci_pci" "ahci" "usb_storage" ];
#kernelModules = [ "kvm-intel" "msr" ];
- kernelModules = [ "msr" ];
};
fileSystems = {
"/" = {
diff --git a/lass/1systems/uriel.nix b/lass/1systems/uriel.nix
index 92996c181..83553f5ca 100644
--- a/lass/1systems/uriel.nix
+++ b/lass/1systems/uriel.nix
@@ -16,6 +16,12 @@ with builtins;
../2configs/bitlbee.nix
../2configs/weechat.nix
../2configs/skype.nix
+ {
+ lass.umts = {
+ enable = true;
+ modem = "/dev/serial/by-id/usb-HUAWEI_Technologies_HUAWEI_Mobile-if00-port0";
+ };
+ }
];
krebs.build.host = config.krebs.hosts.uriel;
@@ -33,8 +39,8 @@ with builtins;
#loader.grub.version = 2;
#loader.grub.device = "/dev/sda";
- loader.gummiboot.enable = true;
- loader.gummiboot.timeout = 5;
+ loader.systemd-boot.enable = true;
+ loader.timeout = 5;
initrd.luks.devices = [ { name = "luksroot"; device = "/dev/sda2"; } ];
initrd.luks.cryptoModules = [ "aes" "sha512" "sha1" "xts" ];
diff --git a/lass/2configs/binary-cache/client.nix b/lass/2configs/binary-cache/client.nix
new file mode 100644
index 000000000..108ff7a1e
--- /dev/null
+++ b/lass/2configs/binary-cache/client.nix
@@ -0,0 +1,9 @@
+{ config, ... }:
+
+{
+ nix = {
+ binaryCaches = ["http://cache.prism.r"];
+ binaryCachePublicKeys = ["cache.prism-1:+S+6Lo/n27XEtvdlQKuJIcb1yO5NUqUCE2lolmTgNJU="];
+ };
+}
+
diff --git a/lass/2configs/binary-cache/server.nix b/lass/2configs/binary-cache/server.nix
new file mode 100644
index 000000000..22ec04307
--- /dev/null
+++ b/lass/2configs/binary-cache/server.nix
@@ -0,0 +1,30 @@
+{ config, lib, pkgs, ...}:
+
+{
+ # generate private key with:
+ # nix-store --generate-binary-cache-key my-secret-key my-public-key
+ services.nix-serve = {
+ enable = true;
+ secretKeyFile = config.krebs.secret.files.nix-serve-key.path;
+ };
+
+ systemd.services.nix-serve = {
+ requires = ["secret.service"];
+ after = ["secret.service"];
+ };
+ krebs.secret.files.nix-serve-key = {
+ path = "/run/secret/nix-serve.key";
+ owner.name = "nix-serve";
+ source-path = toString <secrets> + "/nix-serve.key";
+ };
+ krebs.nginx = {
+ enable = true;
+ servers.nix-serve = {
+ server-names = [ "cache.prism.r" ];
+ locations = lib.singleton (lib.nameValuePair "/" ''
+ proxy_pass http://localhost:${toString config.services.nix-serve.port};
+ '');
+ };
+ };
+}
+
diff --git a/lass/2configs/binary-caches.nix b/lass/2configs/binary-caches.nix
deleted file mode 100644
index c2727520d..000000000
--- a/lass/2configs/binary-caches.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{ config, ... }:
-
-{
- nix.sshServe.enable = true;
- nix.sshServe.keys = [
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBF9SBNKE3Pw/ALwTfzpzs+j6Rpaf0kUy6FiPMmgNNNt root@mors"
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCZSq5oLrokkh3F+MOdK5/nzVIEDvqyvfzLMNWmzsYD root@uriel"
- ];
- nix.binaryCaches = [
- #"scp://nix-ssh@mors"
- #"scp://nix-ssh@uriel"
- ];
-}
diff --git a/lass/2configs/buildbot-standalone.nix b/lass/2configs/buildbot-standalone.nix
index 7d3c236a6..04bdcf9d8 100644
--- a/lass/2configs/buildbot-standalone.nix
+++ b/lass/2configs/buildbot-standalone.nix
@@ -37,13 +37,12 @@ in {
name="fast-all-branches",
builderNames=["fast-tests"]))
'';
- build-all-scheduler = ''
- # build all lass hosts
+ build-scheduler = ''
+ # build all hosts
sched.append(schedulers.SingleBranchScheduler(
- ## only master
- change_filter=util.ChangeFilter(branch_re="master"),
+ change_filter=util.ChangeFilter(branch_re=".*"),
treeStableTimer=10,
- name="prism-master",
+ name="prism-all-branches",
builderNames=["build-all"]))
'';
};
@@ -52,11 +51,16 @@ in {
grab_repo = steps.Git(repourl=stockholm_repo, mode='incremental')
# TODO: get nixpkgs/stockholm paths from krebs
- env = {
+ env_lass = {
"LOGNAME": "lass",
"NIX_REMOTE": "daemon",
"dummy_secrets": "true",
}
+ env_makefu = {
+ "LOGNAME": "makefu",
+ "NIX_REMOTE": "daemon",
+ "dummy_secrets": "true",
+ }
# prepare nix-shell
# the dependencies which are used by the test script
@@ -76,9 +80,18 @@ in {
build-all = ''
f = util.BuildFactory()
f.addStep(grab_repo)
- #TODO: get hosts via krebs
for i in [ "mors", "uriel", "shodan", "helios", "cloudkrebs", "echelon", "dishfire", "prism" ]:
- addShell(f,name="build-{}".format(i),env=env,
+ addShell(f,name="build-{}".format(i),env=env_lass,
+ command=nixshell + \
+ ["make \
+ test \
+ ssh=${sshWrapper} \
+ target=build@localhost:${config.users.users.build.home}/testbuild \
+ method=build \
+ system={}".format(i)])
+
+ for i in [ "pornocauster", "wry" ]:
+ addShell(f,name="build-{}".format(i),env=env_makefu,
command=nixshell + \
["make \
test \
@@ -92,16 +105,17 @@ in {
factory=f))
'';
+
fast-tests = ''
f = util.BuildFactory()
f.addStep(grab_repo)
for i in [ "prism", "mors", "echelon" ]:
- addShell(f,name="populate-{}".format(i),env=env,
+ addShell(f,name="populate-{}".format(i),env=env_lass,
command=nixshell + \
["{}( make system={} eval.config.krebs.build.populate \
| jq -er .)".format("!" if "failing" in i else "",i)])
- addShell(f,name="build-test-minimal",env=env,
+ addShell(f,name="build-test-minimal",env=env_lass,
command=nixshell + \
["nix-instantiate \
--show-trace --eval --strict --json \
diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix
index 9e0e37e48..e3065ba84 100644
--- a/lass/2configs/default.nix
+++ b/lass/2configs/default.nix
@@ -8,6 +8,8 @@ with config.krebs.lib;
../2configs/mc.nix
../2configs/retiolum.nix
../2configs/nixpkgs.nix
+ ../2configs/binary-cache/client.nix
+ ../2configs/gc.nix
./backups.nix
{
users.extraUsers =
@@ -41,12 +43,6 @@ with config.krebs.lib;
};
};
}
- {
- nix = {
- binaryCaches = ["http://cache.prism.r"];
- binaryCachePublicKeys = ["cache.prism-1:+S+6Lo/n27XEtvdlQKuJIcb1yO5NUqUCE2lolmTgNJU="];
- };
- }
];
networking.hostName = config.krebs.build.host.name;
@@ -63,9 +59,7 @@ with config.krebs.lib;
then toString <stockholm/lass/2configs/tests/dummy-secrets>
else "/home/lass/secrets/${config.krebs.build.host.name}";
#secrets-common = "/home/lass/secrets/common";
- stockholm = if getEnv "dummy_secrets" == "true"
- then "/var/lib/buildbot/slave/build-all/build"
- else "/home/lass/stockholm";
+ stockholm = getEnv "PWD";
} // optionalAttrs config.krebs.build.host.secure {
#secrets-master = "/home/lass/secrets/master";
});
@@ -122,6 +116,7 @@ with config.krebs.lib;
krebspaste
pciutils
psmisc
+ q
rs
tmux
untilport
diff --git a/lass/2configs/gc.nix b/lass/2configs/gc.nix
new file mode 100644
index 000000000..8762ad95e
--- /dev/null
+++ b/lass/2configs/gc.nix
@@ -0,0 +1,8 @@
+{ config, ... }:
+
+with config.krebs.lib;
+{
+ nix.gc = {
+ automatic = ! elem config.krebs.build.host.name [ "prism" "mors" ];
+ };
+}
diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix
index c0affe981..9a1cab176 100644
--- a/lass/2configs/git.nix
+++ b/lass/2configs/git.nix
@@ -29,18 +29,10 @@ let
rules = concatMap make-rules (attrValues repos);
public-repos = mapAttrs make-public-repo {
- painload = {};
stockholm = {
cgit.desc = "take all the computers hostage, they'll love you!";
};
- wai-middleware-time = {};
- web-routes-wai-custom = {};
- go = {};
- newsbot-js = {};
kimsufi-check = {};
- realwallpaper = {};
- xmonad-stockholm = {};
- the_playlist = {};
} // mapAttrs make-public-repo-silent {
the_playlist = {};
};
@@ -50,8 +42,6 @@ let
brain = {
collaborators = with config.krebs.users; [ tv makefu ];
};
- extraction_webinterface = {};
- politics-fetching = {};
} //
import <secrets/repos.nix> { inherit config lib pkgs; }
);
@@ -66,6 +56,7 @@ let
channel = "#retiolum";
server = "cd.retiolum";
verbose = config.krebs.build.host.name == "prism";
+ branches = [ "master" ];
};
};
};
@@ -84,12 +75,12 @@ let
with git // config.krebs.users;
repo:
singleton {
- user = [ lass lass-helios lass-uriel ];
+ user = [ lass lass-uriel ];
repo = [ repo ];
perm = push "refs/*" [ non-fast-forward create delete merge ];
} ++
optional repo.public {
- user = [ tv makefu miefda ];
+ user = [ tv makefu ];
repo = [ repo ];
perm = fetch;
} ++
diff --git a/lass/2configs/hw/tp-x220.nix b/lass/2configs/hw/tp-x220.nix
new file mode 100644
index 000000000..be1faccea
--- /dev/null
+++ b/lass/2configs/hw/tp-x220.nix
@@ -0,0 +1,54 @@
+{ config, lib, pkgs, ... }:
+
+with config.krebs.lib;
+{
+ networking.wireless.enable = lib.mkDefault true;
+
+ hardware.enableAllFirmware = true;
+ nixpkgs.config.allowUnfree = true;
+
+ hardware.cpu.intel.updateMicrocode = true;
+
+ zramSwap.enable = true;
+ zramSwap.numDevices = 2;
+
+ hardware.trackpoint = {
+ enable = true;
+ sensitivity = 220;
+ speed = 0;
+ emulateWheel = true;
+ };
+
+ services.tlp.enable = true;
+ services.tlp.extraConfig = ''
+ # BUG: http://linrunner.de/en/tlp/docs/tlp-faq.html#erratic-battery
+ #START_CHARGE_THRESH_BAT0=80
+ STOP_CHARGE_THRESH_BAT0=95
+
+ CPU_SCALING_GOVERNOR_ON_AC=performance
+ CPU_SCALING_GOVERNOR_ON_BAT=ondemand
+ CPU_MIN_PERF_ON_AC=0
+ CPU_MAX_PERF_ON_AC=100
+ CPU_MIN_PERF_ON_BAT=0
+ CPU_MAX_PERF_ON_BAT=30
+ '';
+
+ boot = {
+ kernelModules = [ "kvm-intel" "acpi_call" "tpm-rng" ];
+ extraModulePackages = [ config.boot.kernelPackages.tp_smapi ];
+ };
+
+ hardware.opengl.extraPackages = [
+ pkgs.vaapiIntel
+ pkgs.vaapiVdpau
+ ];
+
+ services.xserver = {
+ videoDriver = "intel";
+ deviceSection = ''
+ Option "AccelMethod" "sna"
+ '';
+ };
+
+ security.rngd.enable = true;
+}
diff --git a/lass/2configs/nixpkgs.nix b/lass/2configs/nixpkgs.nix
index c6d8a5f8c..0f940a369 100644
--- a/lass/2configs/nixpkgs.nix
+++ b/lass/2configs/nixpkgs.nix
@@ -3,6 +3,6 @@
{
krebs.build.source.nixpkgs = {
url = https://github.com/lassulus/nixpkgs;
- rev = "7d932301fe1d98a1ef1872a7124e8809279def74";
+ rev = "446d4c1fc10f53cf97abea1996d067ad93de2ded";
};
}
diff --git a/lass/2configs/realwallpaper-server.nix b/lass/2configs/realwallpaper-server.nix
deleted file mode 100644
index 7340fc7ca..000000000
--- a/lass/2configs/realwallpaper-server.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-{ config, lib, ... }:
-
-let
- hostname = config.krebs.build.host.name;
- inherit (lib)
- nameValuePair
- ;
-
-in {
- imports = [
- ./realwallpaper.nix
- ];
-
- krebs.nginx.servers.wallpaper = {
- server-names = [
- hostname
- ];
- locations = [
- (nameValuePair "/wallpaper.png" ''
- root /tmp/;
- '')
- ];
- };
-
- krebs.iptables = {
- tables = {
- filter.INPUT.rules = [
- { predicate = "-i retiolum -p tcp --dport 80"; target = "ACCEPT"; }
- ];
- };
- };
-}
diff --git a/lass/2configs/realwallpaper.nix b/lass/2configs/realwallpaper.nix
index c69cb1660..2ab52ed92 100644
--- a/lass/2configs/realwallpaper.nix
+++ b/lass/2configs/realwallpaper.nix
@@ -1,5 +1,30 @@
-{ config, ... }:
+{ config, lib, ... }:
-{
+let
+ hostname = config.krebs.build.host.name;
+ inherit (lib)
+ nameValuePair
+ ;
+
+in {
krebs.realwallpaper.enable = true;
+
+ krebs.nginx.servers.wallpaper = {
+ server-names = [
+ hostname
+ ];
+ locations = [
+ (nameValuePair "/wallpaper.png" ''
+ root /tmp/;
+ '')
+ ];
+ };
+
+ krebs.iptables = {
+ tables = {
+ filter.INPUT.rules = [
+ { predicate = "-i retiolum -p tcp --dport 80"; target = "ACCEPT"; }
+ ];
+ };
+ };
}
diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix
new file mode 100644
index 000000000..45a4e2afd
--- /dev/null
+++ b/lass/2configs/repo-sync.nix
@@ -0,0 +1,106 @@
+{ config, lib, pkgs, ... }:
+
+with config.krebs.lib;
+
+let
+ mirror = "git@${config.networking.hostName}:";
+
+ defineRepo = name: announce: let
+ repo = {
+ public = true;
+ name = mkDefault "${name}";
+ cgit.desc = mkDefault "mirror for ${name}";
+ hooks = mkIf announce (mkDefault {
+ post-receive = pkgs.git-hooks.irc-announce {
+ nick = config.networking.hostName;
+ verbose = false;
+ channel = "#retiolum";
+ server = "cd.retiolum";
+ branches = [ "newest" ];
+ };
+ });
+ };
+ in {
+ rules = with git; singleton {
+ user = with config.krebs.users; [
+ config.krebs.users."${config.networking.hostName}-repo-sync"
+ lass
+ lass-shodan
+ ];
+ repo = [ repo ];
+ perm = push ''refs/*'' [ non-fast-forward create delete merge ];
+ };
+ repos."${name}" = repo;
+ };
+
+ sync-retiolum = name:
+ {
+ krebs.repo-sync.repos.${name} = {
+ makefu = {
+ origin.url = "http://cgit.gum/${name}";
+ mirror.url = "${mirror}${name}";
+ };
+ tv = {
+ origin.url = "http://cgit.cd/${name}";
+ mirror.url = "${mirror}${name}";
+ };
+ lassulus = {
+ origin.url = "http://cgit.prism/${name}";
+ mirror.url = "${mirror}${name}";
+ };
+ "@latest" = {
+ mirror.url = "${mirror}${name}";
+ mirror.ref = "heads/newest";
+ };
+ };
+ krebs.git = defineRepo name (config.networking.hostName == "prism");
+ };
+
+ sync-remote = name: url:
+ {
+ krebs.repo-sync.repos.${name} = {
+ remote = {
+ origin.url = url;
+ mirror.url = "${mirror}${name}";
+ };
+ };
+ krebs.git = defineRepo name (config.networking.hostName == "prism");
+ };
+
+ sync-remote-silent = name: url:
+ {
+ krebs.repo-sync.repos.${name} = {
+ remote = {
+ origin.url = url;
+ mirror.url = "${mirror}${name}";
+ };
+ };
+ krebs.git = defineRepo name false;
+ };
+
+in {
+ krebs.repo-sync = {
+ enable = true;
+ unitConfig.ConditionPathExists = "!/var/run/ppp0.pid";
+ };
+ imports = [
+ (sync-remote "array" "https://github.com/makefu/array")
+ (sync-remote "email-header" "https://github.com/4z3/email-header")
+ (sync-remote "mycube-flask" "https://github.com/makefu/mycube-flask")
+ (sync-remote "reaktor-titlebot" "https://github.com/makefu/reaktor-titlebot")
+ (sync-remote "repo-sync" "https://github.com/makefu/repo-sync")
+ (sync-remote "skytraq-datalogger" "https://github.com/makefu/skytraq-datalogger")
+ (sync-remote "xintmap" "https://github.com/4z3/xintmap")
+ (sync-remote-silent "nixpkgs" "https://github.com/nixos/nixpkgs")
+ (sync-retiolum "go")
+ (sync-retiolum "much")
+ (sync-retiolum "newsbot-js")
+ (sync-retiolum "painload")
+ (sync-retiolum "realwallpaper")
+ (sync-retiolum "stockholm")
+ (sync-retiolum "wai-middleware-time")
+ (sync-retiolum "web-routes-wai-custom")
+ (sync-retiolum "xmonad-stockholm")
+ ];
+}
+
diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix
index c69d20633..8a2161e45 100644
--- a/lass/2configs/websites/domsen.nix
+++ b/lass/2configs/websites/domsen.nix
@@ -32,10 +32,10 @@ in {
(ssl [ "makeup.apanowicz.de" "www.makeup.apanowicz.de" ])
(servePage [ "makeup.apanowicz.de" "www.makeup.apanowicz.de" ])
- (ssl [ "pixelpocket.de" "www.pixelpocket.de" ])
+ (ssl [ "pixelpocket.de" ])
(servePage [ "pixelpocket.de" "www.pixelpocket.de" ])
- (ssl [ "o.ubikmedia.de" "www.o.ubikmedia.de" ])
+ (ssl [ "o.ubikmedia.de" ])
(serveOwncloud [ "o.ubikmedia.de" "www.o.ubikmedia.de" ])
(ssl [
@@ -47,6 +47,7 @@ in {
"360gradvideo.tv"
"ubikmedia.eu"
"facts.cloud"
+ "youthtube.xyz"
"www.ubikmedia.de"
"www.aldona.ubikmedia.de"
"www.apanowicz.de"
@@ -55,6 +56,7 @@ in {
"www.360gradvideo.tv"
"www.ubikmedia.eu"
"www.facts.cloud"
+ "www.youthtube.xyz"
])
(serveWordpress [
"ubikmedia.de"
@@ -64,13 +66,15 @@ in {
"360gradvideo.tv"
"ubikmedia.eu"
"facts.cloud"
- "*.ubikmedia.de"
+ "youthtube.xyz"
"www.apanowicz.de"
"www.nirwanabluete.de"
"www.aldonasiech.com"
"www.360gradvideo.tv"
"www.ubikmedia.eu"
"www.facts.cloud"
+ "www.youthtube.xyz"
+ "*.ubikmedia.de"
])
];
@@ -79,6 +83,27 @@ in {
"o_ubikmedia_de"
];
+ krebs.backup.plans = {
+ prism-sql-domsen = {
+ method = "push";
+ src = { host = config.krebs.hosts.prism; path = "/bku/sql_dumps"; };
+ dst = { host = config.krebs.hosts.domsen-nas; path = "/mnt/UBIK-9TB-Pool/BACKUP/XXXX-MAX-UND-ANDERES/prism-sql"; };
+ startAt = "00:01";
+ };
+ prism-http-domsen = {
+ method = "push";
+ src = { host = config.krebs.hosts.prism; path = "/srv/http"; };
+ dst = { host = config.krebs.hosts.domsen-nas; path = "/mnt/UBIK-9TB-Pool/BACKUP/XXXX-MAX-UND-ANDERES/prism-http"; };
+ startAt = "00:10";
+ };
+ prism-o-ubikmedia-domsen = {
+ method = "push";
+ src = { host = config.krebs.hosts.prism; path = "/srv/o.ubikmedia.de-data"; };
+ dst = { host = config.krebs.hosts.domsen-nas; path = "/mnt/UBIK-9TB-Pool/BACKUP/XXXX-MAX-UND-ANDERES/prism-owncloud"; };
+ startAt = "00:30";
+ };
+ };
+
users.users.domsen = {
uid = genid "domsen";
description = "maintenance acc for domsen";
diff --git a/lass/2configs/wordpress.nix b/lass/2configs/wordpress.nix
deleted file mode 100644
index bd59080d9..000000000
--- a/lass/2configs/wordpress.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-{ config, pkgs, ... }:
-
-{
- containers.wordpress = {
- privateNetwork = true;
- hostAddress = "192.168.101.1";
- localAddress = "192.168.101.2";
-
- config = {
- imports = [
- ../../krebs/3modules/iptables.nix
- ];
-
- krebs.iptables = {
- enable = true;
- tables = {
- filter.INPUT.policy = "DROP";
- filter.FORWARD.policy = "DROP";
- filter.INPUT.rules = [
- { predicate = "-m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; precedence = 10001; }
- { predicate = "-p icmp"; target = "ACCEPT"; precedence = 10000; }
- { predicate = "-i lo"; target = "ACCEPT"; precedence = 9999; }
- { predicate = "-p tcp --dport 22"; target = "ACCEPT"; precedence = 9998; }
- { predicate = "-p tcp --dport 80"; target = "ACCEPT"; precedence = 9998; }
- ];
- };
- };
-
- environment.systemPackages = with pkgs; [
- iptables
- ];
-
- services.postgresql = {
- enable = true;
- package = pkgs.postgresql;
- };
-
- services.httpd = {
- enable = true;
- adminAddr = "root@apanowicz.de";
- extraModules = [
- { name = "php5"; path = "${pkgs.php}/modules/libphp5.so"; }
- ];
- virtualHosts = [
- {
- hostName = "wordpress";
- serverAliases = [ "wordpress" "www.wordpress" ];
-
- extraSubservices = [
- {
- serviceName = "wordpress";
- }
- ];
- }
- ];
- };
- };
- };
-}
diff --git a/lass/2configs/xserver/default.nix b/lass/2configs/xserver/default.nix
index 80c947a7b..73b148bf7 100644
--- a/lass/2configs/xserver/default.nix
+++ b/lass/2configs/xserver/default.nix
@@ -91,9 +91,6 @@ let
set -efu
export PATH; PATH=${makeSearchPath "bin" ([
pkgs.rxvt_unicode
- pkgs.i3lock
- pkgs.pulseaudioLight
- pkgs.xorg.xbacklight
] ++ config.environment.systemPackages)}:/var/setuid-wrappers
settle() {(
# Use PATH for a clean journal
diff --git a/lass/2configs/zsh.nix b/lass/2configs/zsh.nix
index 7299e9ac0..b221d7677 100644
--- a/lass/2configs/zsh.nix
+++ b/lass/2configs/zsh.nix
@@ -7,9 +7,6 @@
zsh-newuser-install() { :; }
'';
interactiveShellInit = ''
- HISTFILE=~/.histfile
- HISTSIZE=1000000
- SAVEHIST=100000
#unsetopt nomatch
setopt autocd extendedglob
bindkey -e
@@ -92,6 +89,11 @@
esac
'';
promptInit = ''
+ # TODO: figure out why we need to set this here
+ HISTSIZE=900001
+ HISTFILESIZE=$HISTSIZE
+ SAVEHIST=$HISTSIZE
+
autoload -U promptinit
promptinit
diff --git a/lass/3modules/default.nix b/lass/3modules/default.nix
index b3037205e..6a3b41ca4 100644
--- a/lass/3modules/default.nix
+++ b/lass/3modules/default.nix
@@ -5,6 +5,7 @@ _:
./folderPerms.nix
./mysql-backup.nix
./power-action.nix
+ ./umts.nix
./urxvtd.nix
./wordpress_nginx.nix
./xresources.nix
diff --git a/lass/3modules/ejabberd/config.nix b/lass/3modules/ejabberd/config.nix
index 9a4882644..83ca5dc2a 100644
--- a/lass/3modules/ejabberd/config.nix
+++ b/lass/3modules/ejabberd/config.nix
@@ -10,7 +10,7 @@ in toFile "ejabberd.conf" ''
[
{5222, ejabberd_c2s, [
starttls,
- {certfile, ${toErlang cfg.certfile}},
+ {certfile, ${toErlang cfg.certfile.path}},
{access, c2s},
{shaper, c2s_shaper},
{max_stanza_size, 65536}
@@ -27,7 +27,7 @@ in toFile "ejabberd.conf" ''
]}
]}.
{s2s_use_starttls, required}.
- {s2s_certfile, ${toErlang cfg.s2s_certfile}}.
+ {s2s_certfile, ${toErlang cfg.s2s_certfile.path}}.
{auth_method, internal}.
{shaper, normal, {maxrate, 1000}}.
{shaper, fast, {maxrate, 50000}}.
diff --git a/lass/3modules/ejabberd/default.nix b/lass/3modules/ejabberd/default.nix
index c68f32ef0..18c7cd656 100644
--- a/lass/3modules/ejabberd/default.nix
+++ b/lass/3modules/ejabberd/default.nix
@@ -4,7 +4,12 @@ in {
options.lass.ejabberd = {
enable = mkEnableOption "lass.ejabberd";
certfile = mkOption {
- type = types.str;
+ type = types.secret-file;
+ default = {
+ path = "${cfg.user.home}/ejabberd.pem";
+ owner = cfg.user;
+ source-path = "/var/lib/acme/lassul.us/full.pem";
+ };
};
hosts = mkOption {
type = with types; listOf str;
@@ -17,12 +22,11 @@ in {
export EJABBERD_CONFIG_PATH=${shell.escape (import ./config.nix args)}
exec ${pkgs.ejabberd}/bin/ejabberdctl \
--logs ${shell.escape cfg.user.home} \
- --spool ${shell.escape cfg.user.home} \
"$@"
'';
};
s2s_certfile = mkOption {
- type = types.str;
+ type = types.secret-file;
default = cfg.certfile;
};
user = mkOption {
@@ -36,9 +40,15 @@ in {
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.pkgs.ejabberdctl ];
+ krebs.secret.files = {
+ ejabberd-certfile = cfg.certfile;
+ ejabberd-s2s_certfile = cfg.s2s_certfile;
+ };
+
systemd.services.ejabberd = {
wantedBy = [ "multi-user.target" ];
- after = [ "network.target" ];
+ requires = [ "secret.service" ];
+ after = [ "network.target" "secret.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = "yes";
diff --git a/lass/3modules/power-action.nix b/lass/3modules/power-action.nix
index 06a316270..30875c9a9 100644
--- a/lass/3modules/power-action.nix
+++ b/lass/3modules/power-action.nix
@@ -12,6 +12,10 @@ let
api = {
enable = mkEnableOption "power-action";
+ battery = mkOption {
+ type = types.str;
+ default = "BAT0";
+ };
user = mkOption {
type = types.user;
default = {
@@ -80,13 +84,13 @@ let
"if [ $power -ge ${toString plan.lowerLimit} ] && [ $power -le ${toString plan.upperLimit} ] ${charging_check plan}; then ${plan.action}; fi";
powerlvl = pkgs.writeDash "powerlvl" ''
- cat /sys/class/power_supply/BAT0/capacity
+ cat /sys/class/power_supply/${cfg.battery}/capacity
'';
state = pkgs.writeDash "state" ''
- if [ "$(cat /sys/class/power_supply/BAT0/status)" = "Charging" ]
- then echo "true"
- else echo "false"
+ if [ "$(cat /sys/class/power_supply/${cfg.battery}/status)" = "Discharging" ]
+ then echo "false"
+ else echo "true"
fi
'';
diff --git a/lass/2configs/umts.nix b/lass/3modules/umts.nix
index c1fce9ea2..01adc0409 100644
--- a/lass/2configs/umts.nix
+++ b/lass/3modules/umts.nix
@@ -3,6 +3,36 @@
with config.krebs.lib;
let
+ cfg = config.lass.umts;
+
+ out = {
+ options.lass.umts = api;
+ config = lib.mkIf cfg.enable imp;
+ };
+
+ api = {
+ enable = mkEnableOption "umts";
+ modem = mkOption {
+ type = types.str;
+ default = "/dev/ttyUSB0";
+ };
+ initstrings = mkOption {
+ type = types.str;
+ default = ''
+ Init1 = ATZ
+ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
+ '';
+ };
+ username = mkOption {
+ type = types.str;
+ default = "default";
+ };
+ password = mkOption {
+ type = types.str;
+ default = "default";
+ };
+ };
+
nixpkgs-1509 = import (pkgs.fetchFromGitHub {
owner = "NixOS"; repo = "nixpkgs-channels";
rev = "91371c2bb6e20fc0df7a812332d99c38b21a2bda";
@@ -11,33 +41,32 @@ let
wvdial = nixpkgs-1509.wvdial; # https://github.com/NixOS/nixpkgs/issues/16113
- modem-device = "/dev/serial/by-id/usb-Lenovo_F5521gw_38214921FBBBC7B0-if09";
+ #modem-device = "/dev/serial/by-id/usb-Lenovo_F5521gw_38214921FBBBC7B0-if09";
+ modem-device = "/dev/serial/by-id/usb-HUAWEI_Technologies_HUAWEI_Mobile-if00-port0";
# TODO: currently it is only netzclub
umts-bin = pkgs.writeScriptBin "umts" ''
#!/bin/sh
set -euf
- systemctl stop wpa_supplicant
systemctl start umts
- trap "systemctl stop umts && systemctl start wpa_supplicant;trap - INT TERM EXIT;exit" INT TERM EXIT
+ trap "systemctl stop umts;trap - INT TERM EXIT;exit" INT TERM EXIT
echo nameserver 8.8.8.8 | tee -a /etc/resolv.conf
journalctl -xfu umts
'';
wvdial-defaults = ''
- Modem = ${modem-device}
- Init1 = AT+CFUN=1
- Init2 = AT+CGDCONT=1,"IP","pinternet.interkom.de","",0,0
+ Modem = ${cfg.modem}
+ ${cfg.initstrings}
+ Modem Type = Analog Modem
Baud = 460800
phone= *99#
- Username = netzclub
- Password = netzclub
+ Username = ${cfg.username}
+ Password = ${cfg.password}
Stupid Mode = 1
Idle Seconds = 0
'';
-
- out = {
+ imp = {
environment.shellAliases = {
umts = "sudo ${umts-bin}/bin/umts";
};
@@ -58,5 +87,5 @@ let
};
};
};
-in out
+in out
diff --git a/lass/5pkgs/default.nix b/lass/5pkgs/default.nix
index 73e41790d..c48188f9d 100644
--- a/lass/5pkgs/default.nix
+++ b/lass/5pkgs/default.nix
@@ -3,6 +3,9 @@
{
nixpkgs.config.packageOverrides = rec {
acronym = pkgs.callPackage ./acronym/default.nix {};
+ ejabberd = pkgs.callPackage ./ejabberd {
+ erlang = pkgs.erlangR16;
+ };
firefoxPlugins = {
noscript = pkgs.callPackage ./firefoxPlugins/noscript.nix {};
ublock = pkgs.callPackage ./firefoxPlugins/ublock.nix {};
@@ -10,6 +13,7 @@
};
mk_sql_pair = pkgs.callPackage ./mk_sql_pair/default.nix {};
mpv-poll = pkgs.callPackage ./mpv-poll/default.nix {};
+ q = pkgs.callPackage ./q {};
rs = pkgs.callPackage ./rs/default.nix {};
untilport = pkgs.callPackage ./untilport/default.nix {};
urban = pkgs.callPackage ./urban/default.nix {};
diff --git a/lass/5pkgs/ejabberd/default.nix b/lass/5pkgs/ejabberd/default.nix
new file mode 100644
index 000000000..3a77c5cd1
--- /dev/null
+++ b/lass/5pkgs/ejabberd/default.nix
@@ -0,0 +1,28 @@
+{stdenv, fetchurl, expat, erlang, zlib, openssl, pam, lib}:
+
+stdenv.mkDerivation rec {
+ version = "2.1.13";
+ name = "ejabberd-${version}";
+ src = fetchurl {
+ url = "http://www.process-one.net/downloads/ejabberd/${version}/${name}.tgz";
+ sha256 = "0vf8mfrx7vr3c5h3nfp3qcgwf2kmzq20rjv1h9sk3nimwir1q3d8";
+ };
+ buildInputs = [ expat erlang zlib openssl pam ];
+ patchPhase = ''
+ sed -i \
+ -e "s|erl \\\|${erlang}/bin/erl \\\|" \
+ -e 's|EXEC_CMD=\"sh -c\"|EXEC_CMD=\"${stdenv.shell} -c\"|' \
+ src/ejabberdctl.template
+ '';
+ preConfigure = ''
+ cd src
+ '';
+ configureFlags = ["--enable-pam"];
+
+ meta = {
+ description = "Open-source XMPP application server written in Erlang";
+ license = stdenv.lib.licenses.gpl2;
+ homepage = http://www.ejabberd.im;
+ maintainers = [ lib.maintainers.sander ];
+ };
+}
diff --git a/lass/5pkgs/q/default.nix b/lass/5pkgs/q/default.nix
new file mode 100644
index 000000000..571932b1d
--- /dev/null
+++ b/lass/5pkgs/q/default.nix
@@ -0,0 +1,185 @@
+{ pkgs, ... }:
+let
+ q-cal = let
+ # XXX 23 is the longest line of cal's output
+ pad = ''{
+ ${pkgs.gnused}/bin/sed '
+ # rtrim
+ s/ *$//
+
+ # delete last empty line
+ ''${/^$/d}
+ ' \
+ | ${pkgs.gawk}/bin/awk '{printf "%-23s\n", $0}' \
+ | ${pkgs.gnused}/bin/sed '
+ # colorize header
+ 1,2s/.*/&/
+
+ # colorize week number
+ s/^[ 1-9][0-9]/&/
+ '
+ }'';
+ in ''
+ ${pkgs.coreutils}/bin/paste \
+ <(${pkgs.utillinux}/bin/cal -mw \
+ $(${pkgs.coreutils}/bin/date +'%m %Y' -d 'last month') \
+ | ${pad}
+ ) \
+ <(${pkgs.utillinux}/bin/cal -mw \
+ | ${pkgs.gnused}/bin/sed '
+ # colorize day of month
+ s/\(^\| \)'"$(${pkgs.coreutils}/bin/date +%e)"'\>/&/
+ ' \
+ | ${pad}
+ ) \
+ <(${pkgs.utillinux}/bin/cal -mw \
+ $(${pkgs.coreutils}/bin/date +'%m %Y' -d 'next month') \
+ | ${pad}
+ ) \
+ | ${pkgs.gnused}/bin/sed 's/\t/ /g'
+ '';
+
+ q-isodate = ''
+ ${pkgs.coreutils}/bin/date \
+ '+%Y-%m-%dT%H:%M:%S%:z'
+ '';
+
+ q-gitdir = ''
+ if test -d .git; then
+ #git status --porcelain
+ branch=$(
+ ${pkgs.git}/bin/git branch \
+ | ${pkgs.gnused}/bin/sed -rn 's/^\* (.*)/\1/p'
+ )
+ echo "± $LOGNAME@''${HOSTNAME-$(${pkgs.nettools}/bin/hostname)}:$PWD .git $branch"
+ fi
+ '';
+
+ q-power_supply = ''
+ for uevent in /sys/class/power_supply/*/uevent; do
+ if test -f $uevent; then
+ eval "$(${pkgs.gnused}/bin/sed -n '
+ s/^\([A-Z_]\+=\)\(.*\)/\1'\'''\2'\'''/p
+ ' $uevent)"
+
+ if test "x''${POWER_SUPPLY_CHARGE_NOW-}" = x; then
+ continue
+ fi
+
+ charge_percentage=$(echo "
+ scale=2
+ $POWER_SUPPLY_CHARGE_NOW / $POWER_SUPPLY_CHARGE_FULL
+ " | ${pkgs.bc}/bin/bc)
+
+ lfc=$POWER_SUPPLY_CHARGE_FULL
+ rc=$POWER_SUPPLY_CHARGE_NOW
+ #rc=2800
+ N=78; N=76
+ N=10
+ n=$(echo $N-1 | ${pkgs.bc}/bin/bc)
+ centi=$(echo "$rc*100/$lfc" | ${pkgs.bc}/bin/bc)
+ deci=$(echo "$rc*$N/$lfc" | ${pkgs.bc}/bin/bc)
+ energy_evel=$(
+ echo -n '☳ ' # TRIGRAM FOR THUNDER
+ if test $centi -ge 42; then echo -n ''
+ elif test $centi -ge 23; then echo -n ''
+ elif test $centi -ge 11; then echo -n ''
+ else echo -n ''; fi
+ for i in $(${pkgs.coreutils}/bin/seq 1 $deci); do
+ echo -n ■
+ done
+ echo -n ''
+ for i in $(${pkgs.coreutils}/bin/seq $deci $n); do
+ echo -n ■
+ done
+ echo '' $rc #/ $lfc
+ )
+ echo "$energy_evel $charge_percentage"
+ fi
+ done
+ '';
+
+ q-virtualization = ''
+ echo "VT: $(${pkgs.systemd}/bin/systemd-detect-virt)"
+ '';
+
+ q-wireless = ''
+ for dev in $(
+ ${pkgs.iw}/bin/iw dev \
+ | ${pkgs.gnused}/bin/sed -n 's/^\s*Interface\s\+\([0-9a-z]\+\)$/\1/p'
+ ); do
+ inet=$(${pkgs.iproute}/bin/ip addr show $dev \
+ | ${pkgs.gnused}/bin/sed -n '
+ s/.*inet \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p
+ ') \
+ || unset inet
+ ssid=$(${pkgs.iw}/bin/iw dev $dev link \
+ | ${pkgs.gnused}/bin/sed -n '
+ s/.*\tSSID: \(.*\)/\1/p
+ ') \
+ || unset ssid
+ echo "$dev''${inet+ $inet}''${ssid+ $ssid}"
+ done
+ '';
+
+ q-online = ''
+ if ${pkgs.curl}/bin/curl -s google.com >/dev/null; then
+ echo 'online'
+ else
+ echo offline
+ fi
+ '';
+
+ q-thermal_zone = ''
+ for i in /sys/class/thermal/thermal_zone*; do
+ type=$(${pkgs.coreutils}/bin/cat $i/type)
+ temp=$(${pkgs.coreutils}/bin/cat $i/temp)
+ printf '%s %s°C\n' $type $(echo $temp / 1000 | ${pkgs.bc}/bin/bc)
+ done
+ '';
+
+ q-todo = ''
+ TODO_file=$HOME/TODO
+ if test -e "$TODO_file"; then
+ ${pkgs.coreutils}/bin/cat "$TODO_file" \
+ | ${pkgs.gawk}/bin/gawk -v now=$(${pkgs.coreutils}/bin/date +%s) '
+ BEGIN { print "remind=0" }
+ /^[0-9]/{
+ x = $1
+ gsub(".", "\\\\&", x)
+ rest = substr($0, index($0, " "))
+ rest = $0
+ sub(" *", "", rest)
+ gsub(".", "\\\\&", rest)
+ print "test $(${pkgs.coreutils}/bin/date +%s -d"x") -lt "now" && \
+ echo \"\x1b[38;5;208m\""rest esc "\"\x1b[m\" && \
+ (( remind++ ))"
+ }
+ END { print "test $remind = 0 && echo \"nothing to remind\"" }
+ ' \
+ | {
+ # bash needed for (( ... ))
+ ${pkgs.bash}/bin/bash
+ }
+ else
+ echo "$TODO_file: no such file or directory"
+ fi
+ '';
+
+in
+# bash needed for <(...)
+pkgs.writeBashBin "q" ''
+ set -eu
+ export PATH=/var/empty
+ ${q-cal}
+ echo
+ ${q-isodate}
+ (${q-gitdir}) &
+ (${q-power_supply}) &
+ (${q-virtualization}) &
+ (${q-wireless}) &
+ (${q-online}) &
+ (${q-thermal_zone}) &
+ wait
+ ${q-todo}
+''
diff --git a/lass/5pkgs/xmonad-lass.nix b/lass/5pkgs/xmonad-lass.nix
index 841821a7a..c07bd2b83 100644
--- a/lass/5pkgs/xmonad-lass.nix
+++ b/lass/5pkgs/xmonad-lass.nix
@@ -46,7 +46,7 @@ import XMonad.Util.EZConfig (additionalKeysP)
myTerm :: String
-myTerm = "urxvtc"
+myTerm = "${pkgs.rxvt_unicode}/bin/urxvtc"
myFont :: String
myFont = "-schumacher-*-*-*-*-*-*-*-*-*-*-*-iso10646-*"
@@ -108,11 +108,11 @@ displaySomeException = displayException
myKeyMap :: [([Char], X ())]
myKeyMap =
[ ("M4-<F11>", spawn "i3lock -i /var/lib/wallpaper/wallpaper -f")
- , ("M4-p", spawn "passmenu --type")
- , ("<XF86AudioRaiseVolume>", spawn "pactl -- set-sink-volume 0 +4%")
- , ("<XF86AudioLowerVolume>", spawn "pactl -- set-sink-volume 0 -4%")
- , ("<XF86AudioMute>", spawn "pactl -- set-sink-mute 0 toggle")
- , ("<XF86AudioMicMute>", spawn "pactl -- set-source-mute 1 toggle")
+ , ("M4-p", spawn "${pkgs.pass}/bin/passmenu --type")
+ , ("<XF86AudioRaiseVolume>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume 0 +4%")
+ , ("<XF86AudioLowerVolume>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume 0 -4%")
+ , ("<XF86AudioMute>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-mute 0 toggle")
+ , ("<XF86AudioMicMute>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-source-mute 1 toggle")
, ("<XF86Launch1>", gridselectWorkspace gridConfig W.view)
, ("<XF86MonBrightnessUp>", spawn "xbacklight -steps 1 -time 1 -inc 3")
, ("<XF86MonBrightnessDown>", spawn "xbacklight -steps 1 -time 1 -dec 3")
[cgit] Unable to lock slot /tmp/cgit/53200000.lock: No such file or directory (2)