Skip to content

Instantly share code, notes, and snippets.

@adisbladis
adisbladis / walk-narinfo.py
Created March 7, 2025 02:58
Stupidly recursively walk narinfo's
import urllib3
import sys
CACHE = "https://cache.nixos.org"
visited: set[str] = set()
def get_narinfo(hash) -> dict[str, str | list[str]]:
resp = urllib3.request("GET", f"{CACHE}/{hash}.narinfo")
if resp.status != 200:
@adisbladis
adisbladis / default.nix
Created November 1, 2023 04:20
A nix expression to package the firmware updater for my monitor
let
pkgs = import <nixpkgs> { };
inherit (pkgs) stdenv;
in
stdenv.mkDerivation {
pname = "dell-u3223qe";
version = "m3t102";
src = ./Dell_U3223QE_FWUpdate_M3T102_Ubuntu.deb;
@adisbladis
adisbladis / default.nix
Created May 17, 2022 14:06
activate-linux.nix
{ stdenv
, fetchFromGitHub
, fetchpatch
, pkg-config
, cairo
, xorg
, clang
, lib
}:
@adisbladis
adisbladis / query-build.py
Last active July 21, 2021 00:47
Find sources that went into derivations (recursively)
from pynixutil import drvparse
from functools import wraps
from typing import (
Optional,
Callable,
List,
Set,
)
import subprocess
import argparse
@adisbladis
adisbladis / eaf.nix
Created March 9, 2021 20:12
EAF nix packaging
{ melpaBuild
, fetchFromGitHub
, writeText
, pkgs
# Elisp dependencies
, ctable
, deferred
, epc
, s
| Name | Value | Level of concern |
| ---------------------------- | --------- | ------------------------------ |
| Overall repository size | | |
| * Commits | | |
| * Count | 298 k | |
| * Total size | 148 MiB | |
| * Trees | | |
| * Count | 1.58 M | * |
| * Total size | 5.32 GiB | ** |
| * Total tree entries | 159 M | *** |
use_nix() {
eval "$(lorri direnv)"
}
@adisbladis
adisbladis / iso.nix
Last active August 29, 2022 18:43
Nixos custom iso
# env NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz nix-build '<nixpkgs/nixos>' -A config.system.build.isoImage -I nixos-config=iso.nix --no-out-link --show-trace
{ config, lib, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-graphical-plasma5.nix>
];
boot.kernelPackages = pkgs.linuxPackages_latest;
@adisbladis
adisbladis / iso.nix
Created January 3, 2020 17:46
Nixos custom iso
# env NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz nix-build '<nixpkgs/nixos>' -A config.system.build.isoImage -I nixos-config=iso.nix --no-out-link --show-trace
{ config, lib, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-graphical-kde.nix>
];
boot.kernelPackages = pkgs.linuxPackages_latest;
@adisbladis
adisbladis / podman-shell.nix
Last active March 1, 2025 19:22
Use podman within a nix-shell
{ pkgs ? import <nixpkgs> {} }:
let
# To use this shell.nix on NixOS your user needs to be configured as such:
# users.extraUsers.adisbladis = {
# subUidRanges = [{ startUid = 100000; count = 65536; }];
# subGidRanges = [{ startGid = 100000; count = 65536; }];
# };