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/gnupg/keys.nix;
30 Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com
34 ControlPath ${builtins.toString .sec/ssh}/ssh-%h-%p-%r.socket
36 SSAPIAuthentication no
38 StrictHostKeyChecking yes
39 UserKnownHostsFile ${builtins.toString .sec/ssh/known_hosts}
44 # Using modules enables to separate specific configurations
45 # from reusable code in shell/modules.nix and shell/modules/
46 # which may find its way in another git repository one day.
48 (import shell/modules.nix {
50 modules = [ configuration ];
53 pkgs.stdenv.mkDerivation {
54 name = "sourcephile-nix";
56 #preferLocalBuild = true;
57 #allowSubstitutes = false;
58 buildInputs = modules.nix-shell.buildInputs ++ [
60 nixos.nixos-generate-config
90 #pkgs.rxvt_unicode.terminfo
109 #enableParallelBuilding = true;
111 echo >&2 "nix: running shellHook"
113 # Cleanup extraBuiltins.pass-to-file residues
114 trap "cd '$PWD' && find .sec/tmp -type f -exec shred -fu {} +" EXIT
116 ${modules.nix-shell.shellHook}
119 export NIX_PATH="nixpkgs=${nixpkgs}"
120 NIX_PATH+=":nixpkgs-overlays="$PWD"/overlays"
124 PATH_NIX=$(dirname $(readlink -e ~/.nix-profile/bin/nix))
125 PATH_NIXOS=/run/wrappers/bin
126 PATH_FHS="$PWD"/.lib/nix/fhs-bin
127 PATH_FHS_VBOX="$PWD"/.lib/fhs-vbox-bin
128 export PATH="$PATH_NIXOS:$PATH_FHS_VBOX:$PATH_FHS:$PATH:$PATH_NIX"
130 # NOTE: sudo needs to be own by root with the setuid bit,
131 # but this won't be the case for the sudo provided by Nix outside NixOS,
132 # hence the addition of $PATH_FHS in shellHook
133 # to provide the host system's sudo.
134 # WARNING: beware that sudo may reset the environment,
135 # and especially PATH, to some system's default.
138 export LANG=fr_FR.UTF-8
139 export LC_CTYPE=fr_FR.UTF-8
142 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
146 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
148 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
149 "$gitdir"/hooks/prepare-commit-msg
152 #export NIXOPS_DEPLOYMENT="staging"
153 export NIXOPS_STATE="$PWD"/.sec/nixops/state.nixops
154 NIXOPS_OPTS+=" --show-trace"
158 #export DISNIXOS_USE_NIXOPS=1
159 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
160 #export DISNIX_PROFILE=default
161 #export DISNIX_TARGET_PROPERTY=hostname
162 #export DYSNOMIA_STATEDIR="$PWD"/.sec/dysnomia