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 StrictHostKeyChecking yes
31 UserKnownHostsFile ${builtins.toString .ssh/known_hosts}
36 # Using modules enables to separate specific configurations
37 # from reusable code in shell/modules.nix and shell/modules/
38 # which may find its way in another git repository one day.
40 (import shell/modules.nix {
43 modules = [ configuration ];
46 pkgs.stdenv.mkDerivation {
47 name = "sourcephile-nix";
49 #preferLocalBuild = true;
50 #allowSubstitutes = false;
51 buildInputs = modules.nix-shell.buildInputs ++ [
53 nixos.nixos-generate-config
82 #pkgs.rxvt_unicode.terminfo
100 #enableParallelBuilding = true;
102 echo >&2 "nix: running shellHook"
104 ${modules.nix-shell.shellHook}
107 export NIX_PATH="nixpkgs=${nixpkgs}"
108 NIX_PATH+=":nixpkgs-overlays="$PWD"/overlays"
112 PATH_NIX=$(dirname $(readlink -e ~/.nix-profile/bin/nix))
113 PATH_NIXOS=/run/wrappers/bin
114 PATH_FHS="$PWD"/.lib/nix/fhs-bin
115 PATH_FHS_VBOX="$PWD"/.lib/fhs-vbox-bin
116 export PATH="$PATH_NIXOS:$PATH_FHS_VBOX:$PATH_FHS:$PATH:$PATH_NIX"
118 # NOTE: sudo needs to be own by root with the setuid bit,
119 # but this won't be the case for the sudo provided by Nix outside NixOS,
120 # hence the addition of $PATH_FHS in shellHook
121 # to provide the host system's sudo.
122 # WARNING: beware that sudo may reset the environment,
123 # and especially PATH, to some system's default.
126 export LANG=fr_FR.UTF-8
127 export LC_CTYPE=fr_FR.UTF-8
130 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
134 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
136 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
137 "$gitdir"/hooks/prepare-commit-msg
140 #export NIXOPS_DEPLOYMENT="staging"
141 export NIXOPS_STATE="$PWD"/.sec/nixops/state.nixops
142 NIXOPS_OPTS+=" --show-trace"
146 #export DISNIXOS_USE_NIXOPS=1
147 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
148 #export DISNIX_PROFILE=default
149 #export DISNIX_TARGET_PROPERTY=hostname
150 #export DYSNOMIA_STATEDIR="$PWD"/.sec/dysnomia