lol

switch-to-configuration: bump deps and add more logging (#422798)

authored by

Jared Baur and committed by
GitHub
ae1f7093 9cd5f467

+279 -165
+3 -1
nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md
··· 46 47 By default, some units are filtered from the outputs to make it less spammy. 48 This can be disabled for development or testing by setting the environment variable 49 - `STC_DISPLAY_ALL_UNITS=1` 50 51 Most of these actions are either self-explaining but some of them have to do 52 with our units or the activation script. For this reason, these topics are
··· 46 47 By default, some units are filtered from the outputs to make it less spammy. 48 This can be disabled for development or testing by setting the environment variable 49 + `STC_DISPLAY_ALL_UNITS=1`. 50 + 51 + More detailed output can be displayed by setting `STC_DEBUG=1`. 52 53 Most of these actions are either self-explaining but some of them have to do 54 with our units or the activation script. For this reason, these topics are
+1 -4
pkgs/by-name/sw/switch-to-configuration-ng/package.nix
··· 13 14 src = ./src; 15 16 - cargoLock = { 17 - lockFile = ./src/Cargo.lock; 18 - outputHashes."rust-ini-0.21.1" = "sha256-0nSBhme/g+mVsYdiq0Ash0ek9WEdvbf/b9FRxA7sauk="; 19 - }; 20 21 nativeBuildInputs = [ pkg-config ]; 22 buildInputs = [ dbus ];
··· 13 14 src = ./src; 15 16 + cargoLock.lockFile = ./src/Cargo.lock; 17 18 nativeBuildInputs = [ pkg-config ]; 19 buildInputs = [ dbus ];
+229 -148
pkgs/by-name/sw/switch-to-configuration-ng/src/Cargo.lock
··· 1 # This file is automatically @generated by Cargo. 2 # It is not intended for manual editing. 3 - version = 3 4 5 [[package]] 6 name = "aho-corasick" ··· 12 ] 13 14 [[package]] 15 - name = "ansi_term" 16 - version = "0.12.1" 17 source = "registry+https://github.com/rust-lang/crates.io-index" 18 - checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 19 dependencies = [ 20 - "winapi", 21 ] 22 23 [[package]] 24 - name = "anyhow" 25 - version = "1.0.86" 26 source = "registry+https://github.com/rust-lang/crates.io-index" 27 - checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" 28 29 [[package]] 30 - name = "atty" 31 - version = "0.2.14" 32 source = "registry+https://github.com/rust-lang/crates.io-index" 33 - checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 34 dependencies = [ 35 - "hermit-abi", 36 - "libc", 37 - "winapi", 38 ] 39 40 [[package]] 41 - name = "bitflags" 42 - version = "1.3.2" 43 source = "registry+https://github.com/rust-lang/crates.io-index" 44 - checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 45 46 [[package]] 47 name = "bitflags" 48 - version = "2.5.0" 49 source = "registry+https://github.com/rust-lang/crates.io-index" 50 - checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" 51 52 [[package]] 53 name = "cfg-if" 54 - version = "1.0.0" 55 source = "registry+https://github.com/rust-lang/crates.io-index" 56 - checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 57 58 [[package]] 59 name = "cfg_aliases" 60 - version = "0.1.1" 61 source = "registry+https://github.com/rust-lang/crates.io-index" 62 - checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" 63 64 [[package]] 65 name = "clap" 66 - version = "2.34.0" 67 source = "registry+https://github.com/rust-lang/crates.io-index" 68 - checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" 69 dependencies = [ 70 - "ansi_term", 71 - "atty", 72 - "bitflags 1.3.2", 73 "strsim", 74 - "textwrap", 75 - "unicode-width", 76 - "vec_map", 77 ] 78 79 [[package]] 80 name = "const-random" 81 version = "0.1.18" 82 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 98 99 [[package]] 100 name = "crunchy" 101 - version = "0.2.2" 102 source = "registry+https://github.com/rust-lang/crates.io-index" 103 - checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 104 105 [[package]] 106 name = "dbus" ··· 115 116 [[package]] 117 name = "dbus-codegen" 118 - version = "0.11.0" 119 source = "registry+https://github.com/rust-lang/crates.io-index" 120 - checksum = "bcd91775d91fc83c7d526aa7c08078bac0b30f382706689901ac819fe6ddc812" 121 dependencies = [ 122 "clap", 123 "dbus", ··· 126 127 [[package]] 128 name = "deranged" 129 - version = "0.3.11" 130 source = "registry+https://github.com/rust-lang/crates.io-index" 131 - checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" 132 dependencies = [ 133 "powerfmt", 134 ] ··· 143 ] 144 145 [[package]] 146 - name = "error-chain" 147 - version = "0.12.4" 148 - source = "registry+https://github.com/rust-lang/crates.io-index" 149 - checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" 150 - dependencies = [ 151 - "version_check", 152 - ] 153 - 154 - [[package]] 155 name = "getrandom" 156 - version = "0.2.15" 157 source = "registry+https://github.com/rust-lang/crates.io-index" 158 - checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 159 dependencies = [ 160 "cfg-if", 161 "libc", ··· 164 165 [[package]] 166 name = "glob" 167 - version = "0.3.1" 168 source = "registry+https://github.com/rust-lang/crates.io-index" 169 - checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" 170 171 [[package]] 172 name = "hashbrown" ··· 175 checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 176 177 [[package]] 178 - name = "hermit-abi" 179 - version = "0.1.19" 180 source = "registry+https://github.com/rust-lang/crates.io-index" 181 - checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 182 dependencies = [ 183 "libc", 184 ] 185 186 [[package]] 187 - name = "hostname" 188 - version = "0.3.1" 189 source = "registry+https://github.com/rust-lang/crates.io-index" 190 - checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" 191 - dependencies = [ 192 - "libc", 193 - "match_cfg", 194 - "winapi", 195 - ] 196 197 [[package]] 198 name = "itoa" 199 - version = "1.0.11" 200 source = "registry+https://github.com/rust-lang/crates.io-index" 201 - checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 202 203 [[package]] 204 name = "libc" 205 - version = "0.2.155" 206 source = "registry+https://github.com/rust-lang/crates.io-index" 207 - checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" 208 209 [[package]] 210 name = "libdbus-sys" ··· 217 218 [[package]] 219 name = "log" 220 - version = "0.4.21" 221 source = "registry+https://github.com/rust-lang/crates.io-index" 222 - checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 223 - 224 - [[package]] 225 - name = "match_cfg" 226 - version = "0.1.0" 227 - source = "registry+https://github.com/rust-lang/crates.io-index" 228 - checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" 229 230 [[package]] 231 name = "memchr" 232 - version = "2.7.4" 233 source = "registry+https://github.com/rust-lang/crates.io-index" 234 - checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 235 236 [[package]] 237 name = "nix" 238 - version = "0.28.0" 239 source = "registry+https://github.com/rust-lang/crates.io-index" 240 - checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" 241 dependencies = [ 242 - "bitflags 2.5.0", 243 "cfg-if", 244 "cfg_aliases", 245 "libc", ··· 262 263 [[package]] 264 name = "once_cell" 265 - version = "1.19.0" 266 source = "registry+https://github.com/rust-lang/crates.io-index" 267 - checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 268 269 [[package]] 270 name = "ordered-multimap" ··· 278 279 [[package]] 280 name = "pkg-config" 281 - version = "0.3.30" 282 source = "registry+https://github.com/rust-lang/crates.io-index" 283 - checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" 284 285 [[package]] 286 name = "powerfmt" ··· 290 291 [[package]] 292 name = "proc-macro2" 293 - version = "1.0.86" 294 source = "registry+https://github.com/rust-lang/crates.io-index" 295 - checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" 296 dependencies = [ 297 "unicode-ident", 298 ] 299 300 [[package]] 301 name = "quote" 302 - version = "1.0.36" 303 source = "registry+https://github.com/rust-lang/crates.io-index" 304 - checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" 305 dependencies = [ 306 "proc-macro2", 307 ] 308 309 [[package]] 310 name = "regex" 311 - version = "1.10.5" 312 source = "registry+https://github.com/rust-lang/crates.io-index" 313 - checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" 314 dependencies = [ 315 "aho-corasick", 316 "memchr", ··· 320 321 [[package]] 322 name = "regex-automata" 323 - version = "0.4.7" 324 source = "registry+https://github.com/rust-lang/crates.io-index" 325 - checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" 326 dependencies = [ 327 "aho-corasick", 328 "memchr", ··· 331 332 [[package]] 333 name = "regex-syntax" 334 - version = "0.8.4" 335 source = "registry+https://github.com/rust-lang/crates.io-index" 336 - checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" 337 338 [[package]] 339 name = "rust-ini" 340 - version = "0.21.1" 341 - source = "git+https://github.com/zonyitoo/rust-ini?rev=5748ae57a178216a920b88dfac1296618e967447#5748ae57a178216a920b88dfac1296618e967447" 342 dependencies = [ 343 "cfg-if", 344 "ordered-multimap", 345 - "trim-in-place", 346 ] 347 348 [[package]] 349 name = "serde" 350 - version = "1.0.203" 351 source = "registry+https://github.com/rust-lang/crates.io-index" 352 - checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" 353 dependencies = [ 354 "serde_derive", 355 ] 356 357 [[package]] 358 name = "serde_derive" 359 - version = "1.0.203" 360 source = "registry+https://github.com/rust-lang/crates.io-index" 361 - checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" 362 dependencies = [ 363 "proc-macro2", 364 "quote", ··· 367 368 [[package]] 369 name = "strsim" 370 - version = "0.8.0" 371 source = "registry+https://github.com/rust-lang/crates.io-index" 372 - checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" 373 374 [[package]] 375 name = "switch-to-configuration" ··· 388 389 [[package]] 390 name = "syn" 391 - version = "2.0.67" 392 source = "registry+https://github.com/rust-lang/crates.io-index" 393 - checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" 394 dependencies = [ 395 "proc-macro2", 396 "quote", ··· 399 400 [[package]] 401 name = "syslog" 402 - version = "6.1.1" 403 source = "registry+https://github.com/rust-lang/crates.io-index" 404 - checksum = "dfc7e95b5b795122fafe6519e27629b5ab4232c73ebb2428f568e82b1a457ad3" 405 dependencies = [ 406 - "error-chain", 407 "hostname", 408 "libc", 409 "log", ··· 411 ] 412 413 [[package]] 414 - name = "textwrap" 415 - version = "0.11.0" 416 - source = "registry+https://github.com/rust-lang/crates.io-index" 417 - checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 418 - dependencies = [ 419 - "unicode-width", 420 - ] 421 - 422 - [[package]] 423 name = "time" 424 - version = "0.3.36" 425 source = "registry+https://github.com/rust-lang/crates.io-index" 426 - checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" 427 dependencies = [ 428 "deranged", 429 "itoa", ··· 438 439 [[package]] 440 name = "time-core" 441 - version = "0.1.2" 442 source = "registry+https://github.com/rust-lang/crates.io-index" 443 - checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" 444 445 [[package]] 446 name = "time-macros" 447 - version = "0.2.18" 448 source = "registry+https://github.com/rust-lang/crates.io-index" 449 - checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" 450 dependencies = [ 451 "num-conv", 452 "time-core", ··· 462 ] 463 464 [[package]] 465 - name = "trim-in-place" 466 - version = "0.1.7" 467 - source = "registry+https://github.com/rust-lang/crates.io-index" 468 - checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc" 469 - 470 - [[package]] 471 name = "unicode-ident" 472 - version = "1.0.12" 473 source = "registry+https://github.com/rust-lang/crates.io-index" 474 - checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 475 - 476 - [[package]] 477 - name = "unicode-width" 478 - version = "0.1.13" 479 - source = "registry+https://github.com/rust-lang/crates.io-index" 480 - checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" 481 - 482 - [[package]] 483 - name = "vec_map" 484 - version = "0.8.2" 485 - source = "registry+https://github.com/rust-lang/crates.io-index" 486 - checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" 487 488 [[package]] 489 - name = "version_check" 490 - version = "0.9.4" 491 source = "registry+https://github.com/rust-lang/crates.io-index" 492 - checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 493 494 [[package]] 495 name = "wasi" 496 - version = "0.11.0+wasi-snapshot-preview1" 497 source = "registry+https://github.com/rust-lang/crates.io-index" 498 - checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 499 500 [[package]] 501 name = "winapi" ··· 520 checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 521 522 [[package]] 523 name = "xml-rs" 524 - version = "0.8.20" 525 source = "registry+https://github.com/rust-lang/crates.io-index" 526 - checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193"
··· 1 # This file is automatically @generated by Cargo. 2 # It is not intended for manual editing. 3 + version = 4 4 5 [[package]] 6 name = "aho-corasick" ··· 12 ] 13 14 [[package]] 15 + name = "anstream" 16 + version = "0.6.19" 17 source = "registry+https://github.com/rust-lang/crates.io-index" 18 + checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" 19 dependencies = [ 20 + "anstyle", 21 + "anstyle-parse", 22 + "anstyle-query", 23 + "anstyle-wincon", 24 + "colorchoice", 25 + "is_terminal_polyfill", 26 + "utf8parse", 27 ] 28 29 [[package]] 30 + name = "anstyle" 31 + version = "1.0.11" 32 source = "registry+https://github.com/rust-lang/crates.io-index" 33 + checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" 34 35 [[package]] 36 + name = "anstyle-parse" 37 + version = "0.2.7" 38 source = "registry+https://github.com/rust-lang/crates.io-index" 39 + checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" 40 dependencies = [ 41 + "utf8parse", 42 + ] 43 + 44 + [[package]] 45 + name = "anstyle-query" 46 + version = "1.1.3" 47 + source = "registry+https://github.com/rust-lang/crates.io-index" 48 + checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" 49 + dependencies = [ 50 + "windows-sys", 51 + ] 52 + 53 + [[package]] 54 + name = "anstyle-wincon" 55 + version = "3.0.9" 56 + source = "registry+https://github.com/rust-lang/crates.io-index" 57 + checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" 58 + dependencies = [ 59 + "anstyle", 60 + "once_cell_polyfill", 61 + "windows-sys", 62 ] 63 64 [[package]] 65 + name = "anyhow" 66 + version = "1.0.98" 67 source = "registry+https://github.com/rust-lang/crates.io-index" 68 + checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" 69 70 [[package]] 71 name = "bitflags" 72 + version = "2.9.1" 73 source = "registry+https://github.com/rust-lang/crates.io-index" 74 + checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" 75 76 [[package]] 77 name = "cfg-if" 78 + version = "1.0.1" 79 source = "registry+https://github.com/rust-lang/crates.io-index" 80 + checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" 81 82 [[package]] 83 name = "cfg_aliases" 84 + version = "0.2.1" 85 source = "registry+https://github.com/rust-lang/crates.io-index" 86 + checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" 87 88 [[package]] 89 name = "clap" 90 + version = "4.5.41" 91 + source = "registry+https://github.com/rust-lang/crates.io-index" 92 + checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" 93 + dependencies = [ 94 + "clap_builder", 95 + ] 96 + 97 + [[package]] 98 + name = "clap_builder" 99 + version = "4.5.41" 100 source = "registry+https://github.com/rust-lang/crates.io-index" 101 + checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" 102 dependencies = [ 103 + "anstream", 104 + "anstyle", 105 + "clap_lex", 106 "strsim", 107 ] 108 109 [[package]] 110 + name = "clap_lex" 111 + version = "0.7.5" 112 + source = "registry+https://github.com/rust-lang/crates.io-index" 113 + checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" 114 + 115 + [[package]] 116 + name = "colorchoice" 117 + version = "1.0.4" 118 + source = "registry+https://github.com/rust-lang/crates.io-index" 119 + checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" 120 + 121 + [[package]] 122 name = "const-random" 123 version = "0.1.18" 124 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 140 141 [[package]] 142 name = "crunchy" 143 + version = "0.2.4" 144 source = "registry+https://github.com/rust-lang/crates.io-index" 145 + checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" 146 147 [[package]] 148 name = "dbus" ··· 157 158 [[package]] 159 name = "dbus-codegen" 160 + version = "0.12.0" 161 source = "registry+https://github.com/rust-lang/crates.io-index" 162 + checksum = "cf7b8c78e020d2eb0bb7ad986a86c5e5477d66d3cb13ea23a0faf896dd72a1db" 163 dependencies = [ 164 "clap", 165 "dbus", ··· 168 169 [[package]] 170 name = "deranged" 171 + version = "0.4.0" 172 source = "registry+https://github.com/rust-lang/crates.io-index" 173 + checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" 174 dependencies = [ 175 "powerfmt", 176 ] ··· 185 ] 186 187 [[package]] 188 name = "getrandom" 189 + version = "0.2.16" 190 source = "registry+https://github.com/rust-lang/crates.io-index" 191 + checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" 192 dependencies = [ 193 "cfg-if", 194 "libc", ··· 197 198 [[package]] 199 name = "glob" 200 + version = "0.3.2" 201 source = "registry+https://github.com/rust-lang/crates.io-index" 202 + checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" 203 204 [[package]] 205 name = "hashbrown" ··· 208 checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 209 210 [[package]] 211 + name = "hostname" 212 + version = "0.4.1" 213 source = "registry+https://github.com/rust-lang/crates.io-index" 214 + checksum = "a56f203cd1c76362b69e3863fd987520ac36cf70a8c92627449b2f64a8cf7d65" 215 dependencies = [ 216 + "cfg-if", 217 "libc", 218 + "windows-link", 219 ] 220 221 [[package]] 222 + name = "is_terminal_polyfill" 223 + version = "1.70.1" 224 source = "registry+https://github.com/rust-lang/crates.io-index" 225 + checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" 226 227 [[package]] 228 name = "itoa" 229 + version = "1.0.15" 230 source = "registry+https://github.com/rust-lang/crates.io-index" 231 + checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 232 233 [[package]] 234 name = "libc" 235 + version = "0.2.174" 236 source = "registry+https://github.com/rust-lang/crates.io-index" 237 + checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" 238 239 [[package]] 240 name = "libdbus-sys" ··· 247 248 [[package]] 249 name = "log" 250 + version = "0.4.27" 251 source = "registry+https://github.com/rust-lang/crates.io-index" 252 + checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" 253 254 [[package]] 255 name = "memchr" 256 + version = "2.7.5" 257 source = "registry+https://github.com/rust-lang/crates.io-index" 258 + checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" 259 260 [[package]] 261 name = "nix" 262 + version = "0.30.1" 263 source = "registry+https://github.com/rust-lang/crates.io-index" 264 + checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" 265 dependencies = [ 266 + "bitflags", 267 "cfg-if", 268 "cfg_aliases", 269 "libc", ··· 286 287 [[package]] 288 name = "once_cell" 289 + version = "1.21.3" 290 + source = "registry+https://github.com/rust-lang/crates.io-index" 291 + checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 292 + 293 + [[package]] 294 + name = "once_cell_polyfill" 295 + version = "1.70.1" 296 source = "registry+https://github.com/rust-lang/crates.io-index" 297 + checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" 298 299 [[package]] 300 name = "ordered-multimap" ··· 308 309 [[package]] 310 name = "pkg-config" 311 + version = "0.3.32" 312 source = "registry+https://github.com/rust-lang/crates.io-index" 313 + checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" 314 315 [[package]] 316 name = "powerfmt" ··· 320 321 [[package]] 322 name = "proc-macro2" 323 + version = "1.0.95" 324 source = "registry+https://github.com/rust-lang/crates.io-index" 325 + checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" 326 dependencies = [ 327 "unicode-ident", 328 ] 329 330 [[package]] 331 name = "quote" 332 + version = "1.0.40" 333 source = "registry+https://github.com/rust-lang/crates.io-index" 334 + checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" 335 dependencies = [ 336 "proc-macro2", 337 ] 338 339 [[package]] 340 name = "regex" 341 + version = "1.11.1" 342 source = "registry+https://github.com/rust-lang/crates.io-index" 343 + checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" 344 dependencies = [ 345 "aho-corasick", 346 "memchr", ··· 350 351 [[package]] 352 name = "regex-automata" 353 + version = "0.4.9" 354 source = "registry+https://github.com/rust-lang/crates.io-index" 355 + checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" 356 dependencies = [ 357 "aho-corasick", 358 "memchr", ··· 361 362 [[package]] 363 name = "regex-syntax" 364 + version = "0.8.5" 365 source = "registry+https://github.com/rust-lang/crates.io-index" 366 + checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 367 368 [[package]] 369 name = "rust-ini" 370 + version = "0.21.2" 371 + source = "registry+https://github.com/rust-lang/crates.io-index" 372 + checksum = "e7295b7ce3bf4806b419dc3420745998b447178b7005e2011947b38fc5aa6791" 373 dependencies = [ 374 "cfg-if", 375 "ordered-multimap", 376 ] 377 378 [[package]] 379 name = "serde" 380 + version = "1.0.219" 381 source = "registry+https://github.com/rust-lang/crates.io-index" 382 + checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" 383 dependencies = [ 384 "serde_derive", 385 ] 386 387 [[package]] 388 name = "serde_derive" 389 + version = "1.0.219" 390 source = "registry+https://github.com/rust-lang/crates.io-index" 391 + checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" 392 dependencies = [ 393 "proc-macro2", 394 "quote", ··· 397 398 [[package]] 399 name = "strsim" 400 + version = "0.11.1" 401 source = "registry+https://github.com/rust-lang/crates.io-index" 402 + checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 403 404 [[package]] 405 name = "switch-to-configuration" ··· 418 419 [[package]] 420 name = "syn" 421 + version = "2.0.104" 422 source = "registry+https://github.com/rust-lang/crates.io-index" 423 + checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" 424 dependencies = [ 425 "proc-macro2", 426 "quote", ··· 429 430 [[package]] 431 name = "syslog" 432 + version = "7.0.0" 433 source = "registry+https://github.com/rust-lang/crates.io-index" 434 + checksum = "019f1500a13379b7d051455df397c75770de6311a7a188a699499502704d9f10" 435 dependencies = [ 436 "hostname", 437 "libc", 438 "log", ··· 440 ] 441 442 [[package]] 443 name = "time" 444 + version = "0.3.41" 445 source = "registry+https://github.com/rust-lang/crates.io-index" 446 + checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" 447 dependencies = [ 448 "deranged", 449 "itoa", ··· 458 459 [[package]] 460 name = "time-core" 461 + version = "0.1.4" 462 source = "registry+https://github.com/rust-lang/crates.io-index" 463 + checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" 464 465 [[package]] 466 name = "time-macros" 467 + version = "0.2.22" 468 source = "registry+https://github.com/rust-lang/crates.io-index" 469 + checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" 470 dependencies = [ 471 "num-conv", 472 "time-core", ··· 482 ] 483 484 [[package]] 485 name = "unicode-ident" 486 + version = "1.0.18" 487 source = "registry+https://github.com/rust-lang/crates.io-index" 488 + checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" 489 490 [[package]] 491 + name = "utf8parse" 492 + version = "0.2.2" 493 source = "registry+https://github.com/rust-lang/crates.io-index" 494 + checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 495 496 [[package]] 497 name = "wasi" 498 + version = "0.11.1+wasi-snapshot-preview1" 499 source = "registry+https://github.com/rust-lang/crates.io-index" 500 + checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" 501 502 [[package]] 503 name = "winapi" ··· 522 checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 523 524 [[package]] 525 + name = "windows-link" 526 + version = "0.1.3" 527 + source = "registry+https://github.com/rust-lang/crates.io-index" 528 + checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" 529 + 530 + [[package]] 531 + name = "windows-sys" 532 + version = "0.59.0" 533 + source = "registry+https://github.com/rust-lang/crates.io-index" 534 + checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 535 + dependencies = [ 536 + "windows-targets", 537 + ] 538 + 539 + [[package]] 540 + name = "windows-targets" 541 + version = "0.52.6" 542 + source = "registry+https://github.com/rust-lang/crates.io-index" 543 + checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 544 + dependencies = [ 545 + "windows_aarch64_gnullvm", 546 + "windows_aarch64_msvc", 547 + "windows_i686_gnu", 548 + "windows_i686_gnullvm", 549 + "windows_i686_msvc", 550 + "windows_x86_64_gnu", 551 + "windows_x86_64_gnullvm", 552 + "windows_x86_64_msvc", 553 + ] 554 + 555 + [[package]] 556 + name = "windows_aarch64_gnullvm" 557 + version = "0.52.6" 558 + source = "registry+https://github.com/rust-lang/crates.io-index" 559 + checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 560 + 561 + [[package]] 562 + name = "windows_aarch64_msvc" 563 + version = "0.52.6" 564 + source = "registry+https://github.com/rust-lang/crates.io-index" 565 + checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 566 + 567 + [[package]] 568 + name = "windows_i686_gnu" 569 + version = "0.52.6" 570 + source = "registry+https://github.com/rust-lang/crates.io-index" 571 + checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 572 + 573 + [[package]] 574 + name = "windows_i686_gnullvm" 575 + version = "0.52.6" 576 + source = "registry+https://github.com/rust-lang/crates.io-index" 577 + checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 578 + 579 + [[package]] 580 + name = "windows_i686_msvc" 581 + version = "0.52.6" 582 + source = "registry+https://github.com/rust-lang/crates.io-index" 583 + checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 584 + 585 + [[package]] 586 + name = "windows_x86_64_gnu" 587 + version = "0.52.6" 588 + source = "registry+https://github.com/rust-lang/crates.io-index" 589 + checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 590 + 591 + [[package]] 592 + name = "windows_x86_64_gnullvm" 593 + version = "0.52.6" 594 + source = "registry+https://github.com/rust-lang/crates.io-index" 595 + checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 596 + 597 + [[package]] 598 + name = "windows_x86_64_msvc" 599 + version = "0.52.6" 600 + source = "registry+https://github.com/rust-lang/crates.io-index" 601 + checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 602 + 603 + [[package]] 604 name = "xml-rs" 605 + version = "0.8.27" 606 source = "registry+https://github.com/rust-lang/crates.io-index" 607 + checksum = "6fd8403733700263c6eb89f192880191f1b83e332f7a20371ddcf421c4a337c7"
+4 -6
pkgs/by-name/sw/switch-to-configuration-ng/src/Cargo.toml
··· 10 dbus = "0.9.7" 11 glob = "0.3.1" 12 log = "0.4.21" 13 - nix = { version = "0.28.0", features = ["fs", "signal"] } 14 regex = "1.10.4" 15 - rust-ini = { git = "https://github.com/zonyitoo/rust-ini", rev = "5748ae57a178216a920b88dfac1296618e967447", features = [ 16 - "inline-comment", 17 - ] } 18 - syslog = "6.1.1" 19 20 [build-dependencies] 21 - dbus-codegen = "0.11.0"
··· 10 dbus = "0.9.7" 11 glob = "0.3.1" 12 log = "0.4.21" 13 + nix = { version = "0.30.1", features = ["fs", "signal"] } 14 regex = "1.10.4" 15 + rust-ini = { version = "0.21.2", features = ["inline-comment"] } 16 + syslog = "7.0.0" 17 18 [build-dependencies] 19 + dbus-codegen = "0.12.0"
+42 -6
pkgs/by-name/sw/switch-to-configuration-ng/src/src/main.rs
··· 123 // Allow for this switch-to-configuration to remain consistent with the perl implementation. 124 // Perl's "die" uses errno to set the exit code: https://perldoc.perl.org/perlvar#%24%21 125 fn die() -> ! { 126 - std::process::exit(std::io::Error::last_os_error().raw_os_error().unwrap_or(1)); 127 } 128 129 fn parse_os_release() -> Result<HashMap<String, String>> { ··· 259 &unit_file_content, 260 ParseOption { 261 enabled_quote: true, 262 // Allow for escaped characters that won't get interpreted by the INI parser. These 263 // often show up in systemd unit files device/mount/swap unit names (e.g. dev-disk-by\x2dlabel-root.device). 264 enabled_escape: false, ··· 907 submitted_jobs: &Rc<RefCell<HashMap<dbus::Path<'static>, Job>>>, 908 ) { 909 while !submitted_jobs.borrow().is_empty() { 910 _ = conn.process(Duration::from_millis(500)); 911 } 912 } ··· 959 .restart_unit("nixos-activation.service", "replace") 960 .context("Failed to restart nixos-activation.service")?; 961 962 while !*nixos_activation_done.borrow() { 963 _ = dbus_conn 964 .process(Duration::from_secs(500)) ··· 987 988 /// Performs switch-to-configuration functionality for the entire system 989 fn do_system_switch(action: Action) -> anyhow::Result<()> { 990 let out = PathBuf::from(required_env("OUT")?); 991 let toplevel = PathBuf::from(required_env("TOPLEVEL")?); 992 let distro_id = required_env("DISTRO_ID")?; ··· 994 let install_bootloader = required_env("INSTALL_BOOTLOADER")?; 995 let locale_archive = required_env("LOCALE_ARCHIVE")?; 996 let new_systemd = PathBuf::from(required_env("SYSTEMD")?); 997 998 let action = ACTION.get_or_init(|| action); 999 1000 // The action that is to be performed (like switch, boot, test, dry-activate) Also exposed via 1001 // environment variable from now on ··· 1027 std::fs::set_permissions("/run/nixos", perms) 1028 .context("Failed to set permissions on /run/nixos directory")?; 1029 1030 let Ok(lock) = std::fs::OpenOptions::new() 1031 .append(true) 1032 .create(true) ··· 1036 die(); 1037 }; 1038 1039 let Ok(_lock) = Flock::lock(lock, FlockArg::LockExclusiveNonblock) else { 1040 eprintln!("Could not acquire lock"); 1041 die(); 1042 }; 1043 1044 - if syslog::init(Facility::LOG_USER, LevelFilter::Debug, Some("nixos")).is_err() { 1045 bail!("Failed to initialize logger"); 1046 } 1047 ··· 1051 != "1" 1052 { 1053 do_pre_switch_check(&pre_switch_check, &toplevel, action)?; 1054 } 1055 1056 if *action == Action::Check { ··· 1060 // Install or update the bootloader. 1061 if matches!(action, Action::Switch | Action::Boot) { 1062 do_install_bootloader(&install_bootloader, &toplevel)?; 1063 } 1064 1065 // Just in case the new configuration hangs the system, do a sync now. ··· 1640 eprintln!("restarting systemd..."); 1641 _ = systemd.reexecute(); // we don't get a dbus reply here 1642 1643 while !*systemd_reload_status.borrow() { 1644 _ = dbus_conn 1645 .process(Duration::from_millis(500)) ··· 1654 1655 // Make systemd reload its units. 1656 _ = systemd.reload(); // we don't get a dbus reply here 1657 while !*systemd_reload_status.borrow() { 1658 _ = dbus_conn 1659 .process(Duration::from_millis(500)) ··· 1690 .canonicalize() 1691 .context("Failed to get full path to /proc/self/exe")?; 1692 1693 std::process::Command::new(&myself) 1694 .uid(uid) 1695 .gid(gid) ··· 1865 // 1866 // Wait for events from systemd to settle. process() will return true if we have received any 1867 // messages on the bus. 1868 - while dbus_conn 1869 - .process(Duration::from_millis(250)) 1870 - .unwrap_or_default() 1871 - {} 1872 1873 let new_active_units = get_active_units(&systemd)?; 1874
··· 123 // Allow for this switch-to-configuration to remain consistent with the perl implementation. 124 // Perl's "die" uses errno to set the exit code: https://perldoc.perl.org/perlvar#%24%21 125 fn die() -> ! { 126 + let code = match std::io::Error::last_os_error().raw_os_error().unwrap_or(1) { 127 + // Ensure that even if errno did not point to a helpful error code, we still have a 128 + // non-zero exit code 129 + 0 => 1, 130 + other => other, 131 + }; 132 + 133 + std::process::exit(code); 134 } 135 136 fn parse_os_release() -> Result<HashMap<String, String>> { ··· 266 &unit_file_content, 267 ParseOption { 268 enabled_quote: true, 269 + enabled_indented_mutiline_value: false, 270 + enabled_preserve_key_leading_whitespace: false, 271 // Allow for escaped characters that won't get interpreted by the INI parser. These 272 // often show up in systemd unit files device/mount/swap unit names (e.g. dev-disk-by\x2dlabel-root.device). 273 enabled_escape: false, ··· 916 submitted_jobs: &Rc<RefCell<HashMap<dbus::Path<'static>, Job>>>, 917 ) { 918 while !submitted_jobs.borrow().is_empty() { 919 + log::debug!( 920 + "waiting for submitted jobs to finish, still have {} job(s)", 921 + submitted_jobs.borrow().len() 922 + ); 923 _ = conn.process(Duration::from_millis(500)); 924 } 925 } ··· 972 .restart_unit("nixos-activation.service", "replace") 973 .context("Failed to restart nixos-activation.service")?; 974 975 + log::debug!("waiting for nixos activation to finish"); 976 while !*nixos_activation_done.borrow() { 977 _ = dbus_conn 978 .process(Duration::from_secs(500)) ··· 1001 1002 /// Performs switch-to-configuration functionality for the entire system 1003 fn do_system_switch(action: Action) -> anyhow::Result<()> { 1004 + log::debug!("Performing system switch"); 1005 + 1006 let out = PathBuf::from(required_env("OUT")?); 1007 let toplevel = PathBuf::from(required_env("TOPLEVEL")?); 1008 let distro_id = required_env("DISTRO_ID")?; ··· 1010 let install_bootloader = required_env("INSTALL_BOOTLOADER")?; 1011 let locale_archive = required_env("LOCALE_ARCHIVE")?; 1012 let new_systemd = PathBuf::from(required_env("SYSTEMD")?); 1013 + let log_level = if std::env::var("STC_DEBUG").is_ok() { 1014 + LevelFilter::Debug 1015 + } else { 1016 + LevelFilter::Info 1017 + }; 1018 1019 let action = ACTION.get_or_init(|| action); 1020 + log::debug!("Using action {:?}", action); 1021 1022 // The action that is to be performed (like switch, boot, test, dry-activate) Also exposed via 1023 // environment variable from now on ··· 1049 std::fs::set_permissions("/run/nixos", perms) 1050 .context("Failed to set permissions on /run/nixos directory")?; 1051 1052 + log::debug!("Creating lock file /run/nixos/switch-to-configuration.lock"); 1053 let Ok(lock) = std::fs::OpenOptions::new() 1054 .append(true) 1055 .create(true) ··· 1059 die(); 1060 }; 1061 1062 + log::debug!("Acquiring lock on file /run/nixos/switch-to-configuration.lock"); 1063 let Ok(_lock) = Flock::lock(lock, FlockArg::LockExclusiveNonblock) else { 1064 eprintln!("Could not acquire lock"); 1065 die(); 1066 }; 1067 1068 + if syslog::init(Facility::LOG_USER, log_level, Some("nixos")).is_err() { 1069 bail!("Failed to initialize logger"); 1070 } 1071 ··· 1075 != "1" 1076 { 1077 do_pre_switch_check(&pre_switch_check, &toplevel, action)?; 1078 + log::debug!("Done performing pre-switch checks"); 1079 } 1080 1081 if *action == Action::Check { ··· 1085 // Install or update the bootloader. 1086 if matches!(action, Action::Switch | Action::Boot) { 1087 do_install_bootloader(&install_bootloader, &toplevel)?; 1088 + log::debug!("Done performing bootloader installation"); 1089 } 1090 1091 // Just in case the new configuration hangs the system, do a sync now. ··· 1666 eprintln!("restarting systemd..."); 1667 _ = systemd.reexecute(); // we don't get a dbus reply here 1668 1669 + log::debug!("waiting for systemd restart to finish"); 1670 while !*systemd_reload_status.borrow() { 1671 _ = dbus_conn 1672 .process(Duration::from_millis(500)) ··· 1681 1682 // Make systemd reload its units. 1683 _ = systemd.reload(); // we don't get a dbus reply here 1684 + log::debug!("waiting for systemd reload to finish"); 1685 while !*systemd_reload_status.borrow() { 1686 _ = dbus_conn 1687 .process(Duration::from_millis(500)) ··· 1718 .canonicalize() 1719 .context("Failed to get full path to /proc/self/exe")?; 1720 1721 + log::debug!("Performing user switch for {name}"); 1722 std::process::Command::new(&myself) 1723 .uid(uid) 1724 .gid(gid) ··· 1894 // 1895 // Wait for events from systemd to settle. process() will return true if we have received any 1896 // messages on the bus. 1897 + let mut waited = Duration::from_millis(0); 1898 + let wait_interval = Duration::from_millis(250); 1899 + let max_wait = Duration::from_secs(90); 1900 + log::debug!("waiting for systemd events to settle"); 1901 + while dbus_conn.process(wait_interval).unwrap_or_default() { 1902 + waited += wait_interval; 1903 + if waited >= max_wait { 1904 + log::debug!("timed out waiting systemd events to settle"); 1905 + break; 1906 + } 1907 + } 1908 1909 let new_active_units = get_active_units(&systemd)?; 1910