From 3af998440f7b4bc2b8744a4626254e1a64e8853c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 22 Oct 2023 22:27:58 +0200 Subject: [PATCH] nix: Add more packages --- .../software/templates/package_manager.j2 | 20 ----- .../templates/snippets/pm_data_management.j2 | 12 --- .../snippets/pm_desktop_environment.j2 | 71 ---------------- .../templates/snippets/pm_disk_cleanup.j2 | 13 --- .../templates/snippets/pm_local_monitoring.j2 | 24 ------ .../software/templates/snippets/pm_mpd.j2 | 9 -- .../snippets/pm_multimedia_common.j2 | 13 --- .../snippets/pm_multimedia_toolbox.j2 | 4 - .../templates/snippets/pm_noandroid.j2 | 30 ------- .../software/templates/snippets/pm_remote.j2 | 6 -- .../software/templates/snippets/pm_system.j2 | 16 ---- .../software/templates/snippets/pm_termux.j2 | 9 -- config/nix/configuration.nix | 6 +- config/nix/modules/battery.nix | 7 ++ config/nix/modules/common.nix | 51 +++++++++++- config/nix/modules/desktop.nix | 82 +++++++++++++++++++ config/nix/modules/wireless.nix | 4 + config/nix/modules/x11.nix | 22 ----- 18 files changed, 142 insertions(+), 257 deletions(-) delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_data_management.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_mpd.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_remote.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_system.j2 delete mode 100644 config/automatrop/roles/software/templates/snippets/pm_termux.j2 create mode 100644 config/nix/modules/battery.nix create mode 100644 config/nix/modules/desktop.nix create mode 100644 config/nix/modules/wireless.nix delete mode 100644 config/nix/modules/x11.nix diff --git a/config/automatrop/roles/software/templates/package_manager.j2 b/config/automatrop/roles/software/templates/package_manager.j2 index 7f4a943..3a10339 100644 --- a/config/automatrop/roles/software/templates/package_manager.j2 +++ b/config/automatrop/roles/software/templates/package_manager.j2 @@ -1,24 +1,4 @@ -{# Macros #} -{# Include essential snippets #} -{% include 'snippets/pm_remote.j2' %} -{% include 'snippets/pm_disk_cleanup.j2' %} -{% include 'snippets/pm_local_monitoring.j2' %} -{% include 'snippets/pm_mpd.j2' %} -{% include 'snippets/pm_multimedia_toolbox.j2' %} -{% include 'snippets/pm_multimedia_common.j2' %} -{% include 'snippets/pm_data_management.j2' %} {# Include rules-determined snippets #} -{% if root_access %} -{% include 'snippets/pm_system.j2' %} -{% endif %} -{% if display_server %} -{% include 'snippets/pm_desktop_environment.j2' %} -{% endif %} -{% if termux %} -{% include 'snippets/pm_termux.j2' %} -{% else %} -{% include 'snippets/pm_noandroid.j2' %} -{% endif %} {% if software_full %} {% include 'snippets/pm_android_tools.j2' %} {% include 'snippets/pm_multimedia_editors.j2' %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 b/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 deleted file mode 100644 index d6c2768..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_data_management.j2 +++ /dev/null @@ -1,12 +0,0 @@ -{# -Stuff to synchronize/backup data -#} -rsync -borg -syncthing -{% if arch_based %} -{% if ansible_architecture == 'x86_64' and can_chown %} -freefilesync-bin -{# Not worth the compilation if you can't have the binaries #} -{% endif %} -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 b/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 deleted file mode 100644 index f042a59..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_desktop_environment.j2 +++ /dev/null @@ -1,71 +0,0 @@ -{# Essential #} -firefox -qutebrowser -{# Sound #} -pulseaudio -pacmixer -{% if arch_based %} -ttf-dejavu -ttf-twemoji -{% endif %} -{% if arch_based %} -xkb-qwerty-fr -{% endif %} -thunar -gedit -feh -zathura -zbar -{% if arch_based %} -zathura-pdf-mupdf -{% elif debian_based %} -zathura-pdf-poppler -{% endif %} -meld -{{ python_prefix }}-magic -{% if arch_based %} -yubikey-touch-detector -{% endif %} -{% if display_server == "x11" %} -i3-wm -libgnomekbd{{ lib_suffix }} -dunst -i3lock -numlockx -rofi -{% if arch_based %} -rofimoji -{% endif %} -rxvt-unicode -{% if arch_based %} -urxvt-resize-font-git -alacritty -{% endif %} -scrot -simplescreenrecorder -trayer -unclutter -{% if arch_based %} -xautolock -{% endif %} -xclip -{% if arch_based %} -lemonbar-xft-git -wireless_tools -{% else %} -lemonbar -{% endif %} -{# lemonbar dependency #} -notmuch -autorandr -keynav -sct -xorg-xinit -{% if arch_based %} -xorg-xbacklight -{% elif debian_based %} -xbacklight -{% endif %} -{% elif display_server == "wayland" %} -sway -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 b/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 deleted file mode 100644 index 24361ff..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_disk_cleanup.j2 +++ /dev/null @@ -1,13 +0,0 @@ -{# -Program that essentially help you reduce disk usage -#} -jdupes -duperemove -optipng -{% if debian_based %} -libjpeg-turbo-progs -{% else %} -libjpeg-turbo -{% endif %} -reflac -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 b/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 deleted file mode 100644 index 236557e..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_local_monitoring.j2 +++ /dev/null @@ -1,24 +0,0 @@ -{# -Shell utilities to see what's going on on the system -#} -htop -{% if root_access %} -iotop -iftop -{% endif %} -ncdu -{% if not termux %} -lsof -{% endif %} -strace -pv -progress -{% if not termux %} -speedtest-cli -{% endif %} -{% if arch_based %} -pacman-contrib -{% endif %} -{% if has_battery %} -powertop -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 b/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 deleted file mode 100644 index f5744ea..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_mpd.j2 +++ /dev/null @@ -1,9 +0,0 @@ -{# -To play music with Music Player Daemon -#} -mpd -mpc -{% if arch_based %} -ashuffle-git -vimpc-git -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 b/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 deleted file mode 100644 index 92cedd3..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_multimedia_common.j2 +++ /dev/null @@ -1,13 +0,0 @@ -{% if display_server %} -gimp -inkscape -mpv -{% if arch_based %} -mpv-thumbnail-script -{% endif %} -{% if arch_based %} -libreoffice-fresh -{% elif debian_based %} -libreoffice -{% endif %} -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 b/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 deleted file mode 100644 index 9b8ba1b..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_multimedia_toolbox.j2 +++ /dev/null @@ -1,4 +0,0 @@ -ffmpeg -sox -imagemagick -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 b/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 deleted file mode 100644 index 251d823..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_noandroid.j2 +++ /dev/null @@ -1,30 +0,0 @@ -{# -Stuff that isn't required on Android because there are apps for that -#} -{# Password handling #} -pass -pwgen -{% if display_server %} -rofi-pass -{# TODO Try autopass.cr #} -{% endif %} -{# Mail #} -isync -msmtp -notmuch -neomutt -lynx -{% if not arch_based %} -{# https://aur.archlinux.org/packages/tiv/#comment-812593 #} -tiv -{% endif %} -{% if display_server %} -thunderbird -{% endif %} -{# Organisation #} -vdirsyncer -khard -khal -todoman -syncthing -{# EOF #} diff --git a/config/automatrop/roles/software/templates/snippets/pm_remote.j2 b/config/automatrop/roles/software/templates/snippets/pm_remote.j2 deleted file mode 100644 index c3bded8..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_remote.j2 +++ /dev/null @@ -1,6 +0,0 @@ -openssh -wget -rsync -{% if display_server %} -tigervnc -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_system.j2 b/config/automatrop/roles/software/templates/snippets/pm_system.j2 deleted file mode 100644 index 726dbec..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_system.j2 +++ /dev/null @@ -1,16 +0,0 @@ -etckeeper -{% if has_battery %} -tlp -{% endif %} -dhcpcd -wpa_supplicant -chrony -{% if encrypt_home_stacked_fs %} -ecryptfs-utils -{% endif %} -kexec-tools -openvpn -{% if arch_based %} -openvpn-update-resolv-conf-git -{# TODO Other distributions #} -{% endif %} diff --git a/config/automatrop/roles/software/templates/snippets/pm_termux.j2 b/config/automatrop/roles/software/templates/snippets/pm_termux.j2 deleted file mode 100644 index 8cc9822..0000000 --- a/config/automatrop/roles/software/templates/snippets/pm_termux.j2 +++ /dev/null @@ -1,9 +0,0 @@ -{# -Stuff that only makes sense on Termux -#} -{% if termux %} -{% if root_access %} -tsu -{% endif %} -termux-api -{% endif %} diff --git a/config/nix/configuration.nix b/config/nix/configuration.nix index 2c067b8..d616772 100644 --- a/config/nix/configuration.nix +++ b/config/nix/configuration.nix @@ -2,8 +2,6 @@ let recursiveMerge = import ./recursiveMerge.nix; getModule = name: import (./modules + "/${name}.nix") { inherit config pkgs; }; + loadModules = modules: recursiveMerge ((map getModule) modules); in -recursiveMerge [ - (getModule "common") - (getModule "x11") -] +loadModules [ "common" "desktop" "battery" "wireless" ] diff --git a/config/nix/modules/battery.nix b/config/nix/modules/battery.nix new file mode 100644 index 0000000..8c01d3d --- /dev/null +++ b/config/nix/modules/battery.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + users.users.geoffrey.packages = with pkgs; [ + powertop + ]; + environment.systemPackages = with pkgs; [ tlp ]; +} diff --git a/config/nix/modules/common.nix b/config/nix/modules/common.nix index e71861c..279531e 100644 --- a/config/nix/modules/common.nix +++ b/config/nix/modules/common.nix @@ -60,10 +60,47 @@ # remote openssh rsync + borgbackup - # DEBUG - tree - lolcat + # cleanup + jdupes + duperemove + optipng + libjpeg + # FIXME reflac not available (but also a dumb shell script) + + # local monitoring + htop + iotop + iftop + lsof + strace + pv + progress + speedtest-cli + + # multimedia toolbox + ffmpeg + sox + imagemagick + + # password + pass + pwgen + + # Mail + isync + msmtp + notmuch + neomutt + lynx + + # Organisation + vdirsyncer + khard + khal + todoman + syncthing ]; initialPassword = "cartable"; # DEBUG @@ -72,7 +109,12 @@ ]; }; - environment.systemPackages = with pkgs; [ neovim wget ]; + environment.systemPackages = with pkgs; [ + wget + kexec-tools + openvpn + update-resolv-conf # TODO Is it what I think it is? + ]; # Enable compilation cache programs = { @@ -101,6 +143,7 @@ # Enable the OpenSSH daemon openssh.enable = true; getty.autologinUser = "geoffrey"; # DEBUG + chrony.enable = true; }; # TEST diff --git a/config/nix/modules/desktop.nix b/config/nix/modules/desktop.nix new file mode 100644 index 0000000..58d46de --- /dev/null +++ b/config/nix/modules/desktop.nix @@ -0,0 +1,82 @@ +{ pkgs, ... }: +{ + # Enable the X11 windowing system + services.xserver.enable = true; + + # FIXME qwerty-fr for X11 + + # Enable sound + sound.enable = true; + hardware.pulseaudio.enable = true; + + services.xserver.displayManager.startx.enable = true; + services.xserver.windowManager.i3.enable = true; + + users.users.geoffrey. packages = with pkgs; [ + # remote + tigervnc + + # music + mpd + mpc-cli + ashuffle + vimpc + + # multimedia common + gimp + inkscape + mpv + mpvScripts.thumbnail + libreoffice + + # data management + freefilesync + + # browsers + firefox + qutebrowser + + # fonts + dejavu_fonts + twemoji-color-font + xfce.thunar + gnome.gedit + feh + zathura + zbar + zathura + meld + python3Packages.magic + yubikey-touch-detector + + # x11-exclusive + libgnomekbd # to show keyboard layout + dunst + i3lock + numlockx + rofi + rofimoji + rxvt-unicode + # TODO urxvt-resize-font-git + scrot + simplescreenrecorder + trayer + unclutter + xautolock + xclip + lemonbar-xft + autorandr + keynav + sct + xorg.xinit + xorg.xbacklight + + alacritty + + # organisation + rofi-pass # TODO Try autopass.cr + thunderbird + ]; + + environment.systemPackages = with pkgs; [ pavucontrol ]; +} diff --git a/config/nix/modules/wireless.nix b/config/nix/modules/wireless.nix new file mode 100644 index 0000000..ba7d7e2 --- /dev/null +++ b/config/nix/modules/wireless.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ wirelesstools ]; +} diff --git a/config/nix/modules/x11.nix b/config/nix/modules/x11.nix deleted file mode 100644 index 5bde7b1..0000000 --- a/config/nix/modules/x11.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: -{ - # Enable the X11 windowing system - services.xserver.enable = true; - - # FIXME qwerty-fr for X11 - - # Enable sound - sound.enable = true; - hardware.pulseaudio.enable = true; - - services.xserver.displayManager.startx.enable = true; - services.xserver.windowManager.i3.enable = true; - - users.users.geoffrey. packages = with pkgs; [ - # remote - tigervnc - - # remote - firefox - ]; -}