75 lines
2.1 KiB
Python
75 lines
2.1 KiB
Python
from typing import Literal
|
|
|
|
import decman
|
|
from decman.plugins import pacman, aur
|
|
|
|
|
|
class BasePackages(decman.Module):
|
|
def __init__(self, platform: Literal["desktop", "laptop"]):
|
|
"""Base packages that should never be uninstalled"""
|
|
self._platform: Literal["desktop", "laptop"] = platform
|
|
super().__init__("base")
|
|
|
|
@pacman.packages
|
|
def pkgs(self) -> set[str]:
|
|
return {
|
|
"base",
|
|
"base-devel",
|
|
"cifs-utils",
|
|
"cups",
|
|
"dosfstools",
|
|
"efibootmgr",
|
|
"exfatprogs",
|
|
"git",
|
|
"grub",
|
|
"gsl",
|
|
"libisoburn",
|
|
"libguestfs",
|
|
"libmicrohttpd",
|
|
"linux",
|
|
"linux-firmware",
|
|
"linux-headers",
|
|
"lzop",
|
|
"mesa",
|
|
"mesa-utils",
|
|
"mtools",
|
|
"ntfs-3g",
|
|
"ntfsprogs",
|
|
"networkmanager",
|
|
"pacman-contrib",
|
|
"plymouth",
|
|
"reflector",
|
|
"samba",
|
|
"sdl12-compat",
|
|
"sdl2-compat",
|
|
"sudo",
|
|
"systemd-resolvconf",
|
|
"trash-cli",
|
|
}
|
|
|
|
@aur.packages
|
|
def aurpkgs(self) -> set[str]:
|
|
return {"decman"}
|
|
|
|
# TODO:
|
|
# def file_variables(self) -> dict[str, str]:
|
|
# return super().file_variables()
|
|
|
|
def files(self) -> dict[str, decman.File]:
|
|
# TODO: File substitutions (for PC and laptop)
|
|
if self._platform == "desktop":
|
|
return {
|
|
"/etc/mkinitcpio.conf": decman.File(
|
|
source_file="./system/mkinitcpio.conf"
|
|
),
|
|
"/etc/pacman.conf": decman.File(source_file="./system/pacman.conf"),
|
|
"/etc/default/grub": decman.File(source_file="./system/grub"),
|
|
"/etc/environment": decman.File(source_file="./system/environment"),
|
|
}
|
|
else:
|
|
return {}
|
|
|
|
def on_change(self, store):
|
|
decman.prg(["mkinitcpio", "-P"])
|
|
decman.prg(["grub-mkconfig", "-o", "/boot/grub/grub.cfg"])
|