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-commonsoft/build/overlays.nix;
7 commonsoft-nix-build-modules =
8 (import .lib/nixpkgs-commonsoft/build/modules.nix {
11 modules = [ ( import build/modules.nix ) ];
14 commonsoft-nix-build =
15 pkgs.stdenv.mkDerivation {
16 name = "commonsoft-nix-build";
17 preferLocalBuild = true;
18 allowSubstitutes = false;
19 inherit (pkgs) coreutils;
20 builder = pkgs.writeText "builder.sh" commonsoft-nix-build-modules.init.builder;
23 commonsoft-nix-build =
25 name = "commonsoft-nix-build";
26 pathsToLink = [ "/bin" ];
27 paths = with commonsoft-nix-build-modules; [
29 #gnupg.gpg-fingerprint
30 #nix-plugins.nix-with-extra-builtins
34 pkgs.stdenv.mkDerivation {
35 name = "commonsoft-nix";
37 #preferLocalBuild = true;
38 #allowSubstitutes = false;
49 (pkgs.glibcLocales.override {
70 #pkgs.rxvt_unicode.terminfo
84 #enableParallelBuilding = true;
87 export NIX_PATH="nixpkgs=${nixpkgs}:nixpkgs-commonsoft=$PWD/lib/nixpkgs-commonsoft"
88 #NIX_PATH+=":nixpkgs-overlays="$PWD"/install/overlays.nix"
92 PATH_NIX=$(dirname $(readlink -e ~/.nix-profile/bin/nix))
93 PATH_NIXOS=/run/wrappers/bin
94 PATH_FHS="$PWD"/.lib/nix/fhs-bin
95 PATH_FHS_VBOX="$PWD"/.lib/fhs-vbox-bin
96 export PATH="$PATH_NIXOS:$PATH_FHS_VBOX:$PATH_FHS:$PATH:$PATH_NIX"
97 ln -sfn ${commonsoft-nix-build}/bin "$PWD"/.bin
99 # NOTE: sudo needs to be own by root with the setuid bit,
100 # but this won't be the case for the sudo provided by Nix outside NixOS,
101 # hence the addition of $PATH_FHS in shellHook
102 # to provide the host system's sudo.
103 # WARNING: beware that sudo may reset the environment,
104 # and especially PATH, to some system's default.
107 export LANG=fr_FR.UTF-8
108 export LC_CTYPE=fr_FR.UTF-8
111 gpgconf --launch gpg-agent
112 export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
113 export GPG_TTY=$(tty)
114 export GNUPGHOME="$PWD"/../sec/gnupg
115 install -dm700 "$GNUPGHOME"
118 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
122 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
123 "$PWD"/.git/hooks/prepare-commit-msg
126 export NIXOPS_DEPLOYMENT="virtualbox"
127 export NIXOPS_STATE="$PWD"/.var/nixops/state.nixops
128 # Extend the Nix interpreter
129 # to enable builtins.extraBuiltins,
130 # which provides an unsafe exec useful to get secrets
131 # from the local password-store.
132 NIXOPS_OPTS+=" --show-trace"
133 NIXOPS_OPTS+=" --option plugin-files ${pkgs.nix-plugins}/lib/nix/plugins/libnix-extra-builtins.so"
134 NIXOPS_OPTS+=" --option extra-builtins-file ${commonsoft-nix-build-modules.nix-plugins.extra-builtins}"
138 #export DISNIXOS_USE_NIXOPS=1
139 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
140 #export DISNIX_PROFILE=default
141 #export DISNIX_TARGET_PROPERTY=hostname
142 #export DYSNOMIA_STATEDIR=var/dysnomia