2 nixpkgs = import ./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
35 (pkgs.glibcLocales.override {
49 pkgs.sudo # NOTE: sudo needs to be own by root with the setuid bit,
50 # but this won't be the case for the sudo provided by Nix outside NixOS,
51 # hence the addition of $PATH_FHS in shellHook
52 # to provide the host system's sudo.
53 # WARNING: beware that sudo may reset the environment,
54 # and especially PATH, to some system's default.
64 #enableParallelBuilding = true;
66 root="$(dirname "$(dirname "$PWD")")"
68 export NIX_PATH="nixpkgs=${nixpkgs}:nixpkgs-commonsoft=$root/lib/nixpkgs-commonsoft:root=$root"
69 #NIX_PATH+=":nixpkgs-overlays=$root/install/overlays.nix"
73 PATH_NIX=$(dirname $(readlink ~/.nix-profile/bin/nix))
74 PATH_NIXOS=/run/wrappers/bin
75 PATH_NIX_BUILD=$root/result/bin
76 PATH_FHS=$root/.lib/fhs-bin
77 export PATH=$PATH_NIX_BUILD:$root/bin:$PATH_NIXOS:$PATH_FHS:$PATH:$PATH_NIX
80 export LANG=fr_FR.UTF-8
81 export LC_CTYPE=fr_FR.UTF-8
84 gpgconf --launch gpg-agent
85 export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
87 export GNUPGHOME=$root/../sec/gnupg
90 export PASSWORD_STORE_DIR="$root/../sec/pass"
94 export NIXOPS_DEPLOYMENT="virtualbox"
95 export NIXOPS_STATE="$root/.var/nixops/state.db"
96 # Extend the Nix interpreter
97 # to enable builtins.extraBuiltins,
98 # which provides an unsafe exec useful to get secrets
99 # from the local password-store.
100 NIXOPS_OPTS+=" --show-trace"
101 NIXOPS_OPTS+=" --option plugin-files $root/result/nix/plugins/libnix-extra-builtins.so"
102 NIXOPS_OPTS+=" --option extra-builtins-file $root/result/nix/extra-builtins.nix"
106 #export DISNIXOS_USE_NIXOPS=1
107 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
108 #export DISNIX_PROFILE=default
109 #export DISNIX_TARGET_PROPERTY=hostname
110 #export DYSNOMIA_STATEDIR=var/dysnomia