From 4ca932b75957b2511fb53da8b1053bd6a0fdcea9 Mon Sep 17 00:00:00 2001 From: lelgenio Date: Fri, 11 Feb 2022 23:01:19 -0300 Subject: [PATCH] root: fixup config --- root/.gitignore | 1 + root/_create-subvolumes | 23 ------- root/config.yaml | 125 ++++++++++++++---------------------- root/fstab | 21 ++++-- root/grub | 11 +++- root/hardware.example.yaml | 24 +++++++ root/runit_sv/earlyoom/conf | 1 - root/sysctl/iotop.conf | 1 + void.freeze | 34 +++++----- 9 files changed, 115 insertions(+), 126 deletions(-) create mode 100644 root/.gitignore delete mode 100755 root/_create-subvolumes create mode 100644 root/hardware.example.yaml delete mode 120000 root/runit_sv/earlyoom/conf create mode 100644 root/sysctl/iotop.conf diff --git a/root/.gitignore b/root/.gitignore new file mode 100644 index 0000000..b6f8910 --- /dev/null +++ b/root/.gitignore @@ -0,0 +1 @@ +hardware.yaml diff --git a/root/_create-subvolumes b/root/_create-subvolumes deleted file mode 100755 index 2198452..0000000 --- a/root/_create-subvolumes +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -set -e - -BTRFS_ROOT="{{@@ filesystem.partitions['/'] @@}}" - -if ! mountpoint "$BTRFS_ROOT" -then - mkdir -p "$BTRFS_ROOT" - mount "$BTRFS_ROOT" -fi -cd "$BTRFS_ROOT" - - -{%@@ set new_partitions = filesystem.partitions.update({root_subvol: '/'}) @@%} -{%@@ for name, path in filesystem.partitions.items() @@%} - test -e "./{{@@ name @@}}" || - btrfs subvolume create "./{{@@ name @@}}" - test -d "{{@@ path @@}}" || - mkdir -p "{{@@ path @@}}" - mountpoint "{{@@ path @@}}" || - mount "{{@@ path @@}}" -{%@@ endfor @@%} diff --git a/root/config.yaml b/root/config.yaml index 0f4d02f..a6ec58c 100644 --- a/root/config.yaml +++ b/root/config.yaml @@ -21,31 +21,8 @@ config: - "../funcs.py" # import_configs: # - "../config.yaml" - - -# ############################################################### -# variables: -# ############################################################### - -# plymouth: true -# zram: false -# filesystem: -# partitions: -# "/": /mnt/btrfs-root -# "/@home": /home -# "/@sql": /var/lib/mysql -# "/@swap": /swap - -############################################################### -dynvariables: -############################################################### - - # phisical_uuid: sudo blkid /dev/sda2 -s UUID -o value - # decrypted_uuid: sudo blkid /dev/mapper/main -s UUID -o value - # boot_uuid: sudo blkid /dev/sda1 -s UUID -o value - # root_subvol: echo "/@$(lsb_release -i | cut -f 2)-root" - nproc: nproc - # memory_size: env LC_ALL=C free -b | awk '/^Mem:/ {print $2}' + import_variables: + - "hardware.yaml" ############################################################### actions: @@ -61,43 +38,38 @@ actions: sv restart "{{@@ '_dotfile_key' @@}}" || rc-service "{{@@ '_dotfile_key' @@}}" restart - create_subvolumes: _create-subvolumes create_swapfile: _create-swapfile mount_partitions: mount -a dbus_uuidgen: dbus-uuidgen --ensure sysctl_apply: sysctl -a - mkinitcpio: mkinitcpio -P - start_services: > - _runit_config "{{@@ _dotfile_abs_dst @@}}" - apache - cronie - dbus - dhcpcd - docker - earlyoom - elogind - greetd - iwd - bluetoothd - mariadb - preload - syslog-ng - tlp + # mkinitcpio: mkinitcpio -P + # start_services: > + # _runit_config "{{@@ _dotfile_abs_dst @@}}" + # apache + # cronie + # dbus + # dhcpcd + # docker + # earlyoom + # elogind + # greetd + # iwd + # bluetoothd + # mariadb + # preload + # syslog-ng + # tlp ############################################################### dotfiles: ############################################################### - runit_sv: - src: runit_sv - dst: /etc/runit/sv - - greetd: - src: greetd - dst: /etc/greetd - actions: - - greetd_install + # greetd: + # src: greetd + # dst: /etc/greetd + # actions: + # - greetd_install elogind: src: elogind.conf @@ -105,11 +77,11 @@ dotfiles: actions: - dbus_uuidgen - # grub: - # src: grub - # dst: /etc/default/grub - # actions: - # - grub_install + grub: + src: grub + dst: /etc/default/grub + actions: + - grub_install # mkinitcpio: # src: mkinitcpio.conf @@ -117,11 +89,11 @@ dotfiles: # actions: # - mkinitcpio - pacman: - src: pacman.conf - dst: /etc/pacman.conf - actions: - - pacman_install + # pacman: + # src: pacman.conf + # dst: /etc/pacman.conf + # actions: + # - pacman_install bluez: src: bluetooth.conf @@ -133,13 +105,12 @@ dotfiles: actions: - locale_install - # fstab: - # src: fstab - # dst: /etc/fstab - # actions: - # - create_subvolumes - # - create_swapfile - # - mount_partitions + fstab: + src: fstab + dst: /etc/fstab + actions: + - create_swapfile + - mount_partitions sysctl: src: sysctl @@ -147,19 +118,19 @@ dotfiles: actions: - sysctl_apply - # zram: - # src: zram - # dst: /etc/ + zram: + src: zram + dst: /etc/ # earlyoom: # src: earlyoom # dst: /etc/default/earlyoom - services: - src: runit_sv - dst: /etc/runit/sv - actions: - - start_services + # services: + # src: runit_sv + # dst: /etc/runit/sv + # actions: + # - start_services ############################################################### diff --git a/root/fstab b/root/fstab index f24b378..de8d01b 100644 --- a/root/fstab +++ b/root/fstab @@ -1,17 +1,26 @@ {{@@ non_templated(_dotfile_abs_dst) @@}} ##### Dotdrop-start ##### -{#@@ @@#} +# {%@@ set btrfs_opt_t = "rw,noatime,compress=zstd:3,subvol={}" @@%} {%@@ set entry_t = "UUID={uuid} {path} {fs} {opts} {dump} {pass}" @@%} -UUID={{@@ boot_uuid @@}} /boot vfat rw,errors=remount-ro 0 2 - -{%@@ set new_partitions = filesystem.partitions.update({root_subvol: '/'}) @@%} -{%@@ for name, path in filesystem.partitions.items() @@%} +{%@@ for partition in filesystem.partition @@%} {{@@ entry_t.format( - uuid= decrypted_uuid , + uuid= partition.uuid , + path= partition.path , + fs= partition.type, + opts= partition.options, + dump= "0", + pass= "0", + ) @@}} +{%@@ endfor @@%} + +{%@@ set new_partitions = filesystem.btrfs_subvolumes.update({root_subvol: '/'}) @@%} +{%@@ for name, path in filesystem.btrfs_subvolumes.items() @@%} + {{@@ entry_t.format( + uuid= root_uuid , path= path , fs= "btrfs", opts= btrfs_opt_t.format(name), diff --git a/root/grub b/root/grub index 49ecf9a..fe91a2e 100644 --- a/root/grub +++ b/root/grub @@ -10,8 +10,15 @@ GRUB_RECORDFAIL_TIMEOUT=$GRUB_HIDDEN_TIMEOUT GRUB_DISTRIBUTOR="Artix" GRUB_CMDLINE_LINUX_DEFAULT="" -GRUB_CMDLINE_LINUX=" cryptdevice=/dev/disk/by-uuid/{{@@ phisical_uuid @@}}:main " -GRUB_CMDLINE_LINUX+=" root=/dev/mapper/main rootflags=rw,noatime,compress=zstd,subvol=/{{@@ root_subvol @@}} " +GRUB_CMDLINE_LINUX=" \ + {%@@ if phisical_uuid @@%} + rd.luks.uuid={{@@ phisical_uuid @@}} \ + root=UUID={{@@ root_uuid @@}} \ + {%@@ endif @@%} + {%@@ if root_subvol @@%} + rootflags=rw,noatime,compress=zstd,subvol=/{{@@ root_subvol @@}} \ + {%@@ endif @@%} +" {%@@ if plymouth @@%} GRUB_CMDLINE_LINUX+=" fbcon=nodefer splash quiet loglevel=3 vt.global_cursor_default=0 rd.udev.log_level=3 " diff --git a/root/hardware.example.yaml b/root/hardware.example.yaml new file mode 100644 index 0000000..319dd33 --- /dev/null +++ b/root/hardware.example.yaml @@ -0,0 +1,24 @@ +variables: + plymouth: false + zram: false + + # set to false if root_uuid == phisical_uuid + phisical_uuid: ####RUN#### sudo blkid /dev/sda2 -s UUID -o value + root_uuid: ####RUN#### sudo blkid /dev/mapper/main -s UUID -o value + boot_uuid: ####RUN#### sudo blkid /dev/sda1 -s UUID -o value + # set to false if not using btrfs + root_subvol: ####RUN#### echo "/@$(lsb_release -i | cut -f 2)-root" + nproc: ####RUN#### nproc + memory_size: ####RUN#### env LC_ALL=C free -b | awk '/^Mem:/ {print $2}' + + filesystem: + partition: + - type: vfat + uuid: ####RUN#### sudo blkid /dev/sda1 -s UUID -o value + path: /boot + options: rw + btrfs_subvolumes: + "/": /mnt/btrfs-root + "/@home": /home + "/@mysql": /var/lib/mysql + "/@swap": /swap diff --git a/root/runit_sv/earlyoom/conf b/root/runit_sv/earlyoom/conf deleted file mode 120000 index 376d749..0000000 --- a/root/runit_sv/earlyoom/conf +++ /dev/null @@ -1 +0,0 @@ -/etc/default/earlyoom \ No newline at end of file diff --git a/root/sysctl/iotop.conf b/root/sysctl/iotop.conf new file mode 100644 index 0000000..0796366 --- /dev/null +++ b/root/sysctl/iotop.conf @@ -0,0 +1 @@ +kernel.task_delayacct=1 diff --git a/void.freeze b/void.freeze index ab4beab..6484a9b 100644 --- a/void.freeze +++ b/void.freeze @@ -2,7 +2,7 @@ ImageMagick-7.1.0.19_1 MangoHud-0.6.5_1 Thunar-4.16.10_1 Waybar-0.9.9_1 -alacritty-0.9.0_2 +alacritty-0.10.0_1 apache-2.4.52_1 atool-0.39.0_6 bamf-devel-0.5.5_1 @@ -17,7 +17,7 @@ breeze-cursors-1.0_3 breeze-obsidian-cursor-theme-1.0_3 caffeine-ng-3.5.1_2 cargo-edit-0.8.0_1 -chromium-97.0.4692.99_1 +chromium-98.0.4758.80_1 clyrics-0.13_1 cmake-3.22.1_1 cmatrix-2.0_1 @@ -28,8 +28,8 @@ curl-7.81.0_2 dconf-0.40.0_1 diffr-0.1.4_1 direnv-2.30.3_1 -docker-20.10.10_1 -docker-compose-1.29.2_2 +docker-20.10.12_1 +docker-compose-2.2.3_1 dust-0.7.5_1 efibootmgr-17_6 elogind-246.9.2_3 @@ -39,7 +39,7 @@ entr-5.1_1 exa-0.10.1_1 fail2ban-0.11.2_3 fd-8.3.2_1 -firefox-96.0.2_1 +firefox-97.0_1 fish-shell-3.3.1_1 flatpak-1.12.4_1 font-hack-ttf-3.003_2 @@ -50,7 +50,7 @@ gcc-10.2.1pre1_3 gdb-11.1_2 gettext-0.21_4 gimp-2.10.30_1 -git-2.35.0_1 +git-2.35.1_1 glib-devel-2.70.2_1 grim-1.3.2_1 grub-2.06_2 @@ -74,7 +74,7 @@ iwd-1.23_1 j4-dmenu-desktop-2.18_3 jnettop-0.13.0_2 jq-1.6_1 -kak-lsp-11.1.0_1 +kak-lsp-12.0.1_1 kakoune-2021.11.08_1 kanshi-1.2.0_1 kdeconnect-21.12.2_1 @@ -100,13 +100,13 @@ mako-1.6_2 man-db-2.9.4_1 mariadb-10.5.10_2 mariadb-client-10.5.10_2 -mesa-21.3.3_2 -mesa-32bit-21.3.3_2 -mesa-dri-21.3.3_2 -mesa-dri-32bit-21.3.3_2 -mesa-intel-dri-32bit-21.3.3_2 -mesa-vulkan-intel-21.3.3_2 -mesa-vulkan-intel-32bit-21.3.3_2 +mesa-21.3.5_1 +mesa-32bit-21.3.5_1 +mesa-dri-21.3.5_1 +mesa-dri-32bit-21.3.5_1 +mesa-intel-dri-32bit-21.3.5_1 +mesa-vulkan-intel-21.3.5_1 +mesa-vulkan-intel-32bit-21.3.5_1 meson-0.60.3_1 micro-2.0.10_1 miniupnpc-2.2.2_1 @@ -116,7 +116,7 @@ mpd-0.23.5_2 mpv-0.34.1_1 msmtp-1.8.18_1 mtr-0.95_1 -nano-6.0_1 +nano-6.1_1 ncmpcpp-0.9.2_4 neofetch-7.1.0_2 neomutt-20211029_1 @@ -124,7 +124,6 @@ neovim-0.6.1_1 nerd-fonts-2.1.0_3 net-tools-1.60.20181103git_1 netcat-0.7.1_7 -nix-2.3.12_1 nmap-7.80_6 nodejs-16.13.2_2 notify-send.sh-1.2_1 @@ -158,7 +157,7 @@ pulsemixer-1.5.1_2 pup-0.4.0_12 python3-ipython-7.31.0_1 python3-neovim-0.4.3_2 -python3-pip-22.0.2_1 +python3-pip-22.0.3_1 python3-wheel-0.37.0_2 qemu-6.1.0_3 qt5-5.15.3+20211001_2 @@ -182,6 +181,7 @@ socklog-2.1.0_5 socklog-void-20200115_2 source-sans-pro-3.028_1 speedtest-cli-2.1.3_2 +sqlite-devel-3.37.2_1 starship-1.2.1_1 swappy-1.3.1_1 sway-1.6.1_1