]> Git — Sourcephile - julm/julm-nix.git/blob - machines/oignon.nix
oignon: fix thinkpad fan and light
[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 lsof
103 man
104 miniupnpc
105 mosh
106 ncdu
107 ncurses
108 nmon
109 ntfs3g
110 pasystray
111 pavucontrol
112 pciutils
113 powertop
114 procps
115 python
116 sudo
117 tig
118 tmux
119 tree
120 utillinux
121 vim
122 wget
123 which
124 xdg_utils
125 xsel
126 zfs
127 ];
128
129 programs = {
130 bash = {
131 interactiveShellInit = ''
132 bind '"\e[A":history-search-backward'
133 bind '"\e[B":history-search-forward'
134
135 # Ignore duplicate commands, ignore commands starting with a space
136 export HISTCONTROL=erasedups:ignorespace
137 export HISTSIZE=42000
138 # Append to the history instead of overwriting (good for multiple connections)
139 shopt -s histappend
140 '';
141 shellAliases = {
142 cl = "clear";
143 l = "ls -alh";
144 ll = "ls -al";
145 ls = "ls --color=tty";
146 mem = "ps -e -orss=,user=,args= | sort -b -k1,1n";
147
148 s="sudo systemctl";
149 st="sudo systemctl status";
150 s-u="systemctl --user";
151 j="sudo journalctl -u";
152
153 nix-clean="sudo nix-collect-garbage -d";
154 nix-catalog="sudo nix-channel --list";
155 nix-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
156 nix-rollback="sudo nixos-rebuild switch --rollback";
157 nix-update="sudo nix-channel --update";
158 nix-upgrade="sudo nixos-rebuild switch";
159 nix-upstream="sudo nix-channel --list";
160 nix-config="gvim ~/.config/nixos/*.nix";
161 };
162 };
163 dconf.enable = true;
164 gnupg.agent = {
165 enable = true;
166 enableSSHSupport = true;
167 };
168 mtr.enable = true;
169 };
170
171 services = {
172 avahi = {
173 enable = true;
174 nssmdns = true;
175 };
176 dbus = {
177 packages = [ pkgs.gnome3.dconf ];
178 };
179 gvfs = {
180 enable = true;
181 };
182 journald = {
183 extraConfig = ''
184 Compress=true
185 MaxRetentionSec=1month
186 Storage=persistent
187 SystemMaxUse=100M
188 '';
189 };
190 physlock = {
191 enable = true;
192 allowAnyUser = true;
193 # NOTE: xfconf-query -c xfce4-session -p /general/LockCommand -s "physlock" --create -t string
194 };
195 printing = {
196 enable = true;
197 drivers = [
198 pkgs.gutenprint
199 pkgs.hplip
200 ];
201 };
202 sanoid = {
203 enable = true;
204 extraArgs = [ "--verbose" ];
205 datasets = {
206 "${machineName}/home" = {
207 autosnap = true;
208 autoprune = true;
209 hourly = 12;
210 daily = 7;
211 monthly = 0;
212 yearly = 0;
213 recursive = true;
214 };
215 "${machineName}/var" = {
216 autosnap = true;
217 autoprune = true;
218 hourly = 12;
219 daily = 7;
220 monthly = 0;
221 yearly = 0;
222 recursive = true;
223 };
224 };
225 };
226 xserver = {
227 enable = true;
228 layout = "fr";
229 xkbOptions = "eurosign:e";
230 libinput.enable = true;
231 desktopManager = {
232 session = [
233 # Let the session be generated by home-manager
234 { name = "home-manager";
235 start = ''
236 ${pkgs.runtimeShell} $HOME/.hm-xsession &
237 waitPID=$!
238 '';
239 }
240 ];
241 xfce = {
242 enable = false;
243 /*
244 thunarPlugins = [
245 pkgs.xfce.thunar-archive-plugin
246 ];
247 */
248 };
249 xterm.enable = false;
250 };
251 displayManager = {
252 defaultSession = "home-manager";
253 #defaultSession = "none+xmonad";
254 autoLogin = {
255 enable = true;
256 user = users.julm.name;
257 };
258 };
259 };
260 };
261
262 #virtualisation.virtualbox.host.enable = true;
263
264 # This value determines the NixOS release with which your system is to be
265 # compatible, in order to avoid breaking some software such as database
266 # servers. You should change this only after NixOS release notes say you should.
267 system.stateVersion = "20.09"; # Did you read the comment?
268 }