Skip to content

Instantly share code, notes, and snippets.

View considerate's full-sized avatar

Viktor Kronvall considerate

View GitHub Profile
@cpcloud
cpcloud / flake.lock
Created December 18, 2022 18:07
torch wheel build with poetry2nix; nixos compat and hacks around broken nvidia install behavior
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
@Profpatsch
Profpatsch / !nix-build-if-changed.py
Last active July 13, 2023 18:35
build a nix expression, but only if it isn’t already available in substituters; skip downloading the results if that is the case.
#!/usr/bin/env python3
# Small wrapper around nix-instantiate and `nix-store --realize`
# that checks whether the output path is already in a cache
# and if it isn’t, builds it.
#
# The arguments you pass will be given to nix-instantiate,
# not to nix-store --realize
# (This might be a TODO for the future).
@sergv
sergv / RecSchemesTypecheck.hs
Last active January 23, 2019 10:57
Use recursion schemes to add type information to expressions in a modular way
----------------------------------------------------------------------------
-- Tested with ghc 8.2.2
----------------------------------------------------------------------------
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TupleSections #-}