-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.nix
483 lines (424 loc) · 13.6 KB
/
configuration.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
#One page introduction to Nix, the language - https://github.com/tazjin/nix-1p
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
# In order to be able to easily download packages from unstable channel, we have three options:
# flakes, channels and fetching tarball. I am choosing fetching tarball as it is the most simplest
# and remains in this configuration file only. Now we can install either stable or unstable packages.
# Tarball is downloaded only once and then cached, so when you rebuild - it will not be downloaded again,
# unless there’s been a change in the URL or if it needs to invalidate the cache
# Example:
# android-studio - stable channel
# unstable.android-studio - unstable channel
let
unstableTarball = fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
unstable = import unstableTarball { config = config.nixpkgs.config; };
# # Import the android-nixpkgs repository to use androidenv
# androidNixpkgs = pkgs.callPackage (import (builtins.fetchGit {
# url = "https://github.com/tadfisher/android-nixpkgs.git";
# })) {};
# androidenv = androidNixpkgs.androidenv; # Make sure to define androidenv here
#Add Android SDK setup
android-nixpkgs = pkgs.callPackage (import (builtins.fetchGit {
url = "https://github.com/tadfisher/android-nixpkgs.git";
})) {
channel = "stable";
};
# Create an Android SDK package with selected components
androidSdk = android-nixpkgs.sdk (sdkPkgs: with sdkPkgs; [
cmdline-tools-latest
build-tools-34-0-0
platform-tools
platforms-android-34
emulator
]);
# androidComposition = androidenv.composeAndroidPackages {
# cmdLineToolsVersion = "8.0";
# toolsVersion = "26.1.1";
# platformToolsVersion = "30.0.5";
# buildToolsVersions = [ "30.0.3" ];
# includeEmulator = false;
# emulatorVersion = "30.3.4";
# platformVersions = [ "28" "29" "30" ];
# includeSources = false;
# includeSystemImages = false;
# systemImageTypes = [ "google_apis_playstore" ];
# abiVersions = [ "armeabi-v7a" "arm64-v8a" ];
# cmakeVersions = [ "3.10.2" ];
# includeNDK = true;
# ndkVersions = ["22.0.7026061"];
# useGoogleAPIs = false;
# useGoogleTVAddOns = false;
# includeSDKManager = true;
# includeAVDManager = true;
# includeExtras = [
# "extras;google;gcm"
# ];
# };
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
services.xserver.enable = true;
services.dbus.enable = true;
# Enable the GNOME Desktop Environment.
# services.xserver.displayManager.gdm.enable = true;
# services.xserver.desktopManager.gnome.enable = true;
# Enable Cinnamon Desktop
services.xserver.desktopManager.cinnamon.enable = true;
# Enable automatic garbage collection
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
#HYPERLND tiling manager test
# Enable Hyprland
# programs.hyprland = {
# enable = true;
# xwayland.enable = true;
# };
# environment.sessionVariables = {
# NIXOS_OZONE_WAYLAND = "1"
# }
# Enable fonts needed for a nice Hyprland experience
# fonts.packages = with pkgs; [
# (nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
# ];
# for debugging purposes
# boot.kernel.sysctl = { "kernel.panic_on_oops" = true; };
# boot.crashDump.enable = true;
# boot.consoleLogLevel = 7;
# boot.kernelParams = [ "loglevel=7" ];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
#programs.fish.enable = true;
#enable Android Debug Bridge
programs.adb.enable = true;
programs.firefox.enable = true;
programs.steam.enable = true;
programs.git = {
enable = true;
config = {
user.name = "Nikita0x";
user.email = "<YOUR_EMAIL_HERE>";
};
};
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
withPython3 = true;
withNodeJs = true;
};
#terminal multiplexer
programs.tmux = {
enable = true;
clock24 = true;
};
#new browser but is very alpha
programs.ladybird = {
enable = true;
};
# Aliases
environment.shellAliases = {
rebuild = "sudo nixos-rebuild switch";
config = "sudo hx /etc/nixos/configuration.nix";
config-update = "sudo cp -ur /etc/nixos/* ~/github/nix-dotfiles/";
open = "xdg-open";
nvim-update = "cp -ur ~/.config/nvim/* ~/github/nix-dotfiles/nvim/";
config-nvim = "cd ~/.config/nvim && nvim ~/.config/nvim";
dotfiles = "nvim ~/github/nix-dotfiles/";
c = "cd";
lg = "lazygit";
config-hyperland = "nvim ~/.config/hypr/hyprland.conf";
sublime-merge = "/nix/store/lwyag77m1pvy0a8wg272f5kskrjwbwcx-sublime-merge-2095/bin/sublime_merge";
clipboard = "xclip -selection clipboard";
};
environment.variables = {
EDITOR = "nvim";
VISUAL = "nvim";
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# libray for videos idk - required for some flutter apps or else crashes.
# gotta fix in the future
# https://nixos.wiki/wiki/GStreamer
gst_all_1.gstreamer # Core GStreamer library
gst_all_1.gst-plugins-base # Essential plugins
gst_all_1.gst-plugins-good # Good-quality plugins under LGPL
gst_all_1.gst-plugins-bad # Plugins not up to par yet
gst_all_1.gst-plugins-ugly # Plugins with problematic licenses
gst_all_1.gst-libav # Libav-based plugins for multimedia
#OBS streaming
(pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [
wlrobs
obs-backgroundremoval
obs-pipewire-audio-capture
];
})
(pkgs.androidenv.emulateApp {
name = "emulate-MyAndroidApp";
platformVersion = "VanillaIceCream";
abiVersion = "x86_64"; # armeabi-v7a, mips, x86_64
systemImageType = "google_apis_playstore";
})
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# androidComposition.androidsdk
androidSdk
tldr
unstable.zed-editor
xorg.libX11
xorg.libxcb
xorg.libXrender
xorg.libXext
xorg.libXdamage
xorg.libxkbfile
#test internet speed
speedtest-cli
albert #keyboard launcher
# figma-linux
#useful for reverse engineering I guess?
file
binutils
unixtools.xxd
# arc-browser
sublime-merge-dev #gui git
#unstable.code-cursor
wget
home-manager
neofetch
tree
btop
telegram-desktop
gnome.gnome-tweaks
xclip #to allow yank/copy in nvim
pwvucontrol # if problems with headphones - you can fix it here
vscode
unstable.android-studio
pciutils
python3
python312Packages.pip
nodejs_22
ripgrep
fd
lazygit
tree-sitter
gcc
nerdfonts #fix broken icons in neovim
fzf #cool fuzzy finder for terminal
bat #like cat but with syntax highlight and more
bun
git
yarn
google-chrome
filezilla
postman
go
skypeforlinux
gpick
simplescreenrecorder
typescript
gparted
flameshot
qbittorrent-qt5
tor-browser
calibre #reader for books
prettierd # pretiter daemon needs to be installed for code formatting to be working in neovim (conform plugin)
eslint_d
stylua
anydesk
sass
php83Packages.composer
openjdk
zip
unzip
screenkey #для вывода на экран кнопок
inkscape
krita
kotlin
#editors
helix
emacs
kakoune
kakoune-lsp
#ruby stuff
ruby_3_3
sqlite
rubyPackages_3_3.websocket-driver
#clojure stuff
leiningen
clojure
clojure-lsp
zig_0_11
#c stuff
raylib
clang
cmake
ninja
gcc
# flutter stuff
dart
# flutter309
# unstable.flutterPackages-source.v3_26
# unstable.flutterPackages-source.stable
unstable.flutter326
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
vscode-langservers-extracted
emmet-language-server
nodePackages.eslint
rust-analyzer
tailwindcss-language-server
nodePackages_latest.vls
#nodePackages_latest."@volar/vue-language-server"
];
#enables nix-ld, a compatibility layer for dynamically linked executables.
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
# Add any missing dynamic libraries for unpackaged programs
# here, NOT in environment.systemPackages
# Add Sass-related libraries
sass
nodePackages.sass
libsass
];
# Enable OpenGL
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required for most Wayland compositors
modesetting.enable = true;
# Use the open source version of the NVIDIA kernel module
# Only available on driver 515.43.04+
open = false;
# Enable the NVIDIA settings menu
nvidiaSettings = true;
# Choose the driver version
package = config.boot.kernelPackages.nvidiaPackages.stable;
#Enable PRIME
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager = {
enable = true;
wifi.powersave = false;
};
# Set your time zone.
time.timeZone = "Europe/Kyiv";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "uk_UA.UTF-8";
LC_IDENTIFICATION = "uk_UA.UTF-8";
LC_MEASUREMENT = "uk_UA.UTF-8";
LC_MONETARY = "uk_UA.UTF-8";
LC_NAME = "uk_UA.UTF-8";
LC_NUMERIC = "uk_UA.UTF-8";
LC_PAPER = "uk_UA.UTF-8";
LC_TELEPHONE = "uk_UA.UTF-8";
LC_TIME = "uk_UA.UTF-8";
};
#i3 Window manager
# services.xserver.windowManager.i3 = {
# enable = true;
# extraPackages = with pkgs; [
# dmenu
# i3status
# i3lock
# ];
# };
# Configure keymap in X11
services.xserver.xkb = {
layout = "us,ua,ru";
variant = "";
options = "grp:alt_shift_toggle";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = false;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.nikita = {
#shell = pkgs.fish;
isNormalUser = true;
description = "nikita";
# - adbusers - https://nixos.wiki/wiki/Android#adb_setup
# - kvm - https://nixos.wiki/wiki/Android#hardware_acceleration
extraGroups = [ "networkmanager" "wheel" "adbusers" "kvm" ];
packages = with pkgs; [
# thunderbird
];
};
# Enable automatic login for the user.
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "nikita";
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# nixpkgs.config.allowUnsupportedSystem = true;
nixpkgs.config.android_sdk.accept_license = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ 5173 ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}