-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.nix
208 lines (182 loc) · 5.23 KB
/
configuration.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# # Edit this configuration file to define what should be installed on
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
boot.loader.timeout = 2;
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/sda";
# within virtualbox only
boot.initrd.checkJournalingFS = false;
boot.kernelPackages = pkgs.linuxPackages_4_6;
networking.hostName = "nixos-1603"; # Define your hostname.
networking.enableIPv6 = false;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
nixpkgs.config.allowUnfree = true;
# be a bit more developer friendly (don't collect built-time only deps)
nix.extraOptions = ''
gc-keep-outputs = true
gc-keep-derivations = true
'';
# Select internationalisation properties.
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "be-latin1";
defaultLocale = "en_US.UTF-8";
} ;
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
asciidoctor
aspell
aspellDicts.en
aspellDicts.fr
autojump
bundix
cabal2nix
chromium
docker
emacs
entr
ghc
gitFull
gnupg
gnumake
haskellPackages.xmobar
haskellPackages.shake
haskellPackages.stack
haskellPackages.hlint
haskellPackages.stylish-haskell
hiera-eyaml
htop
jq
nix-repl
neovim
parallel
pandoc
pythonFull
pythonPackages.pip
pythonPackages.ipython
pythonPackages.jedi
ruby
shellcheck
silver-searcher
tree
vault
unzip
wget
which
xfce.terminal
zeal
zip
];
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable the X11 windowing system.
services.xserver = {
enable = true;
layout = "be";
windowManager.xmonad.enable = true;
windowManager.xmonad.enableContribAndExtras = true;
windowManager.default = "xmonad";
xkbOptions = "caps:escape";
#desktopManager.xterm.enable = false;
desktopManager.default = "none";
displayManager = {
lightdm = {
enable = true;
autoLogin.user= "nix";
autoLogin.enable= true;
};
sessionCommands = ''
${pkgs.xlibs.xsetroot}/bin/xsetroot -cursor_name left_ptr
${pkgs.feh}/bin/feh --bg-scale "$HOME/.wallpaper.jpg"
'';
};
};
# services.xserver.xkbOptions = "eurosign:e";
fonts = {
# enableCoreFonts = true;
enableFontDir = true;
fonts = [ pkgs.source-code-pro ];
};
# Define a user account. Don't forget to set a password with ‘passwd’.
users.extraUsers.nix = {
createHome = true;
home = "/home/nix";
isSystemUser = true;
extraGroups = [ "wheel" "disk" "vboxusers" "docker"];
shell = "/run/current-system/sw/bin/bash";
uid = 1000;
};
security.sudo.wheelNeedsPassword = false;
virtualisation.docker.enable = true;
virtualisation.docker.extraOptions = "--insecure-registry docker.cirb.lan --insecure-registry docker.sandbox.srv.cirb.lan";
virtualisation.virtualbox.guest.enable = true;
fileSystems."/vbox/shared" = {
fsType = "vboxsf";
device = "shared";
options = [ "rw" ];
};
fileSystems."/vbox/notebook" = {
fsType = "vboxsf";
device = "notebook";
options = [ "rw" ];
};
programs.bash.enableCompletion = true;
programs.bash.shellAliases = {
du = " du -h" ;
df = " df -h" ;
ls = " ls --color=tty";
la = " ls -lah" ;
ag = "ag --color-line-number=2" ;
vim = "nvim" ;
build = "./build/build.sh" ;
see = "./bin/check_role.sh" ;
};
programs.bash.interactiveShellInit = ''
shopt -s autocd
shopt -s histappend
function presources () {
puppetresources -p . -o $1 --hiera ./tests/hiera.yaml --pdbfile tests/facts.yaml ''${@:2}
}
export HISTCONTROL=ignoreboth
#. $(autojump-share)/autojump.bash
'';
programs.bash.shellInit = ''
shopt -s autocd
function sshi () {
ssh -A -i ~/.ssh/alhazen_rsa alhazen@$1
}
function presources () {
puppetresources -p . -o "$1" --hiera ./tests/hiera.yaml --pdbfile tests/facts.yaml ''${@:2}
}
#. $(autojump-share)/autojump.bash
'';
programs.bash.promptInit = ''
# Provide a nice prompt if the terminal supports it.
if [ "$TERM" != "dumb" -o -n "$INSIDE_EMACS" ]; then
PROMPT_COLOR="1;31m"
let $UID && PROMPT_COLOR="1;32m"
PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] "
if test "$TERM" = "xterm"; then
export PS1='\w\[\033[01;38m\]''$(__git_ps1)\[\033[00m\] → '
fi
fi
'';
# The NixOS release to be compatible with for stateful data such as databases.
system.stateVersion = "16.03";
}