From 1f6ba2a01d8ef041323fcb847a0c445365307182 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 29 Jan 2019 19:59:59 +0100 Subject: [PATCH 01/23] xmonad-stockholm: arguments in one line --- krebs/5pkgs/haskell/xmonad-stockholm.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/krebs/5pkgs/haskell/xmonad-stockholm.nix b/krebs/5pkgs/haskell/xmonad-stockholm.nix index 228d365a3..1b197b914 100644 --- a/krebs/5pkgs/haskell/xmonad-stockholm.nix +++ b/krebs/5pkgs/haskell/xmonad-stockholm.nix @@ -1,5 +1,4 @@ -{ mkDerivation, base, containers, fetchgit, filepath, stdenv, unix, X11, X11-xft -, X11-xshape, xmonad, xmonad-contrib +{ mkDerivation, base, containers, fetchgit, filepath, stdenv, unix, X11, X11-xft , X11-xshape, xmonad, xmonad-contrib }: mkDerivation rec { pname = "xmonad-stockholm"; From b4ad768b786401734064eb747d17dbe68b785faa Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 29 Jan 2019 20:00:28 +0100 Subject: [PATCH 02/23] j krops: fix directory --- jeschli/krops.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/jeschli/krops.nix b/jeschli/krops.nix index 989abcdd0..dbf94bd0d 100644 --- a/jeschli/krops.nix +++ b/jeschli/krops.nix @@ -12,10 +12,7 @@ secrets = if test then { file = toString ./2configs/tests/dummy-secrets; } else { - pass = { - dir = "${lib.getEnv "HOME"}/.password-store"; - name = "hosts/${name}"; - }; + file = "${lib.getEnv "HOME"}/secrets/${name}"; }; } ]; From 6f466e7ab6aaf4786a84682002c929672201a120 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 5 Feb 2019 19:19:09 +0100 Subject: [PATCH 03/23] j brauerei: remove commented dead code --- jeschli/1systems/brauerei/config.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index d342acb64..f7f545294 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -7,6 +7,9 @@ in ./hardware-configuration.nix +# +# +# ]; @@ -147,8 +150,17 @@ in ''; } ]; - }; +# xmonad = { +# enable = true; +# enableContribAndExtras = true; +# extraPackages = haskellPackages: [ +# haskellPackages.xmonad-contrib +# haskellPackages.xmonad-extras +# haskellPackages.xmonad +# ]; +# } + }; }; users.extraUsers.jeschli = { # TODO: define as krebs.users From b1b20cb683a103bd89710f5eabce8209c5041542 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 5 Feb 2019 19:19:29 +0100 Subject: [PATCH 04/23] j brauerei: remove not working tokei override --- jeschli/1systems/brauerei/config.nix | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index f7f545294..7ac4cc2c0 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -109,14 +109,7 @@ in # xorg xorg.xbacklight # tokei - tokei = overrideDerivation super.tokei (old: { - patches = old.patches or [] ++ [ - (self.fetchurl { - url = https://github.com/4z3/tokei/commit/c27529c.patch; - sha256 = "1rdw8bk379cav603ryrb57yfkvk2z8wavfw9prfh01agk3ml693x"; - }) - ]; - }); + tokei ]; # Some programs need SUID wrappers, can be configured further or are From 17712c90772d68f174f579e570fa23a8fa674245 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 5 Feb 2019 19:20:17 +0100 Subject: [PATCH 05/23] j xserver: add dbus magic for xserver (xserver/default.nix not working currently) --- jeschli/2configs/xserver/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jeschli/2configs/xserver/default.nix b/jeschli/2configs/xserver/default.nix index ec3977c7e..44c35ca37 100644 --- a/jeschli/2configs/xserver/default.nix +++ b/jeschli/2configs/xserver/default.nix @@ -51,6 +51,12 @@ in { ${pkgs.xorg.xmodmap}/bin/xmodmap ${import ./Xmodmap.nix args} & ${pkgs.xorg.xrdb}/bin/xrdb ${import ./Xresources.nix args} & ${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c' & + ${config.services.xserver.displayManager.sessionCommands} + if test -z "$DBUS_SESSION_BUS_ADDRESS"; then + exec ${pkgs.dbus.dbus-launch} --exit-with-session "$0" "" + fi + export DBUS_SESSION_BUS_ADDRESS + ${config.systemd.package}/bin/systemctl --user import-environment DISPLAY DBUS_SESSION_BUS_ADDRESS wait ''; From cb03267e0c3fd3bfa4beaa454f8986856a93963f Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 9 Apr 2019 20:08:44 +0200 Subject: [PATCH 06/23] j brauerei: +clion --- jeschli/1systems/brauerei/config.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index b9bb021b8..367091e2c 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -92,9 +92,11 @@ in }) # dev tools gnumake + jetbrains.clion jetbrains.goland jetbrains.pycharm-professional jetbrains.webstorm + vscode # document viewer evince zathura @@ -105,7 +107,6 @@ in cargo rustracer rustup - vscode # orga tools taskwarrior # xorg From 32cfe97d08540178c0119ec66d4a39f673000adb Mon Sep 17 00:00:00 2001 From: jeschli Date: Thu, 25 Apr 2019 11:47:04 +0200 Subject: [PATCH 07/23] j brauerei: -steam (broken?) --- jeschli/1systems/brauerei/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index 367091e2c..8ad53f761 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -10,7 +10,7 @@ in # # # - +# ]; From 78ed3c69552cc05e2992d556914ca079892668dc Mon Sep 17 00:00:00 2001 From: jeschli Date: Thu, 25 Apr 2019 11:47:24 +0200 Subject: [PATCH 08/23] j brauerei: +gnupg --- jeschli/1systems/brauerei/config.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index 8ad53f761..a41e2b8d8 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -55,6 +55,7 @@ in curl dmenu git + gnupg i3lock keepass networkmanagerapplet From 18faf72684087fc91a689131ce56448393dae129 Mon Sep 17 00:00:00 2001 From: jeschli Date: Thu, 25 Apr 2019 11:50:00 +0200 Subject: [PATCH 09/23] j brauerei: configs/vim.nix (broken) -> standard vim --- jeschli/2configs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jeschli/2configs/default.nix b/jeschli/2configs/default.nix index 5aaabe24b..8b61fa29c 100644 --- a/jeschli/2configs/default.nix +++ b/jeschli/2configs/default.nix @@ -2,7 +2,7 @@ with import ; { imports = [ - ./vim.nix +# ./vim.nix ./retiolum.nix ./zsh.nix @@ -56,7 +56,7 @@ with import ; usbutils # logify goify - + vim #unpack stuff p7zip unzip From 271d8e8a204484de383a8151325033b8187eca8b Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 27 Apr 2019 17:05:31 +0200 Subject: [PATCH 10/23] j brauerei: +user blafoo --- jeschli/1systems/brauerei/config.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index a41e2b8d8..b8b2b66bc 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -157,6 +157,11 @@ in extraGroups = ["docker" "vboxusers" "audio"]; uid = 1000; }; + users.extraUsers.blafoo = { + isNormalUser = true; + extraGroups = ["audio"]; + uid = 1002; + }; users.extraUsers.jamie = { isNormalUser = true; uid = 1001; # TODO genid From 97d4f9a771a9bbb1b45085569028db2d7dfbd610 Mon Sep 17 00:00:00 2001 From: jeschli Date: Sun, 28 Apr 2019 15:02:20 +0200 Subject: [PATCH 11/23] j enklave: allowed port 8001 --- jeschli/1systems/enklave/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jeschli/1systems/enklave/config.nix b/jeschli/1systems/enklave/config.nix index cadec3cab..86d21f7d3 100644 --- a/jeschli/1systems/enklave/config.nix +++ b/jeschli/1systems/enklave/config.nix @@ -49,7 +49,7 @@ listenPort = 53589; organisations.lass.users = [ "jeschli" ]; }; - networking.firewall.allowedTCPPorts = [ 53589 ]; + networking.firewall.allowedTCPPorts = [ 53589 8001 ]; } ]; From 5c6a0a6e0077e51af57811be225f1553243997dc Mon Sep 17 00:00:00 2001 From: jeschli Date: Wed, 1 May 2019 21:35:46 +0200 Subject: [PATCH 12/23] j config: add qubasa's i3 config --- jeschli/2configs/window-manager.nix | 1078 +++++++++++++++++++++++++++ 1 file changed, 1078 insertions(+) create mode 100644 jeschli/2configs/window-manager.nix diff --git a/jeschli/2configs/window-manager.nix b/jeschli/2configs/window-manager.nix new file mode 100644 index 000000000..23c958df4 --- /dev/null +++ b/jeschli/2configs/window-manager.nix @@ -0,0 +1,1078 @@ +{pkgs, environment, config, lib, ... }: + +with pkgs; + +let + + bar_update_interval = "1"; # Option + + i3_status_script = pkgs.writeScript "i3script.sh" '' + #!/bin/sh + + # First time without wifi, because it blocks a long time + BAR="$(${temp_status})" + BAR+=" | $(${avail_disk})" + BAR+=" | $(${volume_status})" + BAR+=" | $(${brightness_status})" + BAR+=" | $(${vpn_status})" + BAR+=" | $(${eth_status})" + BAR+=" | Wifi " + BAR+=" | $(${date_status})" + BAR+=" | $(${battery_status})" + + echo "$BAR" + + while true; do + BAR="$(${temp_status})" + BAR+=" | $(${avail_disk})" + BAR+=" | $(${volume_status})" + BAR+=" | $(${brightness_status})" + BAR+=" | $(${vpn_status})" + BAR+=" | $(${eth_status})" + BAR+=" | $(${wifi_status})" + BAR+=" | $(${date_status})" + BAR+=" | $(${battery_status})" + + echo "$BAR" + sleep ${bar_update_interval} + done + + ''; + + # TODO: Change name if you have a different vpn interface name + vpn_status = pkgs.writeScript "vpn_status.sh" '' + #!/bin/sh + + export PATH="$PATH:${gawk}/bin:${acpi}/bin:${coreutils}/bin:${gnugrep}/bin:${calc}/bin" + + VPN="" + if [ -e "/proc/sys/net/ipv4/conf/labs-vpn" ]; then + VPN="Labs-VPN" + elif [ -e "/proc/sys/net/ipv4/conf/office-vpn" ]; then + VPN="Office-VPN" + elif [ -e "/proc/sys/net/ipv4/conf/tun0" ]; then + VPN="UKN-VPN" + elif [ -e "/proc/sys/net/ipv4/conf/wireguard-home" ]; then + VPN="Home-VPN" + fi + + if [ "$VPN" = "" ]; then + echo "VPN " + else + echo "$VPN " + fi + ''; + + avail_disk = pkgs.writeScript "avail_disk.sh" '' + #!/bin/sh + export PATH="$PATH:${gawk}/bin:${coreutils}/bin:${gnugrep}/bin" + + avail=$(df / -h | tail -n1| awk '{print $(NF-2) }') + echo "$avail " + ''; + + wifi_status = pkgs.writeScript "wifi_status.sh" '' + #!/bin/sh + + export PATH="$PATH:${gawk}/bin:${coreutils}/bin:${gnugrep}/bin:${wirelesstools}/bin" + + ssid=$(iwgetid -r) + quality=$(cat /proc/net/wireless | tail -n1 | awk '{ print $3}' | sed 's/\.//g')dB + + if [ "$ssid" = "" ]; then + echo "Wifi " + else + echo "$quality at $ssid " + fi + ''; + + + eth_status = pkgs.writeScript "eth_status.sh" '' + #!/bin/sh + + export PATH="$PATH:${gawk}/bin:${coreutils}/bin:${gnugrep}/bin:${iproute}/bin" + + first_eth=$(for i in /proc/sys/net/ipv4/conf/enp*; do basename "$i"; break; done) + status=$(ip link show dev "$first_eth" | head -n1 | awk '{ print $9 }') + + if [ "$status" = "DOWN" ]; then + echo "" + else + ip_addr=$(ip address show "$first_eth" | grep inet | head -n1 | awk '{ print $2 }' | sed 's/\/24//g') + echo "$ip_addr " + fi + + ''; + + volume_status = pkgs.writeScript "volume_status.sh" '' + #!/bin/sh + + export PATH="$PATH:${gawk}/bin:${coreutils}/bin:${gnugrep}/bin:${alsaUtils}/bin" + + status=$(amixer sget Master | grep 'Right:' | awk -F'[][]' '{ print $4 }') + volume=$(amixer sget Master | grep 'Right:' | awk -F'[][]' '{ print $2 }') + + if [ "$status" = "off" ]; then + echo "Muted " + else + echo "$volume " + fi + ''; + + date_status = pkgs.writeScript "date_status.sh" '' + #!/bin/sh + + export PATH="$PATH:${gawk}/bin:${coreutils}/bin:${gnugrep}/bin" + + echo "$(date +'%d.%m.%Y  %H:%M')" + ''; + + temp_status = pkgs.writeScript "temp_status.sh" '' + #!/bin/sh + + export PATH="$PATH:${gawk}/bin:${acpi}/bin:${coreutils}/bin:${gnugrep}/bin:${calc}/bin" + + temp=$(acpi -t | awk '{print $4}' | calc -p) + echo "$temp " + ''; + + brightness_status = pkgs.writeScript "brightness_status.sh" '' + #!/bin/sh + + brightness=$(${pkgs.acpilight}/bin/xbacklight -get) + echo "$brightness% " + ''; + + battery_status = with pkgs; pkgs.writeScript "battery_status.bash" '' + #!${pkgs.bash}/bin/bash + export PATH="$PATH:${gawk}/bin:${acpi}/bin:${coreutils}/bin:${gnugrep}/bin:${calc}/bin" + + get_battery_charging_status() { + if [ "$(acpi -b | grep Discharging)" != "" ]; then + echo "Discharging"; + else + echo "Charging"; + fi + } + declare -a capacity_arr + capacity_arr=( +  +  +  +  +  + ) + + # get charge of all batteries, combine them + total_charge=$(acpi -b | awk '{print $4}' | grep -Eo "[0-9]+" | paste -sd+ | calc -p); + + # get amount of batteries in the device + battery_number=$(acpi -b | wc -l); + percent=$((total_charge / battery_number)); + index=$((percent / ( 100 / ''${#capacity_arr[@]}) )) + + if [ "$(get_battery_charging_status)" == "Charging" ]; then + echo "$percent% " + else + echo "$percent% ''${capacity_arr[$index]}" + fi + ''; + + random-wallpaper = pkgs.writeScript "random-wallpaper.sh" '' + #!/bin/sh + file=$(find ${config.wallpapers} -type f -print0 | shuf -z -n 1) + ${pkgs.feh}/bin/feh --bg-scale "$file" + ''; + + reload_layout = pkgs.writeScript "reload_layout.sh" '' + #!/bin/sh + pkill gnome-terminal + + i3-msg append_layout ${shell_layout} + + for i in {1..16} + do + gnome-terminal & + done + ''; + + single_shell_spawn = pkgs.writeScript "single_shell_spawn.sh" '' + #!/bin/sh + + i3-msg focus parent + i3-msg append_layout ${single_shell} + for i in {1..2} + do + gnome-terminal + done + sleep 0.3 + i3-msg focus parent + ''; + + single_shell = pkgs.writeText "single-shell.json" '' +{ + "border": "pixel", + "floating": "auto_off", + "layout": "tabbed", + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "pixel", + "floating": "auto_off", + "layout": "splith", + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 0.5, + "type": "con", + "nodes": [ + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + }, + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + } + ] + } + ] + } + ] +} + ''; + + shell_layout = pkgs.writeText "shell-layout.json" '' + { + "border": "pixel", + "floating": "auto_off", + "layout": "tabbed", + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "pixel", + "floating": "auto_off", + "layout": "splith", + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 0.5, + "type": "con", + "nodes": [ + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + }, + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + } + ] + }, + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 0.5, + "type": "con", + "nodes": [ + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + }, + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + } + ] + } + ] + } + ] + }, + + { + "border": "pixel", + "floating": "auto_off", + "layout": "splith", + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 0.5, + "type": "con", + "nodes": [ + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + }, + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + } + ] + }, + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 0.5, + "type": "con", + "nodes": [ + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + }, + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + } + ] + } + ] + } + ] + }, + + { + "border": "pixel", + "floating": "auto_off", + "layout": "splith", + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 0.5, + "type": "con", + "nodes": [ + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + }, + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + } + ] + }, + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 0.5, + "type": "con", + "nodes": [ + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + }, + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + } + ] + } + ] + } + ] + }, + + + { + "border": "pixel", + "floating": "auto_off", + "layout": "splith", + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 0.5, + "type": "con", + "nodes": [ + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + }, + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + } + ] + }, + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 0.5, + "type": "con", + "nodes": [ + { + "border": "pixel", + "floating": "auto_off", + "layout": "splitv", + "percent": 1, + "type": "con", + "nodes": [ + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + }, + { + "border": "pixel", + + "floating": "auto_off", + "geometry": { + "height": 434, + "width": 722, + "x": 0, + "y": 0 + }, + "percent": 0.5, + "swallows": [ + { + "class": "^Gnome\\-terminal$", + "instance": "^gnome\\-terminal\\-server$" + } + ], + "type": "con" + } + ] + } + ] + } + ] + } + ] + } + ''; + + + i3_conf_file = pkgs.writeText "config" '' + # This file has been auto-generated by i3-config-wizard(1). + # It will not be overwritten, so edit it as you like. + # + # Should you change your keyboard layout some time, delete + # this file and re-run i3-config-wizard(1). + # + + # i3 config file (v4) + # + # Please see https://i3wm.org/docs/userguide.html for a complete reference! + + set $mod Mod4 + + ####################### + # # + # LOOKS # + # # + ####################### + # Font for window titles. Will also be used by the bar unless a different font + # is used in the bar {} block below. + font pango:Monospace 20, Icons 10 + hide_edge_borders smart + new_window pixel 1 + new_float normal + + # Lockscreen shortcut + bindsym $mod+l exec xscreensaver-command -l + + # start a terminal + bindsym $mod+Return exec gnome-terminal + + + # class border backgr. text indicator child_border + client.focused #4fceea #285577 #ffffff #2e9ef4 #285577 + client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a + client.unfocused #333333 #222222 #888888 #292d2e #222222 + + # Size of border + default_border pixel 2 + + ####################### + # # + # DEFAULT CONFIG # + # # + ####################### + floating_modifier $mod + workspace_layout stacked + default_orientation vertical + + # Kill focused window + bindsym $mod+Shift+q kill + + # start dmenu (a program launcher) + bindsym $mod+d exec ${pkgs.rofi}/bin/rofi -modi drun#run -combi-modi drun#run -show combi -show-icons -display-combi run -theme /etc/nixos/resources/gruvbox-dark-soft.rasi + + # Switch windows + bindsym $mod+x exec ${pkgs.rofi}/bin/rofi -modi window -show window -auto-select -theme /etc/nixos/resources/gruvbox-dark-soft.rasi + + # Arrow keys for focus navigation + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move focused window + bindsym $mod+Shift+j move left + bindsym $mod+Shift+k move down + bindsym $mod+Shift+l move up + bindsym $mod+Shift+odiaeresis move right + + # Arrow keys for focused window movement + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right + + # Split in horizontal orientation + bindsym $mod+h split h + + # Split in vertical orientation + bindsym $mod+v split v + + # Enter fullscreen mode for the focused container + bindsym $mod+f fullscreen toggle + + # Change container layout (stacked, tabbed, toggle split) + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Toggle tiling / floating + bindsym $mod+Shift+space floating toggle + + # Change focus between tiling / floating windows + bindsym $mod+space focus mode_toggle + + # Focus the parent container + bindsym $mod+a focus parent + + # Reload the configuration file + bindsym $mod+Shift+c reload + + # Restart i3 inplace (preserves your layout/session, can be used to upgrade i3) + bindsym $mod+Shift+r restart + + # Exit i3 (logs you out of your X session) + bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" + + # Resize window. You can also use the mouse for that + mode "resize" { + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym a resize shrink width 10 px or 10 ppt + bindsym s resize grow height 10 px or 10 ppt + bindsym w resize shrink height 10 px or 10 ppt + bindsym d resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" + } + + # Enable floating + for_window [class="usbguard-applet-qt"] floating enable + for_window [class="Nm-connection-editor"] floating enable + for_window [class="Gnome-disks"] floating enable + for_window [class="QtPass" title="QtPass"] move scratchpad + + # Make the currently focused window a scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the first scratchpad window + bindsym $mod+minus scratchpad show + + # Show the sup-mail scratchpad window, if any. + bindsym $mod+Shift+s [class="QtPass" title="QtPass"] scratchpad show + + ####################### + # # + # WORKSPACES # + # # + ####################### + # Variables + set $workspace1 "1: " + set $workspace2 "2: " + set $workspace3 "3: " + set $workspace4 "4: " + set $workspace5 "5: " + set $workspace6 "6: " + set $workspace7 "7" + set $workspace8 "8" + set $workspace9 "9" + set $workspace10 "10" + + assign [class="quassel"] $workspace3 + assign [class="Firefox"] $workspace2 + assign [class="Daily"] $workspace5 + + assign [class="VirtualBox Manager"] $workspace4 + assign [class="Virt-manager" title="Virtual Machine Manager"] $workspace4 + + assign [class="libreoffice"] $workspace6 + assign [class="Eclipse"] $workspace6 + + # Workspace lateral movement + bindsym $mod+Next workspace next + bindsym $mod+Prior workspace prev + + # Switch to workspace + bindsym $mod+1 workspace $workspace1 + bindsym $mod+2 workspace $workspace2 + bindsym $mod+3 workspace $workspace3 + bindsym $mod+4 workspace $workspace4 + bindsym $mod+5 workspace $workspace5 + bindsym $mod+6 workspace $workspace6 + bindsym $mod+7 workspace $workspace7 + bindsym $mod+8 workspace $workspace8 + bindsym $mod+9 workspace $workspace9 + bindsym $mod+0 workspace $workspace10 + + # Move workspace to other monitor + bindsym $mod+Shift+Next move workspace to output right + bindsym $mod+Shift+Prior move workspace to output left + + # move focused container to workspace + bindsym $mod+Shift+1 move container to workspace $workspace1 + bindsym $mod+Shift+2 move container to workspace $workspace2 + bindsym $mod+Shift+3 move container to workspace $workspace3 + bindsym $mod+Shift+4 move container to workspace $workspace4 + bindsym $mod+Shift+5 move container to workspace $workspace5 + bindsym $mod+Shift+6 move container to workspace $workspace6 + bindsym $mod+Shift+7 move container to workspace $workspace7 + bindsym $mod+Shift+8 move container to workspace $workspace8 + bindsym $mod+Shift+9 move container to workspace $workspace9 + bindsym $mod+Shift+0 move container to workspace $workspace10 + + + ####################### + # # + # FUNCTION KEYS # + # # + ####################### + # Backlight controls + bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight +10 + bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -10 + + # Pulse Audio controls + bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume + bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume + bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound + bindsym XF86AudioMicMute exec --no-startup-id amixer set Capture toggle + + ####################### + # # + # CONVENIENCE KEYS # + # # + ####################### + bindsym Shift+Alt+3 exec screenshot + + ####################### + # # + # WINDOW LAYOUT # + # # + ####################### + bindsym XF86LaunchA exec --no-startup-id ${reload_layout} + bindsym XF86Explorer exec --no-startup-id ${single_shell_spawn} + bindsym Shift+F11 exec --no-startup-id ${reload_layout} + bindsym Shift+F12 exec --no-startup-id ${single_shell_spawn} + + + bar { + status_command ${i3_status_script} + mode dock + position top + tray_output none + + font pango:monospace 14 + + # Scrolling on bar changes volume + bindsym button4 exec --no-startup-id pactl set-sink-volume 0 +5% + bindsym button5 exec --no-startup-id pactl set-sink-volume 0 +-5% + + # Right mouse click mutes the volume + bindsym button3 exec --no-startup-id pactl set-sink-mute 0 toggle + + + colors { + background #ffffff00 + statusline #ffe066 + + inactive_workspace #ffffff00 #ffffff00 #ffe066 + active_workspace #ffffff00 #ffffff00 #3f3f3f + urgent_workspace #ffffff00 #ffffff00 #ff8533 + } + } + + ####################### + # # + # AUTORUNS # + # # + ####################### + ## Start 16 gnome shells + exec i3-msg 'workspace $workspace1;' && ${reload_layout} + + # Start firefox + exec --no-startup-id ${pkgs.firefox}/bin/firefox --ProfileManager --new-instance --setDefaultBrowser + + # Quassel client + exec --no-startup-id ${pkgs.quasselClient}/bin/quasselclient + + # Random wallpaper + exec_always--no-startup-id ${random-wallpaper} + + # Start Qt-Pass + exec ${pkgs.qtpass}/bin/qtpass + ''; + +in { + services.xserver.enable = true; + services.xserver.layout = "de"; + + # Enable i3 Window Manager + services.xserver.windowManager.i3 = { + enable = true; + package = pkgs.i3; + configFile = i3_conf_file; + extraSessionCommands = '' + ${pkgs.openssh}/bin/ssh-add ${config.mainUserHome}/.ssh/id_rsa + ''; + }; + + # ${pkgs.xorg.xhost}/bin/xhost +SI:localuser:${cfg.user.name} + # ${pkgs.xorg.xhost}/bin/xhost -LOCAL: + services.xserver.windowManager.default = "i3"; + services.xserver.desktopManager.xterm.enable = false; + + # Enable the X11 windowing system. + services.xserver.displayManager.lightdm = { + enable = true; + autoLogin.enable = true; + autoLogin.user = config.mainUser; + autoLogin.timeout = 2; + greeter.enable = true; + }; + + fonts = { + fonts = with pkgs; [ + font-awesome_5 + ]; + }; + + # Allow users in video group to change brightness + hardware.brightnessctl.enable = true; + + environment.systemPackages = with pkgs; [ + rofi # Dmenu replacement + acpilight # Replacement for xbacklight + arandr # Xrandr gui + feh + wirelesstools # To get wireless statistics + acpi + xorg.xhost + xorg.xauth + ]; + +} From ad57bfe55eaadad1a09344742403725328c036db Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 4 May 2019 07:35:13 +0200 Subject: [PATCH 13/23] j brauerei: remove dead code --- jeschli/1systems/brauerei/config.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index b8b2b66bc..de940fedf 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -1,16 +1,14 @@ { config, pkgs, lib, ... }: let xmonad-jeschli = pkgs.callPackage { inherit config; }; + mainUser = config.krebs.build.user.name; in { imports = [ ./hardware-configuration.nix -# -# -# -# + ]; From 7fd7a1336cbf6e4da69caa231368a82db7f3516c Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 4 May 2019 07:35:46 +0200 Subject: [PATCH 14/23] j brauerei: add rofi --- jeschli/1systems/brauerei/config.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index de940fedf..55b28c3e8 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -52,6 +52,7 @@ in copyq curl dmenu + rofi git gnupg i3lock From a553c80f764d3b02d832a5839abadd6215047c70 Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 4 May 2019 07:37:05 +0200 Subject: [PATCH 15/23] j configs: remove window-manager.nix --- jeschli/2configs/window-manager.nix | 1078 --------------------------- 1 file changed, 1078 deletions(-) delete mode 100644 jeschli/2configs/window-manager.nix diff --git a/jeschli/2configs/window-manager.nix b/jeschli/2configs/window-manager.nix deleted file mode 100644 index 23c958df4..000000000 --- a/jeschli/2configs/window-manager.nix +++ /dev/null @@ -1,1078 +0,0 @@ -{pkgs, environment, config, lib, ... }: - -with pkgs; - -let - - bar_update_interval = "1"; # Option - - i3_status_script = pkgs.writeScript "i3script.sh" '' - #!/bin/sh - - # First time without wifi, because it blocks a long time - BAR="$(${temp_status})" - BAR+=" | $(${avail_disk})" - BAR+=" | $(${volume_status})" - BAR+=" | $(${brightness_status})" - BAR+=" | $(${vpn_status})" - BAR+=" | $(${eth_status})" - BAR+=" | Wifi " - BAR+=" | $(${date_status})" - BAR+=" | $(${battery_status})" - - echo "$BAR" - - while true; do - BAR="$(${temp_status})" - BAR+=" | $(${avail_disk})" - BAR+=" | $(${volume_status})" - BAR+=" | $(${brightness_status})" - BAR+=" | $(${vpn_status})" - BAR+=" | $(${eth_status})" - BAR+=" | $(${wifi_status})" - BAR+=" | $(${date_status})" - BAR+=" | $(${battery_status})" - - echo "$BAR" - sleep ${bar_update_interval} - done - - ''; - - # TODO: Change name if you have a different vpn interface name - vpn_status = pkgs.writeScript "vpn_status.sh" '' - #!/bin/sh - - export PATH="$PATH:${gawk}/bin:${acpi}/bin:${coreutils}/bin:${gnugrep}/bin:${calc}/bin" - - VPN="" - if [ -e "/proc/sys/net/ipv4/conf/labs-vpn" ]; then - VPN="Labs-VPN" - elif [ -e "/proc/sys/net/ipv4/conf/office-vpn" ]; then - VPN="Office-VPN" - elif [ -e "/proc/sys/net/ipv4/conf/tun0" ]; then - VPN="UKN-VPN" - elif [ -e "/proc/sys/net/ipv4/conf/wireguard-home" ]; then - VPN="Home-VPN" - fi - - if [ "$VPN" = "" ]; then - echo "VPN " - else - echo "$VPN " - fi - ''; - - avail_disk = pkgs.writeScript "avail_disk.sh" '' - #!/bin/sh - export PATH="$PATH:${gawk}/bin:${coreutils}/bin:${gnugrep}/bin" - - avail=$(df / -h | tail -n1| awk '{print $(NF-2) }') - echo "$avail " - ''; - - wifi_status = pkgs.writeScript "wifi_status.sh" '' - #!/bin/sh - - export PATH="$PATH:${gawk}/bin:${coreutils}/bin:${gnugrep}/bin:${wirelesstools}/bin" - - ssid=$(iwgetid -r) - quality=$(cat /proc/net/wireless | tail -n1 | awk '{ print $3}' | sed 's/\.//g')dB - - if [ "$ssid" = "" ]; then - echo "Wifi " - else - echo "$quality at $ssid " - fi - ''; - - - eth_status = pkgs.writeScript "eth_status.sh" '' - #!/bin/sh - - export PATH="$PATH:${gawk}/bin:${coreutils}/bin:${gnugrep}/bin:${iproute}/bin" - - first_eth=$(for i in /proc/sys/net/ipv4/conf/enp*; do basename "$i"; break; done) - status=$(ip link show dev "$first_eth" | head -n1 | awk '{ print $9 }') - - if [ "$status" = "DOWN" ]; then - echo "" - else - ip_addr=$(ip address show "$first_eth" | grep inet | head -n1 | awk '{ print $2 }' | sed 's/\/24//g') - echo "$ip_addr " - fi - - ''; - - volume_status = pkgs.writeScript "volume_status.sh" '' - #!/bin/sh - - export PATH="$PATH:${gawk}/bin:${coreutils}/bin:${gnugrep}/bin:${alsaUtils}/bin" - - status=$(amixer sget Master | grep 'Right:' | awk -F'[][]' '{ print $4 }') - volume=$(amixer sget Master | grep 'Right:' | awk -F'[][]' '{ print $2 }') - - if [ "$status" = "off" ]; then - echo "Muted " - else - echo "$volume " - fi - ''; - - date_status = pkgs.writeScript "date_status.sh" '' - #!/bin/sh - - export PATH="$PATH:${gawk}/bin:${coreutils}/bin:${gnugrep}/bin" - - echo "$(date +'%d.%m.%Y  %H:%M')" - ''; - - temp_status = pkgs.writeScript "temp_status.sh" '' - #!/bin/sh - - export PATH="$PATH:${gawk}/bin:${acpi}/bin:${coreutils}/bin:${gnugrep}/bin:${calc}/bin" - - temp=$(acpi -t | awk '{print $4}' | calc -p) - echo "$temp " - ''; - - brightness_status = pkgs.writeScript "brightness_status.sh" '' - #!/bin/sh - - brightness=$(${pkgs.acpilight}/bin/xbacklight -get) - echo "$brightness% " - ''; - - battery_status = with pkgs; pkgs.writeScript "battery_status.bash" '' - #!${pkgs.bash}/bin/bash - export PATH="$PATH:${gawk}/bin:${acpi}/bin:${coreutils}/bin:${gnugrep}/bin:${calc}/bin" - - get_battery_charging_status() { - if [ "$(acpi -b | grep Discharging)" != "" ]; then - echo "Discharging"; - else - echo "Charging"; - fi - } - declare -a capacity_arr - capacity_arr=( -  -  -  -  -  - ) - - # get charge of all batteries, combine them - total_charge=$(acpi -b | awk '{print $4}' | grep -Eo "[0-9]+" | paste -sd+ | calc -p); - - # get amount of batteries in the device - battery_number=$(acpi -b | wc -l); - percent=$((total_charge / battery_number)); - index=$((percent / ( 100 / ''${#capacity_arr[@]}) )) - - if [ "$(get_battery_charging_status)" == "Charging" ]; then - echo "$percent% " - else - echo "$percent% ''${capacity_arr[$index]}" - fi - ''; - - random-wallpaper = pkgs.writeScript "random-wallpaper.sh" '' - #!/bin/sh - file=$(find ${config.wallpapers} -type f -print0 | shuf -z -n 1) - ${pkgs.feh}/bin/feh --bg-scale "$file" - ''; - - reload_layout = pkgs.writeScript "reload_layout.sh" '' - #!/bin/sh - pkill gnome-terminal - - i3-msg append_layout ${shell_layout} - - for i in {1..16} - do - gnome-terminal & - done - ''; - - single_shell_spawn = pkgs.writeScript "single_shell_spawn.sh" '' - #!/bin/sh - - i3-msg focus parent - i3-msg append_layout ${single_shell} - for i in {1..2} - do - gnome-terminal - done - sleep 0.3 - i3-msg focus parent - ''; - - single_shell = pkgs.writeText "single-shell.json" '' -{ - "border": "pixel", - "floating": "auto_off", - "layout": "tabbed", - "percent": 1, - "type": "con", - "nodes": [ - { - "border": "pixel", - "floating": "auto_off", - "layout": "splith", - "percent": 1, - "type": "con", - "nodes": [ - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 0.5, - "type": "con", - "nodes": [ - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - }, - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - } - ] - } - ] - } - ] -} - ''; - - shell_layout = pkgs.writeText "shell-layout.json" '' - { - "border": "pixel", - "floating": "auto_off", - "layout": "tabbed", - "percent": 1, - "type": "con", - "nodes": [ - { - "border": "pixel", - "floating": "auto_off", - "layout": "splith", - "percent": 1, - "type": "con", - "nodes": [ - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 0.5, - "type": "con", - "nodes": [ - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - }, - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - } - ] - }, - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 0.5, - "type": "con", - "nodes": [ - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 1, - "type": "con", - "nodes": [ - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - }, - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - } - ] - } - ] - } - ] - }, - - { - "border": "pixel", - "floating": "auto_off", - "layout": "splith", - "percent": 1, - "type": "con", - "nodes": [ - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 0.5, - "type": "con", - "nodes": [ - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - }, - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - } - ] - }, - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 0.5, - "type": "con", - "nodes": [ - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 1, - "type": "con", - "nodes": [ - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - }, - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - } - ] - } - ] - } - ] - }, - - { - "border": "pixel", - "floating": "auto_off", - "layout": "splith", - "percent": 1, - "type": "con", - "nodes": [ - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 0.5, - "type": "con", - "nodes": [ - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - }, - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - } - ] - }, - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 0.5, - "type": "con", - "nodes": [ - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 1, - "type": "con", - "nodes": [ - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - }, - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - } - ] - } - ] - } - ] - }, - - - { - "border": "pixel", - "floating": "auto_off", - "layout": "splith", - "percent": 1, - "type": "con", - "nodes": [ - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 0.5, - "type": "con", - "nodes": [ - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - }, - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - } - ] - }, - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 0.5, - "type": "con", - "nodes": [ - { - "border": "pixel", - "floating": "auto_off", - "layout": "splitv", - "percent": 1, - "type": "con", - "nodes": [ - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - }, - { - "border": "pixel", - - "floating": "auto_off", - "geometry": { - "height": 434, - "width": 722, - "x": 0, - "y": 0 - }, - "percent": 0.5, - "swallows": [ - { - "class": "^Gnome\\-terminal$", - "instance": "^gnome\\-terminal\\-server$" - } - ], - "type": "con" - } - ] - } - ] - } - ] - } - ] - } - ''; - - - i3_conf_file = pkgs.writeText "config" '' - # This file has been auto-generated by i3-config-wizard(1). - # It will not be overwritten, so edit it as you like. - # - # Should you change your keyboard layout some time, delete - # this file and re-run i3-config-wizard(1). - # - - # i3 config file (v4) - # - # Please see https://i3wm.org/docs/userguide.html for a complete reference! - - set $mod Mod4 - - ####################### - # # - # LOOKS # - # # - ####################### - # Font for window titles. Will also be used by the bar unless a different font - # is used in the bar {} block below. - font pango:Monospace 20, Icons 10 - hide_edge_borders smart - new_window pixel 1 - new_float normal - - # Lockscreen shortcut - bindsym $mod+l exec xscreensaver-command -l - - # start a terminal - bindsym $mod+Return exec gnome-terminal - - - # class border backgr. text indicator child_border - client.focused #4fceea #285577 #ffffff #2e9ef4 #285577 - client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a - client.unfocused #333333 #222222 #888888 #292d2e #222222 - - # Size of border - default_border pixel 2 - - ####################### - # # - # DEFAULT CONFIG # - # # - ####################### - floating_modifier $mod - workspace_layout stacked - default_orientation vertical - - # Kill focused window - bindsym $mod+Shift+q kill - - # start dmenu (a program launcher) - bindsym $mod+d exec ${pkgs.rofi}/bin/rofi -modi drun#run -combi-modi drun#run -show combi -show-icons -display-combi run -theme /etc/nixos/resources/gruvbox-dark-soft.rasi - - # Switch windows - bindsym $mod+x exec ${pkgs.rofi}/bin/rofi -modi window -show window -auto-select -theme /etc/nixos/resources/gruvbox-dark-soft.rasi - - # Arrow keys for focus navigation - bindsym $mod+Left focus left - bindsym $mod+Down focus down - bindsym $mod+Up focus up - bindsym $mod+Right focus right - - # Move focused window - bindsym $mod+Shift+j move left - bindsym $mod+Shift+k move down - bindsym $mod+Shift+l move up - bindsym $mod+Shift+odiaeresis move right - - # Arrow keys for focused window movement - bindsym $mod+Shift+Left move left - bindsym $mod+Shift+Down move down - bindsym $mod+Shift+Up move up - bindsym $mod+Shift+Right move right - - # Split in horizontal orientation - bindsym $mod+h split h - - # Split in vertical orientation - bindsym $mod+v split v - - # Enter fullscreen mode for the focused container - bindsym $mod+f fullscreen toggle - - # Change container layout (stacked, tabbed, toggle split) - bindsym $mod+s layout stacking - bindsym $mod+w layout tabbed - bindsym $mod+e layout toggle split - - # Toggle tiling / floating - bindsym $mod+Shift+space floating toggle - - # Change focus between tiling / floating windows - bindsym $mod+space focus mode_toggle - - # Focus the parent container - bindsym $mod+a focus parent - - # Reload the configuration file - bindsym $mod+Shift+c reload - - # Restart i3 inplace (preserves your layout/session, can be used to upgrade i3) - bindsym $mod+Shift+r restart - - # Exit i3 (logs you out of your X session) - bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" - - # Resize window. You can also use the mouse for that - mode "resize" { - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym a resize shrink width 10 px or 10 ppt - bindsym s resize grow height 10 px or 10 ppt - bindsym w resize shrink height 10 px or 10 ppt - bindsym d resize grow width 10 px or 10 ppt - - # same bindings, but for the arrow keys - bindsym Left resize shrink width 10 px or 10 ppt - bindsym Down resize grow height 10 px or 10 ppt - bindsym Up resize shrink height 10 px or 10 ppt - bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" - } - - # Enable floating - for_window [class="usbguard-applet-qt"] floating enable - for_window [class="Nm-connection-editor"] floating enable - for_window [class="Gnome-disks"] floating enable - for_window [class="QtPass" title="QtPass"] move scratchpad - - # Make the currently focused window a scratchpad - bindsym $mod+Shift+minus move scratchpad - - # Show the first scratchpad window - bindsym $mod+minus scratchpad show - - # Show the sup-mail scratchpad window, if any. - bindsym $mod+Shift+s [class="QtPass" title="QtPass"] scratchpad show - - ####################### - # # - # WORKSPACES # - # # - ####################### - # Variables - set $workspace1 "1: " - set $workspace2 "2: " - set $workspace3 "3: " - set $workspace4 "4: " - set $workspace5 "5: " - set $workspace6 "6: " - set $workspace7 "7" - set $workspace8 "8" - set $workspace9 "9" - set $workspace10 "10" - - assign [class="quassel"] $workspace3 - assign [class="Firefox"] $workspace2 - assign [class="Daily"] $workspace5 - - assign [class="VirtualBox Manager"] $workspace4 - assign [class="Virt-manager" title="Virtual Machine Manager"] $workspace4 - - assign [class="libreoffice"] $workspace6 - assign [class="Eclipse"] $workspace6 - - # Workspace lateral movement - bindsym $mod+Next workspace next - bindsym $mod+Prior workspace prev - - # Switch to workspace - bindsym $mod+1 workspace $workspace1 - bindsym $mod+2 workspace $workspace2 - bindsym $mod+3 workspace $workspace3 - bindsym $mod+4 workspace $workspace4 - bindsym $mod+5 workspace $workspace5 - bindsym $mod+6 workspace $workspace6 - bindsym $mod+7 workspace $workspace7 - bindsym $mod+8 workspace $workspace8 - bindsym $mod+9 workspace $workspace9 - bindsym $mod+0 workspace $workspace10 - - # Move workspace to other monitor - bindsym $mod+Shift+Next move workspace to output right - bindsym $mod+Shift+Prior move workspace to output left - - # move focused container to workspace - bindsym $mod+Shift+1 move container to workspace $workspace1 - bindsym $mod+Shift+2 move container to workspace $workspace2 - bindsym $mod+Shift+3 move container to workspace $workspace3 - bindsym $mod+Shift+4 move container to workspace $workspace4 - bindsym $mod+Shift+5 move container to workspace $workspace5 - bindsym $mod+Shift+6 move container to workspace $workspace6 - bindsym $mod+Shift+7 move container to workspace $workspace7 - bindsym $mod+Shift+8 move container to workspace $workspace8 - bindsym $mod+Shift+9 move container to workspace $workspace9 - bindsym $mod+Shift+0 move container to workspace $workspace10 - - - ####################### - # # - # FUNCTION KEYS # - # # - ####################### - # Backlight controls - bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight +10 - bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -10 - - # Pulse Audio controls - bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume - bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume - bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound - bindsym XF86AudioMicMute exec --no-startup-id amixer set Capture toggle - - ####################### - # # - # CONVENIENCE KEYS # - # # - ####################### - bindsym Shift+Alt+3 exec screenshot - - ####################### - # # - # WINDOW LAYOUT # - # # - ####################### - bindsym XF86LaunchA exec --no-startup-id ${reload_layout} - bindsym XF86Explorer exec --no-startup-id ${single_shell_spawn} - bindsym Shift+F11 exec --no-startup-id ${reload_layout} - bindsym Shift+F12 exec --no-startup-id ${single_shell_spawn} - - - bar { - status_command ${i3_status_script} - mode dock - position top - tray_output none - - font pango:monospace 14 - - # Scrolling on bar changes volume - bindsym button4 exec --no-startup-id pactl set-sink-volume 0 +5% - bindsym button5 exec --no-startup-id pactl set-sink-volume 0 +-5% - - # Right mouse click mutes the volume - bindsym button3 exec --no-startup-id pactl set-sink-mute 0 toggle - - - colors { - background #ffffff00 - statusline #ffe066 - - inactive_workspace #ffffff00 #ffffff00 #ffe066 - active_workspace #ffffff00 #ffffff00 #3f3f3f - urgent_workspace #ffffff00 #ffffff00 #ff8533 - } - } - - ####################### - # # - # AUTORUNS # - # # - ####################### - ## Start 16 gnome shells - exec i3-msg 'workspace $workspace1;' && ${reload_layout} - - # Start firefox - exec --no-startup-id ${pkgs.firefox}/bin/firefox --ProfileManager --new-instance --setDefaultBrowser - - # Quassel client - exec --no-startup-id ${pkgs.quasselClient}/bin/quasselclient - - # Random wallpaper - exec_always--no-startup-id ${random-wallpaper} - - # Start Qt-Pass - exec ${pkgs.qtpass}/bin/qtpass - ''; - -in { - services.xserver.enable = true; - services.xserver.layout = "de"; - - # Enable i3 Window Manager - services.xserver.windowManager.i3 = { - enable = true; - package = pkgs.i3; - configFile = i3_conf_file; - extraSessionCommands = '' - ${pkgs.openssh}/bin/ssh-add ${config.mainUserHome}/.ssh/id_rsa - ''; - }; - - # ${pkgs.xorg.xhost}/bin/xhost +SI:localuser:${cfg.user.name} - # ${pkgs.xorg.xhost}/bin/xhost -LOCAL: - services.xserver.windowManager.default = "i3"; - services.xserver.desktopManager.xterm.enable = false; - - # Enable the X11 windowing system. - services.xserver.displayManager.lightdm = { - enable = true; - autoLogin.enable = true; - autoLogin.user = config.mainUser; - autoLogin.timeout = 2; - greeter.enable = true; - }; - - fonts = { - fonts = with pkgs; [ - font-awesome_5 - ]; - }; - - # Allow users in video group to change brightness - hardware.brightnessctl.enable = true; - - environment.systemPackages = with pkgs; [ - rofi # Dmenu replacement - acpilight # Replacement for xbacklight - arandr # Xrandr gui - feh - wirelesstools # To get wireless statistics - acpi - xorg.xhost - xorg.xauth - ]; - -} From 3899d0195c6077174e2d416c490dfae8783acee5 Mon Sep 17 00:00:00 2001 From: jeschli Date: Wed, 8 May 2019 08:29:14 +0200 Subject: [PATCH 16/23] j brauerei: add xdotool for select last window hack in i3 --- jeschli/1systems/brauerei/config.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index 55b28c3e8..0deaded66 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -53,6 +53,7 @@ in curl dmenu rofi + xdotool git gnupg i3lock From 10ff96638dbfabab63bdf4c795777df395c36bec Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 18 May 2019 18:22:50 +0200 Subject: [PATCH 17/23] j brauerei: add home-manager --- jeschli/1systems/brauerei/config.nix | 22 ++++++++++++++++++++-- jeschli/krops.nix | 6 ++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/jeschli/1systems/brauerei/config.nix b/jeschli/1systems/brauerei/config.nix index 0deaded66..059ec6d71 100644 --- a/jeschli/1systems/brauerei/config.nix +++ b/jeschli/1systems/brauerei/config.nix @@ -7,11 +7,11 @@ in imports = [ ./hardware-configuration.nix + - ]; - + ]; krebs.build.host = config.krebs.hosts.brauerei; # Use the GRUB 2 boot loader. boot.loader.grub.enable = true; @@ -122,6 +122,24 @@ in # programs.mtr.enable = true; programs.gnupg.agent = { enable = true; enableSSHSupport = true; }; + home-manager.useUserPackages = true; + home-manager.users.jeschli = { + home.stateVersion = "19.03"; + }; +# home-manager.enable = true; + + home-manager.users.jeschli.home.file = { + ".emacs.d" = { + source = pkgs.fetchFromGitHub { + owner = "jeschli"; + repo = "emacs.d"; + rev = "8ed6c40"; + sha256 = "1q2y478srwp9f58l8cixnd2wj51909gp1z68k8pjlbjy2mrvibs0"; + }; + recursive = true; + }; + }; + # List services that you want to enable: # Enable the OpenSSH daemon. diff --git a/jeschli/krops.nix b/jeschli/krops.nix index dbf94bd0d..f3964a553 100644 --- a/jeschli/krops.nix +++ b/jeschli/krops.nix @@ -15,6 +15,12 @@ file = "${lib.getEnv "HOME"}/secrets/${name}"; }; } + { + home-manager.git = { + url = https://github.com/rycee/home-manager; + ref = "2ccbf43"; + }; + } ]; in { From 3b1e24235e8ce7f11bd885d4beba4edeb0645b7d Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 18 May 2019 16:24:22 +0000 Subject: [PATCH 18/23] j bolide: update to i3 --- jeschli/1systems/bolide/config.nix | 49 ++++++++++--------- .../bolide/hardware-configuration.nix | 1 + 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/jeschli/1systems/bolide/config.nix b/jeschli/1systems/bolide/config.nix index 699a85b58..748a9d7c5 100644 --- a/jeschli/1systems/bolide/config.nix +++ b/jeschli/1systems/bolide/config.nix @@ -2,13 +2,14 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: - +{ config, pkgs, lib, ... }: { imports = [ ./hardware-configuration.nix + # + # ]; @@ -29,7 +30,8 @@ allowDiscards = true; } ]; # networking.hostName = "bolide"; # Define your hostname. - networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. +# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.networkmanager.enable = true; # Select internationalisation properties. # i18n = { @@ -103,36 +105,37 @@ # Enable the OpenSSH daemon. services.openssh.enable = true; - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - # Enable CUPS to print documents. - # services.printing.enable = true; + services.xserver = { - # Enable the X11 windowing system. - services.xserver.enable = true; - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = "eurosign:e"; + enable = true; - services.xserver.displayManager.sddm.enable = true; - services.xserver.windowManager.xmonad.enable = true; - services.xserver.windowManager.xmonad.enableContribAndExtras = true; - # Enable touchpad support. - # services.xserver.libinput.enable = true; + desktopManager = { + xfce.enable = true; + gnome3.enable = true; + }; +# # Don't install feh into systemPackages +# # refs +# desktopManager.session = lib.mkForce []; +# +# enable = true; +# display = 11; +# tty = 11; +# +# dpi = 96; - # Enable the KDE Desktop Environment. - # services.xserver.displayManager.sddm.enable = true; - # services.xserver.desktopManager.plasma5.enable = true; + videoDrivers = [ "nvidia" ]; + }; + + services.xserver.windowManager.i3.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. users.extraUsers.jeschli = { isNormalUser = true; + extraGroups = ["docker" "vboxusers" "audio"]; uid = 1000; }; + hardware.pulseaudio.enable = true; # This value determines the NixOS release with which your system is to be # compatible, in order to avoid breaking some software such as database # servers. You should change this only after NixOS release notes say you diff --git a/jeschli/1systems/bolide/hardware-configuration.nix b/jeschli/1systems/bolide/hardware-configuration.nix index 183b29e42..042b746ef 100644 --- a/jeschli/1systems/bolide/hardware-configuration.nix +++ b/jeschli/1systems/bolide/hardware-configuration.nix @@ -29,4 +29,5 @@ nix.maxJobs = lib.mkDefault 8; powerManagement.cpuFreqGovernor = "powersave"; + hardware.pulseaudio.enable = true; } From 252c5bd49b08bef4fe0c9a5413ebd53594224d49 Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 18 May 2019 18:31:51 +0200 Subject: [PATCH 19/23] j enklave: add jeschli-bolide to write --- jeschli/2configs/git.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jeschli/2configs/git.nix b/jeschli/2configs/git.nix index a26022789..faa8ccf5b 100644 --- a/jeschli/2configs/git.nix +++ b/jeschli/2configs/git.nix @@ -60,7 +60,7 @@ let with git // config.krebs.users; repo: singleton { - user = [ jeschli jeschli-brauerei]; + user = [ jeschli jeschli-brauerei jeschli-bolide]; repo = [ repo ]; perm = push "refs/*" [ non-fast-forward create delete merge ]; } ++ From c8795f6cf870e1e0c0bccc4012290943d114c213 Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 18 May 2019 18:34:26 +0200 Subject: [PATCH 20/23] j: add home-manager config --- jeschli/2configs/home-manager/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 jeschli/2configs/home-manager/default.nix diff --git a/jeschli/2configs/home-manager/default.nix b/jeschli/2configs/home-manager/default.nix new file mode 100644 index 000000000..ad8663d58 --- /dev/null +++ b/jeschli/2configs/home-manager/default.nix @@ -0,0 +1,9 @@ +{ + imports = [ + + ]; + home-manager.useUserPackages = true; + home-manager.users.jeschli = { + home.stateVersion = "19.03"; + }; +} From dd8cb1bffbd9f3d33dcca643fbe1eb69f334e4a9 Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 18 May 2019 18:48:43 +0000 Subject: [PATCH 21/23] j bolide: home-manager binary --- jeschli/1systems/bolide/config.nix | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/jeschli/1systems/bolide/config.nix b/jeschli/1systems/bolide/config.nix index 748a9d7c5..a9f564f75 100644 --- a/jeschli/1systems/bolide/config.nix +++ b/jeschli/1systems/bolide/config.nix @@ -8,10 +8,9 @@ [ ./hardware-configuration.nix - # - # + - + # ]; krebs.build.host = config.krebs.hosts.bolide; @@ -54,6 +53,8 @@ }; nixpkgs.config.allowUnfree = true; environment.systemPackages = with pkgs; [ + home-manager + wget vim # system helper ag @@ -94,6 +95,22 @@ zathura ]; + home-manager.useUserPackages = true; + home-manager.users.jeschli = { + home.stateVersion = "19.03"; + }; + + home-manager.users.jeschli.home.file = { + ".emacs.d" = { + source = pkgs.fetchFromGitHub { + owner = "jeschli"; + repo = "emacs.d"; + rev = "8ed6c40"; + sha256 = "1q2y478srwp9f58l8cixnd2wj51909gp1z68k8pjlbjy2mrvibs0"; + }; + recursive = true; + }; + }; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.bash.enableCompletion = true; From 78bade2c387a76b55066027396966f4c5bf4307a Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 18 May 2019 18:49:57 +0000 Subject: [PATCH 22/23] j bolide: add home.nix --- jeschli/1systems/bolide/home.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 jeschli/1systems/bolide/home.nix diff --git a/jeschli/1systems/bolide/home.nix b/jeschli/1systems/bolide/home.nix new file mode 100644 index 000000000..cd84ab3fb --- /dev/null +++ b/jeschli/1systems/bolide/home.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: + +{ + home.file = { + ".emacs.d" = { + source = pkgs.fetchFromGitHub { + owner = "jeschli"; + repo = "emacs.d"; + rev = "8ed6c40"; + sha256 = "1q2y478srwp9f58l8cixnd2wj51909gp1z68k8pjlbjy2mrvibs0"; + }; + recursive = true; + }; + ".config/i3/config".text = '' + ''; + }; + +} From 8a44f7f8c8ffa4c47c723b7de647653e980cd6c8 Mon Sep 17 00:00:00 2001 From: jeschli Date: Sat, 18 May 2019 20:55:09 +0200 Subject: [PATCH 23/23] j bolide: add i3 to home.nix --- jeschli/1systems/bolide/home.nix | 153 +++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) diff --git a/jeschli/1systems/bolide/home.nix b/jeschli/1systems/bolide/home.nix index cd84ab3fb..60fee8b67 100644 --- a/jeschli/1systems/bolide/home.nix +++ b/jeschli/1systems/bolide/home.nix @@ -12,6 +12,159 @@ recursive = true; }; ".config/i3/config".text = '' + +set $mod Mod4 + +font pango:monospace 8 + +floating_modifier $mod + +bindsym $mod+Return exec i3-sensible-terminal + +bindsym $mod+Shift+q kill + +bindsym $mod+d exec rofi -modi drun#run -combi-modi drun#run -show combi -show-icons -display-combi run + +bindsym $mod+x exec rofi -modi window -show window -auto-select + +# switch to last used window +bindsym $mod+Tab exec rofi -show window& sleep 0.15 && xdotool key Down + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+l focus up +bindsym $mod+semicolon focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# Resizing windows by 10 in i3 using keyboard only +bindsym $mod+Ctrl+Shift+Right resize shrink width 10 px or 10 ppt +bindsym $mod+Ctrl+Shift+Up resize grow height 10 px or 10 ppt +bindsym $mod+Ctrl+Shift+Down resize shrink height 10 px or 10 ppt +bindsym $mod+Ctrl+Shift+Left resize grow width 10 px or 10 ppt + +# move focused window +bindsym $mod+Shift+j move left +bindsym $mod+Shift+k move down +bindsym $mod+Shift+l move up +bindsym $mod+Shift+semicolon move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace $ws1 +bindsym $mod+2 workspace $ws2 +bindsym $mod+3 workspace $ws3 +bindsym $mod+4 workspace $ws4 +bindsym $mod+5 workspace $ws5 +bindsym $mod+6 workspace $ws6 +bindsym $mod+7 workspace $ws7 +bindsym $mod+8 workspace $ws8 +bindsym $mod+9 workspace $ws9 +bindsym $mod+0 workspace $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3 +bindsym $mod+Shift+4 move container to workspace $ws4 +bindsym $mod+Shift+5 move container to workspace $ws5 +bindsym $mod+Shift+6 move container to workspace $ws6 +bindsym $mod+Shift+7 move container to workspace $ws7 +bindsym $mod+Shift+8 move container to workspace $ws8 +bindsym $mod+Shift+9 move container to workspace $ws9 +bindsym $mod+Shift+0 move container to workspace $ws10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" + +bindsym $mod+p exec i3-sensible-pager + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + position top + status_command i3status +} ''; };