Skip to content

Instantly share code, notes, and snippets.

View flokli's full-sized avatar
🐑
Määh!

Florian Klink flokli

🐑
Määh!
View GitHub Profile
{ pkgs ? import <nixpkgs> {} }:
let
nixLib = pkgs.callPackage /home/flokli/dev/yarn2nix/nix-lib {};
in nixLib.callTemplate ./npm-package.nix
(nixLib.buildNodeDeps ./npm-deps.nix)
@flokli
flokli / Vagrantfile
Created June 9, 2018 21:37
vagrant nix
Vagrant.configure("2") do |config|
config.vm.box = "AndrewDryga/vagrant-box-osx"
config.ssh.forward_agent = true
config.vm.provision "shell", privileged: false, inline: <<-SHELL
if [ ! -d /nix ]; then
curl https://nixos.org/nix/install | sh
fi
if [ ! -d $HOME/nixpkgs ]; then
git clone https://github.com/NixOS/nixpkgs.git ~/nixpkgs
fi
@flokli
flokli / 872ix9w0vg7izkm0ni6gsg15jdb8imjm-vm-test-run-virtualbox-simple-cli.drv
Created August 10, 2019 12:08
nixosTests.virtualbox at 45c4f6ec66fb49abfe81dd5a2ba5bc546f196456 with enableVBoxUART = true
starting VDE switch for network 1
running the VM test script
machine: waiting for the X11 server
machine: running command: journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'Reached target Current graphical'
machine: waiting for the VM to finish booting
machine: starting vm
machine# Formatting '/build/vm-state-machine/machine.qcow2', fmt=qcow2 size=536870912 cluster_size=65536 lazy_refcounts=off refcount_bits=16
machine: QEMU running (pid 597)
machine# c[?7lSeaBIOS (version rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org)
machine#
@flokli
flokli / 872ix9w0vg7izkm0ni6gsg15jdb8imjm-vm-test-run-virtualbox-simple-cli.drv
Created August 10, 2019 12:08
nixosTests.virtualbox at 45c4f6ec66fb49abfe81dd5a2ba5bc546f196456 with enableVBoxUART = true
starting VDE switch for network 1
running the VM test script
machine: waiting for the X11 server
machine: running command: journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'Reached target Current graphical'
machine: waiting for the VM to finish booting
machine: starting vm
machine# Formatting '/build/vm-state-machine/machine.qcow2', fmt=qcow2 size=536870912 cluster_size=65536 lazy_refcounts=off refcount_bits=16
machine: QEMU running (pid 597)
machine# c[?7lSeaBIOS (version rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org)
machine#
#!/usr/bin/env bash
nixBuild() {
DRV=$(nix-instantiate "$@");
nix-build $DRV --builders "" --no-out-link;
S=$?;
if [ $S -ne 0 ]; then
# trigger a git bisect bad if the bad line was found
nix log $DRV | grep -i "has terminated unexpectedly during startup" && exit 42;
# else trigger a skip (some other random build failure)
exit 125;
#!/usr/bin/env bash
# buildkite groups the builds by BUILDKITE_BRANCH.
# This allows us to arbitrarily group buildkite jobs, while still allowing
# agents to checkout, if change and revision id is passed in metadata.
set -euo pipefail
if buildkite-agent meta-data exists change_id && buildkite-agent meta-data exists revision_id; then
change_id="$(buildkite-agent meta-data get change_id)"
revision_id="$(buildkite-agent meta-data get revision_id)"
partial_change_id="${change_id: -2:2}"
# refs/changes/%s/%s/%s", changeID[len(changeID)-2:], changeID, revisionID)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1660", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="82ff", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="8242", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="8442", MODE="0666"
Bus 004 Device 092: ID 1083:1660 Canon Electronics, Inc. CANON P-208II
Bus 004 Device 086: ID 0451:82ff Texas Instruments, Inc.
Bus 004 Device 085: ID 0451:8242 Texas Instruments, Inc. CANON P-208II
Bus 004 Device 082: ID 0451:8442 Texas Instruments, Inc.
@flokli
flokli / build-qcow2.nix
Created August 17, 2020 07:58
build NixOS qcow image for serial testing
# stolen from https://gist.github.com/tarnacious/f9674436fff0efeb4bb6585c79a3b9ff
{ config, lib, pkgs, ... }:
with lib;
{
imports =
[
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
./configuration.nix
@flokli
flokli / foobar.yml
Last active August 21, 2020 09:40
ansible-playbook -i inventory.ini foobar.yml
- name: This doesn't work
hosts: localhost
connection: local
gather_facts: no
become: no
tasks:
- local_action: >
shell
echo hey