2 nixpkgs = import .lib/nix/nixpkgs.nix;
3 pkgs = import nixpkgs {
4 config = {}; # Make the config pure, ignoring user's config.
5 overlays = []; # Make the overlays pure, ignoring user's overlays.
8 pkgs.stdenv.mkDerivation {
9 name = "commonsoft-nix";
23 #pkgs.rxvt_unicode.terminfo
36 (pkgs.glibcLocales.override {
52 pkgs.sudo # NOTE: sudo needs to be own by root with the setuid bit,
53 # but this won't be the case for the sudo provided by Nix outside NixOS,
54 # hence the addition of $PATH_FHS in shellHook
55 # to provide the host system's sudo.
56 # WARNING: beware that sudo may reset the environment,
57 # and especially PATH, to some system's default.
67 #enableParallelBuilding = true;
69 export NIX_PATH="nixpkgs=${nixpkgs}:nixpkgs-commonsoft=$PWD/lib/nixpkgs-commonsoft"
70 #NIX_PATH+=":nixpkgs-overlays="$PWD"/install/overlays.nix"
74 PATH_NIX=$(dirname $(readlink ~/.nix-profile/bin/nix))
75 PATH_NIXOS=/run/wrappers/bin
76 PATH_NIX_BUILD="$PWD"/result/bin
77 PATH_FHS="$PWD"/.lib/nix/fhs-bin
78 PATH_FHS_VBOX="$PWD"/.lib/fhs-vbox-bin
79 export PATH="$PATH_NIX_BUILD:$PWD/bin:$PATH_NIXOS:$PATH_FHS_VBOX:$PATH_FHS:$PATH:$PATH_NIX"
82 export LANG=fr_FR.UTF-8
83 export LC_CTYPE=fr_FR.UTF-8
86 gpgconf --launch gpg-agent
87 export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
89 export GNUPGHOME="$PWD"/../sec/gnupg
90 install -dm700 "$GNUPGHOME"
93 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
97 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
98 "$PWD"/.git/hooks/prepare-commit-msg
101 export NIXOPS_DEPLOYMENT="virtualbox"
102 export NIXOPS_STATE="$PWD"/.var/nixops/state.nixops
103 # Extend the Nix interpreter
104 # to enable builtins.extraBuiltins,
105 # which provides an unsafe exec useful to get secrets
106 # from the local password-store.
107 NIXOPS_OPTS+=" --show-trace"
108 NIXOPS_OPTS+=" --option plugin-files $PWD/result/nix/plugins/libnix-extra-builtins.so"
109 NIXOPS_OPTS+=" --option extra-builtins-file $PWD/result/nix/extra-builtins.nix"
113 #export DISNIXOS_USE_NIXOPS=1
114 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
115 #export DISNIX_PROFILE=default
116 #export DISNIX_TARGET_PROPERTY=hostname
117 #export DYSNOMIA_STATEDIR=var/dysnomia