From 0117d6fc6b3460cd83ab3f475559adbca46fffc2 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Sun, 30 Jun 2019 08:40:27 +0200 Subject: [PATCH 01/15] nix/os/devices/steveej-t480s-work: bump versions --- nix/os/devices/steveej-t480s-work/versions.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix/os/devices/steveej-t480s-work/versions.nix b/nix/os/devices/steveej-t480s-work/versions.nix index 0d93e08..cea319c 100644 --- a/nix/os/devices/steveej-t480s-work/versions.nix +++ b/nix/os/devices/steveej-t480s-work/versions.nix @@ -1,20 +1,20 @@ { channelsNixosStable = { ref = "nixos-19.03"; - rev = "1601f559e89ba71091faa26888711d4dd24c2d4d"; + rev = "2516c454c35344d551420fb74541371c6bfcc5e9"; }; channelsNixosUnstable = { ref = "nixos-unstable"; - rev = "7815c86c104a99417db844791dcda34fe7a7965f"; + rev = "20b993ef2c9e818a636582ade9597f71a485209d"; }; nixpkgsMaster = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "aa2f3eb8b102ffed4258a7e7fbc0a7d17b7ba319"; + rev = "147422082327a03f2a2d29e062077217a1218559"; }; homeManagerModule = { url = "https://github.com/rycee/home-manager"; ref = "master"; - rev = "cf0aad391c10473fa7613dcc41b1f6a366d03148"; + rev = "8467e7e10a6f4a8968710b1a8e1826cae29834b7"; }; } From 9a9de79d605a5423f5c3430e70b056fef0d75864 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Sun, 30 Jun 2019 20:16:17 +0200 Subject: [PATCH 02/15] Justfile: display keyboard shortcut for xephyr --- Justfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Justfile b/Justfile index de2e276..4e1a4a1 100755 --- a/Justfile +++ b/Justfile @@ -147,6 +147,7 @@ hm-iterate-qtile: XEPHYR_PID=$! echo ${XEPHYR_PID} DISPLAY=:1 $(grep qtile ~/.xsession) & + echo "Xephyr started. un-/grab the mouse with Ctrl + Shift-L" wait $! kill ${XEPHYR_PID} From 49e89d1e8c9fd9d4c04bfe561264d836d5470d6b Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Thu, 4 Jul 2019 17:13:11 +0200 Subject: [PATCH 03/15] nix/os/devices/steveej-t480s-work: bump versions --- nix/os/devices/steveej-t480s-work/versions.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix/os/devices/steveej-t480s-work/versions.nix b/nix/os/devices/steveej-t480s-work/versions.nix index cea319c..337e3f1 100644 --- a/nix/os/devices/steveej-t480s-work/versions.nix +++ b/nix/os/devices/steveej-t480s-work/versions.nix @@ -1,20 +1,20 @@ { channelsNixosStable = { ref = "nixos-19.03"; - rev = "2516c454c35344d551420fb74541371c6bfcc5e9"; + rev = "8edf24a379ef596e6a06c139fd5f38f83fbca0bb"; }; channelsNixosUnstable = { ref = "nixos-unstable"; - rev = "20b993ef2c9e818a636582ade9597f71a485209d"; + rev = "73392e79aa62e406683d6a732eb4f4101f4732be"; }; nixpkgsMaster = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "147422082327a03f2a2d29e062077217a1218559"; + rev = "2ebeba49276b4a0e7764ad65f33a0572ff4f1963"; }; homeManagerModule = { url = "https://github.com/rycee/home-manager"; ref = "master"; - rev = "8467e7e10a6f4a8968710b1a8e1826cae29834b7"; + rev = "95382060ebaa19ec49a861921216b1db8460b314"; }; } From 4428c889133f3fabd7bade3cf7ea295c8a777151 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 5 Jul 2019 12:08:07 +0200 Subject: [PATCH 04/15] nix/os/devices/steveej-t480s-work: bump versions --- nix/os/devices/steveej-t480s-work/versions.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/os/devices/steveej-t480s-work/versions.nix b/nix/os/devices/steveej-t480s-work/versions.nix index 337e3f1..6d94e8b 100644 --- a/nix/os/devices/steveej-t480s-work/versions.nix +++ b/nix/os/devices/steveej-t480s-work/versions.nix @@ -1,7 +1,7 @@ { channelsNixosStable = { ref = "nixos-19.03"; - rev = "8edf24a379ef596e6a06c139fd5f38f83fbca0bb"; + rev = "aef662d2eb532eeb9976068fd1705e3cf3663054"; }; channelsNixosUnstable = { ref = "nixos-unstable"; @@ -10,7 +10,7 @@ nixpkgsMaster = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "2ebeba49276b4a0e7764ad65f33a0572ff4f1963"; + rev = "51aa3cc4855c5964a6e71adcf7b79c1a0c23f322"; }; homeManagerModule = { url = "https://github.com/rycee/home-manager"; From a4836f367519aec414cb2ca57bc3a13d8d35dba4 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 12 Jul 2019 20:01:11 +0200 Subject: [PATCH 05/15] zsh: display unterminated lines --- nix/home-manager/profiles/qtile-desktop.nix | 9 ++++----- nix/home-manager/programs/zsh.nix | 5 +++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/nix/home-manager/profiles/qtile-desktop.nix b/nix/home-manager/profiles/qtile-desktop.nix index 1301da0..e1c31b3 100644 --- a/nix/home-manager/profiles/qtile-desktop.nix +++ b/nix/home-manager/profiles/qtile-desktop.nix @@ -31,9 +31,8 @@ let exit 1 ;; esac - ''; - terminal = "${pkgs.gnome3.gnome_terminal}/bin/gnome-terminal"; + ''; qtileConfig = pkgs.writeScript "qtile_config.py" '' from libqtile.config import Key, Screen, Group, Drag, Click @@ -98,9 +97,9 @@ key_control = "control" keys = [ # https://github.com/qtile/qtile/blob/develop/libqtile/xkeysyms.py - Key([key_super], "Return", lazy.spawn("${terminal}")), - Key([key_super], "backslash", lazy.spawn("${terminal}")), - Key([key_super], "apostrophe", lazy.spawn("${terminal}")), + Key([key_super], "Return", lazy.spawn("${pkgs.roxterm}/bin/roxterm")), + Key([key_super], "backslash", lazy.spawn("${pkgs.roxterm}/bin/roxterm")), + Key([key_super], "apostrophe", lazy.spawn("${pkgs.roxterm}/bin/roxterm")), Key([key_super], "r", lazy.spawncmd()), Key([key_super], "w", lazy.window.kill()), diff --git a/nix/home-manager/programs/zsh.nix b/nix/home-manager/programs/zsh.nix index 330d949..3d28c38 100644 --- a/nix/home-manager/programs/zsh.nix +++ b/nix/home-manager/programs/zsh.nix @@ -39,6 +39,11 @@ in { unsetopt AUTO_CD source ${channelSources} + + # print lines without termination + setopt PROMPT_CR + setopt PROMPT_SP + export PROMPT_EOL_MARK="" ''; sessionVariables = { From bc95aafeea0bc4f243f4d5245f19e0148567abc0 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 12 Jul 2019 20:13:49 +0200 Subject: [PATCH 06/15] zsh: replace newline with variable containing a newline --- nix/home-manager/programs/zsh.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nix/home-manager/programs/zsh.nix b/nix/home-manager/programs/zsh.nix index 3d28c38..ba9e22e 100644 --- a/nix/home-manager/programs/zsh.nix +++ b/nix/home-manager/programs/zsh.nix @@ -15,8 +15,7 @@ in { enableCompletion = false; enableAutosuggestions = true; initExtra = '' - PROMPT='%F{%(!.red.green)}%n%f@%m %(?.%F{green}✓%f.%F{red}✗ ($?%))%f %F{blue}%~%f %F{magenta}$(git_prompt_info)%f -%_%F{%(!.red.green)}$(prompt_char)%f ' + PROMPT='%F{%(!.red.green)}%n%f@%m %(?.%F{green}✓%f.%F{red}✗ ($?%))%f %F{blue}%~%f %F{magenta}$(git_prompt_info)%f$prompt_newline%_%F{%(!.red.green)}$(prompt_char)%f ' RPROMPT="" # Automatic rehash From bdd9d56ba14eb8c10fba6ab1cc0aba8685a2c50d Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 12 Jul 2019 20:18:17 +0200 Subject: [PATCH 07/15] zsh: update manually packaged plugins --- nix/home-manager/programs/zsh.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix/home-manager/programs/zsh.nix b/nix/home-manager/programs/zsh.nix index ba9e22e..c94a277 100644 --- a/nix/home-manager/programs/zsh.nix +++ b/nix/home-manager/programs/zsh.nix @@ -56,8 +56,8 @@ in { src = pkgs.fetchFromGitHub { owner = "zsh-users"; repo = "zsh-autosuggestions"; - rev = "v0.4.0"; - sha256 = "0z6i9wjjklb4lvr7zjhbphibsyx51psv50gm07mbb0kj9058j6kc"; + rev = "v0.6.3"; + sha256 = "1smskx9vkx78yhwspjq2c5r5swh9fc5xxa40ib4753f00wk4dwpp"; }; } { @@ -66,8 +66,8 @@ in { src = pkgs.fetchFromGitHub { owner = "b4b4r07"; repo = "enhancd"; - rev = "v2.2.1"; - sha256 = "0iqa9j09fwm6nj5rpip87x3hnvbbz9w9ajgm6wkrd5fls8fn8i5g"; + rev = "v2.2.4"; + sha256 = "1smskx9vkx78yhwspjq2c5r5swh9fc5xxa40ib4753f00wk4dwpp"; }; } { From 2f5c911da4863258224d4f9c180733d155d3e5e7 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Wed, 17 Jul 2019 09:45:57 +0200 Subject: [PATCH 08/15] shell: add alacritty and xwininfo --- shell.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shell.nix b/shell.nix index 999eba0..ed7bde4 100644 --- a/shell.nix +++ b/shell.nix @@ -20,6 +20,12 @@ stdenv.mkDerivation { imagemagick esh + + xorg.xwininfo + + + # testing + alacritty ]; # Set Environment Variables From 8ce1ea2e9dd1fed0eb0b83a55daf95cb5f3940ed Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Wed, 17 Jul 2019 09:46:38 +0200 Subject: [PATCH 09/15] Justfile: add commands to switch yubikey --- Justfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Justfile b/Justfile index 4e1a4a1..6d13ff7 100755 --- a/Justfile +++ b/Justfile @@ -241,3 +241,17 @@ run-with-channels +cmds: #!/usr/bin/env bash source $(just -v _get_nix_path {{invocation_directory()}}/nix/variables/versions.nix) {{cmds}} + +# Switch between yubikeys which have a copy of the same key +switch-yubikey: + #!/usr/bin/env bash + # See https://github.com/drduh/YubiKey-Guide/issues/19 + set -xe + KEY_ID=$(gpg --card-status | rg sec | rg -o '[0-9A-Z]{16}') + gpg --delete-secret-and-public-keys $KEY_ID + gpg2 --edit-card <<-EOF + fetch + quit + EOF + gpg-connect-agent "scd serialno" "learn --force" /bye + gpg --card-status From e3e0859ee606fc530abd25d8c2aea95d027e2d88 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Wed, 17 Jul 2019 09:47:27 +0200 Subject: [PATCH 10/15] svc/home-ch/router-wan.lan: add post-setup script recipe --- services/ffld/router-wan.lan/Justfile | 2 -- services/ffld/router-wan.lan/hosts | 1 - .../ffld/router-wan.lan/openwrt-post-setup.yaml | 13 ------------- services/home-ch/router-wan.lan/Justfile | 8 ++++++++ 4 files changed, 8 insertions(+), 16 deletions(-) delete mode 100644 services/ffld/router-wan.lan/Justfile delete mode 100644 services/ffld/router-wan.lan/hosts delete mode 100644 services/ffld/router-wan.lan/openwrt-post-setup.yaml create mode 100644 services/home-ch/router-wan.lan/Justfile diff --git a/services/ffld/router-wan.lan/Justfile b/services/ffld/router-wan.lan/Justfile deleted file mode 100644 index 322435d..0000000 --- a/services/ffld/router-wan.lan/Justfile +++ /dev/null @@ -1,2 +0,0 @@ -post-setup: - ansible-playbook -i hosts openwrt-post-setup.yaml --verbose diff --git a/services/ffld/router-wan.lan/hosts b/services/ffld/router-wan.lan/hosts deleted file mode 100644 index d31ee02..0000000 --- a/services/ffld/router-wan.lan/hosts +++ /dev/null @@ -1 +0,0 @@ -router-wan.lan ansible_ssh_user=root diff --git a/services/ffld/router-wan.lan/openwrt-post-setup.yaml b/services/ffld/router-wan.lan/openwrt-post-setup.yaml deleted file mode 100644 index 45d89be..0000000 --- a/services/ffld/router-wan.lan/openwrt-post-setup.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# * https://openwrt.org/docs/guide-user/services/nas/usb-storage-samba-webinterface - -- hosts: router-wan.lan - gather_facts: no - tasks: - - name: udpate pkg database - raw: opkg update - - name: install packages - raw: opkg install {{ item }} - loop: - - luci-ssl - - luci-app-samba samba36-server - - block-mount blockd kmod-fs-vmod kmod-fs-vfat kmod-usb-storage usbutils diff --git a/services/home-ch/router-wan.lan/Justfile b/services/home-ch/router-wan.lan/Justfile new file mode 100644 index 0000000..79a278a --- /dev/null +++ b/services/home-ch/router-wan.lan/Justfile @@ -0,0 +1,8 @@ +_run_ssh_cmd cmd: + ssh root@router-wan.lan "{{cmd}}" + +post-setup: + just -v _run_ssh_cmd "opkg update" + just -v _run_ssh_cmd "opkg install luci-ssl" + just -v _run_ssh_cmd "opkg install luci-app-samba samba36-server" + just -v _run_ssh_cmd "opkg install block-mount blockd kmod-fs-vfat kmod-usb-storage usbutils" From f480ac74a39c9cb4e0d85b8b38a53226b6410894 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Wed, 17 Jul 2019 09:48:49 +0200 Subject: [PATCH 11/15] home/graphical-fullblown: use stable virtmanager --- nix/home-manager/configuration/graphical-fullblown.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/home-manager/configuration/graphical-fullblown.nix b/nix/home-manager/configuration/graphical-fullblown.nix index b5ab574..bd71a62 100644 --- a/nix/home-manager/configuration/graphical-fullblown.nix +++ b/nix/home-manager/configuration/graphical-fullblown.nix @@ -146,7 +146,7 @@ in { gnome3.cheese # Virtualization - masterpkgs.virtmanager + virtmanager (pkgs.lib.hiPrio qemu) # virtualbox vagrant From 9bfeb193df86b536974ccae265d75413cb65ee8d Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Wed, 17 Jul 2019 10:02:36 +0200 Subject: [PATCH 12/15] desktop: switch to alacritty as a terminal --- .../configuration/graphical-fullblown.nix | 2 ++ nix/home-manager/profiles/qtile-desktop.nix | 11 +++++++---- nix/overlay.nix | 17 +++++++++++++---- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/nix/home-manager/configuration/graphical-fullblown.nix b/nix/home-manager/configuration/graphical-fullblown.nix index bd71a62..0192c3f 100644 --- a/nix/home-manager/configuration/graphical-fullblown.nix +++ b/nix/home-manager/configuration/graphical-fullblown.nix @@ -360,6 +360,8 @@ in { gnome3.dconf picocom glib.dev # contains gdbus tool + alacritty + roxterm # Screen recording # gtk-recordmydesktop # can't select the window diff --git a/nix/home-manager/profiles/qtile-desktop.nix b/nix/home-manager/profiles/qtile-desktop.nix index e1c31b3..da14963 100644 --- a/nix/home-manager/profiles/qtile-desktop.nix +++ b/nix/home-manager/profiles/qtile-desktop.nix @@ -31,8 +31,11 @@ let exit 1 ;; esac - ''; + # FIXME: alacritty's reflow on grow is currently broken (on my system) + terminalCommand = "${pkgs.alacritty}/bin/alacritty"; + # terminalCommand = "${pkgs.roxterm}/bin/roxterm"; + qtileConfig = pkgs.writeScript "qtile_config.py" '' from libqtile.config import Key, Screen, Group, Drag, Click @@ -97,9 +100,9 @@ key_control = "control" keys = [ # https://github.com/qtile/qtile/blob/develop/libqtile/xkeysyms.py - Key([key_super], "Return", lazy.spawn("${pkgs.roxterm}/bin/roxterm")), - Key([key_super], "backslash", lazy.spawn("${pkgs.roxterm}/bin/roxterm")), - Key([key_super], "apostrophe", lazy.spawn("${pkgs.roxterm}/bin/roxterm")), + Key([key_super], "Return", lazy.spawn("${terminalCommand}")), + Key([key_super], "backslash", lazy.spawn("${terminalCommand}")), + Key([key_super], "apostrophe", lazy.spawn("${terminalCommand}")), Key([key_super], "r", lazy.spawncmd()), Key([key_super], "w", lazy.window.kill()), diff --git a/nix/overlay.nix b/nix/overlay.nix index 3394b5c..9d2e289 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -1,10 +1,8 @@ self: super: let - nixpkgs-master = import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs-channels/archive/de5fd9e6110489722e8667664dce9fdc17331866.tar.gz"; - sha256 = "0z1j2pmvn15m2ir2i9l2prr81cq7f1x8xs4cv2s7q4fslz586ghn"; - }) {}; + nixpkgs-master = import {}; + # one application requires php5 nixpkgsWithPhp5 = super.fetchFromGitHub { owner = "nixos"; @@ -14,6 +12,7 @@ let }; in { + alacritty = nixpkgs-master.alacritty; podman = nixpkgs-master.podman; conmon = nixpkgs-master.conmon; @@ -23,6 +22,16 @@ in { slirp4netns = super.callPackage ./pkgs/slirp4netns.nix {}; staruml = super.callPackage ./pkgs/staruml.nix { inherit (super.gnome2) GConf; libgcrypt = super.libgcrypt_1_5; }; + roxterm = super.stdenv.mkDerivation { + name = "roxterm-custom"; + buildInputs = [ super.makeWrapper ]; + phases = "installPhase"; + installPhase = '' + makeWrapper ${super.roxterm}/bin/roxterm $out/bin/roxterm \ + --add-flags "--separate" + ''; + }; + busyboxStatic = super.busybox.override { enableStatic = true; extraConfig = '' From e3b6e5f60f38fae027fb0ed61ff725b092cff3df Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Wed, 24 Jul 2019 22:14:14 +0200 Subject: [PATCH 13/15] zsh: add just completion --- nix/home-manager/programs/zsh.nix | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/nix/home-manager/programs/zsh.nix b/nix/home-manager/programs/zsh.nix index c94a277..b44fd45 100644 --- a/nix/home-manager/programs/zsh.nix +++ b/nix/home-manager/programs/zsh.nix @@ -7,6 +7,40 @@ let channelSources = (import ../../default.nix { versionsPath = ../../variables/versions.nix; }).channelSources; + + just-plugin = + let + plugin_file = pkgs.writeText "_just" '' + #compdef just + #autload + + alias justl="\just --list" + alias juste="\just --evaluate" + + local subcmds=() + + while read -r line ; do + if [[ ! $line == Available* ]] ; + then + subcmds+=(''${line/[[:space:]]*\#/:}) + fi + done < <(just --list) + + _describe 'command' subcmds + ''; + + in pkgs.stdenv.mkDerivation { + name = "just-completions"; + version = "0.1.0"; + phases = "installPhase"; + installPhase = '' + PLUGIN_PATH=$out/share/oh-my-zsh/plugins/just + mkdir -p $PLUGIN_PATH + cp ${plugin_file} $PLUGIN_PATH/_just + chmod --recursive a-w $out + ''; + }; + in { programs.zsh = { enable = true; @@ -78,6 +112,10 @@ in { name = "minikube"; src = "${pkgs.oh-my-zsh}/share/oh-my-zsh/plugins/minikube"; } + { + name = "just"; + src = "${just-plugin}/share/oh-my-zsh/plugins/just"; + } ]; oh-my-zsh = { enable = true; From 56a66ffae8eabcd3b4031e7cf182558c54bdbc74 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Wed, 24 Jul 2019 22:14:21 +0200 Subject: [PATCH 14/15] Justfile: add TODO --- Justfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Justfile b/Justfile index 6d13ff7..c09286f 100755 --- a/Justfile +++ b/Justfile @@ -249,6 +249,7 @@ switch-yubikey: set -xe KEY_ID=$(gpg --card-status | rg sec | rg -o '[0-9A-Z]{16}') gpg --delete-secret-and-public-keys $KEY_ID + # TODO: fix this as it still blocks on the gpg prompt gpg2 --edit-card <<-EOF fetch quit From 3a17019f44a23242cc9f6c3a44128e783dd0e3f6 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Fri, 6 Sep 2019 11:44:56 +0200 Subject: [PATCH 15/15] gitlab-ci: use custom nix-channels for CI run --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ab2b64..efb4d91 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,4 +7,4 @@ build: - nix script: # Test the nix-shell - - nix-shell --run "echo OK" + - just run-with-channels 'nix-shell --run "echo OK"'