integrate lock
functionality into upd
This commit is contained in:
parent
c4db0959a2
commit
e2fb552850
1 changed files with 4 additions and 8 deletions
|
@ -85,6 +85,10 @@ def _upd(args: list):
|
|||
run(["git", "pull"], cwd=path)
|
||||
else:
|
||||
args.remove("--no-pull")
|
||||
if "--lock" in args:
|
||||
args.remove("--lock")
|
||||
print(f"{c.BLUE}Updating {c.YELLOW}Nix Flake{c.BLUE} lock file{c.END}")
|
||||
run(["nix", "flake", "update", *args], cwd=path)
|
||||
if "--rewrite-hardware-configuration" in args:
|
||||
args.remove("--rewrite-hardware-configuration")
|
||||
print(f"{c.BLUE}Updating {c.YELLOW}NixOS{c.BLUE} hardware configuration file for {c.YELLOW}{gethostname()}{c.BLUE}{c.END}")
|
||||
|
@ -111,14 +115,6 @@ def _upd(args: list):
|
|||
print(f"{c.RED}WARNING: The --impure flag is set!{c.END}")
|
||||
run(["sudo", "nixos-rebuild", subcommand, *args], cwd=path)
|
||||
|
||||
@aliases.register
|
||||
def _lock(args):
|
||||
path = Path("/etc/nixos")
|
||||
if path.exists():
|
||||
c = colors.Colors
|
||||
print(f"{c.BLUE}Updating {c.YELLOW}Nix Flake{c.BLUE} lock file{c.END}")
|
||||
run(["nix", "flake", "update", *args], cwd=path)
|
||||
|
||||
@aliases.register
|
||||
@aliases.return_command
|
||||
def _edit(args):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue