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"' diff --git a/Justfile b/Justfile index de2e276..c09286f 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} @@ -240,3 +241,18 @@ 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 + # TODO: fix this as it still blocks on the gpg prompt + gpg2 --edit-card <<-EOF + fetch + quit + EOF + gpg-connect-agent "scd serialno" "learn --force" /bye + gpg --card-status diff --git a/nix/home-manager/configuration/graphical-fullblown.nix b/nix/home-manager/configuration/graphical-fullblown.nix index b5ab574..0192c3f 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 @@ -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 1301da0..da14963 100644 --- a/nix/home-manager/profiles/qtile-desktop.nix +++ b/nix/home-manager/profiles/qtile-desktop.nix @@ -32,8 +32,10 @@ let ;; esac ''; + # FIXME: alacritty's reflow on grow is currently broken (on my system) + terminalCommand = "${pkgs.alacritty}/bin/alacritty"; + # terminalCommand = "${pkgs.roxterm}/bin/roxterm"; - 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 +100,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("${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/home-manager/programs/zsh.nix b/nix/home-manager/programs/zsh.nix index 330d949..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; @@ -15,8 +49,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 @@ -39,6 +72,11 @@ in { unsetopt AUTO_CD source ${channelSources} + + # print lines without termination + setopt PROMPT_CR + setopt PROMPT_SP + export PROMPT_EOL_MARK="" ''; sessionVariables = { @@ -52,8 +90,8 @@ in { src = pkgs.fetchFromGitHub { owner = "zsh-users"; repo = "zsh-autosuggestions"; - rev = "v0.4.0"; - sha256 = "0z6i9wjjklb4lvr7zjhbphibsyx51psv50gm07mbb0kj9058j6kc"; + rev = "v0.6.3"; + sha256 = "1smskx9vkx78yhwspjq2c5r5swh9fc5xxa40ib4753f00wk4dwpp"; }; } { @@ -62,8 +100,8 @@ in { src = pkgs.fetchFromGitHub { owner = "b4b4r07"; repo = "enhancd"; - rev = "v2.2.1"; - sha256 = "0iqa9j09fwm6nj5rpip87x3hnvbbz9w9ajgm6wkrd5fls8fn8i5g"; + rev = "v2.2.4"; + sha256 = "1smskx9vkx78yhwspjq2c5r5swh9fc5xxa40ib4753f00wk4dwpp"; }; } { @@ -74,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; diff --git a/nix/os/devices/steveej-t480s-work/versions.nix b/nix/os/devices/steveej-t480s-work/versions.nix index 0d93e08..6d94e8b 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 = "aef662d2eb532eeb9976068fd1705e3cf3663054"; }; channelsNixosUnstable = { ref = "nixos-unstable"; - rev = "7815c86c104a99417db844791dcda34fe7a7965f"; + rev = "73392e79aa62e406683d6a732eb4f4101f4732be"; }; nixpkgsMaster = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "aa2f3eb8b102ffed4258a7e7fbc0a7d17b7ba319"; + rev = "51aa3cc4855c5964a6e71adcf7b79c1a0c23f322"; }; homeManagerModule = { url = "https://github.com/rycee/home-manager"; ref = "master"; - rev = "cf0aad391c10473fa7613dcc41b1f6a366d03148"; + rev = "95382060ebaa19ec49a861921216b1db8460b314"; }; } 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 = '' 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" 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