update script
This commit is contained in:
21
apps/aarch64-darwin/update
Executable file
21
apps/aarch64-darwin/update
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env nu
|
||||||
|
|
||||||
|
use ../common.nu *
|
||||||
|
|
||||||
|
def main [...inputs: string] {
|
||||||
|
if ($inputs | is-empty) {
|
||||||
|
print_info "Updating all flake inputs"
|
||||||
|
nix flake update
|
||||||
|
} else {
|
||||||
|
print_info $"Updating flake inputs: ($inputs | str join ', ')"
|
||||||
|
nix flake update ...$inputs
|
||||||
|
}
|
||||||
|
|
||||||
|
print_info "Regenerating flake.nix"
|
||||||
|
nix run .#write-flake
|
||||||
|
|
||||||
|
print_info "Formatting"
|
||||||
|
alejandra .
|
||||||
|
|
||||||
|
print_success "Flake updated"
|
||||||
|
}
|
||||||
21
apps/x86_64-linux/update
Executable file
21
apps/x86_64-linux/update
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env nu
|
||||||
|
|
||||||
|
use ../common.nu *
|
||||||
|
|
||||||
|
def main [...inputs: string] {
|
||||||
|
if ($inputs | is-empty) {
|
||||||
|
print_info "Updating all flake inputs"
|
||||||
|
nix flake update
|
||||||
|
} else {
|
||||||
|
print_info $"Updating flake inputs: ($inputs | str join ', ')"
|
||||||
|
nix flake update ...$inputs
|
||||||
|
}
|
||||||
|
|
||||||
|
print_info "Regenerating flake.nix"
|
||||||
|
nix run .#write-flake
|
||||||
|
|
||||||
|
print_info "Formatting"
|
||||||
|
alejandra .
|
||||||
|
|
||||||
|
print_success "Flake updated"
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
build = "Build configuration";
|
build = "Build configuration";
|
||||||
build-switch = "Build and switch configuration";
|
build-switch = "Build and switch configuration";
|
||||||
rollback = "Rollback to previous generation";
|
rollback = "Rollback to previous generation";
|
||||||
|
update = "Update flake inputs and regenerate flake.nix";
|
||||||
};
|
};
|
||||||
mkApp = name: {
|
mkApp = name: {
|
||||||
type = "app";
|
type = "app";
|
||||||
@@ -19,7 +20,7 @@
|
|||||||
'')}/bin/${name}";
|
'')}/bin/${name}";
|
||||||
meta.description = descriptions.${name};
|
meta.description = descriptions.${name};
|
||||||
};
|
};
|
||||||
appNames = ["apply" "build" "build-switch" "rollback"];
|
appNames = ["apply" "build" "build-switch" "rollback" "update"];
|
||||||
in {
|
in {
|
||||||
apps =
|
apps =
|
||||||
pkgs.lib.genAttrs appNames mkApp
|
pkgs.lib.genAttrs appNames mkApp
|
||||||
|
|||||||
Reference in New Issue
Block a user