2 originNixpkgs = import (.config/nixpkgs-channel + ("/" + builtins.getEnv "nixpkgs_channel" + ".nix"));
3 originPkgs = import originNixpkgs {
4 config = {}; # Make the config pure, ignoring user's config.
9 { meta.description = "nsd : use types.lines where appropriate";
10 url = "https://github.com/NixOS/nixpkgs/pull/78968.diff";
11 sha256 = "11bqq1g1ax6i7xghihyhklmqpsq3njalardp6nvzphkjgxrypb47";
13 { meta.description = "shorewall: init at 5.2.3.3";
14 url = "https://github.com/NixOS/nixpkgs/pull/46131.diff";
15 sha256 = "0mfzlcr23ni5spnwksmmls50sw10alqbr5j6hjrwp9i30z0419yx";
18 { meta.description = "Dovecot plugin for Full Text Search (FTS) with Xapian";
19 url = "https://github.com/NixOS/nixpkgs/pull/78780.diff";
20 sha256 = "053md69ryybj27cp0xdfrza48zyzpblk6wvb2m2dbs9hm0gmcwc4";
22 /* Disabled because it triggers the local build of too many reverse-dependencies
23 { meta.description = "openldap: enable sha2 and pbkdf2 modules";
24 url = "https://github.com/NixOS/nixpkgs/pull/79286.diff";
25 sha256 = "0y255x74qksqy7fm4bdwlknhm3s55vgfgbv4dd7580p4lcavya0m";
28 { meta.description = "Replace simp-le with lego and support DNS-01 challenge";
29 url = "https://github.com/NixOS/nixpkgs/pull/77578.diff";
30 sha256 = "15zs2146zh54jg1gywrcwyqxpx7izc35vlakk3cvrlqwwsvlr2rf";
33 localNixpkgsPatches = [
35 nixpkgs = originPkgs.stdenv.mkDerivation {
36 name = "nixpkgs-patched";
38 phases = [ "unpackPhase" "patchPhase" ];
39 patches = map originPkgs.fetchpatch nixpkgsPatches ++ localNixpkgsPatches;
41 patch=$(printf '%s\n' ${builtins.concatStringsSep " " (map (p: p.sha256) nixpkgsPatches)} |
42 sort | sha256sum | cut -c -7)
44 echo "+patch-$patch" >$out/.version-suffix
47 pkgs = import nixpkgs {
48 config = {}; # Make the config pure, ignoring user's config.
49 overlays = import ./overlays.nix;
54 nixos = pkgs.nixos {};
55 # Configuration of shell/modules/
56 configuration = {config, ...}: {
61 auto-optimise-store = true
69 gnupgHome = toString ../sec/gnupg;
70 keys = import shell/openpgp.nix;
72 trusted-key 0xB2450D97085B7B8C
77 opensslHome = toString ../sec/openssl;
78 certificates = import shell/x509.nix;
81 # WARNING: nixops uses its own ssh, not this one.
84 Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr
88 ControlPath ${builtins.toString ../sec/ssh}/ssh-%h-%p-%r.socket
90 #SSAPIAuthentication no
92 StrictHostKeyChecking yes
93 UserKnownHostsFile ${builtins.toString ../sec/ssh/known_hosts}
101 # Using modules enables to separate specific configurations
102 # from reusable code in shell/modules.nix and shell/modules/
103 # which may find its way in another git repository one day.
105 (import shell/modules.nix {
107 modules = [ configuration ];
111 name = "sourcephile-nix";
113 #preferLocalBuild = true;
114 #allowSubstitutes = false;
115 buildInputs = modules.nix-shell.buildInputs ++ [
117 nixos.nixos-generate-config
151 #pkgs.rxvt_unicode.terminfo
170 #enableParallelBuilding = true;
172 echo >&2 "nix: running shellHook"
173 # WARNING: beware that sudo may reset the environment,
174 # and especially PATH, to some system's default.
177 unset __ETC_PROFILE_SOURCED
178 unset __NIXOS_SET_ENVIRONMENT_DONE
179 test ! -e /etc/profile || . /etc/profile
180 test ! -e ~/.profile || . ~/.profile
183 test ! -e ~/.nix-profile/etc/profile.d/nix.sh ||
184 . ~/.nix-profile/etc/profile.d/nix.sh
187 unset __HM_SESS_VARS_SOURCED
188 test ! -e ~/.nix-profile/etc/profile.d/hm-session-vars.sh ||
189 . ~/.nix-profile/etc/profile.d/hm-session-vars.sh
191 PATH=$NIX_SHELL_PATH:$PATH
192 export NIX_PATH="nixpkgs=${pkgs.path}:nixpkgs-overlays="$PWD"/overlays"
194 # Cleanup "../sec/tmp/"
195 # This is done when exiting the nix-shell
196 # (or when… entering the directory with direnv
197 # which spawns a nix-shell just to get the env).
198 trap "cd '$PWD' && find ../sec/tmp -type f -exec shred -fu {} +" EXIT
200 ${modules.nix-shell.shellHook}
203 export LANG=fr_FR.UTF-8
204 export LC_CTYPE=fr_FR.UTF-8
207 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
210 export GPG_TTY=$(tty)
211 gpg-connect-agent updatestartuptty /bye >/dev/null
215 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
217 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
218 "$gitdir"/hooks/prepare-commit-msg
221 #export NIXOPS_DEPLOYMENT="staging"
222 export NIXOPS_STATE="$PWD"/../sec/nixops/state.nixops
223 NIXOPS_OPTS+=" --show-trace"
227 #export DISNIXOS_USE_NIXOPS=1
228 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
229 #export DISNIX_PROFILE=default
230 #export DISNIX_TARGET_PROPERTY=hostname
231 #export DYSNOMIA_STATEDIR="$PWD"/../sec/dysnomia