]> Git — Sourcephile - julm/julm-nix.git/blob - machines/oignon.nix
add packages
[julm/julm-nix.git] / machines / oignon.nix
1 { config, pkgs, inputs, machineName, ... }:
2 let
3 inherit (config.users) users;
4 in
5 {
6 imports = [
7 oignon/hardware.nix
8 ];
9
10 users.mutableUsers = false;
11 users.users.julm = {
12 isNormalUser = true;
13 uid = 1000;
14 # Put the hashedPassword in /nix/store, but it will also be in /etc/passwd
15 # which is already world readable.
16 hashedPassword = builtins.readFile ../secrets/julm/hashedPassword;
17 extraGroups = [
18 "wheel"
19 "networkmanager"
20 "video"
21 #"vboxusers"
22 ];
23 # If created, zfs-mount.service would require:
24 # zfs set overlay=yes ${machineName}/home
25 createHome = false;
26 };
27
28 nix = {
29 extraOptions = ''
30 auto-optimise-store = true
31 '';
32 gc = {
33 automatic = true;
34 dates = "weekly";
35 options = "--delete-older-than 7d";
36 };
37 nixPath = [
38 "nixpkgs=/etc/nixpkgs"
39 "nixpkgs-overlays=/etc/nixpkgs-overlays/overlays.nix"
40 ];
41 trustedUsers = [ users.julm.name ];
42 };
43 environment.etc."nixpkgs".source = pkgs.path;
44 environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
45
46 nixpkgs.config = {
47 allowUnfree = false;
48 };
49
50 time.timeZone = "Europe/Paris";
51 i18n.defaultLocale = "fr_FR.UTF-8";
52 console.font = "Lat2-Terminus16";
53 console.keyMap = "fr";
54
55 networking = {
56 hostName = machineName;
57 domain = "localdomain";
58 networkmanager = {
59 enable = true;
60 #dhcp = "dhcpcd";
61 logLevel = "INFO";
62 wifi = {
63 #backend = "iwd";
64 #backend = "wpa_supplicant";
65 powersave = false;
66 };
67 };
68 firewall = {
69 enable = true;
70 };
71 };
72
73 sound.enable = true;
74 hardware.pulseaudio.enable = true;
75
76 environment.variables = {
77 EDITOR = "vim";
78 PAGER = "less -R";
79 SYSTEMD_LESS = "FKMRX";
80 };
81 environment.systemPackages = with pkgs; [
82 acpi
83 binutils
84 bmon
85 coreutils
86 cryptsetup
87 curl
88 direnv
89 dstat
90 e2fsprogs
91 file
92 glib # gio
93 gvfs
94 gnumake
95 gnupg
96 gparted
97 hicolor-icon-theme
98 home-manager
99 htop
100 less
101 libfaketime
102 lm_sensors
103 lsof
104 lsscsi
105 man
106 miniupnpc
107 mosh
108 ncdu
109 ncurses
110 nmon
111 ntfs3g
112 parted
113 pasystray
114 pavucontrol
115 pciutils
116 powertop
117 procps
118 python
119 rdfind
120 smartmontools
121 sudo
122 tig
123 tmux
124 tree
125 usbutils
126 utillinux
127 vim
128 wget
129 which
130 xdg_utils
131 xsel
132 zfs
133 ];
134
135 programs = {
136 bash = {
137 interactiveShellInit = ''
138 bind '"\e[A":history-search-backward'
139 bind '"\e[B":history-search-forward'
140
141 # Ignore duplicate commands, ignore commands starting with a space
142 export HISTCONTROL=erasedups:ignorespace
143 export HISTSIZE=42000
144 # Append to the history instead of overwriting (good for multiple connections)
145 shopt -s histappend
146
147 # Utilities
148 mkcd () { mkdir -p "$1"; cd "$1"; }
149 '';
150 shellAliases = {
151 cl = "clear";
152 l = "ls -alh";
153 ll = "ls -al";
154 ls = "ls --color=tty";
155 mem = "ps -e -orss=,user=,args= | sort -b -k1,1n";
156
157 s="sudo systemctl";
158 st="sudo systemctl status";
159 s-u="systemctl --user";
160 j="sudo journalctl -u";
161
162 nix-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
163 };
164 };
165 dconf.enable = true;
166 gnupg.agent = {
167 enable = true;
168 enableSSHSupport = true;
169 };
170 mtr.enable = true;
171 };
172
173 services = {
174 avahi = {
175 enable = true;
176 nssmdns = true;
177 };
178 dbus = {
179 packages = [ pkgs.gnome3.dconf ];
180 };
181 gvfs = {
182 enable = true;
183 };
184 journald = {
185 extraConfig = ''
186 Compress=true
187 MaxRetentionSec=1month
188 Storage=persistent
189 SystemMaxUse=100M
190 '';
191 };
192 physlock = {
193 enable = true;
194 allowAnyUser = true;
195 # NOTE: xfconf-query -c xfce4-session -p /general/LockCommand -s "physlock" --create -t string
196 };
197 printing = {
198 enable = true;
199 drivers = [
200 pkgs.gutenprint
201 pkgs.hplip
202 ];
203 };
204 sanoid = {
205 enable = true;
206 extraArgs = [ "--verbose" ];
207 datasets = {
208 "${machineName}/home" = {
209 autosnap = true;
210 autoprune = true;
211 hourly = 12;
212 daily = 7;
213 monthly = 0;
214 yearly = 0;
215 recursive = true;
216 };
217 "${machineName}/var" = {
218 autosnap = true;
219 autoprune = true;
220 hourly = 12;
221 daily = 7;
222 monthly = 0;
223 yearly = 0;
224 recursive = true;
225 };
226 };
227 };
228 xserver = {
229 enable = true;
230 layout = "fr";
231 xkbOptions = "eurosign:e";
232 libinput.enable = true;
233 desktopManager = {
234 session = [
235 # Let the session be generated by home-manager
236 { name = "home-manager";
237 start = ''
238 ${pkgs.runtimeShell} $HOME/.hm-xsession &
239 waitPID=$!
240 '';
241 }
242 ];
243 xfce = {
244 enable = false;
245 /*
246 thunarPlugins = [
247 pkgs.xfce.thunar-archive-plugin
248 ];
249 */
250 };
251 xterm.enable = false;
252 };
253 displayManager = {
254 defaultSession = "home-manager";
255 #defaultSession = "none+xmonad";
256 autoLogin = {
257 enable = true;
258 user = users.julm.name;
259 };
260 };
261 };
262 };
263
264 #virtualisation.virtualbox.host.enable = true;
265
266 # This value determines the NixOS release with which your system is to be
267 # compatible, in order to avoid breaking some software such as database
268 # servers. You should change this only after NixOS release notes say you should.
269 system.stateVersion = "20.09"; # Did you read the comment?
270 }