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;
10 # Configuration of shell/modules/
11 configuration = {config, ...}: {
16 auto-optimise-store = true
24 gnupgHome = toString ../sec/gnupg;
25 keys = import shell/openpgp.nix;
29 opensslHome = toString ../sec/openssl;
30 certificates = import shell/x509.nix;
35 Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com
39 ControlPath ${builtins.toString ../sec/ssh}/ssh-%h-%p-%r.socket
41 SSAPIAuthentication no
43 StrictHostKeyChecking yes
44 UserKnownHostsFile ${builtins.toString ../sec/ssh/known_hosts}
49 # Using modules enables to separate specific configurations
50 # from reusable code in shell/modules.nix and shell/modules/
51 # which may find its way in another git repository one day.
53 (import shell/modules.nix {
55 modules = [ configuration ];
58 pkgs.stdenv.mkDerivation {
59 name = "sourcephile-nix";
61 #preferLocalBuild = true;
62 #allowSubstitutes = false;
63 buildInputs = modules.nix-shell.buildInputs ++ [
65 nixos.nixos-generate-config
96 #pkgs.rxvt_unicode.terminfo
115 #enableParallelBuilding = true;
117 echo >&2 "nix: running shellHook"
119 # Cleanup "../sec/tmp/"
120 # This is done when exiting the nix-shell
121 # (or when… entering the directory with direnv
122 # which spawns a nix-shell just to get the env).
123 trap "cd '$PWD' && find ../sec/tmp -type f -exec shred -fu {} +" EXIT
125 ${modules.nix-shell.shellHook}
128 export NIX_PATH="nixpkgs=${nixpkgs}"
129 NIX_PATH+=":nixpkgs-overlays="$PWD"/overlays"
133 PATH_NIX=$(dirname $(readlink -e ~/.nix-profile/bin/nix))
134 PATH_NIXOS=/run/wrappers/bin
135 PATH_FHS="$PWD"/.lib/nix/fhs-bin
136 PATH_FHS_VBOX="$PWD"/.lib/fhs-vbox-bin
137 export PATH="$PATH_NIXOS:$PATH_FHS_VBOX:$PATH_FHS:$PATH:$PATH_NIX"
139 # NOTE: sudo needs to be own by root with the setuid bit,
140 # but this won't be the case for the sudo provided by Nix outside NixOS,
141 # hence the addition of $PATH_FHS in shellHook
142 # to provide the host system's sudo.
143 # WARNING: beware that sudo may reset the environment,
144 # and especially PATH, to some system's default.
147 export LANG=fr_FR.UTF-8
148 export LC_CTYPE=fr_FR.UTF-8
151 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
155 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
157 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
158 "$gitdir"/hooks/prepare-commit-msg
161 #export NIXOPS_DEPLOYMENT="staging"
162 export NIXOPS_STATE="$PWD"/../sec/nixops/state.nixops
163 NIXOPS_OPTS+=" --show-trace"
167 #export DISNIXOS_USE_NIXOPS=1
168 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
169 #export DISNIX_PROFILE=default
170 #export DISNIX_TARGET_PROPERTY=hostname
171 #export DYSNOMIA_STATEDIR="$PWD"/../sec/dysnomia