2 originNixpkgs = import .config/nixpkgs-channel/nixos-19.09-small.nix;
3 originPkgs = import originNixpkgs {
4 config = {}; # Make the config pure, ignoring user's config.
8 nixpkgs = originPkgs.stdenv.mkDerivation {
9 name = "nixpkgs-patched";
11 phases = [ "unpackPhase" "patchPhase" ];
12 patches = map originPkgs.fetchpatch [
13 { meta.description = "nsd : use types.lines where appropriate";
14 url = "https://github.com/NixOS/nixpkgs/pull/78968.diff";
15 sha256 = "11bqq1g1ax6i7xghihyhklmqpsq3njalardp6nvzphkjgxrypb47";
19 mkdir $out && cp -r * $out/
20 echo "19.09" > $out/.version
21 echo "19.09pre-git.custom" > $out/.version-suffix
24 pkgs = import nixpkgs {
25 config = {}; # Make the config pure, ignoring user's config.
26 overlays = import ./overlays.nix;
31 nixos = pkgs.nixos {};
32 # Configuration of shell/modules/
33 configuration = {config, ...}: {
38 auto-optimise-store = true
46 gnupgHome = toString ../sec/gnupg;
47 keys = import shell/openpgp.nix;
51 opensslHome = toString ../sec/openssl;
52 certificates = import shell/x509.nix;
55 # WARNING: nixops uses its own ssh, not this one.
58 Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr
62 ControlPath ${builtins.toString ../sec/ssh}/ssh-%h-%p-%r.socket
64 #SSAPIAuthentication no
66 StrictHostKeyChecking yes
67 UserKnownHostsFile ${builtins.toString ../sec/ssh/known_hosts}
75 # Using modules enables to separate specific configurations
76 # from reusable code in shell/modules.nix and shell/modules/
77 # which may find its way in another git repository one day.
79 (import shell/modules.nix {
81 modules = [ configuration ];
84 pkgs.stdenv.mkDerivation {
85 name = "sourcephile-nix";
87 #preferLocalBuild = true;
88 #allowSubstitutes = false;
89 buildInputs = modules.nix-shell.buildInputs ++ [
91 nixos.nixos-generate-config
125 #pkgs.rxvt_unicode.terminfo
144 #enableParallelBuilding = true;
146 echo >&2 "nix: running shellHook"
147 # WARNING: beware that sudo may reset the environment,
148 # and especially PATH, to some system's default.
151 unset __ETC_PROFILE_SOURCED
152 unset __NIXOS_SET_ENVIRONMENT_DONE
153 test ! -e /etc/profile || . /etc/profile
154 test ! -e ~/.profile || . ~/.profile
157 test ! -e ~/.nix-profile/etc/profile.d/nix.sh ||
158 . ~/.nix-profile/etc/profile.d/nix.sh
161 unset __HM_SESS_VARS_SOURCED
162 test ! -e ~/.nix-profile/etc/profile.d/hm-session-vars.sh ||
163 . ~/.nix-profile/etc/profile.d/hm-session-vars.sh
165 PATH=$NIX_SHELL_PATH:$PATH
166 export NIX_PATH="nixpkgs=${pkgs.path}:nixpkgs-overlays="$PWD"/overlays"
168 # Cleanup "../sec/tmp/"
169 # This is done when exiting the nix-shell
170 # (or when… entering the directory with direnv
171 # which spawns a nix-shell just to get the env).
172 trap "cd '$PWD' && find ../sec/tmp -type f -exec shred -fu {} +" EXIT
174 ${modules.nix-shell.shellHook}
177 export LANG=fr_FR.UTF-8
178 export LC_CTYPE=fr_FR.UTF-8
181 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
184 export GPG_TTY=$(tty)
185 gpg-connect-agent updatestartuptty /bye >/dev/null
189 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
191 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
192 "$gitdir"/hooks/prepare-commit-msg
195 #export NIXOPS_DEPLOYMENT="staging"
196 export NIXOPS_STATE="$PWD"/../sec/nixops/state.nixops
197 NIXOPS_OPTS+=" --show-trace"
201 #export DISNIXOS_USE_NIXOPS=1
202 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
203 #export DISNIX_PROFILE=default
204 #export DISNIX_TARGET_PROPERTY=hostname
205 #export DYSNOMIA_STATEDIR="$PWD"/../sec/dysnomia