2 nixpkgs = import .config/nixpkgs-channel/nixos-19.09-small.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/openpgp.nix;
28 opensslHome = toString ../sec/openssl;
29 certificates = import shell/x509.nix;
32 # WARNING: nixops uses its own ssh, not this one.
35 Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr
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}
52 # Using modules enables to separate specific configurations
53 # from reusable code in shell/modules.nix and shell/modules/
54 # which may find its way in another git repository one day.
56 (import shell/modules.nix {
58 modules = [ configuration ];
61 pkgs.stdenv.mkDerivation {
62 name = "sourcephile-nix";
64 #preferLocalBuild = true;
65 #allowSubstitutes = false;
66 buildInputs = modules.nix-shell.buildInputs ++ [
68 nixos.nixos-generate-config
102 #pkgs.rxvt_unicode.terminfo
121 #enableParallelBuilding = true;
123 echo >&2 "nix: running shellHook"
124 # WARNING: beware that sudo may reset the environment,
125 # and especially PATH, to some system's default.
128 unset __ETC_PROFILE_SOURCED
129 unset __NIXOS_SET_ENVIRONMENT_DONE
130 test ! -e /etc/profile || . /etc/profile
131 test ! -e ~/.profile || . ~/.profile
134 test ! -e ~/.nix-profile/etc/profile.d/nix.sh ||
135 . ~/.nix-profile/etc/profile.d/nix.sh
138 unset __HM_SESS_VARS_SOURCED
139 test ! -e ~/.nix-profile/etc/profile.d/hm-session-vars.sh ||
140 . ~/.nix-profile/etc/profile.d/hm-session-vars.sh
142 PATH=$NIX_SHELL_PATH:$PATH
143 export NIX_PATH="nixpkgs=${nixpkgs}:nixpkgs-overlays="$PWD"/overlays"
145 # Cleanup "../sec/tmp/"
146 # This is done when exiting the nix-shell
147 # (or when… entering the directory with direnv
148 # which spawns a nix-shell just to get the env).
149 trap "cd '$PWD' && find ../sec/tmp -type f -exec shred -fu {} +" EXIT
151 ${modules.nix-shell.shellHook}
154 export LANG=fr_FR.UTF-8
155 export LC_CTYPE=fr_FR.UTF-8
158 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
161 export GPG_TTY=$(tty)
162 gpg-connect-agent updatestartuptty /bye >/dev/null
166 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
168 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
169 "$gitdir"/hooks/prepare-commit-msg
172 #export NIXOPS_DEPLOYMENT="staging"
173 export NIXOPS_STATE="$PWD"/../sec/nixops/state.nixops
174 NIXOPS_OPTS+=" --show-trace"
178 #export DISNIXOS_USE_NIXOPS=1
179 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
180 #export DISNIX_PROFILE=default
181 #export DISNIX_TARGET_PROPERTY=hostname
182 #export DYSNOMIA_STATEDIR="$PWD"/../sec/dysnomia