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

Last change on this file since 3cb0c7b was b6142c1, checked in by Mikhail Kirillov <w96k@…>, on Jun 30, 2022 at 5:28:01 AM

Add nixos configuration

I need this because some packages on guix is hard to package and there
is glibc incompatability issue

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