delete fontconfig file in upd alias
This commit is contained in:
parent
b5f5f62335
commit
6f3df98123
1 changed files with 7 additions and 2 deletions
|
@ -51,6 +51,10 @@ def _upd(args: list):
|
||||||
path = Path("/etc/nixos")
|
path = Path("/etc/nixos")
|
||||||
if path.exists():
|
if path.exists():
|
||||||
c = colors.Colors
|
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}")
|
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")
|
run(["sudo", "nixos-generate-config", "--dir", ".",], cwd=path / "hosts")
|
||||||
print(f"{c.BLUE}Deleting redundant {c.YELLOW}NixOS{c.BLUE} configuration file{c.END}")
|
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")
|
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}")
|
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)
|
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}")
|
for file_description, file_path in files_to_delete.items():
|
||||||
run(["rm", ".config/Code/User/settings.json.bak"], exit_on_error=False, cwd="/home/cswimr")
|
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:
|
if "--purge-vscode-extensions" in args:
|
||||||
args.remove("--purge-vscode-extensions")
|
args.remove("--purge-vscode-extensions")
|
||||||
print(f"{c.BLUE}Killing {c.YELLOW}Visual Studio Code{c.BLUE} processes{c.END}")
|
print(f"{c.BLUE}Killing {c.YELLOW}Visual Studio Code{c.BLUE} processes{c.END}")
|
||||||
|
|
Loading…
Reference in a new issue