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 nixpkgs = originPkgs.stdenv.mkDerivation {
34 name = "nixpkgs-patched";
36 phases = [ "unpackPhase" "patchPhase" ];
37 patches = map originPkgs.fetchpatch nixpkgsPatches;
39 patch=$(printf '%s\n' ${builtins.concatStringsSep " " (map (p: p.sha256) nixpkgsPatches)} |
40 sort | sha256sum | cut -c -7)
42 echo "+patch-$patch" >$out/.version-suffix
45 pkgs = import nixpkgs {
46 config = {}; # Make the config pure, ignoring user's config.
47 overlays = import ./overlays.nix;
52 nixos = pkgs.nixos {};
53 # Configuration of shell/modules/
54 configuration = {config, ...}: {
59 auto-optimise-store = true
67 gnupgHome = toString ../sec/gnupg;
68 keys = import shell/openpgp.nix;
70 trusted-key 0xB2450D97085B7B8C
75 opensslHome = toString ../sec/openssl;
76 certificates = import shell/x509.nix;
79 # WARNING: nixops uses its own ssh, not this one.
82 Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr
86 ControlPath ${builtins.toString ../sec/ssh}/ssh-%h-%p-%r.socket
88 #SSAPIAuthentication no
90 StrictHostKeyChecking yes
91 UserKnownHostsFile ${builtins.toString ../sec/ssh/known_hosts}
99 # Using modules enables to separate specific configurations
100 # from reusable code in shell/modules.nix and shell/modules/
101 # which may find its way in another git repository one day.
103 (import shell/modules.nix {
105 modules = [ configuration ];
109 name = "sourcephile-nix";
111 #preferLocalBuild = true;
112 #allowSubstitutes = false;
113 buildInputs = modules.nix-shell.buildInputs ++ [
115 nixos.nixos-generate-config
149 #pkgs.rxvt_unicode.terminfo
168 #enableParallelBuilding = true;
170 echo >&2 "nix: running shellHook"
171 # WARNING: beware that sudo may reset the environment,
172 # and especially PATH, to some system's default.
175 unset __ETC_PROFILE_SOURCED
176 unset __NIXOS_SET_ENVIRONMENT_DONE
177 test ! -e /etc/profile || . /etc/profile
178 test ! -e ~/.profile || . ~/.profile
181 test ! -e ~/.nix-profile/etc/profile.d/nix.sh ||
182 . ~/.nix-profile/etc/profile.d/nix.sh
185 unset __HM_SESS_VARS_SOURCED
186 test ! -e ~/.nix-profile/etc/profile.d/hm-session-vars.sh ||
187 . ~/.nix-profile/etc/profile.d/hm-session-vars.sh
189 PATH=$NIX_SHELL_PATH:$PATH
190 export NIX_PATH="nixpkgs=${pkgs.path}:nixpkgs-overlays="$PWD"/overlays"
192 # Cleanup "../sec/tmp/"
193 # This is done when exiting the nix-shell
194 # (or when… entering the directory with direnv
195 # which spawns a nix-shell just to get the env).
196 trap "cd '$PWD' && find ../sec/tmp -type f -exec shred -fu {} +" EXIT
198 ${modules.nix-shell.shellHook}
201 export LANG=fr_FR.UTF-8
202 export LC_CTYPE=fr_FR.UTF-8
205 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
208 export GPG_TTY=$(tty)
209 gpg-connect-agent updatestartuptty /bye >/dev/null
213 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
215 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
216 "$gitdir"/hooks/prepare-commit-msg
219 #export NIXOPS_DEPLOYMENT="staging"
220 export NIXOPS_STATE="$PWD"/../sec/nixops/state.nixops
221 NIXOPS_OPTS+=" --show-trace"
225 #export DISNIXOS_USE_NIXOPS=1
226 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
227 #export DISNIX_PROFILE=default
228 #export DISNIX_TARGET_PROPERTY=hostname
229 #export DYSNOMIA_STATEDIR="$PWD"/../sec/dysnomia