-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.nix
566 lines (487 loc) · 13.4 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
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
# my nixos configconfiguratio
{ config, pkgs, inputs, userSettings, systemSettings, ... }: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
# <home-manager/nixos>
# ./home-manager.nix
# inputs.xremap-flake.nixosModules.default
];
# using lix insted of nix
nix.package = pkgs.unstable.lix;
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
# services.xremap = {
# withWlroots = true;
# userName = userSettings.username;
# config.modmap = [{
#
# name = "Global";
# remap = { "CapsLock" = "Esc"; }; # globally remap CapsLock to Esc
# remap = { "Esc" = "CapsLock"; }; # globally remap Esc to CapsLock
#
# }];
# };
# Bootloader.
# boot.loader.systemd-boot.enable = true;
# boot.loader.grub.splashImage = null;
# boot.loader.grub.useOSProber = true;
boot.loader = {
grub = {
enable = true;
device = "nodev";
efiSupport = true;
};
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
};
# clean /tmp on every boot
# boot.tmp.cleanOnBoot = true;
# networking
networking.hostName = systemSettings.hostname; # Define your hostname.
networking.wireless.enable = false; # disble wpa whatever
# Dns server
networking.nameservers = [ "1.1.1.1" ];
# Enable networking
networking.networkmanager.enable = true;
networking.networkmanager.dns = "default";
# disable dhcpcd u don't need if u use network manager
networking.dhcpcd.enable = false;
networking.networkmanager.wifi.backend = "iwd";
networking.wireless.iwd.settings = {
IPv6 = { Enabled = true; };
Settings = { AutoConnect = true; };
};
# what to do when lid is closed
services.logind.lidSwitch = "suspend";
#kernel settings
# boot.kernelPackages = pkgs.linuxPackages_latest;
# boot.kernelPackages = pkgs.linuxPackages_zen;
#zram settings
zramSwap.enable = true;
zramSwap.memoryPercent = 70;
boot.kernel.sysctl."vm.page-cluster" = 0;
# Gpu settings
services.xserver.videoDrivers = [ "amdgpu" ];
boot.initrd.kernelModules = [ "amdgpu" ];
# # Enable firmware update service
services.fwupd.enable = true;
# hardware = {
# cpu.amd.updateMicrocode = true;
# enableRedistributableFirmware = true;
# enableAllFirmware = true;
# firmware = with pkgs; [ firmwareLinuxNonfree ];
# opengl = {
# enable = true;
# driSupport = true;
# driSupport32Bit = true;
# extraPackages = with pkgs; [
# rocm-opencl-icd # amd
# mesa
# rocm-opencl-runtime # amd
# rocmPackages.clr.icd
# vaapiVdpau
# libvdpau
# amdvlk
# vulkan-tools # Vulkan development tools
# vulkan-loader # Vulkan loader
# libva-utils
# ];
# extraPackages32 = with pkgs; [ ];
# };
# };
#
# #increse battery ssd life
# services.fstrim.interval = "weekly";
# services.fstrim.enable = true;
# #power savings
# services.system76-scheduler.enable = true;
services.power-profiles-daemon.enable = true;
# dbus u power
services.upower.enable = true;
# geoclue2
# services.geoclue2.enable = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Set your time zone.
time.timeZone = systemSettings.timeZone;
# Select internationalisation properties.
i18n.defaultLocale = systemSettings.locale;
console = {
earlySetup = true;
font = "ter-powerline-v24b";
packages = with pkgs; [ terminus_font powerline-fonts ];
keyMap = "us";
};
i18n.extraLocaleSettings = {
LC_ADDRESS = systemSettings.locale;
LC_IDENTIFICATION = systemSettings.locale;
LC_MEASUREMENT = systemSettings.locale;
LC_MONETARY = systemSettings.locale;
LC_NAME = systemSettings.locale;
LC_NUMERIC = systemSettings.locale;
LC_PAPER = systemSettings.locale;
LC_TELEPHONE = systemSettings.locale;
LC_TIME = systemSettings.locale;
};
# Configure keymap in X11
# services.xserver = {
# xkb.layout = "us";
# xkb.variant = "";
# enable = true;
# };
#systemd.services."getty@tty1".enable = false;
#systemd.services."autovt@tty1".enable = false;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.${userSettings.username} = {
isNormalUser = true;
description = userSettings.name;
extraGroups =
[ "networkmanager" "wheel" "video" "kvm" "input" "audio" "render" ];
packages = with pkgs; [ ];
};
# Allow unfree packages
nixpkgs.config = {
allowUnfree = true;
};
# nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowInsecure = true;
services.blueman.enable = true;
services.gnome.gnome-keyring.enable = true;
hardware = {
bluetooth.enable = true;
bluetooth.powerOnBoot = true;
};
# setup pipewire for audio
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
# alsa.support32Bit = true;
pulse.enable = true;
# jack.enable = true;
wireplumber.enable = true;
};
hardware.pulseaudio.enable = false;
# hardware.pulseaudio.support32Bit = true;
services.libinput.enable = true;
services.locate = {
enable = true;
localuser = null;
package = pkgs.mlocate;
};
services.greetd = {
enable = true;
settings = {
default_session = {
command =
"${pkgs.greetd.tuigreet}/bin/tuigreet --time --time-format '%I:%M %p | %a • %h | %F' --cmd sway";
user = "greeter";
};
};
};
# unlock keyring on login
security.pam.services.greetd.enableGnomeKeyring = true;
# services.xserver.enable = true;sway
# services.xserver.displayManager.gdm.enable = true;
# services.xserver.desktopManager.gnome.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# some good nix tools
river
deadnix
# unstable.veloren
statix
wget
mangohud
protonup
heroic
greetd.tuigreet
i2p
bat
cachix
foot
alejandra
neovim
swayidle
swaylock
# swaylock-effects
cheese
kitty
rclone
alacritty
xorg.xmodmap
libinput
blueman
wl-clipboard
brightnessctl
android-tools
playerctl
wev
go-mtpfs
scrcpy
cmake
gnumake
acpi
xarchiver
baobab
transmission_4-gtk
warpinator
tor-browser
# (brave.override { vulkanSupport = true; })
firefox-esr
fzf
gcc
keepassxc
htop
nautilus
powertop
git
gnome-keyring
lxqt.lxqt-policykit
# polkit_gnome
xorg.xhost
gparted
libnotify
amdgpu_top
appimage-run
mpv
meson
nitch
ninja
dbus
networkmanagerapplet
pavucontrol
pipewire
pkg-config
python311
python311Packages.pip
trash-cli
wlroots
xdg-utils
ripgrep
unzip
obs-studio
v4l-utils
cliphist
#podman
dive # look into docker image layers
podman-tui # status of containers in the terminal
docker-compose # start group of containers for dev
#podman-compose # start group of containers for dev
# nixos helper
nh
#nh helper
nix-output-monitor
nvd
jdk8
# jdk17
unstable.libreoffice
];
#polkit service
security.polkit.enable = true;
# systemd = {
# user.services.polkit-gnome-authentication-agent-1 = {
# description = "polkit-gnome-authentication-agent-1";
# wantedBy = [ "graphical-session.target" ];
# wants = [ "graphical-session.target" ];
# after = [ "graphical-session.target" ];
# serviceConfig = {
# Type = "simple";
# ExecStart =
# "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
# Restart = "on-failure";
# RestartSec = 1;
# TimeoutStopSec = 10;
# };
# };
# };
# 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;
};
services.dbus.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
#fonts
fonts.enableDefaultPackages = true;
fonts.packages = with pkgs; [
(nerdfonts.override {
fonts = [ "JetBrainsMono" "DroidSansMono" "FiraCode" ];
})
font-awesome
liberation_ttf
noto-fonts
lohit-fonts.gujarati
lohit-fonts.devanagari
];
fonts.fontconfig = {
enable = true;
defaultFonts = {
serif = [ "Liberation Serif" ];
sansSerif = [ "Noto Sans" ];
monospace = [ "Fira Code" ];
};
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = false;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# 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 = "23.11"; # Did you read the comment?
#nixpkgs.overlays = [
#(self: super: {
# waybar = super.waybar.overrideAttrs (oldAttrs: {
# mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
# });
# })
# ];
environment.sessionVariables = {
# WLR_NO_HARDWARE_CURSORS = "1";
NIXOS_OZONE_WL = "1";
ACCESSIBILITY_ENABLED = "1";
FLAKE = "/home/${userSettings.username}/nixos-dotfiles";
};
#experimantlal features
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# settings of obs
boot = {
kernelModules = [ "v4l2loopback" ];
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
};
#masked services
systemd.services.NetworkManager-wait-online.enable = false;
#xwayland
programs.xwayland.enable = true;
# #sway graphical session target
# systemd.user.targets.sway-session = {
# description = "sway compositor session";
# documentation = [ "man:systemd.special(7)" ];
# bindsTo = [ "graphical-session.target" ];
# wants = [ "graphical-session-pre.target" ];
# after = [ "graphical-session-pre.target" ];
# };
#sway
programs.sway = {
enable = true;
xwayland.enable = true;
wrapperFeatures.gtk = true; # so that gtk works properly
extraPackages = with pkgs; [
sway-audio-idle-inhibit
imv
wlogout
hyprpicker
swww
slurp
grim
];
extraSessionCommands = "export MOZ_ENABLE_WAYLAND=1 ";
};
security.pam.loginLimits = [{
domain = "@users";
item = "rtprio";
type = "-";
value = 1;
}];
# programs.waybar.enable = true;
#environment.variables = {
# EDITOR = "nvim";
# };
virtualisation.waydroid.enable = true;
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
# Automatic Garbage Collection
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
boot.loader.grub.configurationLimit = 10;
# nix store auto-optimization
nix.settings.auto-optimise-store = true;
virtualisation.containers.enable = true;
services.flatpak.enable = true;
virtualisation = {
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
};
};
#thunar file-manager
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
thunar-dropbox-plugin
];
};
# thunar to open things in terminal
xdg.terminal-exec = {
enable = true;
settings.default = [ "foot.desktop" ];
};
programs.nautilus-open-any-terminal.enable = true;
services.gvfs = { enable = true; };
xdg.mime.defaultApplications = { "image/png" = [ "imv.desktop" ]; };
# bye bye nano
# programs.nano.enable = lib.mkForce false;
# Disable things here
# documentation.nixos.enable = false;
programs.appimage.enable = true;
#enable i2p
# services.i2p.enable = true;
# solves The name org.a11y.Bus was not provided by any .service files.
services.gnome.at-spi2-core.enable = true;
#game mode
programs.gamemode.enable = true;
programs.gamescope.enable = true;
# nixos devshell tools
programs.direnv.enable = true;
programs.direnv = {
package = pkgs.direnv;
silent = true;
loadInNixShell = true;
direnvrcExtra = "";
nix-direnv = {
enable = true;
package = pkgs.nix-direnv;
};
};
services.keyd = {
enable = true;
keyboards = {
default = {
settings = {
main = {
# Simple capslock to escape remap
capslock = "escape";
escape = "capslock";
};
};
};
};
};
}