2 nixpkgs_channel = builtins.getEnv "nixpkgs_channel";
3 originNixpkgs = import (.config/nixpkgs-channel + ("/" + nixpkgs_channel + ".nix"));
4 originPkgs = import originNixpkgs {
5 config = {}; # Make the config pure, ignoring user's config.
10 { meta.description = "nsd : use types.lines where appropriate";
11 url = "https://github.com/NixOS/nixpkgs/pull/78968.diff";
12 sha256 = "11bqq1g1ax6i7xghihyhklmqpsq3njalardp6nvzphkjgxrypb47";
14 { meta.description = "shorewall: init at 5.2.3.3";
15 url = "https://github.com/NixOS/nixpkgs/pull/46131.diff";
16 sha256 = "0mfzlcr23ni5spnwksmmls50sw10alqbr5j6hjrwp9i30z0419yx";
19 { meta.description = "Dovecot plugin for Full Text Search (FTS) with Xapian";
20 url = "https://github.com/NixOS/nixpkgs/pull/78780.diff";
21 sha256 = "053md69ryybj27cp0xdfrza48zyzpblk6wvb2m2dbs9hm0gmcwc4";
23 /* Disabled because it triggers the local build of too many reverse-dependencies
24 { meta.description = "openldap: enable sha2 and pbkdf2 modules";
25 url = "https://github.com/NixOS/nixpkgs/pull/79286.diff";
26 sha256 = "0y255x74qksqy7fm4bdwlknhm3s55vgfgbv4dd7580p4lcavya0m";
29 { meta.description = "Replace simp-le with lego and support DNS-01 challenge";
30 url = "https://github.com/NixOS/nixpkgs/pull/77578.diff";
31 sha256 = "15zs2146zh54jg1gywrcwyqxpx7izc35vlakk3cvrlqwwsvlr2rf";
34 localNixpkgsPatches = [
36 nixpkgs = originPkgs.stdenv.mkDerivation {
37 name = "nixpkgs-patched";
39 phases = [ "unpackPhase" "patchPhase" ];
40 patches = map originPkgs.fetchpatch nixpkgsPatches ++ localNixpkgsPatches;
42 patch=$(printf '%s\n' ${builtins.concatStringsSep " " (map (p: p.sha256) nixpkgsPatches)} |
43 sort | sha256sum | cut -c -7)
45 echo "+patch-$patch" >$out/.version-suffix
48 pkgs = import nixpkgs {
49 config = {}; # Make the config pure, ignoring user's config.
50 overlays = import ./overlays.nix;
55 nixos = pkgs.nixos {};
56 # Configuration of shell/modules/
57 configuration = {config, ...}: {
62 auto-optimise-store = true
70 gnupgHome = toString ../sec/gnupg;
71 keys = import shell/openpgp.nix;
73 trusted-key 0xB2450D97085B7B8C
78 opensslHome = toString ../sec/openssl;
79 certificates = import shell/x509.nix;
82 # WARNING: nixops uses its own ssh, not this one.
85 Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr
89 ControlPath ${builtins.toString ../sec/ssh}/ssh-%h-%p-%r.socket
91 #SSAPIAuthentication no
93 StrictHostKeyChecking yes
94 UserKnownHostsFile ${builtins.toString ../sec/ssh/known_hosts}
102 # Using modules enables to separate specific configurations
103 # from reusable code in shell/modules.nix and shell/modules/
104 # which may find its way in another git repository one day.
106 (import shell/modules.nix {
108 modules = [ configuration ];
112 name = "sourcephile-nix";
114 #preferLocalBuild = true;
115 #allowSubstitutes = false;
116 buildInputs = modules.nix-shell.buildInputs ++ [
118 nixos.nixos-generate-config
152 #pkgs.rxvt_unicode.terminfo
171 #enableParallelBuilding = true;
173 echo >&2 "nix: running shellHook"
174 # WARNING: beware that sudo may reset the environment,
175 # and especially PATH, to some system's default.
178 unset __ETC_PROFILE_SOURCED
179 unset __NIXOS_SET_ENVIRONMENT_DONE
180 test ! -e /etc/profile || . /etc/profile
181 test ! -e ~/.profile || . ~/.profile
184 test ! -e ~/.nix-profile/etc/profile.d/nix.sh ||
185 . ~/.nix-profile/etc/profile.d/nix.sh
188 unset __HM_SESS_VARS_SOURCED
189 test ! -e ~/.nix-profile/etc/profile.d/hm-session-vars.sh ||
190 . ~/.nix-profile/etc/profile.d/hm-session-vars.sh
192 PATH=$NIX_SHELL_PATH:$PATH
193 export NIX_PATH="nixpkgs=${toString pkgs.path}:nixpkgs-overlays="$PWD"/overlays"
194 export nixpkgs_channel=${nixpkgs_channel}
196 # Cleanup "../sec/tmp/"
197 # This is done when exiting the nix-shell
198 # (or when… entering the directory with direnv
199 # which spawns a nix-shell just to get the env).
200 trap "cd '$PWD' && find ../sec/tmp -type f -exec shred -fu {} +" EXIT
202 ${modules.nix-shell.shellHook}
205 export LANG=fr_FR.UTF-8
206 export LC_CTYPE=fr_FR.UTF-8
209 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
212 export GPG_TTY=$(tty)
213 gpg-connect-agent updatestartuptty /bye >/dev/null
217 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
219 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
220 "$gitdir"/hooks/prepare-commit-msg
223 #export NIXOPS_DEPLOYMENT="staging"
224 export NIXOPS_STATE="$PWD"/../sec/nixops/state.nixops
225 NIXOPS_OPTS+=" --show-trace"
229 #export DISNIXOS_USE_NIXOPS=1
230 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
231 #export DISNIX_PROFILE=default
232 #export DISNIX_TARGET_PROPERTY=hostname
233 #export DYSNOMIA_STATEDIR="$PWD"/../sec/dysnomia