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
{ 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
{ 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
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 = |
Password-store keeps your passwords (or any other sensitive information) saved in GnuPG encrypted files organized in ~/.password-store
. For more information about GPG, consult the GNU Privacy Handbook.
To get started, install pass
and generate a keypair.
$ brew install pass
$ gpg --gen-key
$ gpg --list-keys
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
{ config, lib, pkgs, ... }: | |
{ | |
services.sshd.enable = true; | |
services.terraria = { | |
enable = true; | |
home = "/srv/terraria"; | |
}; | |
nixpkgs.config.allowUnfree = true; | |
networking.firewall.allowedTCPPorts = [ 80 ]; |
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> {} }: | |
let | |
# To use this shell.nix on NixOS your user needs to be configured as such: | |
# users.extraUsers.adisbladis = { | |
# subUidRanges = [{ startUid = 100000; count = 65536; }]; | |
# subGidRanges = [{ startGid = 100000; count = 65536; }]; | |
# }; |
(draft; work in progress)
See also:
- Compilers
- Program analysis:
- Dynamic analysis - instrumentation, translation, sanitizers
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> {}}: | |
let | |
jupyterPort = pkgs.config.jupyterPort; | |
fhs = pkgs.buildFHSUserEnv { | |
name = "julia-fhs"; | |
targetPkgs = pkgs: with pkgs; | |
[ | |
git | |
gitRepo |
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
{ config, lib, pkgs, ...}: | |
with lib; | |
let | |
cfg = config.services.batteryNotifier; | |
in { | |
options = { | |
services.batteryNotifier = { | |
enable = mkOption { |
OlderNewer