Skip to content

Instantly share code, notes, and snippets.

View timor's full-sized avatar
💭
Setting Status

timor

💭
Setting Status
View GitHub Profile
@danbst
danbst / imperative-env.sh
Last active January 15, 2024 22:55
Imperative nix-env rewrite (so it becomes declarative)
#!/usr/bin/env bash
statefile=~/.config/nixpkgs/declarative
action="$1"
package="$2"
mkdir -p $(dirname "$statefile")
touch "$statefile"
function update {
envExpr=~/.config/nixpkgs/declarative-env.nix