Skip to content

Instantly share code, notes, and snippets.

@CRTified
CRTified / README.md
Last active May 5, 2024 15:57
VFIO Passthrough on NixOS

VFIO Setup on NixOS

Disclaimer: Nobody else tested my setup so far, so this is a "works on my machine" scenario. I am not responsible for anything you break on your machine (although I'd not expect much harm).

Hardware

My system has the following hardware:

  • Board: ASRock X570 Pro4
{-# LANGUAGE Arrows #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
import Control.Applicative ((<|>))
import Control.Arrow
import Control.Category
import Control.Monad (unless)
import Data.Maybe (fromJust)
@NaeosPsy
NaeosPsy / job.md
Last active July 25, 2019 19:57
Serokell is hiring Nix DevOps Engineers

tl;dr Serokell is hiring Nix DevOps Engineers

Hi! We’re Serokell – a company with about 30 Haskellers working on a bunch of blockchain-related projects (like Cardano or TeachMePlease). We are hiring SREs and a Head of IT Operations that can work with Nix (yay Nix!) and know some Haskell. The job is fully remote.

A bit more about us

@3noch
3noch / Distributed Builds.md
Last active January 4, 2024 14:34
How to set up distributed builds with nix

Reference: https://github.com/LnL7/nix-docker

# If on Darwin, I recommend keeping nix stuff contained
mkdir -p /nix/etc/nix
ln -s /nix/etc/nix /etc/nix  # sysconfdir; can be overridden with $NIX_CONF_DIR

cd /nix/etc/nix/
openssl genrsa -out signing-key.sec 2048
openssl rsa -in signing-key.sec -pubout &gt; signing-key.pub
anonymous
anonymous / IRC client in pure bash 4
Created March 28, 2016 16:57
IRC client written in pure bash using only bash builtin commands and no other binaries.
#!/bin/bash
#no PATH, no way to accidently run any programs
PATH=''
#useful variables
term_height=0
term_width=0
term_scroll_height=0
status_line_row=0
@pkirkovsky
pkirkovsky / yubikey-reset.sh
Last active October 20, 2023 21:57
Utility for resetting a Yubikey to factory defaults using gpg-connect-agent. This will wipe out any stored keys and reset PINs to default values.
# Adapted from https://developers.yubico.com/ykneo-openpgp/ResetApplet.html
gpg-connect-agent <<EOF
/hex
scd serialno
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
@edolstra
edolstra / nix-ui.md
Last active February 2, 2024 23:31
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.

@0xadada
0xadada / README.md
Last active August 5, 2022 16:48
VIM movement, keyboard commands and shortcuts