remove unused code
This commit is contained in:
parent
a91c419858
commit
6931853de3
14 changed files with 9 additions and 198 deletions
|
|
@ -1,7 +1,5 @@
|
|||
import argparse
|
||||
import functools
|
||||
#from pathlib import Path
|
||||
#from pprint import pformat
|
||||
import shlex
|
||||
import textwrap
|
||||
from typing import Any, cast, TYPE_CHECKING
|
||||
|
|
@ -64,7 +62,6 @@ def get_cli_args() -> argparse.Namespace:
|
|||
machine.log(f"{cmdline_args=}")
|
||||
print(f"{cmdline_args=}")
|
||||
|
||||
#return shlex.join(cmdline_args[1:])
|
||||
args, rest = parser.parse_known_args(cmdline_args)
|
||||
return args
|
||||
|
||||
|
|
@ -77,12 +74,7 @@ def dynix_append(option: str, value: Any):
|
|||
@beartype
|
||||
def do_apply():
|
||||
expr = textwrap.dedent("""
|
||||
let
|
||||
nixos = import <nixpkgs/nixos> { };
|
||||
in nixos.config.dynamicism.applyDynamicConfiguration {
|
||||
baseConfiguration = /etc/nixos/configuration.nix;
|
||||
newConfiguration = /etc/nixos/dynamic.nix;
|
||||
}
|
||||
(import <nixpkgs/nixos> { }).config.dynamicism.applyDynamicConfiguration { }
|
||||
""").strip()
|
||||
|
||||
machine.succeed(rf"""
|
||||
|
|
@ -95,7 +87,6 @@ machine.log("INIT")
|
|||
|
||||
# Config should have our initial values.
|
||||
args = get_cli_args()
|
||||
#assert '--jobs 12' in args, f'--jobs 12 not in {args=}'
|
||||
assert args.jobs == 12, f'{args.jobs=} != 12'
|
||||
assert args.job_lifetime == 900, f'{args.job_lifetime} != 900'
|
||||
assert args.log_level == 'warning', f'{args.log_level=} != warning'
|
||||
|
|
@ -105,10 +96,13 @@ with machine.nested("must succeed: initial nixos-rebuild switch"):
|
|||
|
||||
# Config should not have changed.
|
||||
args = get_cli_args()
|
||||
assert args.jobs == 12, f'{args.jobs=} != 12'
|
||||
assert args.job_lifetime == 900, f'{args.job_lifetime} != 900'
|
||||
assert args.log_level == 'warning', f'{args.log_level=} != warning'
|
||||
#machine.log(f"config.toml after first rebuild: {indent(pformat(args))}")
|
||||
#assert int(args['workers']) == 4, f"{args['workers']=} != 4"
|
||||
#assert int(args['max_connection_rate']) == 256, f"{args['max_connection_rate']=} != 256"
|
||||
#
|
||||
|
||||
new_jobs = 4
|
||||
dynix_append("services.distccd.maxJobs", new_jobs)
|
||||
do_apply()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue