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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.IO | |
open System.Net | |
open System.Text.Json | |
open System.Collections.Generic | |
open System.Security.Cryptography | |
/// Taken from hash.cc in the nix codebase | |
/// https://github.com/NixOS/nix/blob/a7540294cfae82c098e8691cd5212a9184add574/src/libutil/hash.cc | |
module Base32 = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self: super: | |
let | |
py-override = { | |
packageOverrides = python-self: python-super: { | |
altgraph = python-super.buildPythonPackage rec { | |
pname = "altgraph"; | |
version = "0.16.1"; | |
doCheck = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
let | |
inherit (lib) optional optionals; | |
proxy = "<your proxy if you need one>"; | |
in | |
mkShell { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{lib, options, pkgs, config, ...}: | |
{ | |
systemd.services.ipfs-daemon = { | |
description = "IPFS Daemon"; | |
wantedBy = [ "default.target" ]; | |
after = [ "network.target" ]; | |
serviceConfig = { | |
Type = "forking"; | |
User = "usul"; |
NewerOlder