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";
20 { meta.description = "openldap: enable sha2 and pbkdf2 modules";
21 url = "https://github.com/NixOS/nixpkgs/pull/79286.diff";
22 sha256 = "0y255x74qksqy7fm4bdwlknhm3s55vgfgbv4dd7580p4lcavya0m";
25 nixpkgs = originPkgs.stdenv.mkDerivation {
26 name = "nixpkgs-patched";
28 phases = [ "unpackPhase" "patchPhase" ];
29 patches = map originPkgs.fetchpatch nixpkgsPatches;
31 patch=$(printf '%s\n' ${builtins.concatStringsSep " " (map (p: p.sha256) nixpkgsPatches)} |
32 sort | sha256sum | cut -c -7)
34 echo "+patch-$patch" >$out/.version-suffix
37 pkgs = import nixpkgs {
38 config = {}; # Make the config pure, ignoring user's config.
39 overlays = import ./overlays.nix;
44 nixos = pkgs.nixos {};
45 # Configuration of shell/modules/
46 configuration = {config, ...}: {
51 auto-optimise-store = true
59 gnupgHome = toString ../sec/gnupg;
60 keys = import shell/openpgp.nix;
62 trusted-key 0xB2450D97085B7B8C
67 opensslHome = toString ../sec/openssl;
68 certificates = import shell/x509.nix;
71 # WARNING: nixops uses its own ssh, not this one.
74 Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr
78 ControlPath ${builtins.toString ../sec/ssh}/ssh-%h-%p-%r.socket
80 #SSAPIAuthentication no
82 StrictHostKeyChecking yes
83 UserKnownHostsFile ${builtins.toString ../sec/ssh/known_hosts}
91 # Using modules enables to separate specific configurations
92 # from reusable code in shell/modules.nix and shell/modules/
93 # which may find its way in another git repository one day.
95 (import shell/modules.nix {
97 modules = [ configuration ];
101 name = "sourcephile-nix";
103 #preferLocalBuild = true;
104 #allowSubstitutes = false;
105 buildInputs = modules.nix-shell.buildInputs ++ [
107 nixos.nixos-generate-config
141 #pkgs.rxvt_unicode.terminfo
160 #enableParallelBuilding = true;
162 echo >&2 "nix: running shellHook"
163 # WARNING: beware that sudo may reset the environment,
164 # and especially PATH, to some system's default.
167 unset __ETC_PROFILE_SOURCED
168 unset __NIXOS_SET_ENVIRONMENT_DONE
169 test ! -e /etc/profile || . /etc/profile
170 test ! -e ~/.profile || . ~/.profile
173 test ! -e ~/.nix-profile/etc/profile.d/nix.sh ||
174 . ~/.nix-profile/etc/profile.d/nix.sh
177 unset __HM_SESS_VARS_SOURCED
178 test ! -e ~/.nix-profile/etc/profile.d/hm-session-vars.sh ||
179 . ~/.nix-profile/etc/profile.d/hm-session-vars.sh
181 PATH=$NIX_SHELL_PATH:$PATH
182 export NIX_PATH="nixpkgs=${pkgs.path}:nixpkgs-overlays="$PWD"/overlays"
184 # Cleanup "../sec/tmp/"
185 # This is done when exiting the nix-shell
186 # (or when… entering the directory with direnv
187 # which spawns a nix-shell just to get the env).
188 trap "cd '$PWD' && find ../sec/tmp -type f -exec shred -fu {} +" EXIT
190 ${modules.nix-shell.shellHook}
193 export LANG=fr_FR.UTF-8
194 export LC_CTYPE=fr_FR.UTF-8
197 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
200 export GPG_TTY=$(tty)
201 gpg-connect-agent updatestartuptty /bye >/dev/null
205 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
207 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
208 "$gitdir"/hooks/prepare-commit-msg
211 #export NIXOPS_DEPLOYMENT="staging"
212 export NIXOPS_STATE="$PWD"/../sec/nixops/state.nixops
213 NIXOPS_OPTS+=" --show-trace"
217 #export DISNIXOS_USE_NIXOPS=1
218 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
219 #export DISNIX_PROFILE=default
220 #export DISNIX_TARGET_PROPERTY=hostname
221 #export DYSNOMIA_STATEDIR="$PWD"/../sec/dysnomia