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 { meta.description = "nsd : use types.lines where appropriate";
9 url = "https://github.com/NixOS/nixpkgs/pull/78968.diff";
10 sha256 = "11bqq1g1ax6i7xghihyhklmqpsq3njalardp6nvzphkjgxrypb47";
12 { meta.description = "shorewall: init at 5.2.3.3";
13 url = "https://github.com/NixOS/nixpkgs/pull/46131.diff";
14 sha256 = "0mfzlcr23ni5spnwksmmls50sw10alqbr5j6hjrwp9i30z0419yx";
16 { meta.description = "Dovecot plugin for Full Text Search (FTS) with Xapian";
17 url = "https://github.com/NixOS/nixpkgs/pull/78780.diff";
18 sha256 = "053md69ryybj27cp0xdfrza48zyzpblk6wvb2m2dbs9hm0gmcwc4";
21 nixpkgs = originPkgs.stdenv.mkDerivation {
22 name = "nixpkgs-patched";
24 phases = [ "unpackPhase" "patchPhase" ];
25 patches = map originPkgs.fetchpatch nixpkgsPatches;
27 patch=$(printf '%s\n' ${builtins.concatStringsSep " " (map (p: p.sha256) nixpkgsPatches)} |
28 sort | sha256sum | cut -c -7)
30 echo "+patch-$patch" >$out/.version-suffix
33 pkgs = import nixpkgs {
34 config = {}; # Make the config pure, ignoring user's config.
35 overlays = import ./overlays.nix;
40 nixos = pkgs.nixos {};
41 # Configuration of shell/modules/
42 configuration = {config, ...}: {
47 auto-optimise-store = true
55 gnupgHome = toString ../sec/gnupg;
56 keys = import shell/openpgp.nix;
60 opensslHome = toString ../sec/openssl;
61 certificates = import shell/x509.nix;
64 # WARNING: nixops uses its own ssh, not this one.
67 Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr
71 ControlPath ${builtins.toString ../sec/ssh}/ssh-%h-%p-%r.socket
73 #SSAPIAuthentication no
75 StrictHostKeyChecking yes
76 UserKnownHostsFile ${builtins.toString ../sec/ssh/known_hosts}
84 # Using modules enables to separate specific configurations
85 # from reusable code in shell/modules.nix and shell/modules/
86 # which may find its way in another git repository one day.
88 (import shell/modules.nix {
90 modules = [ configuration ];
94 name = "sourcephile-nix";
96 #preferLocalBuild = true;
97 #allowSubstitutes = false;
98 buildInputs = modules.nix-shell.buildInputs ++ [
100 nixos.nixos-generate-config
134 #pkgs.rxvt_unicode.terminfo
153 #enableParallelBuilding = true;
155 echo >&2 "nix: running shellHook"
156 # WARNING: beware that sudo may reset the environment,
157 # and especially PATH, to some system's default.
160 unset __ETC_PROFILE_SOURCED
161 unset __NIXOS_SET_ENVIRONMENT_DONE
162 test ! -e /etc/profile || . /etc/profile
163 test ! -e ~/.profile || . ~/.profile
166 test ! -e ~/.nix-profile/etc/profile.d/nix.sh ||
167 . ~/.nix-profile/etc/profile.d/nix.sh
170 unset __HM_SESS_VARS_SOURCED
171 test ! -e ~/.nix-profile/etc/profile.d/hm-session-vars.sh ||
172 . ~/.nix-profile/etc/profile.d/hm-session-vars.sh
174 PATH=$NIX_SHELL_PATH:$PATH
175 export NIX_PATH="nixpkgs=${pkgs.path}:nixpkgs-overlays="$PWD"/overlays"
177 # Cleanup "../sec/tmp/"
178 # This is done when exiting the nix-shell
179 # (or when… entering the directory with direnv
180 # which spawns a nix-shell just to get the env).
181 trap "cd '$PWD' && find ../sec/tmp -type f -exec shred -fu {} +" EXIT
183 ${modules.nix-shell.shellHook}
186 export LANG=fr_FR.UTF-8
187 export LC_CTYPE=fr_FR.UTF-8
190 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
193 export GPG_TTY=$(tty)
194 gpg-connect-agent updatestartuptty /bye >/dev/null
198 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
200 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
201 "$gitdir"/hooks/prepare-commit-msg
204 #export NIXOPS_DEPLOYMENT="staging"
205 export NIXOPS_STATE="$PWD"/../sec/nixops/state.nixops
206 NIXOPS_OPTS+=" --show-trace"
210 #export DISNIXOS_USE_NIXOPS=1
211 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
212 #export DISNIX_PROFILE=default
213 #export DISNIX_TARGET_PROPERTY=hostname
214 #export DYSNOMIA_STATEDIR="$PWD"/../sec/dysnomia