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
@flokli
flokli / qnap-ec.nix
Created August 21, 2022 20:17
qnap-ec kernel module. Set `boot.extraModulePackages = [ (config.boot.kernelPackages.callPackage ./path-to-qnap-ec.nix {}) ];` to use
{ stdenv
, lib
, fetchFromGitHub
, kernel
, kmod
}:
stdenv.mkDerivation {
pname = "qnap-ec";
version = "unstable-2021-11-22";
@flokli
flokli / talos_nocloud_cidata.bash
Created March 25, 2022 16:31
Install talos nocloud and add CIDATA with config
#!/usr/bin/env bash
# This assumes a booted rescue system, copies the installation media to the destination disk
# it'll then add a CIDATA partition to the end of the disk, and prepare it with user-data
# used in a terraform ssh provisioner, but extracted to here for now.
destination_disk=/dev/nvme0n1
talos_version=v0.14.3
wipefs -af $destination_disk
wget https://github.com/talos-systems/talos/releases/download/${talos_version}/nocloud-amd64.raw.xz
@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
@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
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.
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"
#!/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)
#!/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;
@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#