2 nixpkgs = import .lib/nix/nixpkgs.nix;
3 pkgs = import nixpkgs {
4 config = {}; # Make the config pure, ignoring user's config.
5 overlays = import ./overlays.nix;
9 # Configuration of shell/modules/
10 configuration = {config, ...}: {
15 auto-optimise-store = true
23 gnupgHome = toString ../sec/gnupg;
24 keys = import shell/gnupg/keys.nix;
30 UserKnownHostsFile ${builtins.toString .ssh/known_hosts}
35 # Using modules enables to separate specific configurations
36 # from reusable code in shell/modules.nix and shell/modules/
37 # which may find its way in another git repository one day.
39 (import shell/modules.nix {
42 modules = [ configuration ];
45 pkgs.stdenv.mkDerivation {
46 name = "sourcephile-nix";
48 #preferLocalBuild = true;
49 #allowSubstitutes = false;
50 buildInputs = modules.nix-shell.buildInputs ++ [
52 nixos.nixos-generate-config
81 #pkgs.rxvt_unicode.terminfo
99 #enableParallelBuilding = true;
101 echo >&2 "nix: running shellHook"
103 ${modules.nix-shell.shellHook}
106 export NIX_PATH="nixpkgs=${nixpkgs}"
107 NIX_PATH+=":nixpkgs-overlays="$PWD"/overlays"
111 PATH_NIX=$(dirname $(readlink -e ~/.nix-profile/bin/nix))
112 PATH_NIXOS=/run/wrappers/bin
113 PATH_FHS="$PWD"/.lib/nix/fhs-bin
114 PATH_FHS_VBOX="$PWD"/.lib/fhs-vbox-bin
115 export PATH="$PATH_NIXOS:$PATH_FHS_VBOX:$PATH_FHS:$PATH:$PATH_NIX"
117 # NOTE: sudo needs to be own by root with the setuid bit,
118 # but this won't be the case for the sudo provided by Nix outside NixOS,
119 # hence the addition of $PATH_FHS in shellHook
120 # to provide the host system's sudo.
121 # WARNING: beware that sudo may reset the environment,
122 # and especially PATH, to some system's default.
125 export LANG=fr_FR.UTF-8
126 export LC_CTYPE=fr_FR.UTF-8
129 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
133 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
135 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
136 "$gitdir"/hooks/prepare-commit-msg
139 #export NIXOPS_DEPLOYMENT="staging"
140 export NIXOPS_STATE="$PWD"/.sec/nixops/state.nixops
141 NIXOPS_OPTS+=" --show-trace"
145 #export DISNIXOS_USE_NIXOPS=1
146 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
147 #export DISNIX_PROFILE=default
148 #export DISNIX_TARGET_PROPERTY=hostname
149 #export DYSNOMIA_STATEDIR="$PWD"/.sec/dysnomia