aboutsummaryrefslogtreecommitdiff
path: root/common/packages.yml
blob: afc4504c83e6ea787d78ca98f30a3956ba58a439 (plain)
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
# Dotfiles Installation Packages Configuration
# This file defines packages to install based on installation profiles and distribution-specific mappings

#======================================
# Installation Profiles
#======================================

# Core packages needed by all installations
common:
  - git
  - curl
  - wget

# Essential packages for basic functionality
essentials:
  - zsh
  - bash
  - vim
  - openssh
  - sudo
  - man
  - bc
  - time
  - rsync
  - tree

# Minimal development environment
minimal:
  - gcc
  - make
  - python
  - jq
  - fzf
  - neovim
  - tmux

# Full development environment
dev:
  - clang
  - meson
  - gdb
  - cmake
  - go
  - ninja
  - ripgrep
  - fd
  - nodejs
  - emacs
  - vscode
  - ansible

# Server-focused packages
server:
  - ufw
  - net-tools
  - htop
  - btop
  - powertop
  - clamav
  - ntp
  - networkmanager
  - smartmontools
  - hdparm
  - acpi
  - parted
  - sysstat
  - hwinfo
  - ansible

# Desktop environment packages
desktop:
  - xorg
  - wayland
  - xclip
  - xterm
  - gtk
  - firefox
  - mpv
  - discord
  - libinput
  - nnn
  - ranger
  - obs-studio
  - unrar
  - unzip
  - p7zip
  - imagemagick
  - ffmpeg
  - wezterm
  - ncdu
  - picom
  - rofi
  - udiskie
  - brightnessctl
  - wl-clipboard
  - nemo
  - blueman
  - bluez

# Window managers
wm:
  - hyprland
  - bspwm
  - sxhkd
  - polybar

# Audio/Media packages
media:
  - mpd
  - pipewire
  - ncmpcpp

# Gaming
gaming:
  - wine
  - steam

# Virtualization
virtualization:
  - libvirt
  - qemu

# Fonts
fonts:
  - hack-font
  - nerd-fonts
  - font-awesome
  - dejavu-fonts

#======================================
# Distribution-specific package mappings
# Format: generic_name -> distro_specific_name
#======================================

arch:
  # Core tools
  python: python
  nodejs: nodejs
  man: man-pages man-db
  tree: tree
  ntp: ntpsec
  hack-font: ttf-hack
  nerd-fonts: ttf-nerd-fonts-symbols-mono
  font-awesome: ttf-font-awesome
  dejavu-fonts: ttf-dejavu
  networkmanager: networkmanager
  qemu: qemu-full
  vscode: code

  # Desktop specific
  xorg: xorg xorg-server
  wayland: wayland xorg-xwayland
  gtk: gtk3 gtk4
  libinput: libinput xf86-input-libinput
  bluez: bluez bluez-utils bluez-tools

  # Media
  pipewire: pipewire wireplumber

debian:
  # Core tools
  python: python3 python3-pip
  nodejs: nodejs npm
  man: man-pages-dev man-db
  tree: tree
  ntp: ntp
  hack-font: fonts-hack
  nerd-fonts: fonts-nerd-font-symbols
  font-awesome: fonts-font-awesome
  dejavu-fonts: fonts-dejavu
  networkmanager: network-manager
  qemu: qemu-system
  vscode: code
  fd: fd-find
  openssh: openssh-server
  ansible: ansible

fedora:
  # Core tools
  python: python3 python3-pip
  nodejs: nodejs npm
  man: man-pages man-db
  tree: tree
  ntp: chrony
  hack-font: adobe-source-code-pro-fonts
  nerd-fonts: powerline-fonts
  font-awesome: fontawesome-fonts
  dejavu-fonts: dejavu-fonts-common
  networkmanager: NetworkManager
  qemu: qemu-kvm
  vscode: code-oss
  fd: fd-find
  openssh: openssh-server
  ansible: ansible
  ninja: ninja-build

  # Desktop specific
  xorg: xorg xserver-xorg
  wayland: libwayland-dev xwayland
  gtk: libgtk-3-dev libgtk-4-dev
  libinput: libinput10 xserver-xorg-input-libinput
  bluez: bluez bluez-tools

  # Media
  pipewire: pipewire wireplumber

  # System tools
  ufw: ufw
  net-tools: net-tools
  btop: btop
  powertop: powertop
  clamav: clamav
  smartmontools: smartmontools
  hdparm: hdparm
  acpi: acpi
  parted: parted
  cups: cups
  sysstat: sysstat
  hwinfo: hwinfo

rhel:
  # Core tools
  python: python3 python3-pip
  nodejs: nodejs npm
  man: man-pages man-db
  tree: tree
  ntp: chrony
  hack-font: adobe-source-code-pro-fonts
  nerd-fonts: powerline-fonts
  font-awesome: fontawesome-fonts
  dejavu-fonts: dejavu-fonts-common
  networkmanager: NetworkManager
  qemu: qemu-kvm
  vscode: code
  fd: fd-find
  openssh: openssh-server
  ansible: ansible
  ninja: ninja-build

  # Desktop specific
  xorg: xorg-x11-server-Xorg
  wayland: wayland-devel xorg-x11-server-Xwayland
  gtk: gtk3-devel gtk4-devel
  libinput: libinput
  bluez: bluez bluez-tools

  # System tools
  ufw: firewalld
  net-tools: net-tools
  btop: htop
  powertop: powertop
  clamav: clamav
  smartmontools: smartmontools
  hdparm: hdparm
  acpi: acpi
  parted: parted
  cups: cups
  sysstat: sysstat

opensuse:
  # Core tools
  python: python3 python3-pip
  nodejs: nodejs16 npm16
  man: man-pages man
  tree: tree
  ntp: chrony
  hack-font: adobe-sourcecodepro-fonts
  nerd-fonts: powerline-fonts
  font-awesome: fontawesome-fonts
  dejavu-fonts: dejavu-fonts
  networkmanager: NetworkManager
  qemu: qemu
  vscode: code
  openssh: openssh
  ansible: ansible

gentoo:
  # Core tools with full package paths
  git: dev-vcs/git
  curl: net-misc/curl
  wget: net-misc/wget
  zsh: app-shells/zsh
  bash: app-shells/bash
  vim: app-editors/vim
  neovim: app-editors/neovim
  tmux: app-misc/tmux
  openssh: net-misc/openssh
  sudo: app-admin/sudo
  man: sys-apps/man-pages sys-apps/man-db
  bc: sys-devel/bc
  time: sys-process/time
  rsync: net-misc/rsync
  tree: app-text/tree
  gcc: sys-devel/gcc
  clang: sys-devel/clang
  make: sys-devel/make
  cmake: dev-util/cmake
  meson: dev-util/meson
  gdb: sys-devel/gdb
  ninja: dev-util/ninja
  ripgrep: sys-apps/ripgrep
  fd: sys-apps/fd
  python: dev-lang/python
  nodejs: net-libs/nodejs
  jq: app-misc/jq
  fzf: app-shells/fzf
  emacs: app-editors/emacs
  vscode: app-editors/vscode
  go: dev-lang/go
  htop: sys-process/htop
  ufw: net-firewall/ufw
  net-tools: sys-apps/net-tools
  btop: sys-process/btop
  powertop: sys-power/powertop
  clamav: app-antivirus/clamav
  ntp: net-misc/chrony
  networkmanager: net-misc/networkmanager
  smartmontools: sys-apps/smartmontools
  hdparm: sys-apps/hdparm
  acpi: sys-power/acpi
  parted: sys-block/parted
  cups: net-print/cups
  sysstat: app-admin/sysstat
  hwinfo: sys-apps/hwinfo
  hack-font: media-fonts/hack
  nerd-fonts: media-fonts/nerd-fonts
  font-awesome: media-fonts/fontawesome
  dejavu-fonts: media-fonts/dejavu

  # Desktop
  xorg: x11-base/xorg-server
  wayland: dev-libs/wayland x11-base/xwayland
  xclip: x11-misc/xclip
  xterm: x11-terms/xterm
  gtk: x11-libs/gtk+
  firefox: www-client/firefox
  mpv: media-video/mpv
  discord: net-im/discord-bin
  libinput: dev-libs/libinput x11-drivers/xf86-input-libinput
  nnn: app-misc/nnn
  ranger: app-misc/ranger
  obs-studio: media-video/obs-studio
  unrar: app-arch/unrar
  unzip: app-arch/unzip
  p7zip: app-arch/p7zip
  imagemagick: media-gfx/imagemagick
  ffmpeg: media-video/ffmpeg
  wezterm: x11-terms/wezterm
  ncdu: sys-fs/ncdu
  picom: x11-misc/picom
  rofi: x11-misc/rofi
  udiskie: sys-fs/udiskie
  brightnessctl: app-misc/brightnessctl
  wl-clipboard: gui-apps/wl-clipboard
  nemo: gnome-extra/nemo
  blueman: net-wireless/blueman
  bluez: net-wireless/bluez

  # Window managers
  hyprland: gui-wm/hyprland
  bspwm: x11-wm/bspwm
  sxhkd: x11-misc/sxhkd
  polybar: x11-misc/polybar

  # Media
  mpd: media-sound/mpd
  pipewire: media-video/pipewire media-video/wireplumber
  ncmpcpp: media-sound/ncmpcpp

  # Gaming
  wine: app-emulation/wine-vanilla
  steam: games-util/steam-launcher

  # Virtualization
  libvirt: app-emulation/libvirt
  qemu: app-emulation/qemu

alpine:
  python: python3 py3-pip
  nodejs: nodejs npm
  man: man-pages man-db
  ntp: chrony
  htop: htop
  openssh: openssh
  ansible: ansible

void:
  python: python3 python3-pip
  nodejs: nodejs
  man: man-pages
  ntp: chrony
  openssh: openssh
  ripgrep: ripgrep
  fd: fd
  btop: btop
  networkmanager: NetworkManager
  ansible: ansible

macos:
  # Homebrew packages
  - git
  - curl
  - wget
  - zsh
  - bash
  - vim
  - neovim
  - tmux
  - openssh
  - python3
  - node
  - jq
  - fzf
  - ripgrep
  - fd
  - bat
  - htop
  - rsync
  - cmake
  - ninja
  - go
  - emacs
  - visual-studio-code
  - ansible

windows:
  # Chocolatey/Scoop/Winget packages
  - git
  - ripgrep
  - fd
  - microsoft-windows-terminal
  - nodejs
  - python
  - neovim
  - vscode
  - firefox
  - 7zip

#======================================
# Gentoo USE flags configuration
#======================================
gentoo_use_flags:
  git: "curl gpg perl python"
  curl: "ssl http2 ipv6"
  wget: "ssl ipv6 nls"
  zsh: "unicode pcre gdbm"
  bash: "net nls readline"
  tmux: "vim-syntax"
  vim: "python lua ruby perl cscope"
  neovim: "lua python ruby"
  emacs: "gtk jpeg png svg tiff xpm cairo dbus json ssl xml"
  gcc: "cxx fortran graphite jit nptl openmp pch pie ssp"
  clang: "static-analyzer"
  python: "sqlite ssl readline ncurses xml"
  nodejs: "ssl"
  htop: "unicode lm-sensors"
  openssh: "ssl kerberos ldap pam"
  firefox: "dbus gtk3 pulseaudio startup-notification wifi"
  mpv: "alsa pulseaudio lua drm wayland X"
  gtk: "wayland X cups introspection"
  pipewire: "alsa bluetooth jack pulseaudio sound-server"
  ffmpeg: "alsa encode mp3 opus pulseaudio theora vorbis webp x264 x265"
  networkmanager: "bluetooth dhclient introspection wifi"
  bluez: "alsa cups obex readline"
  qemu: "aio alsa bluetooth curl gtk jpeg ncurses opengl png pulseaudio sdl spice ssh usb vnc"
  libvirt: "firewalld libssh nfs numa parted qemu sasl udev"

#======================================
# System tweaks and configurations
#======================================
system_tweaks:
  gnome:
    # Power management settings
    - gsettings set org.gnome.desktop.session idle-delay 0
    - gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
    - gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'nothing'
    # Interface tweaks
    - gsettings set org.gnome.desktop.interface clock-show-weekday true
    - gsettings set org.gnome.desktop.interface show-battery-percentage true

  kde:
    # Power management
    - kwriteconfig5 --file powermanagementprofilesrc --group AC --group DimDisplay --key idleTime 300000
    - kwriteconfig5 --file powermanagementprofilesrc --group AC --group DPMSControl --key idleTime 600000

  windows:
    registry:
      # Explorer settings
      - path: "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"
        name: "Hidden"
        value: 1
        type: "DWORD"
        description: "Show hidden files"
      - path: "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"
        name: "HideFileExt"
        value: 0
        type: "DWORD"
        description: "Show file extensions"
      - path: "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"
        name: "TaskbarGlomLevel"
        value: 2
        type: "DWORD"
        description: "Never combine taskbar buttons"
      - path: "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"
        name: "TaskbarSmallIcons"
        value: 1
        type: "DWORD"
        description: "Use small taskbar icons"

      # Dark mode
      - path: "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"
        name: "AppsUseLightTheme"
        value: 0
        type: "DWORD"
        description: "Use dark theme for apps"
      - path: "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"
        name: "SystemUsesLightTheme"
        value: 0
        type: "DWORD"
        description: "Use dark theme for system"

      # Search settings
      - path: "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search"
        name: "SearchBoxTaskbarMode"
        value: 0
        type: "DWORD"
        description: "Hide search box from taskbar"

    features:
      - name: "Microsoft-Windows-Subsystem-Linux"
        description: "Windows Subsystem for Linux"
        requires_admin: true
      - name: "VirtualMachinePlatform"
        description: "Virtual Machine Platform"
        requires_admin: true

    hardening:
      registry:
        # Security hardening registry settings
        - path: "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"
          name: "EnableLUA"
          value: 1
          type: "DWORD"
          description: "Enable User Account Control"
        - path: "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"
          name: "ConsentPromptBehaviorAdmin"
          value: 2
          type: "DWORD"
          description: "UAC prompt for administrators"
        - path: "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
          name: "DisablePasswordCaching"
          value: 1
          type: "DWORD"
          description: "Disable password caching"
        - path: "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Lsa"
          name: "LimitBlankPasswordUse"
          value: 1
          type: "DWORD"
          description: "Limit blank password use"
        - path: "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\lanmanserver\\parameters"
          name: "AutoDisconnectTimeout"
          value: 15
          type: "DWORD"
          description: "Auto disconnect timeout"
        - path: "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"
          name: "DontDisplayLastUserName"
          value: 1
          type: "DWORD"
          description: "Don't display last username"

      services:
        disable:
          - "Fax"
          - "TelnetD"
          - "RemoteRegistry"
          - "Messenger"
          - "NetMeeting Remote Desktop Sharing"
          - "Remote Desktop Help Session Manager"
          - "Routing and Remote Access"
          - "Simple TCP/IP Services"
          - "SNMP Service"

      firewall:
        - "netsh advfirewall set allprofiles state on"
        - "netsh advfirewall firewall set rule group=\"File and Printer Sharing\" new enable=No"
        - "netsh advfirewall firewall set rule group=\"Network Discovery\" new enable=No"

  linux:
    hardening:
      sysctl:
        # Network security
        - net.ipv4.ip_forward = 0
        - net.ipv4.conf.all.send_redirects = 0
        - net.ipv4.conf.default.send_redirects = 0
        - net.ipv4.conf.all.accept_source_route = 0
        - net.ipv4.conf.default.accept_source_route = 0
        - net.ipv4.conf.all.accept_redirects = 0
        - net.ipv4.conf.default.accept_redirects = 0
        - net.ipv4.conf.all.secure_redirects = 0
        - net.ipv4.conf.default.secure_redirects = 0
        - net.ipv4.conf.all.log_martians = 1
        - net.ipv4.conf.default.log_martians = 1
        - net.ipv4.icmp_echo_ignore_broadcasts = 1
        - net.ipv4.icmp_ignore_bogus_error_responses = 1
        - net.ipv4.conf.all.rp_filter = 1
        - net.ipv4.conf.default.rp_filter = 1
        - net.ipv4.tcp_syncookies = 1
        - net.ipv6.conf.all.accept_ra = 0
        - net.ipv6.conf.default.accept_ra = 0
        - net.ipv6.conf.all.accept_redirects = 0
        - net.ipv6.conf.default.accept_redirects = 0

        # Kernel security
        - kernel.dmesg_restrict = 1
        - kernel.kptr_restrict = 2
        - kernel.yama.ptrace_scope = 1
        - kernel.kexec_load_disabled = 1
        - kernel.unprivileged_bpf_disabled = 1
        - net.core.bpf_jit_harden = 2

        # Memory protection
        - kernel.randomize_va_space = 2
        - vm.mmap_min_addr = 65536

      packages:
        security:
          - fail2ban
          - ufw
          - rkhunter
          - chkrootkit
          - lynis
          - aide
          - apparmor
          - apparmor-utils

      services:
        disable:
          - avahi-daemon
          - cups
          - bluetooth
          - whoopsie
          - apport
        enable:
          - ufw
          - fail2ban
          - apparmor

      filesystem:
        - "chmod 700 /root"
        - "chmod 644 /etc/passwd"
        - "chmod 600 /etc/shadow"
        - "chmod 644 /etc/group"
        - "chmod 600 /etc/gshadow"
        - "find /home -name '.netrc' -delete"
        - "find /home -name '.rhosts' -delete"

  macos:
    hardening:
      defaults:
        # Security settings
        - domain: "com.apple.screensaver"
          key: "askForPassword"
          value: 1
          type: "int"
          description: "Require password after screensaver"
        - domain: "com.apple.screensaver"
          key: "askForPasswordDelay"
          value: 0
          type: "int"
          description: "Require password immediately"
        - domain: "com.apple.Safari"
          key: "SendDoNotTrackHTTPHeader"
          value: 1
          type: "bool"
          description: "Enable Do Not Track"
        - domain: "com.apple.Safari"
          key: "AutoFillPasswords"
          value: 0
          type: "bool"
          description: "Disable password autofill"
        - domain: "com.apple.loginwindow"
          key: "GuestEnabled"
          value: 0
          type: "bool"
          description: "Disable guest account"
        - domain: "com.apple.loginwindow"
          key: "SHOWFULLNAME"
          value: 1
          type: "bool"
          description: "Show full name in login window"

      system:
        - "sudo spctl --master-enable"  # Enable Gatekeeper
        - "sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 1"  # Enable firewall
        - "sudo launchctl load /System/Library/LaunchDaemons/com.apple.locate.plist"  # Enable locate database

      services:
        disable:
          - "com.apple.AirPlayXPCHelper"
          - "com.apple.RemoteDesktop.agent"

      packages:
        security:
          - gpg
          - gnupg
          - pinentry-mac

#======================================
# Service configurations
#======================================
services:
  enable:
    all:
      - sshd
      - networkmanager
    server:
      - firewalld
      - chronyd
    desktop:
      - bluetooth
      - cups
  disable:
    server:
      - bluetooth
      - cups
      - gdm
    minimal:
      - cups
      - bluetooth

#======================================
# Development environment configurations
#======================================
development:
  git_config:
    - git config --global init.defaultBranch main
    - git config --global pull.rebase false
    - git config --global core.editor vim

  rust:
    components:
      - rustc
      - cargo
      - clippy
      - rustfmt

  nodejs:
    global_packages:
      - typescript
      - eslint
      - prettier

  python:
    global_packages:
      - black
      - flake8
      - mypy
      - requests
      - virtualenvwrapper

#======================================
# System update checks and maintenance
#======================================
system_updates:
  linux:
    kernel_check:
      - "uname -r"  # Current kernel
      - "ls /boot/vmlinuz-* | tail -1 | sed 's/.*vmlinuz-//'"  # Latest available

    distro_updates:
      arch:
        check: "checkupdates"
        update: "pacman -Syu"
        kernel_update: "pacman -S linux linux-headers"
      debian:
        check: "apt list --upgradable"
        update: "apt update && apt upgrade -y"
        kernel_update: "apt install linux-image-generic linux-headers-generic"
      rhel:
        check: "dnf check-update"
        update: "dnf update -y"
        kernel_update: "dnf update kernel kernel-headers"
      gentoo:
        check: "emerge -pv --update --deep --newuse @world"
        update: "emerge --update --deep --newuse @world"
        kernel_update: "emerge gentoo-sources && genkernel all"

  macos:
    system_updates:
      check: "softwareupdate -l"
      update: "softwareupdate -ia"
      major_check: "softwareupdate --list-full-installers"

  windows:
    system_updates:
      check: "Get-WindowsUpdate -MicrosoftUpdate"
      update: "Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot"
      feature_updates: "Get-WindowsUpdate -UpdateType Software"

#======================================
# Custom installation commands
#======================================
custom_installs:
  yq:
    condition: "! command -v yq"
    linux: |
      YQ_VERSION=$(curl -s https://api.github.com/repos/mikefarah/yq/releases/latest | grep 'tag_name' | cut -d'"' -f4)
      YQ_BINARY="yq_linux_amd64"
      curl -L "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY}" -o ~/.local/bin/yq
      chmod +x ~/.local/bin/yq
    macos: "brew install yq"
    windows: "choco install yq"

  homebrew:
    condition: "test $(uname) = Darwin && ! command -v brew"
    macos: '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'

  system_updates:
    condition: "true"  # Always available
    description: "Check and install system updates"
    linux: |
      case "$CFG_DISTRO" in
        arch) checkupdates && sudo pacman -Syu ;;
        debian|ubuntu) apt list --upgradable && sudo apt update && sudo apt upgrade -y ;;
        rhel|fedora|centos) dnf check-update && sudo dnf update -y ;;
        gentoo) emerge -pv --update --deep --newuse @world && sudo emerge --update --deep --newuse @world ;;
        *) echo "Unsupported distribution for automatic updates" ;;
      esac
    macos: "softwareupdate -l && sudo softwareupdate -ia"
    windows: |
      if (Get-Module -ListAvailable -Name PSWindowsUpdate) {
        Get-WindowsUpdate -MicrosoftUpdate
        Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot
      } else {
        Write-Host "PSWindowsUpdate module not installed. Install with: Install-Module PSWindowsUpdate"
      }

  zsh_plugins:
    condition: "command -v zsh"
    description: "Install common Zsh plugins"
    linux: |
      ZPLUG_DIR="$HOME/.config/zsh/plugins"; mkdir -p "$ZPLUG_DIR"; command -v git >/dev/null 2>&1 || exit 0; c(){ n="$1"; u="$2"; [ -d "$ZPLUG_DIR/$n" ] && return 0; env -i PATH="$PATH" HOME="$HOME" GIT_TERMINAL_PROMPT=0 GIT_ASKPASS=/bin/true git -c credential.helper= -c core.askPass= clone --depth 1 --single-branch "$u" "$ZPLUG_DIR/$n" 2>/dev/null || true; }; c zsh-you-should-use https://github.com/MichaelAquilina/zsh-you-should-use.git; c zsh-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting.git; c zsh-autosuggestions https://github.com/zsh-users/zsh-autosuggestions.git
    macos: |
      ZPLUG_DIR="$HOME/.config/zsh/plugins"; mkdir -p "$ZPLUG_DIR"; command -v git >/dev/null 2>&1 || exit 0; c(){ n="$1"; u="$2"; [ -d "$ZPLUG_DIR/$n" ] && return 0; env -i PATH="$PATH" HOME="$HOME" GIT_TERMINAL_PROMPT=0 GIT_ASKPASS=/bin/true git -c credential.helper= -c core.askPass= clone --depth 1 --single-branch "$u" "$ZPLUG_DIR/$n" 2>/dev/null || true; }; c zsh-you-should-use https://github.com/MichaelAquilina/zsh-you-should-use.git; c zsh-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting.git; c zsh-autosuggestions https://github.com/zsh-users/zsh-autosuggestions.git

  vscode_extensions:
    condition: "command -v code"
    description: "Install template VSCode extensions"
    linux: |
      for e in ms-python.python ms-vscode.cpptools golang.Go rust-lang.rust-analyzer esbenp.prettier-vscode eamodio.gitlens ms-azuretools.vscode-docker hashicorp.terraform redhat.ansible; do code --install-extension "$e" --force >/dev/null 2>&1 || true; done
    macos: |
      for e in ms-python.python ms-vscode.cpptools golang.Go rust-lang.rust-analyzer esbenp.prettier-vscode eamodio.gitlens ms-azuretools.vscode-docker hashicorp.terraform redhat.ansible; do code --install-extension "$e" --force >/dev/null 2>&1 || true; done

  nix_home_manager:
    condition: "command -v nix-env"
    description: "Bootstrap Home Manager if missing"
    linux: |
      if ! command -v home-manager >/dev/null 2>&1; then nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager || true; nix-channel --update || true; nix-shell '<home-manager>' -A install || true; fi
    macos: |
      if ! command -v home-manager >/dev/null 2>&1; then nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager || true; nix-channel --update || true; nix-shell '<home-manager>' -A install || true; fi


#======================================
# Profile-specific package lists
#======================================
profiles:
  essentials:
    description: "Essential packages only (git, curl, wget, vim, zsh)"
    packages:
      - common
      - essentials

  minimal:
    description: "Minimal setup for basic development"
    packages:
      - common
      - essentials
      - minimal

  dev:
    description: "Full development environment"
    packages:
      - common
      - essentials
      - minimal
      - dev
    enable_development: true

  server:
    description: "Server configuration"
    packages:
      - common
      - essentials
      - minimal
      - server
    enable_services: server

  full:
    description: "Complete installation with all packages"
    packages:
      - common
      - essentials
      - minimal
      - dev
      - server
      - desktop
      - wm
      - media
      - fonts
    enable_development: true
    enable_services: desktop

#======================================
# Package management helpers
#======================================
package_managers:
  arch:
    update: "pacman -Syu"
    install: "pacman -S --noconfirm"
    search: "pacman -Ss"

  debian:
    update: "apt update && apt upgrade -y"
    install: "apt install -y"
    search: "apt search"

  rhel:
    update: "dnf update -y"
    install: "dnf install -y"
    search: "dnf search"

  fedora:
    update: "dnf update -y"
    install: "dnf install -y"
    search: "dnf search"

  opensuse:
    update: "zypper update -y"
    install: "zypper install -y"
    search: "zypper search"

  gentoo:
    update: "emerge --sync && emerge -uDN @world"
    install: "emerge"
    search: "emerge --search"

  alpine:
    update: "apk update && apk upgrade"
    install: "apk add"
    search: "apk search"

  void:
    update: "xbps-install -Su"
    install: "xbps-install -y"
    search: "xbps-query -Rs"

  macos:
    update: "brew update && brew upgrade"
    install: "brew install"
    search: "brew search"

  windows:
    update: "choco upgrade all -y"
    install: "choco install -y"
    search: "choco search"
  nix:
    update: "nix-channel --update && nix-env -u"
    install: "nix-env -iA"
    search: "nix-env -qaP"