Skip to content

Instantly share code, notes, and snippets.

View tfc's full-sized avatar

Jacek Galowicz tfc

View GitHub Profile
@tfc
tfc / default.nix
Created May 22, 2026 19:48
tailscale demo und test
let
pkgs = import <nixpkgs> {};
in
pkgs.testers.runNixOSTest ./test.nix
# Partitions:
# 1. BIOS boot (1M) -> grub compat
# 2. ESP (500M) -> /boot
# 3. persist (rest) -> /persist (ext4), includes /persist/nix
#
# Usage: disko.devices = import ../disk-layout.nix "/dev/sda";
diskDevice: {
disk.${diskDevice} = {
device = diskDevice;
@tfc
tfc / mandelbrot.nix
Created April 14, 2026 07:43
Mandelbrot fractal in nix
let
pkgs = import <nixpkgs> {};
inherit (pkgs) lib;
# minimal complex number library
complex = {
zero = { r = 0.0; i = 0.0; };
fromXY = r: i: { inherit r i; };
@tfc
tfc / with-parents.txt
Created April 4, 2026 17:31
AMD path closures with parent discovery and without
extra-sandbox-paths
/dev/dri=/dev/dri
/dev/kfd=/dev/kfd
/nix/store/20rmp04wywyhvcm0j3q3gc28w8w8f9i7-graphics-drivers=/nix/store/20rmp04wywyhvcm0j3q3gc28w8w8f9i7-graphics-drivers
/nix/store/aq4s5j9yjv6rhzd6r0cnkrq33xn2qbmm-mesa-26.0.3/share=/nix/store/aq4s5j9yjv6rhzd6r0cnkrq33xn2qbmm-mesa-26.0.3/share
/run/opengl-driver=/run/opengl-driver
/sys/bus/acpi=/sys/bus/acpi
/sys/bus/pci=/sys/bus/pci
/sys/class/devlink=/sys/class/devlink
/sys/class/drm=/sys/class/drm
@tfc
tfc / config-app.nix
Last active September 23, 2025 08:04
{ pkgs, ... }:
{
imports = [
./python-web-module.nix
];
nixpkgs.overlays = [
(import ./overlay.nix)
];
{ pkgs, ... }:
{
imports = [
./hello-as-a-service.nix
];
# variante A
# nixpkgs.overlays = [
# (final: prev: {
@tfc
tfc / gist:980d1a45c88d1b5c2a50338f04c0bcd8
Created February 22, 2023 08:56
sphinx 5.3.0 build errors
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pip-build-hook
Using pipBuildPhase
Using pipShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
From f2d7b1b89e4429e2dc93bdc7528ac86bb23dbf41 Mon Sep 17 00:00:00 2001
From: Jacek Galowicz <[email protected]>
Date: Wed, 24 Aug 2022 11:09:32 +0200
Subject: [PATCH] Modularize login test
---
nixos/tests/all-tests.nix | 3 +--
nixos/tests/login.nix | 22 ++++++++++++++--------
2 files changed, 15 insertions(+), 10 deletions(-)
@tfc
tfc / heterogeneous-unique-lists.hs
Created March 20, 2022 10:14
Filtering of unique items from heterogeneous lists in haskell on the type level
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
@tfc
tfc / autotools.nix
Last active May 11, 2024 18:59 — forked from lucabrunox/autotools.nix
Nix pill 12
pkgs: attrs:
with pkgs;
let defaultAttrs = {
builder = "${bash}/bin/bash";
args = [ ./builder.sh ];
setup = ./setup.sh;
baseInputs = [ gnutar gzip gnumake gcc binutils-unwrapped coreutils gawk gnused gnugrep patchelf findutils ];
buildInputs = [];
system = builtins.currentSystem;
};