]> Git — Sourcephile - sourcephile-nix.git/blob - bootstrap/sévy/system.nix
nixops: add mermet
[sourcephile-nix.git] / bootstrap / sévy / system.nix
1 { config, pkgs, ... }: {
2
3 nix = {
4 extraOptions = ''
5 auto-optimise-store = true
6 '';
7 gc = {
8 automatic = true;
9 dates = "weekly";
10 options = "--delete-older-than 30d";
11 };
12 };
13
14 nixpkgs.config = {
15 allowUnfree = false;
16 };
17
18 time.timeZone = "Europe/Paris";
19
20 i18n = { # internationalization
21 consoleFont = "Lat2-Terminus16";
22 consoleKeyMap = "fr";
23 defaultLocale = "fr_FR.UTF-8";
24 };
25
26 networking = {
27 networkmanager = {
28 enable = true;
29 };
30 firewall = {
31 enable = true;
32 allowedTCPPorts = [
33 51413 # transmission-gtk
34 4662 # edonkey
35 ];
36 allowedUDPPorts = [
37 51413 # transmission-gtk
38 4667 # edonkey
39 4672 # edonkey
40 ];
41 };
42 };
43
44 sound.enable = true;
45 hardware.pulseaudio.enable = true;
46
47 environment = {
48 variables = {
49 EDITOR = "gvim";
50 PAGER = "less -R";
51 };
52 systemPackages = with pkgs; [
53 acpi
54 binutils
55 coreutils
56 cryptsetup
57 curl
58 direnv
59 dstat
60 e2fsprogs
61 elementary-xfce-icon-theme
62 file
63 glib # gio
64 gnome3.defaultIconTheme
65 gnome3.file-roller
66 gnome3.gnome-keyring
67 gnome3.seahorse
68 gvfs
69 gnumake
70 gnupg
71 gparted
72 ffmpeg
73 hicolor-icon-theme
74 htop
75 less
76 libfaketime
77 lsof
78 man
79 miniupnpc
80 ncdu
81 ncurses
82 networkmanagerapplet
83 ntfs3g
84 #pasystray
85 pavucontrol
86 powertop
87 procps
88 python
89 redshift
90 sudo
91 tig
92 tmux
93 tree
94 utillinux
95 wget
96 which
97 xdg_utils
98 xfce.thunar-volman
99 ];
100 };
101
102 programs = {
103 bash = {
104 interactiveShellInit = ''
105 bind '"\e[A":history-search-backward'
106 bind '"\e[B":history-search-forward'
107
108 # Ignore duplicate commands, ignore commands starting with a space
109 export HISTCONTROL=erasedups:ignorespace
110 export HISTSIZE=42000
111 # Append to the history instead of overwriting (good for multiple connections)
112 shopt -s histappend
113 fan () {
114 if [ $# -gt 0 ]
115 then sudo tee /proc/acpi/ibm/fan <<<"level $1"
116 else grep '^\(level\|speed\):' /proc/acpi/ibm/fan
117 fi
118 acpi -t
119 }
120 '';
121 shellAliases = {
122 cl = "clear";
123 l = "ls -alh";
124 ll = "ls -l";
125 ls = "ls --color=tty";
126
127 s="sudo systemctl";
128 s-u="systemctl --user";
129
130 nix-clean="sudo nix-collect-garbage -d";
131 nix-catalog="sudo nix-channel --list";
132 nix-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
133 nix-rollback="sudo nixos-rebuild switch --rollback";
134 nix-update="sudo nix-channel --update";
135 nix-upgrade="sudo nixos-rebuild switch";
136 nix-upstream="sudo nix-channel --list";
137 nix-config="gvim ~/.config/nixos/*.nix";
138 };
139 };
140
141 dconf.enable = true;
142
143 gnupg.agent = {
144 enable = true;
145 enableSSHSupport = true;
146 };
147
148 mtr.enable = true;
149 };
150
151 services = {
152 avahi = {
153 enable = true;
154 nssmdns = true;
155 };
156
157 dbus = {
158 packages = [ pkgs.gnome3.dconf ];
159 };
160
161 gnome3 = {
162 gvfs = {
163 enable = true;
164 };
165 };
166
167 physlock = {
168 enable = true;
169 allowAnyUser = true;
170 # NOTE: xfconf-query -c xfce4-session -p /general/LockCommand -s "physlock" --create -t string
171 };
172
173 printing = {
174 enable = true;
175 drivers = [
176 pkgs.gutenprint
177 ];
178 };
179
180 xserver = {
181 enable = true;
182 layout = "fr";
183 xkbOptions = "eurosign:e";
184 libinput.enable = true;
185
186 desktopManager = {
187 default = "xfce";
188 xfce = {
189 enable = true;
190 thunarPlugins = [
191 pkgs.xfce.thunar-archive-plugin
192 ];
193 };
194 xterm.enable = false;
195 };
196
197 };
198 };
199
200 # This value determines the NixOS release with which your system is to be
201 # compatible, in order to avoid breaking some software such as database
202 # servers. You should change this only after NixOS release notes say you should.
203 system.stateVersion = "19.09"; # Did you read the comment?
204 }