delete fontconfig file in upd alias

This commit is contained in:
Seaswimmer 2024-12-23 01:24:59 -05:00
parent b5f5f62335
commit 6f3df98123
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -51,6 +51,10 @@ def _upd(args: list):
path = Path("/etc/nixos")
if path.exists():
c = colors.Colors
files_to_delete = {
"Visual Studio Code user settings": ".config/Code/User/settings.json.bak",
"fontconfig": ".config/fontconfig/conf.d/10-hm-fonts.conf.bak"
}
print(f"{c.BLUE}Updating {c.YELLOW}NixOS{c.BLUE} hardware configuration file for {c.YELLOW}{gethostname()}{c.BLUE}{c.END}")
run(["sudo", "nixos-generate-config", "--dir", ".",], cwd=path / "hosts")
print(f"{c.BLUE}Deleting redundant {c.YELLOW}NixOS{c.BLUE} configuration file{c.END}")
@ -59,8 +63,9 @@ def _upd(args: list):
run(["sudo", "mv", "hardware-configuration.nix", "{hostname}.nix".format(hostname=gethostname())], cwd=path / "hosts")
print(f"{c.BLUE}Adding {c.YELLOW}NixOS{c.BLUE} hardware configuration file for {c.YELLOW}{gethostname()}{c.BLUE} to git{c.END}")
run(["git", "add", "hosts/{hostname}.nix".format(hostname=gethostname())], cwd=path)
print(f"{c.BLUE}Deleting {c.YELLOW}Visual Studio Code{c.BLUE} user settings backup file{c.END}")
run(["rm", ".config/Code/User/settings.json.bak"], exit_on_error=False, cwd="/home/cswimr")
for file_description, file_path in files_to_delete.items():
print(f"{c.BLUE}Deleting {c.YELLOW}{file_description}{c.BLUE} backup file{c.END}")
run(["rm", file_path], exit_on_error=False, cwd="/home/cswimr")
if "--purge-vscode-extensions" in args:
args.remove("--purge-vscode-extensions")
print(f"{c.BLUE}Killing {c.YELLOW}Visual Studio Code{c.BLUE} processes{c.END}")