3 # Configuration of shell/modules/
4 # to expand shellHook and buildInputs of this shell.nix
5 shellConfig = {config, ...}: {
11 auto-optimise-store = true
12 experimental-features nix-command flake
17 gnupgHome = "../sec/gnupg";
20 trusted-key 0xB2450D97085B7B8C
22 gpgAgentExtraConf = ''
23 #pretend-request-origin remote
24 #extra-socket ${toString ./.}/S.gpg-agent.extra
25 #log-file ${toString ./.}/gpg-agent.log
28 #allow-loopback-pinentry
34 opensslHome = "../sec/openssl";
35 certificates = import shell/x509.nix;
41 Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr
45 ControlPath .ssh-%h-%p-%r.socket
47 #SSAPIAuthentication no
49 StrictHostKeyChecking yes
50 UserKnownHostsFile ${inputs.secrets + "/ssh/known_hosts"}
58 # Using modules enables to separate specific configurations
59 # from reusable code in shell/modules.nix and shell/modules/
60 # which may find its way in another git repository one day.
61 shell = (pkgs.lib.evalModules {
64 { config._module.args = { inherit inputs pkgs; }; }
65 ] ++ map import (pkgs.lib.findFiles ".*\\.nix" (inputs.shell + "/modules"));
68 pwd = toString (./. + "");
69 sourcephile-shred-tmp = pkgs.writeShellScriptBin "sourcephile-shred-tmp" ''
70 # This is done when entering the nix-shell
71 # because direnv already hooks trap EXIT.
73 test ! -e sec/tmp || {
74 find sec/tmp -type f -exec shred -fu {} +
80 name = "sourcephile-nix";
82 #preferLocalBuild = true;
83 #allowSubstitutes = false;
84 buildInputs = shell.nix-shell.buildInputs ++ [
86 (pkgs.nixos []).nixos-generate-config
87 (pkgs.nixos []).nixos-install
88 (pkgs.nixos []).nixos-enter
120 #pkgs.rxvt_unicode.terminfo
137 pkgs.linuxPackages.perf
145 #enableParallelBuilding = true;
147 PASSWORD_STORE_DIR = "pass";
148 GNUPGHOME = shell.gnupg.gnupgHome;
149 NIX_PATH = pkgs.lib.concatStringsSep ":" [
150 "nixpkgs=${pkgs.path}"
151 ("nixpkgs-overlays=" + pkgs.writeText "overlays.nix" ''
152 import ${inputs.self + "/nixpkgs/overlays.nix"} ++
153 import ${inputs.julm-nix + "/nixpkgs/overlays.nix"}
158 echo >&2 "nix: running shellHook"
160 # Since the .envrc calls this shellHook
161 # the EXIT trap cannot be freely used
162 # because it's already used by direnv,
163 # hence shred at startup, which is not ideal.
164 sourcephile-shred-tmp
166 ${shell.nix-shell.shellHook}
169 export GPG_TTY=$(tty)
170 gpg-connect-agent updatestartuptty /bye >/dev/null