source: dotfiles/nix/configuration.nix@ 3a31a31

Last change on this file since 3a31a31 was 3a31a31, checked in by Mikhail Kirillov <w96k@…>, on Jul 12, 2022 at 11:04:15 AM

Update nixos configuration with new emacs packages and font

  • Property mode set to 100644
File size: 7.5 KB
Line 
1# Edit this configuration file to define what should be installed on
2# your system. Help is available in the configuration.nix(5) man page
3# and in the NixOS manual (accessible by running ‘nixos-help’).
4
5{ config, pkgs, ... }:
6
7{
8 imports =
9 [ # Include the results of the hardware scan.
10 ./hardware-configuration.nix
11 <nixos-hardware/lenovo/thinkpad/x200s>
12 <home-manager/nixos>
13
14 ];
15
16 nix = {
17 package = pkgs.nixUnstable;
18 extraOptions = ''
19 experimental-features = nix-command flakes
20 '';
21 };
22
23 # Bootloader
24 boot.kernelPackages = pkgs.linuxPackages_latest;
25 boot.loader.grub.enable = true;
26 boot.loader.grub.device = "/dev/sdb";
27 boot.loader.grub.useOSProber = true;
28 boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; };
29
30 networking.hostName = "nixos"; # Define your hostname.
31 #networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
32
33 # Configure network proxy if necessary
34 # networking.proxy.default = "http://user:password@proxy:port/";
35 # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
36
37 # Enable networking
38 networking.networkmanager.enable = true;
39
40 # Select internationalisation properties.
41 i18n.defaultLocale = "en_US.UTF-8";
42 console = {
43 font = "Lat2-Terminus16";
44 keyMap = "us";
45 };
46
47 fonts.fonts = with pkgs; [
48 unifont
49 dejavu_fonts
50 ];
51
52 fonts.fontDir.enable = true;
53
54 # Set your time zone.
55 time.timeZone = "Europe/Moscow";
56
57 services.lorri.enable = true;
58
59 # Configure keymap in X11
60 services.xserver = {
61 enable = true;
62 layout = "us,ru";
63 xkbOptions = "grp:shifts_toggle,caps:ctrl_modifier";
64 videoDrivers = [ "intel" ];
65
66 windowManager.ratpoison.enable = true;
67 displayManager.startx.enable = true;
68 displayManager.defaultSession = "none+ratpoison";
69 };
70
71 powerManagement = {
72 enable = true;
73 cpuFreqGovernor = "ondemand";
74 };
75
76 # Define a user account. Don't forget to set a password with ‘passwd’.
77 users.users.w96k = {
78 isNormalUser = true;
79 description = "Mikhail Kirillov";
80 extraGroups = [ "networkmanager" "wheel" "audio" "docker" "libvirtd"];
81 };
82
83 nix.trustedUsers = [ "root" "w96k" ];
84
85 home-manager.useGlobalPkgs = true;
86
87 home-manager.users.w96k = { pkgs, ... }: {
88 home.stateVersion = "22.05";
89 home.packages = [
90 pkgs.gparted
91 pkgs.python3
92 pkgs.nodejs
93 # pkgs.php81
94 # # Minimal requirements for symfony
95 # pkgs.php81Extensions.redis
96 # pkgs.php81Extensions.amqp
97 # pkgs.php81Extensions.xsl
98 pkgs.php81Packages.psysh
99 pkgs.gimp
100 pkgs.php81Packages.composer
101 pkgs.direnv
102 pkgs.openjdk17
103 pkgs.firefox
104 pkgs.tdesktop
105 pkgs.imagemagick
106 pkgs.arandr
107 pkgs.symfony-cli
108 pkgs.shellcheck
109 pkgs.gnome.gnome-boxes
110 pkgs.cachix
111 pkgs.tor-browser-bundle-bin
112 pkgs.htop
113 pkgs.ghc
114 pkgs.nix-prefetch-scripts
115 pkgs.libreoffice
116 pkgs.mpv
117 pkgs.musescore
118 pkgs.yarn
119 pkgs.postgresql
120 pkgs.unzip
121 pkgs.sloc
122 ];
123
124 programs.git = {
125 enable = true;
126 userName = "Mikhail Kirillov";
127 userEmail = "w96k.ru@gmail.com";
128 };
129 programs.autorandr.enable = true;
130 programs.direnv.enable = true;
131 programs.direnv.nix-direnv.enable = true;
132 programs.bash.enable = true;
133 programs.emacs = {
134 enable = true;
135 extraPackages = epkgs: with epkgs; [
136 flycheck
137 avy
138 anaconda-mode
139 auctex
140 beginend
141 composer
142 cinspect
143 debian-el
144 dpkg-dev-el
145 edebug-inline-result
146 magit
147 git-dwim
148 gitpatch
149 goto-chg
150 debbugs
151 direnv
152 docker
153 docker-cli
154 docker-tramp
155 mastodon
156 exec-path-from-shell
157 expand-region
158 geiser
159 geiser-guile
160 guix
161 gnuplot
162 isearch-mb
163 minibuffer-line
164 org-roam
165 org-roam-ui
166 org-download
167 org-babel-eval-in-repl
168 on-screen
169 pdf-tools
170 lsp-mode
171 lsp-java
172 company
173 company-quickhelp
174 # ac-php
175 # php-mode
176 # php-quickhelp
177 phan
178 php-cs-fixer
179 # company-php
180 # php-eldoc
181 realgud
182 kiwix
183 slime
184 simple-httpd
185 sudo-edit
186 imenu-list
187 telega
188 mini-frame
189 mini-modeline
190 undo-tree
191 yasnippet
192 yasnippet-snippets
193 vimrc-mode
194 no-littering
195 web-mode
196 reverse-im
197 restclient
198 # php-scratch
199 yaml-mode
200 php-quickhelp
201 nix-mode
202 ];
203};
204 };
205
206 # nixpkgs.config.allowUnfree = true;
207 # Nixos optimizations for thinkpadg
208 # nixpkgs.localSystem = {
209 # system = "x86_64-linux";
210 # gcc.arch = "core2";
211 # gcc.tune = "core2";
212 # };
213
214 # Enable sound
215 sound.enable = true;
216
217 # List packages installed in system profile. To search, run:
218 # $ nix search wget
219 environment.systemPackages = with pkgs; [
220 wget
221 lm_sensors
222 emacs28NativeComp
223 nix-tree
224 xorg.xf86inputevdev
225 xorg.xf86videointel
226 xorg.xorgserver
227 xorg.xinit
228 thinkfan
229 home-manager
230 neofetch
231 git
232 wmname
233 docker-compose
234 niv
235
236 (pkgs.php81.buildEnv {
237 extensions = ({ enabled, all }: enabled ++ (with all; [
238 xdebug
239 amqp
240 redis
241 xsl
242 ]));
243 extraConfig = ''
244 xdebug.mode=debug
245 '';
246 })
247 ];
248
249 services.emacs.package = pkgs.emacs28NativeComp;
250 services.emacs.defaultEditor = true;
251
252 # services.postgresql = {
253 # enable = true;
254 # package = pkgs.postgresql_14;
255 # enableTCPIP = true;
256 # authentication = pkgs.lib.mkOverride 10 ''
257 # local all all trust
258 # host all all 127.0.0.1/32 trust
259 # host all all ::1/128 trust
260 # '';
261 # initialScript = pkgs.writeText "backend-initScript" ''
262 # CREATE ROLE w96k WITH LOGIN PASSWORD 'w96k' CREATEDB;
263 # CREATE DATABASE symfony;
264 # GRANT ALL PRIVILEGES ON DATABASE symfony TO w96k;
265 # '';
266 # };
267
268 services.tor.settings = {
269 UseBridges = true;
270 ClientTransportPlugin = "obfs4 exec ${pkgs.obfs4}/bin/obfs4proxy";
271 Bridge = "obfs4 IP:ORPort [fingerprint]";
272 };
273
274 services.tor.client.enable = true;
275
276 virtualisation.docker = {
277 enable = true;
278 enableOnBoot = true;
279 # autoPrune.enable = true;
280 };
281
282 virtualisation.libvirtd.enable = true;
283
284 systemd.mounts = [
285 { what = "/dev/sda2";
286 where = "/mnt/guix";
287 mountConfig = {
288 TimeoutSec = "1";
289 Options = "uid=c184f446-df67-4103-b28e-465ac8776f10";
290 };
291 }
292 ];
293
294 # Some programs need SUID wrappers, can be configured further or are
295 # started in user sessions.
296 # programs.mtr.enable = true;
297 programs.gnupg.agent = {
298 enable = true;
299 enableSSHSupport = true;
300 };
301
302 nix.autoOptimiseStore = true;
303 nix.gc = {
304 automatic = true;
305 dates = "weekly";
306 options = "--delete-older-than 60d";
307 };
308
309 # List services that you want to enable:
310
311 # Enable the OpenSSH daemon.
312 # services.openssh.enable = true;
313
314 # Open ports in the firewall.
315 # networking.firewall.allowedTCPPorts = [ ... ];
316 # networking.firewall.allowedUDPPorts = [ ... ];
317 # Or disable the firewall altogether.
318 # networking.firewall.enable = false;
319
320 # This value determines the NixOS release from which the default
321 # settings for stateful data, like file locations and database versions
322 # on your system were taken. It‘s perfectly fine and recommended to leavecatenate(variables, "bootdev", bootdev)
323 # this value at the release version of the first install of this system.
324 # Before changing this value read the documentation for this option
325 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
326 system.stateVersion = "22.05"; # Did you read the comment?
327}
Note: See TracBrowser for help on using the repository browser.