Skip to content

V0.5 python module

this is the module we discussed before, has read_packages/add_packages/delete_packages with error handling, exception handling and a safety net for home.nix config with a backup system, has proper documentation in code.

also for use:

from nix_config import nix_config

existing_packages : list = nix_config.read_packages()

# handle_output looks like this [output: list, simple_error: list, full_error: list]
packages_added : list, handle_output : list = nix_config.add_packages(["pkgs.neovim", "pkgs.git"]) # see description in function

packages_deleted : list, handle_output : list = nix_config.delete_packages(["pkgs.neovim", "pkgs.git"]) # see description in function

it is important to note full_error is not ALL of the errors in case there are errors and a restore fail or a backup fail they will both change

in case of backup fail:

full_error = exception log , or UNKNOWN FALIURE

simple_error = user friendly "failed to backup too risky to run without, exiting."

in case of restore fail:

full_error = same as normal but with restore_error appended last

simple_error = appended first, user friendly "failed to restore you're {filename} probably does not exist create it please!"

Edited by ChromiumOS-Guy

Merge request reports

Loading