Skip to content

Instantly share code, notes, and snippets.

View lucperkins's full-sized avatar
🎯
Focusing

Luc Perkins lucperkins

🎯
Focusing
View GitHub Profile
{
apps = {
# nix run <flake>#server
server = {
type = "app";
program = "${myPkg}/bin/server";
};
# nix run <flake>#client
client = {
nix run <flake>#my-linter
nix run <flake>#my-checker
# If the flake were in the current directory
nix run .#my-linter
nix run .#my-checker
# If the flake were in a GitHub repo
nix run github:my-org/my-repo#my-linter
nix run github:my-org/my-repo#my-checker
{
apps = {
my-linter = {
type = "app";
program = "${myLinter}/bin/my-linter";
};
my-checker = {
type = "app";
program = "${myChecker}/bin/my-checker";
{
apps.default = {
type = "app";
program = "${myPkg}/bin/my-pkg";
# Assuming there's a local derivation called myPkg
};
}
- name: Prettify repo code
uses: creyD/[email protected]
with:
prettier_options: --write **/*.{js,jsx,ts,tsx}
only_changed: true
[package.metadata.riff]
build-inputs = ["protobuf"]
[package.metadata.riff.targets.aarch64-apple-darwin]
build-inputs = ["darwin.apple_sdk.frameworks.CoreServices"]
[package.metadata.riff.targets.x86_64-apple-darwin]
build-inputs = ["darwin.apple_sdk.frameworks.CoreServices"]
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ go_1_19 terraform ];
};
}
{
# Inputs omitted for brevity
outputs = { ... }: {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ node2nix nodejs pnpm yarn ];
shellHook = ''
echo "node `${pkgs.nodejs}/bin/node --version`"
'';
final: prev: {
qemu = prev.qemu.overrideAttrs (o: {
patches = o.patches ++ [ (prev.fetchpatch {
name = "qemu-9p-performance-fix.patch";
url = "https://gitlab.com/lheckemann/qemu/-/commit/ca8c4a95a320dba9854c3fd4159ff4f52613311f.patch";
sha256 = "sha256-9jYpGmD28yJGZU4zlae9BL4uU3iukWdPWpSkgHHvOxI=";
}) ];
});
}
static V9fsFidState *coroutine_fn get_fid(V9fsPDU *pdu, int32_t fid)
{
int err;
V9fsFidState *f;
V9fsState *s = pdu->s;
// Blog note: I've omitted some parts that are irrelevant to performance here.
QSIMPLEQ_FOREACH(f, &s->fid_list, next) {
if (f->fid == fid) {
return f;