Skip to content

Instantly share code, notes, and snippets.

@aabs
aabs / shell.nix
Last active July 10, 2022 05:24
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:

@ejpcmac
ejpcmac / shell.nix
Last active March 10, 2021 16:37
Example shell.nix for Nerves projects, setting both Erlang and Elixir versions
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
inherit (lib) optional optionals;
erlangDrv = { mkDerivation }:
mkDerivation rec {
version = "21.0";
@sconstantinides
sconstantinides / PWAs.md
Created May 3, 2018 18:19
How to install a Progressive Web App

How to install a Progressive Web App

Progressive Web Apps (or PWAs) work across browsers and devices. When installed they may include offline support.

iOS Safari

  1. Visit the app’s website
  2. Click the export icon on Safari’s bottom bar
  3. Scroll the options and select “Add to Home Screen”
@edolstra
edolstra / nix-lang.md
Last active May 2, 2024 23:39
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to