diff --git a/.bauke/scripts/copy-nixos-config.ts b/.bauke/scripts/copy-nixos-config.ts index 6392172..fdd654d 100644 --- a/.bauke/scripts/copy-nixos-config.ts +++ b/.bauke/scripts/copy-nixos-config.ts @@ -11,6 +11,10 @@ async function main(): Promise { default: (await runAndReturnStdout({ cmd: ["hostname"] })).trim(), }) .option("--diff", 'Output diffs between local and "/etc/nixos/" files.') + .option( + "--rebuild ", + 'Run "sudo nixos-rebuild " after copying.', + ) .parse(Deno.args); const sourceDir = new URL(`../nix/${options.hostname}/`, import.meta.url); @@ -39,6 +43,12 @@ async function main(): Promise { "/etc/nixos/", ], }).status(); + + if (options.rebuild) { + await Deno.run({ + cmd: ["sudo", "nixos-rebuild", options.rebuild], + }).status(); + } } if (import.meta.main) {