2 nixpkgs = import .lib/nix/nixpkgs.nix;
3 pkgs = import nixpkgs {
4 config = {}; # Make the config pure, ignoring user's config.
5 overlays = import .lib/nixpkgs-plurasoft/build/overlays.nix;
7 plurasoft-nix-build-modules =
8 (import .lib/nixpkgs-plurasoft/build/modules.nix {
11 modules = [ ( import build/modules.nix ) ];
15 pkgs.stdenv.mkDerivation {
16 name = "plurasoft-nix-build";
17 preferLocalBuild = true;
18 allowSubstitutes = false;
19 inherit (pkgs) coreutils;
20 builder = pkgs.writeText "builder.sh" plurasoft-nix-build-modules.init.builder;
25 name = "plurasoft-nix-build";
26 pathsToLink = [ "/bin" ];
27 paths = with plurasoft-nix-build-modules; [
29 #gnupg.gpg-fingerprint
30 #nix-plugins.nix-with-extra-builtins
34 pkgs.stdenv.mkDerivation {
35 name = "plurasoft-nix";
37 #preferLocalBuild = true;
38 #allowSubstitutes = false;
64 #pkgs.rxvt_unicode.terminfo
78 #enableParallelBuilding = true;
81 export NIX_PATH="nixpkgs=${nixpkgs}:nixpkgs-plurasoft=$PWD/.lib/nixpkgs-plurasoft"
82 #NIX_PATH+=":nixpkgs-overlays="$PWD"/install/overlays.nix"
86 PATH_NIX=$(dirname $(readlink -e ~/.nix-profile/bin/nix))
87 PATH_NIXOS=/run/wrappers/bin
88 PATH_FHS="$PWD"/.lib/nix/fhs-bin
89 PATH_FHS_VBOX="$PWD"/.lib/fhs-vbox-bin
90 export PATH="$PATH_NIXOS:$PATH_FHS_VBOX:$PATH_FHS:$PATH:$PATH_NIX"
91 ln -sfn ${plurasoft-nix-build}/bin "$PWD"/.bin
93 # NOTE: sudo needs to be own by root with the setuid bit,
94 # but this won't be the case for the sudo provided by Nix outside NixOS,
95 # hence the addition of $PATH_FHS in shellHook
96 # to provide the host system's sudo.
97 # WARNING: beware that sudo may reset the environment,
98 # and especially PATH, to some system's default.
101 export LANG=fr_FR.UTF-8
102 export LC_CTYPE=fr_FR.UTF-8
105 export GNUPGHOME="$PWD"/../sec/gnupg
106 install -dm700 "$GNUPGHOME"
107 export GPG_TTY=$(tty)
108 gpgconf --launch gpg-agent
109 export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
112 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
115 export SSL_CERT_FILE="${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
119 test ! -f "$gitdir" || while IFS=" :" read -r hdr gitdir; do [ "$hdr" != gitdir ] || break; done <"$gitdir"
121 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
122 "$gitdir"/hooks/prepare-commit-msg
125 export NIXOPS_DEPLOYMENT="virtualbox"
126 export NIXOPS_STATE="$PWD"/.sec/nixops/state.nixops
127 # Extend the Nix interpreter
128 # to enable builtins.extraBuiltins,
129 # which provides an unsafe exec useful to get secrets
130 # from the local password-store.
131 NIXOPS_OPTS+=" --show-trace"
132 NIXOPS_OPTS+=" --option plugin-files ${pkgs.nix-plugins}/lib/nix/plugins/libnix-extra-builtins.so"
133 NIXOPS_OPTS+=" --option extra-builtins-file ${plurasoft-nix-build-modules.nix-plugins.extra-builtins}"
137 #export DISNIXOS_USE_NIXOPS=1
138 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
139 #export DISNIX_PROFILE=default
140 #export DISNIX_TARGET_PROPERTY=hostname
141 #export DYSNOMIA_STATEDIR="$PWD"/.sec/dysnomia