]> Git — Sourcephile - sourcephile-nix.git/blob - shell.nix
pass: fix paths
[sourcephile-nix.git] / shell.nix
1 let
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.
6 };
7 in
8 pkgs.stdenv.mkDerivation {
9 name = "commonsoft-nix";
10 src = null;
11 buildInputs = [
12 # Nix
13 nixpkgs
14
15 # Development
16 pkgs.direnv
17 pkgs.git
18 pkgs.less
19 pkgs.man
20 pkgs.tig
21 pkgs.vim
22 #pkgs.tmux
23 #pkgs.rxvt_unicode.terminfo
24
25 # Building
26 pkgs.coreutils
27 pkgs.gnumake
28 #pkgs.binutils
29
30 # Adminsys
31 pkgs.cryptsetup
32 pkgs.libfaketime
33 pkgs.nixops
34 pkgs.time
35 pkgs.curl
36 (pkgs.glibcLocales.override {
37 allLocales = false;
38 locales = [
39 "en_US.UTF-8/UTF-8"
40 "fr_FR.UTF-8/UTF-8"
41 ];
42 })
43 pkgs.gnupg
44 pkgs.pass
45 #pkgs.sqlite
46 pkgs.htop
47 pkgs.ncurses
48 pkgs.ncdu
49 #pkgs.virtualbox
50 pkgs.sqlite
51 pkgs.procps
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.
58 pkgs.tree
59 pkgs.utillinux
60 pkgs.which
61 pkgs.xdg_utils
62 #pkgs.openssl
63 #pkgs.inetutils
64 #pkgs.mailutils
65 #pkgs.dnsutils
66 ];
67 #enableParallelBuilding = true;
68 shellHook = ''
69 export NIX_PATH="nixpkgs=${nixpkgs}:nixpkgs-commonsoft=$PWD/lib/nixpkgs-commonsoft"
70 #NIX_PATH+=":nixpkgs-overlays="$PWD"/install/overlays.nix"
71 #NIX_PATH+=""
72
73 # executables
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"
80
81 # locales
82 export LANG=fr_FR.UTF-8
83 export LC_CTYPE=fr_FR.UTF-8
84
85 # gpg
86 gpgconf --launch gpg-agent
87 export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
88 export GPG_TTY=$(tty)
89 export GNUPGHOME="$PWD"/../sec/gnupg
90 install -dm700 "$GNUPGHOME"
91
92 # password-store
93 export PASSWORD_STORE_DIR="$PWD"/../sec/pass
94
95 # git
96 ln -fnsr \
97 "$PWD"/.lib/git/hooks/prepare-commit-msg--longuest-common-prefix \
98 "$PWD"/.git/hooks/prepare-commit-msg
99
100 # nixops
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"
110 export NIXOPS_OPTS
111
112 # disnix
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
118 '';
119 }
120