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
95 #pkgs.rxvt_unicode.terminfo
114 #enableParallelBuilding = true;
116 echo >&2 "nix: running shellHook"
118 # Cleanup "../sec/tmp/"
119 # This is done when exiting the nix-shell
120 # (or when… entering the directory with direnv
121 # which spawns a nix-shell just to get the env).
122 trap "cd '$PWD' && find ../sec/tmp -type f -exec shred -fu {} +" EXIT
124 ${modules.nix-shell.shellHook}
127 export NIX_PATH="nixpkgs=${nixpkgs}"
128 NIX_PATH+=":nixpkgs-overlays="$PWD"/overlays"
132 PATH_NIX=$(dirname $(readlink -e ~/.nix-profile/bin/nix))
133 PATH_NIXOS=/run/wrappers/bin
134 PATH_FHS="$PWD"/.lib/nix/fhs-bin
135 PATH_FHS_VBOX="$PWD"/.lib/fhs-vbox-bin
136 export PATH="$PATH_NIXOS:$PATH_FHS_VBOX:$PATH_FHS:$PATH:$PATH_NIX"
138 # NOTE: sudo needs to be own by root with the setuid bit,
139 # but this won't be the case for the sudo provided by Nix outside NixOS,
140 # hence the addition of $PATH_FHS in shellHook
141 # to provide the host system's sudo.
142 # WARNING: beware that sudo may reset the environment,
143 # and especially PATH, to some system's default.
146 export LANG=fr_FR.UTF-8
147 export LC_CTYPE=fr_FR.UTF-8
150 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
154 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
156 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
157 "$gitdir"/hooks/prepare-commit-msg
160 #export NIXOPS_DEPLOYMENT="staging"
161 export NIXOPS_STATE="$PWD"/../sec/nixops/state.nixops
162 NIXOPS_OPTS+=" --show-trace"
166 #export DISNIXOS_USE_NIXOPS=1
167 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
168 #export DISNIX_PROFILE=default
169 #export DISNIX_TARGET_PROPERTY=hostname
170 #export DYSNOMIA_STATEDIR="$PWD"/../sec/dysnomia