Template:Evaluate: Difference between revisions

Adds support for recommending the `boot` and `test` subcommands for `nixos-rebuild`. Does nothing if the editor doesn't specifically request the non-standard actions.
Add --use-remote-sudo-less support to the template via the root=true attribute.
 
Line 23: Line 23:
<pre>
<pre>
<nowiki>{{Evaluate|test}}</nowiki>
<nowiki>{{Evaluate|test}}</nowiki>
</pre>
Default <code>Evaluate</code> Box without <code>--use-remote-sudo</code>:
<pre>
<nowiki>{{Evaluate|root=true}}</nowiki>
</pre>
Boot <code>Evaluate</code> Box without <code>--use-remote-sudo</code>:
<pre>
<nowiki>{{Evaluate|boot|root=true}}</nowiki>
</pre>
Test <code>Evaluate</code> Box without <code>--use-remote-sudo</code>:
<pre>
<nowiki>{{Evaluate|test|root=true}}</nowiki>
</pre>
</pre>


Line 34: Line 54:
Test <code>Evaluate</code> Box:
Test <code>Evaluate</code> Box:
{{Evaluate|test}}
{{Evaluate|test}}
Default <code>Evaluate</code> Box without <code>--use-remote-sudo</code>:
{{Evaluate|root=true}}
Boot <code>Evaluate</code> Box without <code>--use-remote-sudo</code>:
{{Evaluate|boot|root=true}}
Test <code>Evaluate</code> Box without <code>--use-remote-sudo</code>:
{{Evaluate|test|root=true}}


</noinclude><includeonly>{{Tip
</noinclude><includeonly>{{Tip
|1=In order to '''affect''' your NixOS system by your nix-language-specific changes you must first '''evaluate''' it:{{Commands|$ nixos-rebuild {{{1|switch}}} --use-remote-sudo}}{{#ifeq: boot | {{{1}}} | Then, reboot:{{Commands|$ systemctl reboot}}}}{{#ifeq: test | {{{1}}} | '''Remember:''' any changes evaluated through <code>nixos-rebuild test</code> '''will not''' persist upon reboot.}}}}</includeonly>
|1=In order to affect your NixOS system by your nix-language-specific changes you must first '''evaluate''' it:{{Commands|{{#if: {{{root|}}}|#|$}} nixos-rebuild {{{1|switch}}} {{#if: {{{root|}}} ||--use-remote-sudo}}}}{{#ifeq: boot | {{{1}}} | Then, reboot:{{Commands|{{#if: {{{root|}}}|<nowiki>#</nowiki>|$}} systemctl reboot}}}}{{#ifeq: test | {{{1}}} | '''Remember:''' any changes evaluated through <code>nixos-rebuild test</code> '''will not''' persist upon reboot.}}}}</includeonly>