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 ${modules.nix-shell.shellHook}
116 export NIX_PATH="nixpkgs=${nixpkgs}"
117 NIX_PATH+=":nixpkgs-overlays="$PWD"/overlays"
121 PATH_NIX=$(dirname $(readlink -e ~/.nix-profile/bin/nix))
122 PATH_NIXOS=/run/wrappers/bin
123 PATH_FHS="$PWD"/.lib/nix/fhs-bin
124 PATH_FHS_VBOX="$PWD"/.lib/fhs-vbox-bin
125 export PATH="$PATH_NIXOS:$PATH_FHS_VBOX:$PATH_FHS:$PATH:$PATH_NIX"
127 # NOTE: sudo needs to be own by root with the setuid bit,
128 # but this won't be the case for the sudo provided by Nix outside NixOS,
129 # hence the addition of $PATH_FHS in shellHook
130 # to provide the host system's sudo.
131 # WARNING: beware that sudo may reset the environment,
132 # and especially PATH, to some system's default.
135 export LANG=fr_FR.UTF-8
136 export LC_CTYPE=fr_FR.UTF-8
139 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
143 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
145 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
146 "$gitdir"/hooks/prepare-commit-msg
149 #export NIXOPS_DEPLOYMENT="staging"
150 export NIXOPS_STATE="$PWD"/.sec/nixops/state.nixops
151 NIXOPS_OPTS+=" --show-trace"
155 #export DISNIXOS_USE_NIXOPS=1
156 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
157 #export DISNIX_PROFILE=default
158 #export DISNIX_TARGET_PROPERTY=hostname
159 #export DYSNOMIA_STATEDIR="$PWD"/.sec/dysnomia