-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.nix
1197 lines (1110 loc) · 32 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
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# 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, lib, ... }:
# let
# nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
# export __NV_PRIME_RENDER_OFFLOAD=1
# export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
# export __GLX_VENDOR_LIBRARY_NAME=nvidia
# export __VK_LAYER_NV_optimus=NVIDIA_only
# exec -a "$0" "$@"
# '';
# in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nixpkgs.config = {
allowUnfree = true;
#allowBroken = true;
# firefox = {
# enablePepperFlash = true;
# };
# Explicit pulseaudio support in applications
pulseaudio = true;
# permittedInsecurePackages = [
# "qtwebkit-5.212.0-alpha4"
# ];
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Use the systemd-boot EFI boot loader.
boot.loader = {
systemd-boot = {
enable = true;
# configurationLimit = 42;
};
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
# grub = {
# # despite what the configuration.nix manpage seems to indicate,
# # as of release 17.09, setting device to "nodev" will still call
# # `grub-install` if efiSupport is true
# # (the devices list is not used by the EFI grub install,
# # but must be set to some value in order to pass an assert in grub.nix)
# devices = [ "nodev" ];
# efiSupport = true;
# enable = true;
# # set $FS_UUID to the UUID of the EFI partition
# extraEntries = ''
# menuentry "Windows" {
# insmod part_gpt
# insmod fat
# insmod search_fs_uuid
# insmod chain
# search --fs-uuid --set=root $FS_UUID
# chainloader /EFI/Microsoft/Boot/bootmgfw.efi
# }
# '';
# version = 2;
# configurationLimit = 42;
# };
};
# boot.kernelPatches = [ {
# name = "thunderbolt";
# patch = null;
# extraConfig = ''
# THUNDERBOLT y
# HOTPLUG_PCI y
# HOTPLUG_PCI_ACPI y
# '';
# } ];
# Select internationalisation properties.
console = {
font = "Lat2-Terminus16";
keyMap = "dvorak";
#defaultLocale = "en_GB.UTF-8";
#defaultLocale = "en_US.UTF-8";
};
i18n = {
#defaultLocale = "en_GB.UTF-8";
defaultLocale = "en_US.UTF-8";
};
# Set your time zone.
time.timeZone = "Europe/Berlin";
time.hardwareClockInLocalTime = true; # For windows iop
# environment.shells = with pkgs; [bashInteractive zsh];
environment.shells = with pkgs; [bashInteractive fish];
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
# nvidia-offload
ntfs3g # to mount windows
cifs-utils
nfs-utils
sshfs-fuse
exfat
parted
gpart
gparted
hdf5
nox
nix-index # contains nix-locate
# glibcLocales
# #glibc = { locales = true; };
# xorg.xf86inputsynaptics # xf86-input-synaptics
# #xorg.xf86videointel # xf86-video-intel
# xorg.xf86inputevdev # xf86-input-evdev
# xorg.xf86inputkeyboard
# xorg.xf86inputlibinput
# #libinput
# xorg.xrdb
# xorg.xinit
# xorg.xorgserver
# xorg.setxkbmap
# xorg.xrandr
# xorg.xauth
gnumake
automake
autoconf
ninja
libtool
pkg-config
clang
gcc
gdb rr linuxPackages.perf
socat
gmp
cmake
cmakeCurses
binutils
zlib
nix-serve
nix-prefetch-git
git
gitAndTools.diff-so-fancy
gitAndTools.gh
subversion
git-lfs
stow
# hdparm
acpi
acpid
acpitool
# pmtools
acpica-tools
usbutils
wget
bash
bash-completion
bashInteractive
kbd
ffmpeg # for sway
#gdk-pixbuf # for sway
libjpeg
imagemagick
imagemagickBig
# i3-gaps # required for sway configuration until everything is dropped
# i3lock
xautolock
# compton
# i3status
# i3blocks-gaps
# i3blocks
# wmctrl # required for i3+plasma
# scrot # screenshot
spectacle # KDE screenshot
feh
#poppler
poppler_utils
# arandr
#autorandr
# lm_sensors
# sysstat
playerctl
pango
perlPackages.Pango
# xwayland
# networkmanager
# networkmanagerapplet
# wpa_supplicant
#dunst
# pamixer
# ponymix
# pasystray
# pavucontrol
# volnoti
kakoune
peek
vscodium
#kak-lsp
cargo
editorconfig-core-c
elmPackages.elm
elmPackages.elm-test
elmPackages.elm-format
elmPackages.elm-language-server
tmux
zellij
jq
mtm
notcurses
dmenu
rofi
# firefox
firefox-wayland
chromium
thunderbird
#vivaldi
#vimb
vlc
# xfce.thunar
# gnome3.nautilus
gimp
krita
xournalpp
# openboard
# darktable
# enblend-enfuse # panorama images
# hugin # panorama images
rxvt_unicode-with-plugins
#st # terminal
urxvt_perls
# terminator termite
kitty
zathura
pdfgrep
pdftk
okular
# ghc
# stack
# cabal-install
nodejs
nodePackages.typescript
flow # static type checker
direnv
# bluez
bluez-tools
silver-searcher
platinum-searcher
ripgrep
#zsh
#zsh-autosuggestions
#zsh-completions
#zsh-navigation-tools
#zsh-syntax-highlighting
# libva
# libvdpau
# libvdpau-va-gl
# vaapiIntel # libva-intel-driver
# vaapiVdpau # libva-vdpau-driver
# microcodeIntel # microcode-intel
# powertop #intel
# intel-gpu-tools
# beignet
#brightnessctl light
#bluetoothctl
xsel
#mesa_noglu
libnotify
# vtk
unzip
zip
p7zip
w3m
ranger
# lsix
tree
vim
thermald
texlive.bin.pygmentex
texlive.combined.scheme-full
lmodern
rsync
#redshift
#geoclue
#despotify
#python27
ruby bundix
python3Full
python3
python3Packages.pip
python3Packages.ipython
# python38Packages.numpy
# python38Packages.scipy
# python38Packages.matplotlib
# python38Packages.seaborn
# python38Packages.pandas
# python38Packages.pandocfilters
mlocate
lm_sensors
linuxHeaders
libreoffice-fresh
catdoc
hunspell
# hunspellDicts.de_DE
aspell
aspellDicts.de
aspellDicts.en
aspellDicts.fr
inkscape
i7z
htop
ncurses
gnupg pinentry
pinentry-curses
#gpicview
# geeqie
# clutter clutter-gtk
# gpicview
#gliv
fasd
fzf
# pandoc
biber
# haskellPackages.pandoc-citeproc
#haskellPackages.pandoc-crossref
#haskellPackages.pandoc-csv2table
dbus
busybox
cryptsetup
# clamav
cmake
#linuxPackages.cpupower
# cpufrequtils
boost
mkpasswd
meson
cairo
# conky
dropbox
#google-cloud-sdk
jdk
jre
# eclipses.eclipse-cpp
# eclipses.eclipse-java
# eclipses.eclipse-scala-sdk
# eclipses.eclipse-sdk
# steam
# steam-run
# krohnkite
# xorg.libX11
# xorg.libXext
lua
perl
spotify
# slack
# xlibsWrapper
#wine
#winetricks
#protontricks
#steam-run
# pactl
# Here we but a shell script into path, which lets us start sway.service (after importing the environment of the login shell).
(
pkgs.writeTextFile {
name = "startsway";
destination = "/bin/startsway";
executable = true;
text = ''
#! ${pkgs.bash}/bin/bash
# first import environment variables from the login manager
systemctl --user import-environment
# then start the service
exec systemctl --user start sway.service
'';
}
)
];
networking = {
hostName = "jimmy"; # Define your hostname.
networkmanager.enable = true;
# networkmanager.wifi.backend = "iwd"; # or "wpa_supplicant"
wireless.enable = false; # Enables wireless support via wpa_supplicant.
wireless.userControlled.enable = true;
wireless.userControlled.group = "network";
extraHosts = ''
127.0.0.1 db
'';
firewall = {
# Open ports in the firewall.
allowedTCPPorts = [
# 22 # ssh - automaticall
80 # HTTP
443 # HTTPS
];
allowedUDPPorts = [
# 5353 # MDNS - multicast dns
# 427 # SLP - server location protocol
];
# Or disable the firewall altogether.
enable = true;
allowPing = true;
};
};
# Define a user account. Don't forget to set a password with ‘passwd’.
# users.extraUsers.guest = {
# isNormalUser = true;
# uid = 1000;
# };
# users.defaultUserShell = pkgs.zsh;
users.defaultUserShell = pkgs.fish;
#users.users.geier =
users.extraUsers.geier =
{
isNormalUser = true;
name = "geier";
home = "/home/geier";
hashedPassword = "$6$cG2jGEtZXcQ/4U4L$8z6a.OUetzdmy9/TZslXXMsoZ0QUhlftkxF.ZjPFz2qUQ2tk9RVRwwjdO45TkQmgAigmfjRDR/.chZgLVvcab0"; # mkpasswd -m sha-512
initialHashedPassword = "$6$cG2jGEtZXcQ/4U4L$8z6a.OUetzdmy9/TZslXXMsoZ0QUhlftkxF.ZjPFz2qUQ2tk9RVRwwjdO45TkQmgAigmfjRDR/.chZgLVvcab0"; # mkpasswd -m sha-512
uid = 1000;
description = "Philpp Geier";
extraGroups = [ "wheel" "lp" "networkmanager" "network" "dialout" "audio" "video" "sys" "scanner" "kvm" "optical" "storage" "input" "disk" "floppy" "uucp" "lock" "docker" "sway" "rfkill" ];
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3fHurt4sgmcc9j5nw4DGcmy8j0zSp0IQcD0RMU0bsbkwq/RfyvEfrLqOEQ0Oj7oO+ESNuLmB14dgZAmJ1M8UIrZONqRijmYL6iat+rqXlJksFh9aLwt9Ubarg0bnfhJDBaWGBhtmP00tIKn2TKQqw5F5CIMMXc9GbKD0mWUCS2tR+acjj6SOOwDSUsk5SnEYZz5kTbBtYPxgDj/wkmTPI/s2dNb241P5gdBnhiSRnTWe608VzD1bJOb3jc/qIZekjOqAWbP5zOj/5OVakFmh1gaJ8md90kE+/FmnAw69cLTAYlz1QtfvpNhOVQAUhUE3ring69o8mO/zv/PAm1Mst geier@jimmy" ];
};
#users.mutableUsers = false;
# The NixOS release to be compatible with for stateful data such as databases.
system = {
autoUpgrade.enable = true;
stateVersion = "23.11";
};
systemd.services.kbdrate = {
description = "Keyboard repeat rate in tty";
serviceConfig = {
Type = "simple";
RemainAfterExit="yes";
StandardInput="tty";
StandardOutput="tty";
#ExecStart = "${pkgs.ipfs}/bin/kbdrate -s -d 150 -r 50";
ExecStart = "${pkgs.kbd}/bin/kbdrate -s -d 150 -r 50";
#ExecStop = "pkill ....";
Restart = "on-failure";
};
wantedBy = [ "multi-user.target" ];
enable = true;
};
# # https://github.com/shosti/nixos-config/blob/master/configuration.nix
# # Make sure screen is locked on suspend
# systemd.services."i3lock" = {
# enable = true;
# description = "i3lock";
# wantedBy = [ "suspend.target" "hibernate.target" ];
# before = [ "systemd-suspend.service" "systemd-hibernate.target" ];
# serviceConfig = {
# Type = "forking";
# User = "geier"; # unfortunately necessary :(
# };
# script = "${pkgs.i3lock}/bin/i3lock";
# postStart = "${pkgs.coreutils}/bin/sleep 1";
# environment = { DISPLAY = ":0"; };
# };
# List services that you want to enable:
services = {
# syncthing = {
# user = "geier";
# enable = true;
# dataDir = "/home/geier/.syncthing";
# };
#ntp.enable = true;
timesyncd.enable = true;
locate = {
enable = true;
interval = "hourly";
localuser = null;
package = pkgs.mlocate;
extraFlags = [ "-n '.git .backups .Trash .mail .cache vendor'" ];
};
# allow access for user
#udev.path = with pkgs; [utillinux];
udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="${pkgs.coreutils}/bin/chgrp input /sys/class/leds/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/leds/%k/brightness"
ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"
#Flipper Zero serial port
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", ATTRS{manufacturer}=="Flipper Devices Inc.", TAG+="uaccess"
#Flipper Zero DFU
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", ATTRS{manufacturer}=="STMicroelectronics", TAG+="uaccess"
'';
# kmscon = {
# enable = false; # disabled - as login with sway
# extraConfig = ''
# xkb-layout=us,de
# xkb-variant=dvorak,
# xkb-options=grp:switch,grp:menu_toggle
# xkb-repeat-delay=150
# xkb-repeat-rate=50
# '';
# hwRender = true;
# };
acpid = {
enable = true;
};
hdapsd = {
enable = true;
};
# Enable the OpenSSH daemon.
openssh = {
settings.PermitRootLogin = "no";
enable = true;
};
dnscrypt-proxy2 = {
enable = true;
#localPort = 43;
};
dnsmasq = {
enable = true;
settings.servers = [ "127.0.0.1#43" ];
};
# privoxy.enable = true;
# privoxy.enableTor = true;
# tor = {
# enable = true;
# client = {
# enable = true;
# };
# tsocks.enable = true;
# };
# gammastep = {
# enable = true;
# location = {
# latitude = "49.398750";
# longitude = "8.672434";
# };
# #package = pkgs.redshift-wlr;
# };
tlp = {
enable = true;
# settings = ''
# DEVICES_TO_DISABLE_ON_STARTUP="bluetooth"
# '';
};
upower.enable = true;
udisks2.enable = true;
printing = {
enable = true;
browsing = true;
drivers = with pkgs; [ splix hplip hplipWithPlugin gutenprint gutenprintBin cups cups-filters foomatic-filters cups-bjnp cups-dymo ]; # hplip hplipWithPlugins
};
avahi = {
enable = true;
nssmdns = true;
};
# xserver = {
# enable = false;
# #enable = true;
# #autorun = false;
# exportConfiguration = true;
# autoRepeatDelay = 150;
# autoRepeatInterval = 50;
# modules = with pkgs; [
# xorg.xf86inputsynaptics # xf86-input-synaptics
# xorg.xf86videointel # xf86-video-intel
# xorg.xf86inputevdev # xf86-input-evdev
# xorg.xf86inputkeyboard
# xorg.xf86inputlibinput
# #libinput
# xorg.xrdb
# xorg.xinit
# xorg.xorgserver
# xorg.setxkbmap
# xorg.xrandr
# xorg.xauth
# ];
# # libinput.enable = true;
# # videoDrivers = ["intel" "mesa-noglu" "modesetting" "nvidia"];
# # videoDrivers = ["intel" "modesetting" "nvidia"];
# videoDrivers = ["intel" "nvidia"];
# # videoDrivers = ["intel" "mesa-noglu" ];
# # videoDrivers = ["modesetting" "nvidia"];
# # videoDrivers = ["nvidia"];
# layout = "us,de";
# xkbVariant = "dvorak,";
# xkbOptions = "grp:switch,grp:menu_toggle";
# inputClassSections = [''
# Identifier "touchpad"
# Driver "synaptics"
# MatchIsTouchpad "on"
# Option "TapButton1" "1"
# Option "TapButton2" "2"
# Option "TapButton3" "3"
# Option "VertEdgeScroll" "on"
# Option "VertTwoFingerScroll" "on"
# Option "HorizEdgeScroll" "on"
# Option "HorizTwoFingerScroll" "on"
# Option "CircularScrolling" "on"
# Option "CircScrollTrigger" "2"
# #Option "EmulateTwoFingerMinZ" "40"
# #Option "EmulateTwoFingerMinW" "8"
# #Option "CoastingSpeed" "0"
# #Option "FingerLow" "30"
# #Option "FingerHigh" "50"
# #Option "MaxTapTime" "125"
# ''
# ''
# Identifier "keyboard"
# MatchIsKeyboard "yes"
# Option "XkbLayout" "us,de"
# Option "XkbVariant" "dvorak,"
# Option "XkbOptions" "grp:switch,grp:menu_toggle"
# Option "AutoRepeat" "150 50"
# ''];
# # Enable the KDE Desktop Environment.
# # displayManager = {
# # sddm.enable = true;
# # };
# # desktopManager = {
# # plasma5.enable = true;
# # };
# };
};
programs.sway = {
enable = true;
# wrapperFeatures.gtk = true; # so that gtk works properly
extraPackages = with pkgs; [
# swaylock
swaylock-effects
swaybg
swayidle
xwayland # for legacy apps
waybar # statusbar
nwg-launchers
# pactl
wl-clipboard
clipman
mako # notification daemon
# alacritty # Alacritty is the default terminal in the config
foot
wofi
# dmenu # Dmenu is the default in the config but i recommend wofi since its wayland native
kanshi # autorandr
brightnessctl
light
# Theming
gtk-engine-murrine
gtk_engines
gsettings-desktop-schemas
# qt5.qtbase.gtk
# gsettings-qt
glib
lxappearance
lxappearance-gtk2
lxqt.lxqt-policykit
# lxqt.lxqt-themes
materia-theme
material-design-icons
material-icons
gruvbox-dark-icons-gtk
numix-solarized-gtk-theme
numix-gtk-theme
numix-sx-gtk-theme
numix-icon-theme
numix-cursor-theme
numix-icon-theme-square
numix-icon-theme-circle
papirus-icon-theme
papirus-maia-icon-theme
luna-icons
flat-remix-icon-theme
# flat-remix-gtk
elementary-xfce-icon-theme
zafiro-icons
# sweet
# adementary-theme
# elementary-xfce-icon-theme
# yaru-theme
# libsForQt5.grantleetheme
# adwaita-qt
# More
autotiling
# flashfocus
gammastep
geoclue2 # for gammastep
wf-recorder
grim
slurp
swappy
pavucontrol
volnoti
pasystray
ponymix
networkmanagerapplet
playerctl
pcmanfm
cinnamon.nemo
gtk3
gtk4
];
};
# environment = {
# etc = {
# # Put config files in /etc. Note that you also can put these in ~/.config, but then you can't manage them with NixOS anymore!
# "sway/config".source = /home/geier/dotfiles/sway/.config/sway/config;
# "xdg/waybar/config".source = /home/geier/dotfiles/waybar/.config/waybar/config;
# "xdg/waybar/style.css".source = /home/geier/dotfiles/waybar/.config/waybar/style.css;
# };
# };
# programs.qt5ct.enable = true;
qt = {
enable = true;
platformTheme = "gtk2";
style = "gtk2";
# platformTheme = "gnome"; # gtk2, gnome, lxqt, qt5ct, kde
# style = "adwaita";
};
programs.waybar.enable = true;
programs.nm-applet.enable = true;
programs.nm-applet.indicator = true;
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" ];
};
systemd.user.services.sway = {
description = "Sway - Wayland window manager";
documentation = [ "man:sway(5)" ];
bindsTo = [ "graphical-session.target" ];
wants = [ "graphical-session-pre.target" ];
after = [ "graphical-session-pre.target" ];
# We explicitly unset PATH here, as we want it to be set by
# systemctl --user import-environment in startsway
environment.PATH = lib.mkForce null;
serviceConfig = {
Type = "simple";
ExecStart = ''
${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway --debug
'';
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
systemd.user.services.kanshi = {
description = "Kanshi output autoconfig ";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig = {
# kanshi doesn't have an option to specifiy config file yet, so it looks
# at .config/kanshi/config
ExecStart = ''
${pkgs.kanshi}/bin/kanshi
'';
RestartSec = 5;
Restart = "always";
};
};
systemd.user.services.swayidle = {
description = "Idle Manager for Wayland";
documentation = [ "man:swayidle(1)" ];
wantedBy = [ "sway-session.target" ];
partOf = [ "graphical-session.target" ];
path = [ pkgs.bash ];
serviceConfig = {
ExecStart = '' ${pkgs.swayidle}/bin/swayidle -w -d \
timeout 300 '${pkgs.sway}/bin/swaymsg "output * dpms off"' \
resume '${pkgs.sway}/bin/swaymsg "output * dpms on"'
'';
};
};
security.polkit.enable = true;
security.polkit.extraConfig = ''
polkit.addAdminRule(function(action, subject) {
return ["unix-group:wheel"];
});
/* Allow users in admin group to run GParted without authentication */
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.archlinux.pkexec.gparted") == 0 && subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("network")) {
return polkit.Result.YES;
}
});
'';
# systemd.user.services.waybar = {
# description = "Highly customizable Wayland bar for Sway and Wlroots based compositors.";
# documentation = [ https://github.com/Alexays/Waybar/wiki/ ];
# wantedBy = [ "sway-session.target" ];
# partOf = [ "graphical-session.target" ];
# path = [ pkgs.bash ];
# serviceConfig = {
# ExecStart = '' ${pkgs.waybar}/bin/waybar '';
# };
# };
# end sway
# Pipewire
# sound.enable = true;
# pulseaudio = {
# enable = true;
# support32Bit = true;
# # systemWide = true;
# package = pkgs.pulseaudioFull;
# extraModules = [ pkgs.pulseaudio-modules-bt ];
# extraConfig = "
# load-module module-switch-on-connect
# load-module module-bluetooth-policy auto_switch=2
# ";
# # configFile = pkgs.writeText "default.pa" ''
# # load-module module-bluetooth-policy
# # load-module module-bluetooth-discover
# # ## module fails to load with
# # ## module-bluez5-device.c: Failed to get device path from module arguments
# # ## module.c: Failed to load module "module-bluez5-device" (argument: ""): initialization failed.
# # # load-module module-bluez5-device
# # # load-module module-bluez5-discover
# # '';
# };
environment.sessionVariables = {
MOZ_ENABLE_WAYLAND = "1";
XDG_CURRENT_DESKTOP = "sway";
};
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 = true;
# 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)
wireplumber.enable = true;
# media-session.enable = true;
# media-session.config.bluez-monitor.rules = [
# {
# # Matches all cards
# matches = [ { "device.name" = "~bluez_card.*"; } ];
# actions = {
# "update-props" = {
# "bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ];
# # mSBC is not expected to work on all headset + adapter combinations.
# "bluez5.msbc-support" = true;
# # SBC-XQ is not expected to work on all headset + adapter combinations.
# "bluez5.sbc-xq-support" = true;
# };
# };
# }
# {
# matches = [
# # Matches all sources
# { "node.name" = "~bluez_input.*"; }
# # Matches all outputs
# { "node.name" = "~bluez_output.*"; }
# ];
# actions = {
# "node.pause-on-idle" = false;
# };
# }
# ];
# config.pipewire = {
# "context.properties" = {
# default.clock.allowed-rates = [ 44100 48000 96000 ];
# #"link.max-buffers" = 64;
# "link.max-buffers" = 16; # version < 3 clients can't handle more than this
# "log.level" = 2; # https://docs.pipewire.org/#Logging
# #"default.clock.rate" = 48000;
# #"default.clock.quantum" = 1024;
# #"default.clock.min-quantum" = 32;
# #"default.clock.max-quantum" = 8192;
# };
# };
# Lowlatency setup according to nixos
# config.pipewire = {
# "context.properties" = {
# default.clock.allowed-rates = [ 44100 48000 96000 ];
# "link.max-buffers" = 16;
# "log.level" = 2;
# "default.clock.rate" = 48000;
# # "default.clock.quantum" = 32;
# "default.clock.quantum" = 1024;
# "default.clock.min-quantum" = 32;
# # "default.clock.max-quantum" = 32;
# "default.clock.max-quantum" = 8192;
# "core.daemon" = true;
# "core.name" = "pipewire-0";
# };
# "context.modules" = [
# {
# name = "libpipewire-module-rtkit";
# args = {
# "nice.level" = -15;
# "rt.prio" = 88;
# "rt.time.soft" = 200000;
# "rt.time.hard" = 200000;
# };
# flags = [ "ifexists" "nofail" ];
# }
# { name = "libpipewire-module-protocol-native"; }
# { name = "libpipewire-module-profiler"; }
# { name = "libpipewire-module-metadata"; }
# { name = "libpipewire-module-spa-device-factory"; }
# { name = "libpipewire-module-spa-node-factory"; }
# { name = "libpipewire-module-client-node"; }
# { name = "libpipewire-module-client-device"; }
# {
# name = "libpipewire-module-portal";
# flags = [ "ifexists" "nofail" ];
# }
# {
# name = "libpipewire-module-access";
# args = {};
# }
# { name = "libpipewire-module-adapter"; }
# { name = "libpipewire-module-link-factory"; }
# { name = "libpipewire-module-session-manager"; }
# ];
# };
# config.pipewire-pulse = {
# "context.properties" = {
# "log.level" = 2;
# };
# "context.modules" = [
# {
# name = "libpipewire-module-rtkit";
# args = {
# "nice.level" = -15;
# "rt.prio" = 88;
# "rt.time.soft" = 200000;
# "rt.time.hard" = 200000;
# };
# flags = [ "ifexists" "nofail" ];
# }
# { name = "libpipewire-module-protocol-native"; }
# { name = "libpipewire-module-client-node"; }
# { name = "libpipewire-module-adapter"; }
# { name = "libpipewire-module-metadata"; }
# {
# name = "libpipewire-module-protocol-pulse";
# args = {
# "pulse.min.req" = "32/48000";
# "pulse.default.req" = "32/48000";