Skip to content

Instantly share code, notes, and snippets.

View tfc's full-sized avatar

Jacek Galowicz tfc

View GitHub Profile
@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;
};
{ config, pkgs, lib, ... }:
let
cfg = config.installHello;
in
{
options = {
installHello.enable = lib.mkEnableOption "Some way to install GNU hello";
};
{ pkgs, config, ... }:
{
hardware.deviceTree.overlays = [
{ name = "dwc2"; dtboFile = /nix/store/6fanghkkwfa8wrcq0khhc0fvm7dym2w3-linux-5.10.17-1.20210303/dtbs/overlays/dwc2.dtbo; }
{
name = "dwc2-overlay";
dtsText = ''
/dts-v1/;
/plugin/;
#!/usr/bin/env bash
#productization: don't use <nixpkgs>
IFS='' read -r -d '' expression <<"EOF"
{ inputPath }:
let
pkgs = import <nixpkgs> {};
input = import inputPath;
pathString = builtins.foldl'
@tfc
tfc / Main.hs
Last active March 27, 2021 11:44
module Main where
import Control.Monad.Fix (MonadFix)
import Data.Text (Text)
import Reflex.Dom
data Tool = Tool { toolName :: Text } deriving (Eq, Show)
main :: IO ()
main = mainWidget bodyWidget
@tfc
tfc / generics-example.hs
Created March 19, 2021 21:34
convert ADTs to trees of maps
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE UndecidableInstances #-}
nix-repl> :b pkgs.runCommandNoCC "foo" {} "touch $out"
[1 built, 0.0 MiB DL]
this derivation produced the following outputs:
out -> /nix/store/dyw8bl14y7rdp25qx2m7j4bk5rs3lrx0-foo
nix-repl> :b pkgs.runCommandNoCC "foo" { __structuredAttrs = true; } "touch $out"
builder for '/nix/store/hrzdfvwadb4hjazj2l1mlxkwzfis7ajv-foo.drv' failed with exit code 1; last 1 log lines:
/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh: line 1: /setup: No such file or directory
[0 built (1 failed)]