Skip to content

Instantly share code, notes, and snippets.

with import <nixpkgs> {};
let
path = ./mwe;
string = "./mwe";
pathPath = path + /test/file.nix;
pathString = path + "/test/file.nix";
pathStringPath = path + "/test" + /file.nix;
stringPath = string + /test/file.nix;
stringPathWorking = string + /nix/var/nix/db/schema;
@AndersonTorres
AndersonTorres / nix-development-template-file.org
Last active July 26, 2024 00:09
A project workflow for Nixpkgs/NixOS

Standard project structure

This is a project structure I’ve found useful. Looking for any thoughts/comments/feedback. Roughly, I found a tension between the style nixpkgs expects and the style conducive to development, so I extracted the common portion into a derivation.nix which is used by the remaining .nix files. This setup allows me to use nix build, nix-shell, overlays, Hydra, alternate packaging schemes, cross-compiling, etc.

@romainl
romainl / grep.md
Last active April 27, 2025 01:19
Instant grep + quickfix

FOREWORDS

I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.

My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.


Instant grep + quickfix

@aabs
aabs / shell.nix
Last active April 29, 2025 11:59
A simple nix-shell script to establish an environment for Phoenix, Elixir and PostgreSQL development
{ nixpkgs ? import <nixpkgs> {}
, version ? "0.1"
, proxy ? "http://10.183.23.58:3128"
}:
with nixpkgs;
let
elixir = beam.packages.erlangR21.elixir_1_7;
nodejs = nodejs-10_x;
@tomciopp
tomciopp / README.txt
Created November 25, 2018 17:47
Pure Elixir/Erlang CRC32C implementations
I have tested the elixir version and it works, but have not tested the erlang version of this code.
@LisannaAtHome
LisannaAtHome / help.md
Last active April 30, 2022 12:43
Lisanna's eclectic nix troubleshooting guide for suicidal power users

Lisanna's eclectic nix troubleshooting guide for suicidal power users

tar fails with exit code 1

unpacking 'https://example.com/nixexprs.tar.xz'...
tar: Error opening archive: Failed to open '/nix/store/411sszfqfya5ad2wllmqcr15z5d30575-nixexprs.tar.xz'
error: program 'tar' failed with exit code 1

Discussion:

@CMCDragonkai
CMCDragonkai / nix_ca_certificate_handling.md
Created October 16, 2018 07:02
Nix CA Certificate Handling #nix

Nix CA Certificate Handling

Some applications requires contacting HTTPS endpoints. In those cases you need to supply the CA certificates.

Most Nix applications won't package in the CA certificates, this is because they can make use of the OS provided CA certificate store.

The NixOS location for this is at: /etc/ssl/certs.

The OpenSSL library in Nixpkgs is compiled to use that path if there is no environment variables such as SSL_CERT_FILE.

@ejpcmac
ejpcmac / setup
Created September 28, 2018 20:39
Setup script for Phoenix projects using Nix and PostgreSQL
#!/bin/sh
echo
if [ ! -d "deps" ] || [ ! "$(ls -A deps)" ]; then
printf "\e[32m=> Fetching dependencies and building the application...\e[0m\n\n"
echo "+ mix do deps.get, compile --verbose"
mix do deps.get, compile --verbose
echo
fi
@ejpcmac
ejpcmac / shell.nix
Created September 28, 2018 12:14
Shell for Phoenix projects with node.js and PostgreSQL
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
inherit (lib) optional optionals;
elixir = beam.packages.erlangR21.elixir_1_7;
nodejs = nodejs-10_x;
postgresql = postgresql100;
@CMCDragonkai
CMCDragonkai / nix_c_package.md
Last active August 12, 2023 11:49
An Illustration of a Nix C Package #nix #c

An Illustration of a Nix C Package

The pkgs.nix:

import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/4df3426f5a5e78cef4835897a43abd9e2a092b74.tar.gz) {}

The default.nix: