Merge remote-tracking branch 'lass/master'

This commit is contained in:
makefu 2021-08-05 21:20:17 +02:00
commit c177a49ca3
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
18 changed files with 266 additions and 114 deletions

View File

@ -9,11 +9,11 @@ let
hooks = pkgs.reaktor2-plugins.hooks; hooks = pkgs.reaktor2-plugins.hooks;
commands = pkgs.reaktor2-plugins.commands; commands = pkgs.reaktor2-plugins.commands;
task = name: let taskRcFile = builtins.toFile "taskrc" ''
rcFile = builtins.toFile "taskrc" ''
confirmation=no confirmation=no
''; '';
in {
task = name: {
pattern = "^${name}-([a-z]+)(?::?\\s*(.*))?"; pattern = "^${name}-([a-z]+)(?::?\\s*(.*))?";
activate = "match"; activate = "match";
command = 1; command = 1;
@ -21,19 +21,19 @@ let
env.TASKDATA = "${stateDir}/${name}"; env.TASKDATA = "${stateDir}/${name}";
commands = { commands = {
add.filename = pkgs.writeDash "${name}-task-add" '' add.filename = pkgs.writeDash "${name}-task-add" ''
${pkgs.taskwarrior}/bin/task rc:${rcFile} add "$1" ${pkgs.taskwarrior}/bin/task rc:${taskRcFile} add "$1"
''; '';
list.filename = pkgs.writeDash "${name}-task-list" '' list.filename = pkgs.writeDash "${name}-task-list" ''
${pkgs.taskwarrior}/bin/task rc:${rcFile} export \ ${pkgs.taskwarrior}/bin/task rc:${taskRcFile} export \
| ${pkgs.jq}/bin/jq -r ' | ${pkgs.jq}/bin/jq -r '
.[] | select(.id != 0) | "\(.id) \(.description)" .[] | select(.id != 0) | "\(.id) \(.description)"
' '
''; '';
delete.filename = pkgs.writeDash "${name}-task-delete" '' delete.filename = pkgs.writeDash "${name}-task-delete" ''
${pkgs.taskwarrior}/bin/task rc:${rcFile} delete "$1" ${pkgs.taskwarrior}/bin/task rc:${taskRcFile} delete "$1"
''; '';
done.filename = pkgs.writeDash "${name}-task-done" '' done.filename = pkgs.writeDash "${name}-task-done" ''
${pkgs.taskwarrior}/bin/task rc:${rcFile} done "$1" ${pkgs.taskwarrior}/bin/task rc:${taskRcFile} done "$1"
''; '';
}; };
}; };
@ -120,8 +120,138 @@ in {
uid = genid_uint31 "reaktor2"; uid = genid_uint31 "reaktor2";
home = stateDir; home = stateDir;
isSystemUser = true; isSystemUser = true;
extraGroups = [ "reaktor2" ];
}; };
users.groups.reaktor2 = {};
systemd.services.htgen-agenda.serviceConfig.StateDirectory = "reaktor2";
krebs.htgen.agenda = {
port = 8009;
user = {
name = "reaktor2";
home = stateDir;
};
script = ''. ${pkgs.writeDash "agenda" ''
echo "$Method $Request_URI" >&2
case "$Method" in
"GET")
printf 'HTTP/1.1 200 OK\r\n'
printf 'Connection: close\r\n'
printf '\r\n'
TASKDATA=/var/lib/reaktor2/agenda ${pkgs.taskwarrior}/bin/task rc:${taskRcFile} export
exit
;;
esac
''}'';
};
services.nginx = {
virtualHosts."agenda.r" = {
locations."= /index.html".extraConfig = ''
alias ${pkgs.writeText "agenda.html" ''
<!DOCTYPE html>
<html>
<head>
<title>Agenda</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
html {
font-family: monospace;
}
dt {
float: left;
clear: left;
width: 30px;
text-align: right;
font-weight: bold;
}
dd {
margin: 0 0 0 40px;
padding: 0 0 0.5em 0;
}
.date {
color: grey;
font-style: italic;
}
</style>
</head>
<body>
<dl id="agenda"></dl>
<script>
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());
if (params.hasOwnProperty("style")) {
const cssUrls = params["style"].split(" ").filter((x) => x.length > 0);
for (const cssUrl of cssUrls)
fetch(cssUrl)
.then((response) =>
response.text().then((css) => {
const title = document.getElementsByTagName("head")[0];
const style = document.createElement("style");
style.appendChild(document.createTextNode(css));
title.appendChild(style);
})
)
.catch(console.log);
}
fetch("/agenda.json")
.then((response) => {
response.json().then((agenda) => {
const dl = document.getElementById("agenda");
for (const agendaItem of agenda) {
if (agendaItem.status !== "pending") continue;
// task warrior date format to ISO
const entryDate = agendaItem.entry.replace(
/(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z/,
"$1-$2-$3T$4:$5:$6Z"
);
const dt = document.createElement("dt");
dt.className = "id";
dt.appendChild(document.createTextNode(agendaItem.id.toString()));
dl.appendChild(dt);
const spanDate = document.createElement("span");
spanDate.className = "date";
spanDate.title = new Date(entryDate).toString();
spanDate.appendChild(document.createTextNode(entryDate));
const dd = document.createElement("dd");
dd.className = "description";
dd.appendChild(document.createTextNode(agendaItem.description));
dd.appendChild(document.createTextNode(" "));
dd.appendChild(spanDate);
dl.appendChild(dd);
}
});
})
.then((data) => console.log(data));
</script>
</body>
</html>
''};
'';
locations."/agenda.json".extraConfig = ''
proxy_set_header Host $host;
proxy_pass http://localhost:8009;
'';
extraConfig = ''
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
'';
};
};
systemd.services.reaktor2-r.serviceConfig.DynamicUser = mkForce false;
systemd.services.reaktor2-hackint.serviceConfig.DynamicUser = mkForce false;
krebs.reaktor2 = { krebs.reaktor2 = {
hackint = { hackint = {
hostname = "irc.hackint.org"; hostname = "irc.hackint.org";
@ -140,23 +270,6 @@ in {
username = "reaktor2"; username = "reaktor2";
port = "6697"; port = "6697";
}; };
freenode = {
hostname = "irc.freenode.org";
nick = "reaktor2|krebs";
plugins = [
{
plugin = "register";
config = {
channels = [
"#krebs"
];
};
}
systemPlugin
];
username = "reaktor2";
port = "6697";
};
r = { r = {
nick = "reaktor2|krebs"; nick = "reaktor2|krebs";
sendDelaySec = null; sendDelaySec = null;

View File

@ -220,6 +220,7 @@ in {
Ya8buh4RgyE/0hp4QNpa4K7fvntriK+k6zHs7BcZcG2aMWP3O9/4DgjzBR3eslQV Ya8buh4RgyE/0hp4QNpa4K7fvntriK+k6zHs7BcZcG2aMWP3O9/4DgjzBR3eslQV
oou23ajP11wyfrmZK0/PQGTpsU472Jj+06KtMAaH0zo4vAR8s2kV1ukCAwEAAQ== oou23ajP11wyfrmZK0/PQGTpsU472Jj+06KtMAaH0zo4vAR8s2kV1ukCAwEAAQ==
-----END RSA PUBLIC KEY----- -----END RSA PUBLIC KEY-----
Ed25519PublicKey = s/HNXjzVyDiBZImQdhJqUmj7symv+po9D9uDj+/6c2F
''; '';
}; };
}; };

View File

@ -70,6 +70,7 @@ in {
ip4.addr = "10.243.77.3"; ip4.addr = "10.243.77.3";
aliases = [ aliases = [
"hotdog.r" "hotdog.r"
"agenda.r"
"build.r" "build.r"
"build.hotdog.r" "build.hotdog.r"
"cgit.hotdog.r" "cgit.hotdog.r"

View File

@ -149,6 +149,7 @@ let
inherit (cfg.user) home name uid; inherit (cfg.user) home name uid;
createHome = true; createHome = true;
description = "repo-sync user"; description = "repo-sync user";
isSystemUser = true;
}; };
systemd.timers = mapAttrs' (name: repo: systemd.timers = mapAttrs' (name: repo:

View File

@ -1,12 +1,13 @@
{ fetchgit, lib, pkgs, stdenv }: { fetchgit, lib, pkgs, stdenv }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "htgen"; pname = "htgen";
version = "1.3.0"; version = "1.3.1";
#src = <htgen>;
src = fetchgit { src = fetchgit {
url = "http://cgit.krebsco.de/htgen"; url = "http://cgit.krebsco.de/htgen";
rev = "refs/tags/v${version}"; rev = "refs/tags/${version}";
sha256 = "0p3517wkfpvip4z0axh0b4v1jm1nqpppldnhq4806c0p33vrjxnf"; sha256 = "0ml8kp89bwkrwy6iqclzyhxgv2qn9dcpwaafbmsr4mgcl70zx22r";
}; };
installPhase = '' installPhase = ''

View File

@ -2,13 +2,13 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "rss-bridge"; pname = "rss-bridge";
version = "unstable-2021-01-10"; version = "unstable-2021-04-20";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "RSS-Bridge"; owner = "RSS-Bridge";
repo = "rss-bridge"; repo = "rss-bridge";
rev = "98352845a14b9f2eb8925ad7a04a5f6cc6a5af06"; rev = "716f5ddc0e20c10cb77ded46380cc376913a92fd";
sha256 = "1nv1f6f17cn057k9mydd3a0bmj2xa5k410fdq7nhw5b7msyxy2qv"; sha256 = "17aqmj7rz0ysk8nj4kbjvnsjdm47d0xsypfygzzk2vagxfz5w3p8";
}; };
patchPhase = '' patchPhase = ''

View File

@ -1,9 +1,9 @@
{ {
"url": "https://github.com/NixOS/nixpkgs", "url": "https://github.com/NixOS/nixpkgs",
"rev": "fbfb79400a08bf754e32b4d4fc3f7d8f8055cf94", "rev": "dd14e5d78e90a2ccd6007e569820de9b4861a6c2",
"date": "2021-06-06T04:54:09-03:00", "date": "2021-07-24T08:14:16-04:00",
"path": "/nix/store/51dsmanfc179xy70kn2rl0qvg45cn6qr-nixpkgs", "path": "/nix/store/0z5nrrjzmjcicjhhdrqb9vgm56zxysk3-nixpkgs",
"sha256": "0pgyx1l1gj33g5i9kwjar7dc3sal2g14mhfljcajj8bqzzrbc3za", "sha256": "1zmhwx1qqgl1wrrb9mjkck508887rldrnragvximhd7jrh1ya3fb",
"fetchSubmodules": false, "fetchSubmodules": false,
"deepClone": false, "deepClone": false,
"leaveDotGit": false "leaveDotGit": false

View File

@ -1,9 +1,9 @@
{ {
"url": "https://github.com/NixOS/nixpkgs", "url": "https://github.com/NixOS/nixpkgs",
"rev": "1f91fd1040667e9265a760b0347f8bc416249da7", "rev": "91903ceb294dbe63a696759bfba3d23ee667f2dc",
"date": "2021-06-13T11:32:41+02:00", "date": "2021-07-26T09:21:28+02:00",
"path": "/nix/store/8cx16mc5cymv2ll52fs831lmd4ljzmq1-nixpkgs", "path": "/nix/store/2v649741xdh1crybi2dm879bl60zrkhf-nixpkgs",
"sha256": "1lcfcwgal9fpaiq71981abyzz160r6nx1y4pyy1dnvaf951xkdcj", "sha256": "1hmpwi27r4q0lnspg7ylfzxakwz2fhl3r07vjvq5yalcdqwiain3",
"fetchSubmodules": false, "fetchSubmodules": false,
"deepClone": false, "deepClone": false,
"leaveDotGit": false "leaveDotGit": false

View File

@ -80,7 +80,7 @@ with import <stockholm/lib>;
#remote control #remote control
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
x11vnc x11vnc
torbrowser # torbrowser
]; ];
krebs.iptables.tables.filter.INPUT.rules = [ krebs.iptables.tables.filter.INPUT.rules = [
{ predicate = "-p tcp -i retiolum --dport 5900"; target = "ACCEPT"; } { predicate = "-p tcp -i retiolum --dport 5900"; target = "ACCEPT"; }

View File

@ -1,13 +1,15 @@
with (import <stockholm/lib>); with (import <stockholm/lib>);
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }: let
weechat = pkgs.weechat.override {
configure = { availablePlugins, ... }: with pkgs.weechatScripts; {
plugins = lib.attrValues (availablePlugins // {
python = availablePlugins.python.withPackages (_: [ weechat-matrix ]);
});
scripts = [ weechat-matrix ];
};
};
{ tmux = pkgs.writeDashBin "tmux" ''
imports = [
./bitlbee.nix
];
systemd.services.chat = let
tmux = pkgs.writeDash "tmux" ''
exec ${pkgs.tmux}/bin/tmux -f ${pkgs.writeText "tmux.conf" '' exec ${pkgs.tmux}/bin/tmux -f ${pkgs.writeText "tmux.conf" ''
set-option -g prefix ` set-option -g prefix `
unbind-key C-b unbind-key C-b
@ -23,7 +25,13 @@ with (import <stockholm/lib>);
bind-key C-s switch-client -l bind-key C-s switch-client -l
''} "$@" ''} "$@"
''; '';
in { in {
imports = [
./bitlbee.nix
];
environment.systemPackages = [ tmux ];
systemd.services.chat = {
description = "chat environment setup"; description = "chat environment setup";
after = [ "network.target" ]; after = [ "network.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
@ -38,8 +46,8 @@ with (import <stockholm/lib>);
User = "lass"; User = "lass";
RemainAfterExit = true; RemainAfterExit = true;
Type = "oneshot"; Type = "oneshot";
ExecStart = "${tmux} -2 new-session -d -s IM ${pkgs.weechat}/bin/weechat"; ExecStart = "${tmux}/bin/tmux -2 new-session -d -s IM ${weechat}/bin/weechat";
ExecStop = "${tmux} kill-session -t IM"; ExecStop = "${tmux}/bin/tmux kill-session -t IM"; # TODO run save in weechat
}; };
}; };
} }

View File

@ -2,7 +2,6 @@
with import <stockholm/lib>; with import <stockholm/lib>;
let let
user = config.krebs.build.user; user = config.krebs.build.user;
xmonad-lass = pkgs.callPackage <stockholm/lass/5pkgs/custom/xmonad-lass> { inherit config; };
in { in {
imports = [ imports = [
./mpv.nix ./mpv.nix
@ -19,6 +18,7 @@ in {
security.rtkit.enable = true; security.rtkit.enable = true;
sound.enableOSSEmulation = false; sound.enableOSSEmulation = false;
} }
./xmonad.nix
{ {
krebs.per-user.lass.packages = [ krebs.per-user.lass.packages = [
pkgs.sshuttle pkgs.sshuttle
@ -120,30 +120,13 @@ in {
xkbVariant = "altgr-intl"; xkbVariant = "altgr-intl";
xkbOptions = "caps:escape"; xkbOptions = "caps:escape";
libinput.enable = true; libinput.enable = true;
displayManager.lightdm.enable = true; displayManager = {
displayManager.defaultSession = "none+xmonad"; lightdm.enable = true;
windowManager.session = [{ defaultSession = "none+xmonad";
name = "xmonad"; sessionCommands = ''
start = ''
${pkgs.xorg.xhost}/bin/xhost +LOCAL: ${pkgs.xorg.xhost}/bin/xhost +LOCAL:
${pkgs.systemd}/bin/systemctl --user start xmonad
exec ${pkgs.coreutils}/bin/sleep infinity
''; '';
}];
}; };
systemd.user.services.xmonad = {
environment = {
DISPLAY = ":${toString config.services.xserver.display}";
RXVT_SOCKET = "%t/urxvtd-socket";
XMONAD_DATA_DIR = "/tmp";
};
serviceConfig = {
SyslogIdentifier = "xmonad";
ExecStart = "${xmonad-lass}/bin/xmonad";
ExecStop = "${xmonad-lass}/bin/xmonad --shutdown";
};
restartIfChanged = false;
}; };
nixpkgs.config.packageOverrides = super: { nixpkgs.config.packageOverrides = super: {

View File

@ -106,7 +106,6 @@ with import <stockholm/lib>;
jq jq
#style #style
most
rxvt_unicode.terminfo rxvt_unicode.terminfo
#monitoring tools #monitoring tools
@ -117,6 +116,7 @@ with import <stockholm/lib>;
iptables iptables
iftop iftop
tcpdump tcpdump
mosh
#stuff for dl #stuff for dl
aria2 aria2
@ -125,29 +125,31 @@ with import <stockholm/lib>;
file file
hashPassword hashPassword
kpaste kpaste
krebspaste
mosh
pciutils pciutils
pop pop
psmisc
q q
rs rs
tmux
untilport untilport
usbutils usbutils
logify logify
goify goify
#unpack stuff #unpack stuff
p7zip libarchive
unzip
unrar
(pkgs.writeDashBin "sshn" '' (pkgs.writeDashBin "sshn" ''
${pkgs.openssh}/bin/ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$@" ${pkgs.openssh}/bin/ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$@"
'') '')
]; ];
environment.shellAliases = {
ll = "ls -l";
la = "ls -la";
ls = "ls --color";
ip = "ip -color=auto";
grep = "grep --color=auto";
};
programs.bash = { programs.bash = {
enableCompletion = true; enableCompletion = true;
interactiveShellInit = '' interactiveShellInit = ''

View File

@ -225,7 +225,7 @@ in {
${pkgs.mpc_cli}/bin/mpc idle player > /dev/null ${pkgs.mpc_cli}/bin/mpc idle player > /dev/null
${pkgs.mpc_cli}/bin/mpc current -f %file% ${pkgs.mpc_cli}/bin/mpc current -f %file%
done | while read track; do done | while read track; do
listeners=$(${pkgs.iproute}/bin/ss -Hno state established 'sport = :8000' | grep '^mptcp' | wc -l) listeners=$(${pkgs.iproute}/bin/ss -Hno state established 'sport = :8000' | grep '^tcp' | wc -l)
echo "$(date -Is)" "$track" | tee -a "$HISTORY_FILE" echo "$(date -Is)" "$track" | tee -a "$HISTORY_FILE"
echo "$(tail -$LIMIT "$HISTORY_FILE")" > "$HISTORY_FILE" echo "$(tail -$LIMIT "$HISTORY_FILE")" > "$HISTORY_FILE"
${set_irc_topic} "playing: $track listeners: $listeners" ${set_irc_topic} "playing: $track listeners: $listeners"
@ -347,6 +347,19 @@ in {
locations."= /recent".extraConfig = '' locations."= /recent".extraConfig = ''
alias /tmp/played; alias /tmp/played;
''; '';
locations."= /current".extraConfig = ''
proxy_pass http://localhost:8001;
'';
locations."= /skip".extraConfig = ''
proxy_pass http://localhost:8001;
'';
locations."= /good".extraConfig = ''
proxy_pass http://localhost:8001;
'';
extraConfig = ''
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
'';
}; };
virtualHosts."lassul.us".locations."= /the_playlist".extraConfig = let virtualHosts."lassul.us".locations."= /the_playlist".extraConfig = let
html = pkgs.writeText "index.html" '' html = pkgs.writeText "index.html" ''

View File

@ -1,10 +1,13 @@
{ config, pkgs, ... }: { config, lib, pkgs, ... }:
pkgs.writers.writeHaskellBin "xmonad" {
libraries = with pkgs.haskellPackages; [ {
extra services.xserver.windowManager.xmonad = {
xmonad-stockholm enable = true;
extraPackages = hs: [
hs.extra
hs.xmonad-stockholm
]; ];
} /* haskell */ '' config = /* haskell */ ''
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE LambdaCase #-}
@ -48,6 +51,7 @@ import XMonad.Prompt.Window (windowPromptGoto, windowPromptBringCopy)
import XMonad.Util.EZConfig (additionalKeysP) import XMonad.Util.EZConfig (additionalKeysP)
import XMonad.Util.NamedWindows (getName) import XMonad.Util.NamedWindows (getName)
import XMonad.Util.Run (safeSpawn) import XMonad.Util.Run (safeSpawn)
import XMonad.Util.Ungrab (unGrab)
import XMonad.Stockholm.Shutdown (newShutdownEventHandler, shutdown) import XMonad.Stockholm.Shutdown (newShutdownEventHandler, shutdown)
import XMonad.Stockholm.Pager (defaultWindowColors, pager, MatchMethod(MatchPrefix), PagerConfig(..)) import XMonad.Stockholm.Pager (defaultWindowColors, pager, MatchMethod(MatchPrefix), PagerConfig(..))
@ -62,7 +66,9 @@ instance UrgencyHook LibNotifyUrgencyHook where
safeSpawn "${pkgs.libnotify}/bin/notify-send" [show name, "workspace " ++ idx] safeSpawn "${pkgs.libnotify}/bin/notify-send" [show name, "workspace " ++ idx]
myTerm :: FilePath myTerm :: FilePath
myTerm = "${pkgs.rxvt_unicode-with-plugins}/bin/urxvtc" -- myTerm = "${pkgs.rxvt_unicode-with-plugins}/bin/urxvtc -e /run/current-system/sw/bin/xonsh"
-- myTerm = "${pkgs.rxvt_unicode-with-plugins}/bin/urxvtc"
myTerm = "/run/current-system/sw/bin/alacritty"
myFont :: String myFont :: String
myFont = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1" myFont = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1"
@ -109,19 +115,19 @@ floatHooks = composeAll
myKeyMap :: [([Char], X ())] myKeyMap :: [([Char], X ())]
myKeyMap = myKeyMap =
[ ("M4-<F11>", spawn "${config.lass.screenlock.command}") [ ("M4-C-p", forkFile "${pkgs.scrot}/bin/scrot" [ "~/public_html/scrot.png" ] Nothing )
, ("M4-C-p", spawn "${pkgs.scrot}/bin/scrot ~/public_html/scrot.png") , ("M4-p", forkFile "${pkgs.pass}/bin/passmenu" [ "--type" ] Nothing)
, ("M4-p", spawn "${pkgs.pass}/bin/passmenu --type") , ("M4-S-p", forkFile "${pkgs.otpmenu}/bin/otpmenu" [] Nothing)
, ("M4-S-p", spawn "${pkgs.otpmenu}/bin/otpmenu") , ("M4-o", forkFile "${pkgs.brain}/bin/brainmenu --type" [] Nothing)
, ("M4-o", spawn "${pkgs.brain}/bin/brainmenu --type") , ("M4-z", forkFile "${pkgs.emot-menu}/bin/emoticons" [] Nothing)
, ("M4-z", spawn "${pkgs.emot-menu}/bin/emoticons")
, ("M4-S-q", restart "xmonad" True)
, ("<XF86AudioMute>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-mute @DEFAULT_SINK@ toggle") , ("<XF86AudioMute>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-mute @DEFAULT_SINK@ toggle")
, ("<XF86AudioRaiseVolume>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ +4%") , ("<XF86AudioRaiseVolume>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ +4%")
, ("<XF86AudioLowerVolume>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ -4%") , ("<XF86AudioLowerVolume>", spawn "${pkgs.pulseaudioLight.out}/bin/pactl -- set-sink-volume @DEFAULT_SINK@ -4%")
, ("<XF86MonBrightnessDown>", spawn "${pkgs.acpilight}/bin/xbacklight -time 0 -dec 1") , ("<XF86MonBrightnessDown>", spawn "${pkgs.acpilight}/bin/xbacklight -time 0 -dec 1")
, ("<XF86MonBrightnessUp>", spawn "${pkgs.acpilight}/bin/xbacklight -time 0 -inc 1") , ("<XF86MonBrightnessUp>", spawn "${pkgs.acpilight}/bin/xbacklight -time 0 -inc 1")
, ("<XF86Launch1>", gridselectWorkspace gridConfig W.view)
, ("M4-C-k", spawn "${pkgs.xorg.xkill}/bin/xkill") , ("M4-C-k", spawn "${pkgs.xorg.xkill}/bin/xkill")
, ("M4-<Tab>", focusDown) , ("M4-<Tab>", focusDown)
@ -137,7 +143,8 @@ myKeyMap =
, ("M4-<Esc>", toggleWS) , ("M4-<Esc>", toggleWS)
, ("M4-S-<Enter>", spawn myTerm) , ("M4-S-<Enter>", spawn myTerm)
, ("M4-x", floatNext True >> spawn myTerm) , ("M4-x", floatNext True >> spawn myTerm)
, ("M4-c", floatNext True >> spawn "${pkgs.termite}/bin/termite") , ("M4-c", spawn "/run/current-system/sw/bin/emacsclient -c")
-- , ("M4-c", unGrab)
, ("M4-f", floatNext True) , ("M4-f", floatNext True)
, ("M4-b", spawn "/run/current-system/sw/bin/klem") , ("M4-b", spawn "/run/current-system/sw/bin/klem")
@ -171,6 +178,9 @@ myKeyMap =
, ("M4-<F9>", spawn "${pkgs.redshift}/bin/redshift -O 4000 -g 0.9:0.8:0.8") , ("M4-<F9>", spawn "${pkgs.redshift}/bin/redshift -O 4000 -g 0.9:0.8:0.8")
, ("M4-<F10>", spawn "${pkgs.redshift}/bin/redshift -x") , ("M4-<F10>", spawn "${pkgs.redshift}/bin/redshift -x")
, ("M4-<F11>", spawn "${config.lass.screenlock.command}")
, ("M4-<F12>", spawn "${pkgs.systemd}/bin/systemctl suspend -i")
, ("M4-u", spawn "${pkgs.xcalib}/bin/xcalib -invert -alter") , ("M4-u", spawn "${pkgs.xcalib}/bin/xcalib -invert -alter")
, ("M4-s", spawn "${pkgs.knav}/bin/knav") , ("M4-s", spawn "${pkgs.knav}/bin/knav")
@ -183,7 +193,7 @@ myKeyMap =
forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X () forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X ()
forkFile path args env = forkFile path args env =
xfork (executeFile path False args env) >> return () xfork (executeFile path True args env) >> return ()
myXPConfig :: XPConfig myXPConfig :: XPConfig
myXPConfig = def myXPConfig = def
@ -227,4 +237,6 @@ gridConfig = def
allWorkspaceNames :: W.StackSet i l a sid sd -> X [i] allWorkspaceNames :: W.StackSet i l a sid sd -> X [i]
allWorkspaceNames ws = allWorkspaceNames ws =
return $ map W.tag (W.hidden ws ++ (map W.workspace $ W.visible ws)) ++ [W.tag $ W.workspace $ W.current ws] return $ map W.tag (W.hidden ws ++ (map W.workspace $ W.visible ws)) ++ [W.tag $ W.workspace $ W.current ws]
'' '';
};
}

View File

@ -123,7 +123,6 @@ with import <stockholm/lib>;
pkgs.hashPassword pkgs.hashPassword
pkgs.htop pkgs.htop
pkgs.kpaste pkgs.kpaste
pkgs.krebspaste
pkgs.nix-prefetch-scripts pkgs.nix-prefetch-scripts
pkgs.ovh-zone pkgs.ovh-zone
pkgs.push pkgs.push

View File

@ -84,6 +84,7 @@ in {
users.users.${cfg.user.name} = { users.users.${cfg.user.name} = {
inherit (cfg.user) home name uid; inherit (cfg.user) home name uid;
createHome = true; createHome = true;
isSystemUser = true;
}; };
}; };
} }

View File

@ -119,6 +119,7 @@ in {
users.users.${cfg.user.name} = { users.users.${cfg.user.name} = {
inherit (cfg.user) home name uid; inherit (cfg.user) home name uid;
createHome = true; createHome = true;
isSystemUser = true;
}; };
}; };
} }

View File

@ -0,0 +1,16 @@
{ pkgs }:
let
grep = "${pkgs.gnugrep}/bin/grep";
xset = "${pkgs.xorg.xset}/bin/xset";
in
pkgs.writeDashBin "xtoggledpms" ''
# usage: xtoggledpms
set -efu
if ${xset} q | ${grep} -qF 'DPMS is Disabled'; then
${xset} dpms force off
else
${xset} s off -dpms
fi
''