]> Git — Sourcephile - sourcephile-nix.git/blob - shell.nix
.gitignore
[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.curl
35 (pkgs.glibcLocales.override {
36 allLocales = false;
37 locales = [
38 "en_US.UTF-8/UTF-8"
39 "fr_FR.UTF-8/UTF-8"
40 ];
41 })
42 pkgs.gnupg
43 pkgs.pass
44 #pkgs.sqlite
45 pkgs.htop
46 pkgs.ncurses
47 pkgs.ncdu
48 pkgs.procps
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.
55 pkgs.tree
56 pkgs.utillinux
57 pkgs.which
58 pkgs.xdg_utils
59 #pkgs.openssl
60 #pkgs.inetutils
61 #pkgs.mailutils
62 #pkgs.dnsutils
63 ];
64 #enableParallelBuilding = true;
65 shellHook = ''
66 export NIX_PATH="nixpkgs=${nixpkgs}:nixpkgs-commonsoft=$PWD/lib/nixpkgs-commonsoft"
67 #NIX_PATH+=":nixpkgs-overlays=$PWD/install/overlays.nix"
68 #NIX_PATH+=""
69
70 # executables
71 PATH_NIX=$(dirname $(readlink ~/.nix-profile/bin/nix))
72 PATH_NIXOS=/run/wrappers/bin
73 PATH_NIX_BUILD=$PWD/result/bin
74 PATH_FHS=$PWD/.lib/fhs-bin
75 export PATH=$PATH_NIX_BUILD:$PWD/bin:$PATH_NIXOS:$PATH_FHS:$PATH:$PATH_NIX
76
77 # locales
78 export LANG=fr_FR.UTF-8
79 export LC_CTYPE=fr_FR.UTF-8
80
81 # gpg
82 gpgconf --launch gpg-agent
83 export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
84 export GPG_TTY=$(tty)
85 export GNUPGHOME=$PWD/../sec/gnupg
86
87 # password-store
88 export PASSWORD_STORE_DIR="$PWD/../sec/pass"
89
90
91 # nixops
92 export NIXOPS_DEPLOYMENT="virtualbox"
93 export NIXOPS_STATE="$PWD/.var/nixops/state.db"
94 # Extend the Nix interpreter
95 # to enable builtins.extraBuiltins,
96 # which provides an unsafe exec useful to get secrets
97 # from the local password-store.
98 NIXOPS_OPTS+=" --show-trace"
99 NIXOPS_OPTS+=" --option plugin-files $PWD/result/nix/plugins/libnix-extra-builtins.so"
100 NIXOPS_OPTS+=" --option extra-builtins-file $PWD/result/nix/extra-builtins.nix"
101 export NIXOPS_OPTS
102
103 # disnix
104 #export DISNIXOS_USE_NIXOPS=1
105 #export DISNIX_CLIENT_INTERFACE=disnix-nixops-client
106 #export DISNIX_PROFILE=default
107 #export DISNIX_TARGET_PROPERTY=hostname
108 #export DYSNOMIA_STATEDIR=var/dysnomia
109 '';
110 }
111