Merge branch 'pr/bump' into 'master'

bump master

See merge request steveeJ/infra!17
This commit is contained in:
steveej 2019-09-06 10:12:44 +00:00
commit de76d35f18
12 changed files with 105 additions and 36 deletions

View file

@ -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"'

View file

@ -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

View file

@ -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

View file

@ -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()),

View file

@ -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;

View file

@ -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";
};
}

View file

@ -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 <nixpkgs-master> {};
# 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 = ''

View file

@ -1,2 +0,0 @@
post-setup:
ansible-playbook -i hosts openwrt-post-setup.yaml --verbose

View file

@ -1 +0,0 @@
router-wan.lan ansible_ssh_user=root

View file

@ -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

View file

@ -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"

View file

@ -20,6 +20,12 @@ stdenv.mkDerivation {
imagemagick
esh
xorg.xwininfo
# testing
alacritty
];
# Set Environment Variables