Skip to content

Instantly share code, notes, and snippets.

View MMongelli99's full-sized avatar

Michael Mongelli MMongelli99

View GitHub Profile
@573
573 / readme.md
Created February 1, 2024 10:40
nix tip: nix-shell --pure vs. nix develop
          In case this helps anyone. ``--ignore-environment` is more hermetic than `--pure` and may have unexpected effects in conjunction with profile and rcfile's.

On NixOS one may have to add --keep __ETC_PROFILE_DONE or add --norc to the bash call.

nix shell --ignore-environment nixpkgs#hello --command $SHELL --norc
nix shell --ignore-environment nixpkgs#hello --keep __ETC_PROFILE_DONE

while we're at it we can simulate the behavior of nix-shell --pure with something like this. The _DONE is to retain variables related to sourcing/re-sourcing profile and rc

@GaetanLepage
GaetanLepage / nixvim.nix
Last active June 18, 2024 14:09
Example of a nixvim configuration
{
programs.nixvim = {
enable = true;
vimAlias = true;
# Configure neovim options...
options = {
relativenumber = true;
incsearch = true;
};
@m1cr0man
m1cr0man / flake.nix
Last active March 13, 2026 23:47
The simplest Nix Flake for nixos-rebuild
# This can be built with nixos-rebuild --flake .#myhost build
{
description = "the simplest flake for nixos-rebuild";
inputs = {
nixpkgs = {
# Using the nixos-unstable branch specifically, which is the
# closest you can get to following the equivalent channel with flakes.
url = "github:NixOS/nixpkgs/nixos-unstable";
};
# build an ISO image that will auto install NixOS and reboot
# $ nix-build make-iso.nix
let
config = (import <nixpkgs/nixos/lib/eval-config.nix> {
system = "x86_64-linux";
modules = [
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
({ pkgs, lib, ... }:
let
{ config, pkgs, lib, ... }:
{
rune.project.name = "shopify-pay";
rune.framework.rails.enable = true;
aspect.packages.include = with pkgs; [
geolite2 ngrok mysqlClient57 overmind watchman toxiproxy v8
];
rune.project.repoName = "pay";
@unglitched
unglitched / iterm2kitty.py
Created January 24, 2020 01:18
Convert .itermcolors file to kitty term theme colors
#!/usr/bin/env python3
#
# Convert .itermcolors files to kitty terminal color settings.
# Modded from https://gist.github.com/MSylvia/4e90860743f1a4de187d
# Might need to adjust dicts[i][NUMBER].text per your file.
import sys
import xml.etree.ElementTree as ET
def rgb_to_hex(rgb):

Introduction

I was recently asked to explain why I felt disappointed by Haskell, as a language. And, well. Crucified for crucified, I might as well criticise Haskell publicly.

First though, I need to make it explicit that I claim no particular skill with the language - I will in fact vehemently (and convincingly!) argue that I'm a terrible Haskell programmer. And what I'm about to explain is not meant as The Truth, but my current understanding, potentially flawed, incomplete, or flat out incorrect. I welcome any attempt at proving me wrong, because when I dislike something that so many clever people worship, it's usually because I missed an important detail.

Another important point is that this is not meant to convey the idea that Haskell is a bad language. I do feel, however, that the vocal, and sometimes aggressive, reverence in which it's held might lead people to have unreasonable expectations. It certainly was my case, and the reason I'm writing this.

Type classes

I love the concept of type class

@CMCDragonkai
CMCDragonkai / nix_string_and_path_concatenation.md
Last active April 2, 2026 22:21
Nix: String and Path Concatenation #nix #nixos

Nix String and Path Concatenation

From Bas van Dijk:

To understand these things I would recommend using nix-repl:

$ nix-repl
Welcome to Nix version 1.11.2. Type :? for help.
@mandiwise
mandiwise / Count lines in Git repo
Last active December 27, 2025 13:49
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l