Skip to content

Instantly share code, notes, and snippets.

@mbakke
mbakke / config.scm
Last active February 7, 2022 18:35
Bisect Linux with Guix
(use-modules (gnu)
(srfi srfi-1)
(srfi srfi-71)
(git repository)
(git reference)
(git oid)
(git commit)
(git describe)
(guix git)
(guix packages)
@mbakke
mbakke / bisect.scm
Last active June 8, 2021 16:28
Script to bisect regression in SQLite leading to https://bugzilla.mozilla.org/show_bug.cgi?id=1714874
#!/usr/bin/env -S guile --no-auto-compile
;; Mode: -*- Scheme;-*-
!#
(use-modules (git repository)
(git reference)
(git oid)
(git commit)
(git describe)
(guix git)
@mbakke
mbakke / vngl.scm
Last active June 4, 2021 15:14
Guix manifest with vendor-neutral OpenGL dispatch
;; This is a proof-of-concept and does not actually work (yet!).
;; The idea is that 'guix environment --ad-hoc -m vngl.scm -- glxgears' should
;; succeed even on unsupported graphics drivers, using the "foreign" libGL.
(use-modules (guix packages)
(guix utils)
(gnu packages gl))
(define vendor-neutral-mesa
(package/inherit mesa
@mbakke
mbakke / zac.scm
Last active February 6, 2021 15:06
zabbix-auto-config config
(use-modules (gnu) (gnu system nss)
(guix packages)
(guix utils)
(gnu services shepherd)
(uio services monitoring))
(use-package-modules databases monitoring)
(use-service-modules databases monitoring networking web)
(define %zac-configuration-directory
@mbakke
mbakke / reverse-package-dependencies.scm
Last active December 11, 2020 15:01
List the number of dependents of each package in Guix
(use-modules (guix store)
(guix monads)
(guix packages)
(guix graph)
(guix scripts graph)
(gnu packages)
(ice-9 format))
(define (all-packages)
(fold-packages (lambda (package result)
@mbakke
mbakke / guix.sh
Created June 28, 2019 20:00
Guix on a foreign distribution (/etc/profile.d/guix.sh)
# If GUIX_PROFILE is set while sourcing the profile, the variables will
# refer to that instead of just the latest generation of the profile.
GUIX_PROFILE="${HOME}/.guix-profile"
if [[ -L "${GUIX_PROFILE}" ]]; then
. "${GUIX_PROFILE}/etc/profile"
fi
# Make sure the Guix from "guix pull" appears first in PATH.
export PATH="${HOME}/.config/guix/current/bin:${PATH}"
export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
@mbakke
mbakke / config.scm
Last active December 26, 2022 18:53
GuixSD with custom kernel
(define-module (my packages)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages linux)
#:use-module (guix build-system trivial)
#:use-module (gnu)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix packages))
(define (linux-nonfree-urls version)