From b07c44198798fdd9f51c9ba34dc4811b857e56d4 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 29 Jul 2024 00:19:46 +0200 Subject: [PATCH 001/197] shell.nix: Enable e.g. --arg nixpkgs ./. This allows shell.nix to be run with the latest tools instead of the pinned ones when desired, which is probably not very often, but useful nonetheless. --- shell.nix | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/shell.nix b/shell.nix index d9e94eb2816d..9913ff5dbc7d 100644 --- a/shell.nix +++ b/shell.nix @@ -4,17 +4,25 @@ # because every time you change any file and do another `nix develop`, # it would create another copy of the entire ~500MB tree in the store. # See https://github.com/NixOS/nix/pull/6530 for the future -{ - system ? builtins.currentSystem, -}: +# +# Note: We use a pinned Nixpkgs so that the tools are readily available even +# when making changes that would otherwise require a new build of those tools. +# If you'd like to test out changes to the tools themselves, you can pass +# +# nix-shell --arg nixpkgs ./. +# let pinnedNixpkgs = builtins.fromJSON (builtins.readFile ci/pinned-nixpkgs.json); +in +{ + system ? builtins.currentSystem, - nixpkgs = fetchTarball { + nixpkgs ? fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/${pinnedNixpkgs.rev}.tar.gz"; sha256 = pinnedNixpkgs.sha256; - }; - + }, +}: +let pkgs = import nixpkgs { inherit system; config = {}; From d2398e062ee2ee1e1e6d6fec28af3c48d68af83c Mon Sep 17 00:00:00 2001 From: Norbert Melzer Date: Mon, 26 Aug 2024 21:00:35 +0200 Subject: [PATCH 002/197] rustic: 0.7.0-unstable-2024-08-10 -> 0.8.0 --- pkgs/by-name/ru/rustic/Cargo.lock | 5170 ---------------------------- pkgs/by-name/ru/rustic/package.nix | 16 +- 2 files changed, 4 insertions(+), 5182 deletions(-) delete mode 100644 pkgs/by-name/ru/rustic/Cargo.lock diff --git a/pkgs/by-name/ru/rustic/Cargo.lock b/pkgs/by-name/ru/rustic/Cargo.lock deleted file mode 100644 index 85482a10a675..000000000000 --- a/pkgs/by-name/ru/rustic/Cargo.lock +++ /dev/null @@ -1,5170 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "abscissa_core" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8346a52bf3fb445d5949d144c37360ad2f1d7950cfcc6d4e9e4999b1cd1bd42a" -dependencies = [ - "abscissa_derive", - "arc-swap", - "backtrace", - "canonical-path", - "clap", - "color-eyre", - "fs-err", - "once_cell", - "regex", - "secrecy", - "semver", - "serde", - "termcolor", - "toml 0.5.11", - "tracing", - "tracing-log 0.1.4", - "tracing-subscriber", - "wait-timeout", -] - -[[package]] -name = "abscissa_derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55bfb86e57d13c06e482c570826ddcddcc8f07fab916760e8911141d4fda8b62" -dependencies = [ - "ident_case", - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aead" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" -dependencies = [ - "crypto-common", - "generic-array", -] - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if 1.0.0", - "cipher", - "cpufeatures", -] - -[[package]] -name = "aes256ctr_poly1305aes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2926121f4e92f1682d993563f9128b65978dab1fb3879f8f533e97c0697483" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "poly1305", - "subtle", - "zeroize", -] - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if 1.0.0", - "const-random", - "getrandom", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "allocator-api2" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anstream" -version = "0.6.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" - -[[package]] -name = "anstyle-parse" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - -[[package]] -name = "anyhow" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" - -[[package]] -name = "arc-swap" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" - -[[package]] -name = "array-init" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" - -[[package]] -name = "assert_cmd" -version = "2.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d" -dependencies = [ - "anstyle", - "bstr", - "doc-comment", - "libc", - "predicates", - "predicates-core", - "predicates-tree", - "wait-timeout", -] - -[[package]] -name = "async-trait" -version = "0.1.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "awaitable" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70af449c9a763cb655c6a1e5338b42d99c67190824ff90658c1e30be844c0775" -dependencies = [ - "awaitable-error", - "cfg-if 1.0.0", -] - -[[package]] -name = "awaitable-error" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5b3469636cdf8543cceab175efca534471f36eee12fb8374aba00eb5e7e7f8a" - -[[package]] -name = "backoff" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" -dependencies = [ - "getrandom", - "instant", - "rand", -] - -[[package]] -name = "backon" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d67782c3f868daa71d3533538e98a8e13713231969def7536e8039606fc46bf0" -dependencies = [ - "fastrand 2.1.0", - "futures-core", - "pin-project", - "tokio", -] - -[[package]] -name = "backtrace" -version = "0.3.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" -dependencies = [ - "addr2line", - "cc", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "bb8" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10cf871f3ff2ce56432fddc2615ac7acc3aa22ca321f8fea800846fbb32f188" -dependencies = [ - "async-trait", - "futures-util", - "parking_lot", - "tokio", -] - -[[package]] -name = "binrw" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f36b7cb3ab9ff6a2858650d8dc360e783a5d14dc29594db48c56a3c233cc265" -dependencies = [ - "array-init", - "binrw_derive", - "bytemuck", -] - -[[package]] -name = "binrw_derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ea7a8c5c8eeffffac6d54d172444e15beffac6f817fac714460a9a9aa88da3" -dependencies = [ - "either", - "owo-colors", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-padding" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bstr" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" -dependencies = [ - "memchr", - "regex-automata 0.4.7", - "serde", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "bytemuck" -version = "1.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" - -[[package]] -name = "bytesize" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" - -[[package]] -name = "cached" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4d73155ae6b28cf5de4cfc29aeb02b8a1c6dab883cb015d15cd514e42766846" -dependencies = [ - "ahash", - "cached_proc_macro", - "cached_proc_macro_types", - "hashbrown 0.14.5", - "once_cell", - "thiserror", - "web-time", -] - -[[package]] -name = "cached_proc_macro" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f42a145ed2d10dce2191e1dcf30cfccfea9026660e143662ba5eec4017d5daa" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "cached_proc_macro_types" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" - -[[package]] -name = "cachedir" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4703f3937077db8fa35bee3c8789343c1aec2585f0146f09d658d4ccc0e8d873" -dependencies = [ - "tempfile", -] - -[[package]] -name = "canonical-path" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" - -[[package]] -name = "cassowary" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" - -[[package]] -name = "castaway" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" -dependencies = [ - "rustversion", -] - -[[package]] -name = "cbc" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" -dependencies = [ - "cipher", -] - -[[package]] -name = "cc" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" -dependencies = [ - "jobserver", - "libc", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-targets 0.52.6", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "clap" -version = "4.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d8838454fda655dafd3accb2b6e2bea645b9e4078abe84a22ceb947235c5cc" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", - "terminal_size", -] - -[[package]] -name = "clap_complete" -version = "4.5.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d11bff0290e9a266fc9b4ce6fa96c2bf2ca3f9724c41c10202ac1daf7a087f8" -dependencies = [ - "clap", -] - -[[package]] -name = "clap_derive" -version = "4.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "clap_lex" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" - -[[package]] -name = "color-eyre" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" -dependencies = [ - "backtrace", - "eyre", - "indenter", - "once_cell", - "owo-colors", -] - -[[package]] -name = "colorchoice" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" - -[[package]] -name = "comfy-table" -version = "7.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" -dependencies = [ - "crossterm 0.27.0", - "strum", - "strum_macros", - "unicode-width", -] - -[[package]] -name = "compact_str" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6050c3a16ddab2e412160b31f2c871015704239bca62f72f6e5f0be631d3f644" -dependencies = [ - "castaway", - "cfg-if 1.0.0", - "itoa", - "rustversion", - "ryu", - "static_assertions", -] - -[[package]] -name = "concurrent_arena" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c529c2d4ecc249ae15d317c9a8b9e7d86f87e80d4417de6cfa8f4d6030f37daf" -dependencies = [ - "arc-swap", - "parking_lot", - "triomphe", -] - -[[package]] -name = "console" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "unicode-width", - "windows-sys 0.52.0", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "const-random" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" -dependencies = [ - "const-random-macro", -] - -[[package]] -name = "const-random-macro" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" -dependencies = [ - "getrandom", - "once_cell", - "tiny-keccak", -] - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32c" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a47af21622d091a8f0fb295b88bc886ac74efcc613efc19f5d0b21de5c89e47" -dependencies = [ - "rustc_version", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crossterm" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" -dependencies = [ - "bitflags", - "crossterm_winapi", - "libc", - "parking_lot", - "winapi", -] - -[[package]] -name = "crossterm" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" -dependencies = [ - "bitflags", - "crossterm_winapi", - "mio", - "parking_lot", - "rustix", - "signal-hook", - "signal-hook-mio", - "winapi", -] - -[[package]] -name = "crossterm_winapi" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" -dependencies = [ - "winapi", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - -[[package]] -name = "curve25519-dalek" -version = "4.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "curve25519-dalek-derive", - "digest", - "fiat-crypto", - "rustc_version", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.72", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if 1.0.0", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "data-encoding" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" - -[[package]] -name = "dav-server" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a9e373ca09a43ad20c0b7805fcb4b489713f049a3ee2750ed61efa72f9cde9" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "headers 0.4.0", - "htmlescape", - "http 1.1.0", - "http-body 1.0.1", - "http-body-util", - "hyper 1.4.1", - "lazy_static", - "log", - "mime_guess", - "percent-encoding", - "pin-project", - "pin-utils", - "regex", - "time", - "tokio", - "url", - "uuid", - "warp", - "xml-rs", - "xmltree", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_destructure2" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b697ac90ff296f0fc031ee5a61c7ac31fb9fff50e3fb32873b09223613fc0c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "derive_more" -version = "0.99.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" -dependencies = [ - "convert_case 0.4.0", - "proc-macro2", - "quote", - "rustc_version", - "syn 2.0.72", -] - -[[package]] -name = "derive_setters" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "dialoguer" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" -dependencies = [ - "console", - "shell-words", - "tempfile", - "thiserror", - "zeroize", -] - -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "difflib" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "dircmp" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ca7fa3ba397980657070e679f412acddb7a372f1793ff68ef0bbe708680f0f" -dependencies = [ - "regex", - "sha2", - "thiserror", - "walkdir", -] - -[[package]] -name = "directories" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "dlv-list" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" -dependencies = [ - "const-random", -] - -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "ed25519" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" -dependencies = [ - "pkcs8", - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" -dependencies = [ - "curve25519-dalek", - "ed25519", - "serde", - "sha2", - "signature", - "subtle", - "zeroize", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "enum-map" -version = "2.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" -dependencies = [ - "enum-map-derive", -] - -[[package]] -name = "enum-map-derive" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "enumset" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" -dependencies = [ - "enumset_derive", - "serde", -] - -[[package]] -name = "enumset_derive" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "env_logger" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "eyre" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "fiat-crypto" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" - -[[package]] -name = "filetime" -version = "0.2.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf401df4a4e3872c4fe8151134cf483738e74b67fc934d6532c882b3d24a4550" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "libredox", - "windows-sys 0.59.0", -] - -[[package]] -name = "flagset" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" - -[[package]] -name = "flate2" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "float-cmp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" -dependencies = [ - "num-traits", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fs-err" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" -dependencies = [ - "autocfg", -] - -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "gethostname" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" -dependencies = [ - "libc", - "windows-targets 0.48.5", -] - -[[package]] -name = "gethostname" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc3655aa6818d65bc620d6911f05aa7b6aeb596291e1e9f79e52df85583d1e30" -dependencies = [ - "rustix", - "windows-targets 0.52.6", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "libc", - "wasi", - "wasm-bindgen", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "globset" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", -] - -[[package]] -name = "governor" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" -dependencies = [ - "cfg-if 1.0.0", - "dashmap", - "futures", - "futures-timer", - "no-std-compat", - "nonzero_ext", - "parking_lot", - "portable-atomic", - "quanta", - "rand", - "smallvec", - "spinning_top", -] - -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.3.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "headers" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" -dependencies = [ - "base64 0.21.7", - "bytes", - "headers-core 0.2.0", - "http 0.2.12", - "httpdate", - "mime", - "sha1", -] - -[[package]] -name = "headers" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322106e6bd0cba2d5ead589ddb8150a13d7c4217cf80d7c4f682ca994ccc6aa9" -dependencies = [ - "base64 0.21.7", - "bytes", - "headers-core 0.3.0", - "http 1.1.0", - "httpdate", - "mime", - "sha1", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http 0.2.12", -] - -[[package]] -name = "headers-core" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" -dependencies = [ - "http 1.1.0", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -dependencies = [ - "serde", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "htmlescape" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http 1.1.0", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" -dependencies = [ - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "human-panic" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c5a08ed290eac04006e21e63d32e90086b6182c7cd0452d10f4264def1fec9a" -dependencies = [ - "anstream", - "anstyle", - "backtrace", - "os_info", - "serde", - "serde_derive", - "toml 0.8.19", - "uuid", -] - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "0.14.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" -dependencies = [ - "futures-util", - "http 1.1.0", - "hyper 1.4.1", - "hyper-util", - "rustls", - "rustls-native-certs", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", - "webpki-roots", -] - -[[package]] -name = "hyper-util" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "hyper 1.4.1", - "pin-project-lite", - "socket2", - "tokio", - "tower", - "tower-service", - "tracing", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "ignore" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" -dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata 0.4.7", - "same-file", - "walkdir", - "winapi-util", -] - -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "indicatif" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" -dependencies = [ - "console", - "instant", - "number_prefix", - "portable-atomic", - "unicode-width", -] - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "block-padding", - "generic-array", -] - -[[package]] -name = "instability" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c" -dependencies = [ - "quote", - "syn 2.0.72", -] - -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "integer-sqrt" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" -dependencies = [ - "num-traits", -] - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "jemalloc-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45" -dependencies = [ - "cc", - "fs_extra", - "libc", -] - -[[package]] -name = "jemallocator" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69" -dependencies = [ - "jemalloc-sys", - "libc", -] - -[[package]] -name = "jemallocator-global" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "991b61de8365c8b5707cf6cabbff98cfd6eaca9b851948b883efea408c7f581e" -dependencies = [ - "cfg-if 0.1.10", - "jemallocator", -] - -[[package]] -name = "jobserver" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "jsonwebtoken" -version = "9.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" -dependencies = [ - "base64 0.21.7", - "js-sys", - "pem", - "ring", - "serde", - "serde_json", - "simple_asn1", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin", -] - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "libmimalloc-sys" -version = "0.1.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags", - "libc", - "redox_syscall", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "lru" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" -dependencies = [ - "hashbrown 0.14.5", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if 1.0.0", - "digest", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "merge" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10bbef93abb1da61525bbc45eeaff6473a41907d19f8f9aa5168d214e10693e9" -dependencies = [ - "merge_derive", - "num-traits", -] - -[[package]] -name = "merge_derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209d075476da2e63b4b29e72a2ef627b840589588e71400a25e3565c4f849d07" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "mimalloc" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633" -dependencies = [ - "libmimalloc-sys", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" -dependencies = [ - "hermit-abi", - "libc", - "log", - "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "multer" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" -dependencies = [ - "bytes", - "encoding_rs", - "futures-util", - "http 0.2.12", - "httparse", - "log", - "memchr", - "mime", - "spin", - "version_check", -] - -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "cfg_aliases", - "libc", -] - -[[package]] -name = "no-std-compat" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" - -[[package]] -name = "nonzero_ext" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" - -[[package]] -name = "normalize-line-endings" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "smallvec", - "zeroize", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_threads" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" -dependencies = [ - "libc", -] - -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - -[[package]] -name = "opendal" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615d41187deea0ea7fab5b48e9afef6ae8fc742fdcfa248846ee3d92ff71e986" -dependencies = [ - "anyhow", - "async-trait", - "backon", - "base64 0.22.1", - "bb8", - "bytes", - "chrono", - "crc32c", - "flagset", - "futures", - "getrandom", - "governor", - "http 1.1.0", - "log", - "md-5", - "once_cell", - "openssh", - "openssh-sftp-client", - "percent-encoding", - "quick-xml 0.36.1", - "reqsign", - "reqwest", - "serde", - "serde_json", - "sha2", - "tokio", - "uuid", -] - -[[package]] -name = "openssh" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "330f4b61092456dc0aaa0cf9a205d956cae07d8127a69ffeff6760a72549c77f" -dependencies = [ - "libc", - "once_cell", - "shell-escape", - "tempfile", - "thiserror", - "tokio", - "tokio-pipe", -] - -[[package]] -name = "openssh-sftp-client" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f472c9c38ea60bc161f8b5df4d04c79057003cdc12572eaad7f6dcc74e6fca5" -dependencies = [ - "bytes", - "derive_destructure2", - "futures-core", - "once_cell", - "openssh", - "openssh-sftp-client-lowlevel", - "openssh-sftp-error", - "pin-project", - "scopeguard", - "tokio", - "tokio-io-utility", - "tokio-util", - "tracing", -] - -[[package]] -name = "openssh-sftp-client-lowlevel" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a84f1a52761901fcf5b10885544085348a872e57294531ec9188145d9a83042" -dependencies = [ - "awaitable", - "bytes", - "concurrent_arena", - "derive_destructure2", - "openssh-sftp-error", - "openssh-sftp-protocol", - "pin-project", - "tokio", - "tokio-io-utility", -] - -[[package]] -name = "openssh-sftp-error" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a5aea093d714df10186f481a6003e3f906f6fc8360c026737a841f4f182996" -dependencies = [ - "awaitable-error", - "openssh", - "openssh-sftp-protocol-error", - "ssh_format_error", - "thiserror", - "tokio", -] - -[[package]] -name = "openssh-sftp-protocol" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf38532d784978966f95d241226223823f351d5bb2a4bebcf6b20b9cb1e393e0" -dependencies = [ - "bitflags", - "num-derive", - "num-traits", - "openssh-sftp-protocol-error", - "serde", - "ssh_format", - "vec-strings", -] - -[[package]] -name = "openssh-sftp-protocol-error" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0719269eb3f037866ae07ec89cb44ed2c1d63b72b2390cef8e1aa3016a956ff8" -dependencies = [ - "serde", - "thiserror", - "vec-strings", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "ordered-multimap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" -dependencies = [ - "dlv-list", - "hashbrown 0.14.5", -] - -[[package]] -name = "os_info" -version = "3.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" -dependencies = [ - "log", - "serde", - "windows-sys 0.52.0", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "owo-colors" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" - -[[package]] -name = "pariter" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a62b9e7b5f270c0acc92a2040f8028bb643f959f9c068f11a7864f327e3d9" -dependencies = [ - "crossbeam", - "crossbeam-channel", - "num_cpus", -] - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "path-dedot" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ba0ad7e047712414213ff67533e6dd477af0a4e1d14fb52343e53d30ea9397" -dependencies = [ - "once_cell", -] - -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest", - "hmac", -] - -[[package]] -name = "pem" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" -dependencies = [ - "base64 0.22.1", - "serde", -] - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs1" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" -dependencies = [ - "der", - "pkcs8", - "spki", -] - -[[package]] -name = "pkcs5" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e847e2c91a18bfa887dd028ec33f2fe6f25db77db3619024764914affe8b69a6" -dependencies = [ - "aes", - "cbc", - "der", - "pbkdf2", - "scrypt", - "sha2", - "spki", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "pkcs5", - "rand_core", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "poly1305" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" -dependencies = [ - "cpufeatures", - "opaque-debug", - "universal-hash", -] - -[[package]] -name = "portable-atomic" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "predicates" -version = "3.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" -dependencies = [ - "anstyle", - "difflib", - "float-cmp", - "normalize-line-endings", - "predicates-core", - "regex", -] - -[[package]] -name = "predicates-core" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931" - -[[package]] -name = "predicates-tree" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13" -dependencies = [ - "predicates-core", - "termtree", -] - -[[package]] -name = "pretty_assertions" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" -dependencies = [ - "diff", - "yansi", -] - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit 0.21.1", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quanta" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" -dependencies = [ - "crossbeam-utils", - "libc", - "once_cell", - "raw-cpuid", - "wasi", - "web-sys", - "winapi", -] - -[[package]] -name = "quick-xml" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" -dependencies = [ - "memchr", -] - -[[package]] -name = "quick-xml" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86e446ed58cef1bbfe847bc2fda0e2e4ea9f0e57b90c507d4781292590d72a4e" -dependencies = [ - "memchr", - "serde", -] - -[[package]] -name = "quick-xml" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc" -dependencies = [ - "memchr", - "serde", -] - -[[package]] -name = "quick_cache" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec932c60e6faf77dc6601ea149a23d821598b019b450bb1d98fe89c0301c0b61" -dependencies = [ - "ahash", - "equivalent", - "hashbrown 0.14.5", - "parking_lot", -] - -[[package]] -name = "quickcheck" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6" -dependencies = [ - "env_logger", - "log", - "rand", -] - -[[package]] -name = "quickcheck_macros" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22a693222d716a9587786f37ac3f6b4faedb5b80c23914e7303ff5a1d8016e9" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "quinn" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" -dependencies = [ - "bytes", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "socket2", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" -dependencies = [ - "bytes", - "rand", - "ring", - "rustc-hash", - "rustls", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - -[[package]] -name = "quinn-udp" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" -dependencies = [ - "libc", - "once_cell", - "socket2", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "ratatui" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba6a365afbe5615999275bea2446b970b10a41102500e27ce7678d50d978303" -dependencies = [ - "bitflags", - "cassowary", - "compact_str", - "crossterm 0.28.1", - "instability", - "itertools", - "lru", - "paste", - "strum", - "strum_macros", - "unicode-segmentation", - "unicode-truncate", - "unicode-width", -] - -[[package]] -name = "raw-cpuid" -version = "11.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" -dependencies = [ - "bitflags", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" -dependencies = [ - "getrandom", - "libredox", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "relative-path" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" - -[[package]] -name = "reqsign" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03dd4ba7c3901dd43e6b8c7446a760d45bc1ea4301002e1a6fa48f97c3a796fa" -dependencies = [ - "anyhow", - "async-trait", - "base64 0.22.1", - "chrono", - "form_urlencoded", - "getrandom", - "hex", - "hmac", - "home", - "http 1.1.0", - "jsonwebtoken", - "log", - "once_cell", - "percent-encoding", - "quick-xml 0.35.0", - "rand", - "reqwest", - "rsa", - "rust-ini", - "serde", - "serde_json", - "sha1", - "sha2", -] - -[[package]] -name = "reqwest" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "http-body-util", - "hyper 1.4.1", - "hyper-rustls", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "quinn", - "rustls", - "rustls-native-certs", - "rustls-pemfile", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tokio-rustls", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "webpki-roots", - "winreg", -] - -[[package]] -name = "rhai" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61797318be89b1a268a018a92a7657096d83f3ecb31418b9e9c16dcbb043b702" -dependencies = [ - "ahash", - "bitflags", - "instant", - "num-traits", - "once_cell", - "rhai_codegen", - "serde", - "smallvec", - "smartstring", - "thin-vec", -] - -[[package]] -name = "rhai_codegen" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a11a05ee1ce44058fa3d5961d05194fdbe3ad6b40f904af764d81b86450e6b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if 1.0.0", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rsa" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" -dependencies = [ - "const-oid", - "digest", - "num-bigint-dig", - "num-integer", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core", - "sha2", - "signature", - "spki", - "subtle", - "zeroize", -] - -[[package]] -name = "rstest" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b423f0e62bdd61734b67cd21ff50871dfaeb9cc74f869dcd6af974fbcb19936" -dependencies = [ - "futures", - "futures-timer", - "rstest_macros", - "rustc_version", -] - -[[package]] -name = "rstest_macros" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e1711e7d14f74b12a58411c542185ef7fb7f2e7f8ee6e2940a883628522b42" -dependencies = [ - "cfg-if 1.0.0", - "glob", - "proc-macro-crate", - "proc-macro2", - "quote", - "regex", - "relative-path", - "rustc_version", - "syn 2.0.72", - "unicode-ident", -] - -[[package]] -name = "runtime-format" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09958d5b38bca768ede7928c767c89a08ba568144a7b61992aecae79b03c8c94" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "rust-ini" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e310ef0e1b6eeb79169a1171daf9abcb87a2e17c03bee2c4bb100b55c75409f" -dependencies = [ - "cfg-if 1.0.0", - "ordered-multimap", - "trim-in-place", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustic-rs" -version = "0.7.0-dev" -dependencies = [ - "abscissa_core", - "aho-corasick", - "anyhow", - "assert_cmd", - "bytesize", - "cached", - "chrono", - "clap", - "clap_complete", - "comfy-table", - "convert_case 0.6.0", - "crossterm 0.28.1", - "dav-server", - "dialoguer", - "dircmp", - "directories", - "displaydoc", - "gethostname 0.5.0", - "globset", - "human-panic", - "humantime", - "indicatif", - "itertools", - "jemallocator-global", - "libc", - "log", - "merge", - "mimalloc", - "once_cell", - "predicates", - "pretty_assertions", - "quickcheck", - "quickcheck_macros", - "ratatui", - "rhai", - "rstest", - "rustic_backend", - "rustic_core", - "rustic_testing", - "scopeguard", - "self_update", - "semver", - "serde", - "serde_json", - "serde_with", - "simplelog", - "tempfile", - "thiserror", - "tokio", - "toml 0.8.19", - "tui-textarea", - "warp", -] - -[[package]] -name = "rustic_backend" -version = "0.1.1" -source = "git+https://github.com/rustic-rs/rustic_core.git#1cecce812107e511633d7ed2f72d1007cdc76ef5" -dependencies = [ - "aho-corasick", - "anyhow", - "backoff", - "bytes", - "bytesize", - "clap", - "derive_setters", - "displaydoc", - "hex", - "humantime", - "itertools", - "log", - "merge", - "opendal", - "rand", - "rayon", - "reqwest", - "rustic_core", - "semver", - "serde", - "shell-words", - "strum", - "strum_macros", - "thiserror", - "tokio", - "url", - "walkdir", -] - -[[package]] -name = "rustic_core" -version = "0.2.0" -source = "git+https://github.com/rustic-rs/rustic_core.git#1cecce812107e511633d7ed2f72d1007cdc76ef5" -dependencies = [ - "aes256ctr_poly1305aes", - "anyhow", - "binrw", - "bytes", - "bytesize", - "cached", - "cachedir", - "chrono", - "clap", - "crossbeam-channel", - "dav-server", - "derivative", - "derive_more", - "derive_setters", - "dirs", - "displaydoc", - "dunce", - "enum-map", - "enum-map-derive", - "enumset", - "filetime", - "futures", - "gethostname 0.4.3", - "hex", - "humantime", - "ignore", - "integer-sqrt", - "itertools", - "log", - "merge", - "nix", - "pariter", - "path-dedot", - "quick_cache", - "rand", - "rayon", - "runtime-format", - "scrypt", - "serde", - "serde-aux", - "serde_derive", - "serde_json", - "serde_with", - "sha2", - "strum", - "thiserror", - "walkdir", - "xattr", - "zstd", -] - -[[package]] -name = "rustic_testing" -version = "0.1.0" -source = "git+https://github.com/rustic-rs/rustic_core.git#1cecce812107e511633d7ed2f72d1007cdc76ef5" -dependencies = [ - "aho-corasick", - "anyhow", - "bytes", - "enum-map", - "once_cell", - "rustic_core", - "tempfile", -] - -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.23.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" -dependencies = [ - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-native-certs" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "rustls-pki-types", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" -dependencies = [ - "base64 0.22.1", - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" - -[[package]] -name = "rustls-webpki" -version = "0.102.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "salsa20" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" -dependencies = [ - "cipher", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "scrypt" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" -dependencies = [ - "pbkdf2", - "salsa20", - "sha2", -] - -[[package]] -name = "secrecy" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" -dependencies = [ - "serde", - "zeroize", -] - -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "self-replace" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7828a58998685d8bf5a3c5e7a3379a5867289c20828c3ee436280b44b598515" -dependencies = [ - "fastrand 1.9.0", - "tempfile", - "windows-sys 0.48.0", -] - -[[package]] -name = "self_update" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469a3970061380c19852269f393e74c0fe607a4e23d85267382cf25486aa8de5" -dependencies = [ - "either", - "flate2", - "hyper 1.4.1", - "indicatif", - "log", - "quick-xml 0.23.1", - "regex", - "reqwest", - "self-replace", - "semver", - "serde_json", - "tar", - "tempfile", - "urlencoding", - "zipsign-api", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.205" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-aux" -version = "4.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2e8bfba469d06512e11e3311d4d051a4a387a5b42d010404fecf3200321c95" -dependencies = [ - "chrono", - "serde", - "serde_json", -] - -[[package]] -name = "serde_derive" -version = "1.0.205" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "serde_json" -version = "1.0.122" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" -dependencies = [ - "base64 0.22.1", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.3.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest", - "sha2-asm", -] - -[[package]] -name = "sha2-asm" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b845214d6175804686b2bd482bcffe96651bb2d1200742b712003504a2dac1ab" -dependencies = [ - "cc", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shell-escape" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" - -[[package]] -name = "shell-words" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" - -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-mio" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" -dependencies = [ - "libc", - "mio", - "signal-hook", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest", - "rand_core", -] - -[[package]] -name = "simple_asn1" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" -dependencies = [ - "num-bigint", - "num-traits", - "thiserror", - "time", -] - -[[package]] -name = "simplelog" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16257adbfaef1ee58b1363bdc0664c9b8e1e30aed86049635fb5f147d065a9c0" -dependencies = [ - "log", - "termcolor", - "time", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -dependencies = [ - "serde", -] - -[[package]] -name = "smartstring" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" -dependencies = [ - "autocfg", - "serde", - "static_assertions", - "version_check", -] - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "spinning_top" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" -dependencies = [ - "lock_api", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "ssh_format" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ab31081d1c9097c327ec23550858cb5ffb4af6b866c1ef4d728455f01f3304" -dependencies = [ - "bytes", - "serde", - "ssh_format_error", -] - -[[package]] -name = "ssh_format_error" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be3c6519de7ca611f71ef7e8a56eb57aa1c818fecb5242d0a0f39c83776c210c" -dependencies = [ - "serde", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.72", -] - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - -[[package]] -name = "tar" -version = "0.4.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" -dependencies = [ - "filetime", - "libc", - "xattr", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if 1.0.0", - "fastrand 2.1.0", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "terminal_size" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" -dependencies = [ - "rustix", - "windows-sys 0.48.0", -] - -[[package]] -name = "termtree" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" - -[[package]] -name = "thin-vec" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" -dependencies = [ - "serde", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "libc", - "num-conv", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tinyvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.39.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-io-utility" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d672654d175710e52c7c41f6aec77c62b3c0954e2a7ebce9049d1e94ed7c263" -dependencies = [ - "bytes", - "tokio", -] - -[[package]] -name = "tokio-macros" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "tokio-pipe" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f213a84bffbd61b8fa0ba8a044b4bbe35d471d0b518867181e82bd5c15542784" -dependencies = [ - "libc", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" -dependencies = [ - "rustls", - "rustls-pki-types", - "tokio", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" -dependencies = [ - "futures-util", - "log", - "tokio", - "tungstenite", -] - -[[package]] -name = "tokio-util" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[package]] -name = "toml" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.22.20", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.3.0", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" -dependencies = [ - "indexmap 2.3.0", - "serde", - "serde_spanned", - "toml_datetime", - "winnow 0.6.18", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log 0.2.0", -] - -[[package]] -name = "trim-in-place" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc" - -[[package]] -name = "triomphe" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" -dependencies = [ - "arc-swap", - "serde", - "stable_deref_trait", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "tui-textarea" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c07084342a575cea919eea996b9658a358c800b03d435df581c1d7c60e065a" -dependencies = [ - "crossterm 0.28.1", - "ratatui", - "unicode-width", -] - -[[package]] -name = "tungstenite" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 1.1.0", - "httparse", - "log", - "rand", - "sha1", - "thiserror", - "url", - "utf-8", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "unicode-truncate" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" -dependencies = [ - "itertools", - "unicode-segmentation", - "unicode-width", -] - -[[package]] -name = "unicode-width" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "universal-hash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" -dependencies = [ - "crypto-common", - "subtle", -] - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "uuid" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" -dependencies = [ - "getrandom", - "serde", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vec-strings" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8509489e2a7ee219522238ad45fd370bec6808811ac15ac6b07453804e77659" -dependencies = [ - "serde", - "thin-vec", -] - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "warp" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4378d202ff965b011c64817db11d5829506d3404edeadb61f190d111da3f231c" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "headers 0.3.9", - "http 0.2.12", - "hyper 0.14.30", - "log", - "mime", - "mime_guess", - "multer", - "percent-encoding", - "pin-project", - "scoped-tls", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-tungstenite", - "tokio-util", - "tower-service", - "tracing", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.72", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "wasm-streams" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" -dependencies = [ - "memchr", -] - -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if 1.0.0", - "windows-sys 0.48.0", -] - -[[package]] -name = "xattr" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" -dependencies = [ - "libc", - "linux-raw-sys", - "rustix", -] - -[[package]] -name = "xml-rs" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a77ee7c0de333dcc6da69b177380a0b81e0dacfa4f7344c465a36871ee601" - -[[package]] -name = "xmltree" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" -dependencies = [ - "xml-rs", -] - -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder", - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" - -[[package]] -name = "zipsign-api" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413a546ada9dbcd0b9a3e0b0880581279e35047bce9797e523b3408e1df607c" -dependencies = [ - "base64 0.22.1", - "ed25519-dalek", - "thiserror", -] - -[[package]] -name = "zstd" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/pkgs/by-name/ru/rustic/package.nix b/pkgs/by-name/ru/rustic/package.nix index 588d25aff2a7..d8f92de73f2a 100644 --- a/pkgs/by-name/ru/rustic/package.nix +++ b/pkgs/by-name/ru/rustic/package.nix @@ -11,24 +11,16 @@ rustPlatform.buildRustPackage rec { pname = "rustic"; - version = "0.7.0-unstable-2024-08-10"; + version = "0.8.0"; src = fetchFromGitHub { owner = "rustic-rs"; repo = "rustic"; - # rev = "refs/tags/v${version}"; - rev = "1c9969c"; - hash = "sha256-+YVF59xHb82TOn7Gl0BbX2Yx6Owsp0LiOBgEXHN9QVI="; + rev = "refs/tags/v${version}"; + hash = "sha256-4DQNg/pYoIVQpdOp2Yx1AGUdsJbfGSL09Ll5yJTeJlU="; }; - # With the next release please go back to `cargoHash` and remove the vendored - # `Cargo.lock` if possible. - cargoLock = { - lockFile = ./Cargo.lock; - outputHashes = { - "rustic_backend-0.1.1" = "sha256-6VC0DKqV9NPzwKs6SOI3dQMKrGZd2azUBMbU9dejHKs="; - }; - }; + cargoHash = "sha256-YFVxTJNzw/A0lz7mH6B+zKjeW5FYqyKHEWckCSVs4A8="; # At the time of writing, upstream defaults to "self-update", "tui", and "webdav". # "self-update" is a self-updater, which we don't want in nixpkgs. From 4585a6b185cf232133188c08646cd277bbc82f1a Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Aug 2024 11:35:21 +0000 Subject: [PATCH 003/197] youtrack: 2024.2.40106 -> 2024.2.41254 --- pkgs/by-name/yo/youtrack/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/yo/youtrack/package.nix b/pkgs/by-name/yo/youtrack/package.nix index ac045ca8bb8b..476a49f32743 100644 --- a/pkgs/by-name/yo/youtrack/package.nix +++ b/pkgs/by-name/yo/youtrack/package.nix @@ -2,11 +2,11 @@ stdenvNoCC.mkDerivation (finalAttrs: { pname = "youtrack"; - version = "2024.2.40106"; + version = "2024.2.41254"; src = fetchzip { url = "https://download.jetbrains.com/charisma/youtrack-${finalAttrs.version}.zip"; - hash = "sha256-EihSVUmsVhex2/+VmQ74jEVbpA5A6aOKDt8ejPlw5dQ="; + hash = "sha256-17IukQTBKspspVDyHpv8DtkAnuAHrB+rXenu8h7Yfno="; }; nativeBuildInputs = [ makeBinaryWrapper ]; From 0211be66dec8b8839a5bb550f41b2d23351f8e7b Mon Sep 17 00:00:00 2001 From: hand7s Date: Tue, 27 Aug 2024 23:24:53 +0300 Subject: [PATCH 004/197] maintainers: add s0me1newithhand7s --- maintainers/maintainer-list.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index b424321e6436..26454638255d 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -18223,6 +18223,13 @@ githubId = 766350; name = "Richard Zetterberg"; }; + s0me1newithhand7s = { + name = "hand7s"; + email = "s0me1newithhand7s@gmail.com"; + matrix = "@s0me1newithhand7s:matrix.org"; + github = "s0me1newithhand7s"; + githubId = 117505144; + }; s1341 = { email = "s1341@shmarya.net"; matrix = "@s1341:matrix.org"; From 987dd7f9a28589c2757932f0c503275ecf37ae88 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Wed, 28 Aug 2024 09:26:53 -0700 Subject: [PATCH 005/197] git-gr: 1.4.2 -> 1.4.3 --- pkgs/by-name/gi/git-gr/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/gi/git-gr/package.nix b/pkgs/by-name/gi/git-gr/package.nix index 3103498f1859..96a03ed49e94 100644 --- a/pkgs/by-name/gi/git-gr/package.nix +++ b/pkgs/by-name/gi/git-gr/package.nix @@ -15,7 +15,7 @@ let canRunGitGr = stdenv.hostPlatform.emulatorAvailable buildPackages; gitGr = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/git-gr"; pname = "git-gr"; - version = "1.4.2"; + version = "1.4.3"; in rustPlatform.buildRustPackage { inherit pname version; @@ -24,12 +24,12 @@ rustPlatform.buildRustPackage { owner = "9999years"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-/g5EpSwnYI0fYZKsstfwApmMxvdFKVfeXDi0dUn5bxU="; + hash = "sha256-t308Ep27iRvRHSdvVMOrRGVoajBtnTutHAkKbZkO7Wg="; }; buildFeatures = [ "clap_mangen" ]; - cargoHash = "sha256-qVOCnJD/VNoi6Ur7mjtar1likNd26Fuggwp9m9/K2/w="; + cargoHash = "sha256-oukVU3YZMI2Z6HqIrEe2npmCj9PtwQUT6VOPkklM0Ig="; OPENSSL_NO_VENDOR = true; From 6b9904319f954a4d5c800f684ae06efd881a830a Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Aug 2024 16:39:18 +0000 Subject: [PATCH 006/197] valijson: 1.0.2 -> 1.0.3 --- pkgs/by-name/va/valijson/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/va/valijson/package.nix b/pkgs/by-name/va/valijson/package.nix index 614172dedd48..05da39c37475 100644 --- a/pkgs/by-name/va/valijson/package.nix +++ b/pkgs/by-name/va/valijson/package.nix @@ -6,13 +6,13 @@ stdenv.mkDerivation rec { pname = "valijson"; - version = "1.0.2"; + version = "1.0.3"; src = fetchFromGitHub { owner = "tristanpenman"; repo = "valijson"; rev = "v${version}"; - hash = "sha256-wvFdjsDtKH7CpbEpQjzWtLC4RVOU9+D2rSK0Xo1cJqo="; + hash = "sha256-TO+eb1OANq+xPIwF0qPZ7uwoZGAtjCL6y/XbHHohcDU="; }; nativeBuildInputs = [ From 604c269b5615d70a64e42ebaad96cf9a99c21c9e Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Aug 2024 16:46:29 +0000 Subject: [PATCH 007/197] sentry-native: 0.7.8 -> 0.7.9 --- pkgs/development/libraries/sentry-native/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/sentry-native/default.nix b/pkgs/development/libraries/sentry-native/default.nix index acda15495bd4..7f6325faef25 100644 --- a/pkgs/development/libraries/sentry-native/default.nix +++ b/pkgs/development/libraries/sentry-native/default.nix @@ -9,13 +9,13 @@ stdenv.mkDerivation rec { pname = "sentry-native"; - version = "0.7.8"; + version = "0.7.9"; src = fetchFromGitHub { owner = "getsentry"; repo = "sentry-native"; rev = version; - hash = "sha256-S9fkxLCeQdHOt1FUa8CcZMmORNcxwQSuchng/dNq4g8="; + hash = "sha256-L7VlsxgjWPCceDuJ9OR6Et6wzaBn1hb0AOFbc7PuZWw="; }; nativeBuildInputs = [ From e20d310ac68919dfaeaf06ef74ff6a43673389f1 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Aug 2024 18:03:52 +0000 Subject: [PATCH 008/197] vala-lint: 0-unstable-2023-12-05 -> 0-unstable-2024-08-28 --- pkgs/development/tools/vala-lint/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/vala-lint/default.nix b/pkgs/development/tools/vala-lint/default.nix index 8fd63f6e30a3..d47e7c22470a 100644 --- a/pkgs/development/tools/vala-lint/default.nix +++ b/pkgs/development/tools/vala-lint/default.nix @@ -15,13 +15,13 @@ stdenv.mkDerivation rec { pname = "vala-lint"; - version = "0-unstable-2023-12-05"; + version = "0-unstable-2024-08-28"; src = fetchFromGitHub { owner = "vala-lang"; repo = "vala-lint"; - rev = "8ae2bb65fe66458263d94711ae4ddd978faece00"; - sha256 = "sha256-FZV726ZeNEX4ulEh+IIzwZqpnVRr7IeZb47FV1C7YjU="; + rev = "4ed1443c35a8a84445fb59292d539358365d8263"; + sha256 = "sha256-NPadBrL2g5w95slwDpp7kNXBgLJ9na8Yd/J7zm28SSo="; }; nativeBuildInputs = [ From 104606364e2b8366394b9a655b6daf9b41af01d2 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Aug 2024 18:04:02 +0000 Subject: [PATCH 009/197] sentry-cli: 2.33.1 -> 2.34.1 --- pkgs/development/tools/sentry-cli/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/sentry-cli/default.nix b/pkgs/development/tools/sentry-cli/default.nix index 07db1eb06644..f90c06c3eee8 100644 --- a/pkgs/development/tools/sentry-cli/default.nix +++ b/pkgs/development/tools/sentry-cli/default.nix @@ -11,13 +11,13 @@ }: rustPlatform.buildRustPackage rec { pname = "sentry-cli"; - version = "2.33.1"; + version = "2.34.1"; src = fetchFromGitHub { owner = "getsentry"; repo = "sentry-cli"; rev = version; - sha256 = "sha256-7hjTmXIHqoSnXblF4CxV7rgjIdjDMKcu4SvJmmGlmlc="; + sha256 = "sha256-TaBhYZYIoY1W+O7lMRFKlMAhoaz2emqVE9h6AB+jMbE="; }; doCheck = false; @@ -27,7 +27,7 @@ rustPlatform.buildRustPackage rec { buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ CoreServices Security SystemConfiguration ]; nativeBuildInputs = [ installShellFiles pkg-config ]; - cargoHash = "sha256-lMKDFBIFElYfIxenpLFynEpEJhbRA2gOsTLD7wLPUSw="; + cargoHash = "sha256-uCNlOsgrQNoHZvuoQDdxuvD4JCqi82OdGeKlphayPC8="; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd sentry-cli \ From 6ed8812dfcccf5f75aeb822d0aefaa38b8f45857 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Aug 2024 20:44:13 +0000 Subject: [PATCH 010/197] pocketbase: 0.22.19 -> 0.22.20 --- pkgs/servers/pocketbase/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/pocketbase/default.nix b/pkgs/servers/pocketbase/default.nix index 009c9b42ed98..07e1dedce259 100644 --- a/pkgs/servers/pocketbase/default.nix +++ b/pkgs/servers/pocketbase/default.nix @@ -6,16 +6,16 @@ buildGoModule rec { pname = "pocketbase"; - version = "0.22.19"; + version = "0.22.20"; src = fetchFromGitHub { owner = "pocketbase"; repo = "pocketbase"; rev = "v${version}"; - hash = "sha256-FQEQrXOUo/EtMc5Jy8yAxwxSFnLgwfv5muksId5m4AY="; + hash = "sha256-ZkajcBwoXyH6+ARI/pl1HmvN99ibgqwqF/VfmptJgrc="; }; - vendorHash = "sha256-9i4ieAlrhtnFhCJvIJyS+9GJfq1bX4BE45vV2SvhY2s="; + vendorHash = "sha256-5lfjwCh930B5k8KbUDW81HkmiO7io4RqEr4VP8MikeA="; # This is the released subpackage from upstream repo subPackages = [ "examples/base" ]; From 9facf7de8d00b40d2cb87ad33d5f8fbc66137323 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Wed, 28 Aug 2024 17:11:51 -0400 Subject: [PATCH 011/197] hyprland-autoname-workspaces: 1.1.14 -> 1.1.15 --- .../misc/hyprland-autoname-workspaces/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/hyprland-autoname-workspaces/default.nix b/pkgs/applications/misc/hyprland-autoname-workspaces/default.nix index 1bec06a38c99..9655ad5c2308 100644 --- a/pkgs/applications/misc/hyprland-autoname-workspaces/default.nix +++ b/pkgs/applications/misc/hyprland-autoname-workspaces/default.nix @@ -5,16 +5,18 @@ rustPlatform.buildRustPackage rec { pname = "hyprland-autoname-workspaces"; - version = "1.1.14"; + version = "1.1.15"; src = fetchFromGitHub { owner = "hyprland-community"; repo = "hyprland-autoname-workspaces"; rev = version; - hash = "sha256-RTx4fmamjydrQzC1CpgbuvV6kg0S6Jyj/0Q9FrfrMlU="; + hash = "sha256-oXVKee3YAMXtVJBqJGt1SpH0KFzvIB278EN69A2OeXY="; }; - cargoHash = "sha256-Te3nBgr3uq8km8lX3AkCAS28leolZLXEF68phIEpg5k="; + cargoHash = "sha256-Ub7jU9c0I/w4h1DBFvimP7SjkabkP9EF+qtHAPtdPFI="; + + doCheck = false; meta = with lib; { description = "Automatically rename workspaces with icons of started applications"; From fbd927db77eda73b0f557079a576b61ce94c1969 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:58 +0200 Subject: [PATCH 012/197] nixos/services.foundationdb: remove `with lib;` --- .../services/databases/foundationdb.nix | 147 +++++++++--------- 1 file changed, 72 insertions(+), 75 deletions(-) diff --git a/nixos/modules/services/databases/foundationdb.nix b/nixos/modules/services/databases/foundationdb.nix index 670a149ea5e7..8fc35474b39c 100644 --- a/nixos/modules/services/databases/foundationdb.nix +++ b/nixos/modules/services/databases/foundationdb.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.foundationdb; pkg = cfg.package; @@ -10,10 +7,10 @@ let initialIpAddr = if (cfg.publicAddress != "auto") then cfg.publicAddress else "127.0.0.1"; fdbServers = n: - concatStringsSep "\n" (map (x: "[fdbserver.${toString (x+cfg.listenPortStart)}]") (range 0 (n - 1))); + lib.concatStringsSep "\n" (map (x: "[fdbserver.${toString (x+cfg.listenPortStart)}]") (lib.range 0 (n - 1))); backupAgents = n: - concatStringsSep "\n" (map (x: "[backup_agent.${toString x}]") (range 1 n)); + lib.concatStringsSep "\n" (map (x: "[backup_agent.${toString x}]") (lib.range 1 n)); configFile = pkgs.writeText "foundationdb.conf" '' [general] @@ -32,25 +29,25 @@ let logdir = ${cfg.logDir} logsize = ${cfg.logSize} maxlogssize = ${cfg.maxLogSize} - ${optionalString (cfg.class != null) "class = ${cfg.class}"} + ${lib.optionalString (cfg.class != null) "class = ${cfg.class}"} memory = ${cfg.memory} storage_memory = ${cfg.storageMemory} - ${optionalString (lib.versionAtLeast cfg.package.version "6.1") '' + ${lib.optionalString (lib.versionAtLeast cfg.package.version "6.1") '' trace_format = ${cfg.traceFormat} ''} - ${optionalString (cfg.tls != null) '' + ${lib.optionalString (cfg.tls != null) '' tls_plugin = ${pkg}/libexec/plugins/FDBLibTLS.so tls_certificate_file = ${cfg.tls.certificate} tls_key_file = ${cfg.tls.key} tls_verify_peers = ${cfg.tls.allowedPeers} ''} - ${optionalString (cfg.locality.machineId != null) "locality_machineid=${cfg.locality.machineId}"} - ${optionalString (cfg.locality.zoneId != null) "locality_zoneid=${cfg.locality.zoneId}"} - ${optionalString (cfg.locality.datacenterId != null) "locality_dcid=${cfg.locality.datacenterId}"} - ${optionalString (cfg.locality.dataHall != null) "locality_data_hall=${cfg.locality.dataHall}"} + ${lib.optionalString (cfg.locality.machineId != null) "locality_machineid=${cfg.locality.machineId}"} + ${lib.optionalString (cfg.locality.zoneId != null) "locality_zoneid=${cfg.locality.zoneId}"} + ${lib.optionalString (cfg.locality.datacenterId != null) "locality_dcid=${cfg.locality.datacenterId}"} + ${lib.optionalString (cfg.locality.dataHall != null) "locality_data_hall=${cfg.locality.dataHall}"} ${fdbServers cfg.serverProcesses} @@ -62,30 +59,30 @@ in { options.services.foundationdb = { - enable = mkEnableOption "FoundationDB Server"; + enable = lib.mkEnableOption "FoundationDB Server"; - package = mkOption { - type = types.package; + package = lib.mkOption { + type = lib.types.package; description = '' The FoundationDB package to use for this server. This must be specified by the user in order to ensure migrations and upgrades are controlled appropriately. ''; }; - publicAddress = mkOption { - type = types.str; + publicAddress = lib.mkOption { + type = lib.types.str; default = "auto"; description = "Publicly visible IP address of the process. Port is determined by process ID"; }; - listenAddress = mkOption { - type = types.str; + listenAddress = lib.mkOption { + type = lib.types.str; default = "public"; description = "Publicly visible IP address of the process. Port is determined by process ID"; }; - listenPortStart = mkOption { - type = types.int; + listenPortStart = lib.mkOption { + type = lib.types.int; default = 4500; description = '' Starting port number for database listening sockets. Every FDB process binds to a @@ -94,8 +91,8 @@ in ''; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = '' Open the firewall ports corresponding to FoundationDB processes and coordinators @@ -103,44 +100,44 @@ in ''; }; - dataDir = mkOption { - type = types.path; + dataDir = lib.mkOption { + type = lib.types.path; default = "/var/lib/foundationdb"; description = "Data directory. All cluster data will be put under here."; }; - logDir = mkOption { - type = types.path; + logDir = lib.mkOption { + type = lib.types.path; default = "/var/log/foundationdb"; description = "Log directory."; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "foundationdb"; description = "User account under which FoundationDB runs."; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "foundationdb"; description = "Group account under which FoundationDB runs."; }; - class = mkOption { - type = types.nullOr (types.enum [ "storage" "transaction" "stateless" ]); + class = lib.mkOption { + type = lib.types.nullOr (lib.types.enum [ "storage" "transaction" "stateless" ]); default = null; description = "Process class"; }; - restartDelay = mkOption { - type = types.int; + restartDelay = lib.mkOption { + type = lib.types.int; default = 10; description = "Number of seconds to wait before restarting servers."; }; - logSize = mkOption { - type = types.str; + logSize = lib.mkOption { + type = lib.types.str; default = "10MiB"; description = '' Roll over to a new log file after the current log file @@ -148,8 +145,8 @@ in ''; }; - maxLogSize = mkOption { - type = types.str; + maxLogSize = lib.mkOption { + type = lib.types.str; default = "100MiB"; description = '' Delete the oldest log file when the total size of all log @@ -158,20 +155,20 @@ in ''; }; - serverProcesses = mkOption { - type = types.int; + serverProcesses = lib.mkOption { + type = lib.types.int; default = 1; description = "Number of fdbserver processes to run."; }; - backupProcesses = mkOption { - type = types.int; + backupProcesses = lib.mkOption { + type = lib.types.int; default = 1; description = "Number of backup_agent processes to run for snapshots."; }; - memory = mkOption { - type = types.str; + memory = lib.mkOption { + type = lib.types.str; default = "8GiB"; description = '' Maximum memory used by the process. The default value is @@ -192,8 +189,8 @@ in ''; }; - storageMemory = mkOption { - type = types.str; + storageMemory = lib.mkOption { + type = lib.types.str; default = "1GiB"; description = '' Maximum memory used for data storage. The default value is @@ -208,29 +205,29 @@ in ''; }; - tls = mkOption { + tls = lib.mkOption { default = null; description = '' FoundationDB Transport Security Layer (TLS) settings. ''; - type = types.nullOr (types.submodule ({ + type = lib.types.nullOr (lib.types.submodule ({ options = { - certificate = mkOption { - type = types.str; + certificate = lib.mkOption { + type = lib.types.str; description = '' Path to the TLS certificate file. This certificate will be offered to, and may be verified by, clients. ''; }; - key = mkOption { - type = types.str; + key = lib.mkOption { + type = lib.types.str; description = "Private key file for the certificate."; }; - allowedPeers = mkOption { - type = types.str; + allowedPeers = lib.mkOption { + type = lib.types.str; default = "Check.Valid=1,Check.Unexpired=1"; description = '' "Peer verification string". This may be used to adjust which TLS @@ -245,7 +242,7 @@ in })); }; - locality = mkOption { + locality = lib.mkOption { default = { machineId = null; zoneId = null; @@ -257,11 +254,11 @@ in FoundationDB locality settings. ''; - type = types.submodule ({ + type = lib.types.submodule ({ options = { - machineId = mkOption { + machineId = lib.mkOption { default = null; - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; description = '' Machine identifier key. All processes on a machine should share a unique id. By default, processes on a machine determine a unique id to share. @@ -269,9 +266,9 @@ in ''; }; - zoneId = mkOption { + zoneId = lib.mkOption { default = null; - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; description = '' Zone identifier key. Processes that share a zone id are considered non-unique for the purposes of data replication. @@ -279,9 +276,9 @@ in ''; }; - datacenterId = mkOption { + datacenterId = lib.mkOption { default = null; - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; description = '' Data center identifier key. All processes physically located in a data center should share the id. If you are depending on data @@ -289,9 +286,9 @@ in ''; }; - dataHall = mkOption { + dataHall = lib.mkOption { default = null; - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; description = '' Data hall identifier key. All processes physically located in a data hall should share the id. If you are depending on data @@ -302,9 +299,9 @@ in }); }; - extraReadWritePaths = mkOption { + extraReadWritePaths = lib.mkOption { default = [ ]; - type = types.listOf types.path; + type = lib.types.listOf lib.types.path; description = '' An extra set of filesystem paths that FoundationDB can read to and write from. By default, FoundationDB runs under a heavily @@ -316,20 +313,20 @@ in ''; }; - pidfile = mkOption { - type = types.path; + pidfile = lib.mkOption { + type = lib.types.path; default = "/run/foundationdb.pid"; description = "Path to pidfile for fdbmonitor."; }; - traceFormat = mkOption { - type = types.enum [ "xml" "json" ]; + traceFormat = lib.mkOption { + type = lib.types.enum [ "xml" "json" ]; default = "xml"; description = "Trace logging format."; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { assertions = [ { assertion = lib.versionOlder cfg.package.version "6.1" -> cfg.traceFormat == "xml"; message = '' @@ -341,7 +338,7 @@ in environment.systemPackages = [ pkg ]; - users.users = optionalAttrs (cfg.user == "foundationdb") { + users.users = lib.optionalAttrs (cfg.user == "foundationdb") { foundationdb = { description = "FoundationDB User"; uid = config.ids.uids.foundationdb; @@ -349,11 +346,11 @@ in }; }; - users.groups = optionalAttrs (cfg.group == "foundationdb") { + users.groups = lib.optionalAttrs (cfg.group == "foundationdb") { foundationdb.gid = config.ids.gids.foundationdb; }; - networking.firewall.allowedTCPPortRanges = mkIf cfg.openFirewall + networking.firewall.allowedTCPPortRanges = lib.mkIf cfg.openFirewall [ { from = cfg.listenPortStart; to = (cfg.listenPortStart + cfg.serverProcesses) - 1; } From 300317e52bcf752a314c9c4b4fc3ccd76e67f2ce Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Aug 2024 22:23:24 +0000 Subject: [PATCH 013/197] yandex-cloud: 0.131.1 -> 0.132.1 --- pkgs/by-name/ya/yandex-cloud/sources.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/ya/yandex-cloud/sources.json b/pkgs/by-name/ya/yandex-cloud/sources.json index 63abafcc4e9e..8cc8c92fb364 100644 --- a/pkgs/by-name/ya/yandex-cloud/sources.json +++ b/pkgs/by-name/ya/yandex-cloud/sources.json @@ -1,25 +1,25 @@ { - "version": "0.131.1", + "version": "0.132.1", "binaries": { "aarch64-darwin": { - "url": "https://storage.yandexcloud.net/yandexcloud-yc/release/0.131.1/darwin/arm64/yc", - "hash": "sha256-LwvaJcBe33tqMuFBkjQ2D6CYGjgXAHvgvvGIAcJ1UEw=" + "url": "https://storage.yandexcloud.net/yandexcloud-yc/release/0.132.1/darwin/arm64/yc", + "hash": "sha256-d8Fw17Ld4/ifJ6hHTX2kcc8ju/5eXcUcRjyey16lEoo=" }, "aarch64-linux": { - "url": "https://storage.yandexcloud.net/yandexcloud-yc/release/0.131.1/linux/arm64/yc", - "hash": "sha256-c9HrW0K73c+Jo7FccaqO3qWi+Oxd6Zk0ek5fpth7u04=" + "url": "https://storage.yandexcloud.net/yandexcloud-yc/release/0.132.1/linux/arm64/yc", + "hash": "sha256-VvfJGsNKd5uBDDZ8bWab7ZLaIKj7lG/5Kwvc/60MTuA=" }, "i686-linux": { - "url": "https://storage.yandexcloud.net/yandexcloud-yc/release/0.131.1/linux/386/yc", - "hash": "sha256-Gff8Lu487NZueBlcTsLyo8N0WBkhh9p6ESFJMgwBXiw=" + "url": "https://storage.yandexcloud.net/yandexcloud-yc/release/0.132.1/linux/386/yc", + "hash": "sha256-99rqys2wqY4B3S5XT2r75WyiffO09QoFBaKbbvNRSr8=" }, "x86_64-darwin": { - "url": "https://storage.yandexcloud.net/yandexcloud-yc/release/0.131.1/darwin/amd64/yc", - "hash": "sha256-39r/kXctRam2UHYI5/x+8+zTE9iSfrI8fi+mo1pKwvE=" + "url": "https://storage.yandexcloud.net/yandexcloud-yc/release/0.132.1/darwin/amd64/yc", + "hash": "sha256-ATMGC4RAHXJV13u4xNZWJboplrec6SSvbQwjTz1cBgI=" }, "x86_64-linux": { - "url": "https://storage.yandexcloud.net/yandexcloud-yc/release/0.131.1/linux/amd64/yc", - "hash": "sha256-ZI5iZlXsDJXaHJFIr/cpx3OSOGqlsE3JQNy2HHK7mV4=" + "url": "https://storage.yandexcloud.net/yandexcloud-yc/release/0.132.1/linux/amd64/yc", + "hash": "sha256-gI4ACuKEH7n3BP+v8I/8B7nyYFZch6LGuywr0qIxlE8=" } } } From 0717502d600bea1fe6b1ead202e5c67797bbdacb Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:07 +0200 Subject: [PATCH 014/197] nixos/services.athens: remove `with lib;` --- nixos/modules/services/development/athens.nix | 409 +++++++++--------- 1 file changed, 203 insertions(+), 206 deletions(-) diff --git a/nixos/modules/services/development/athens.nix b/nixos/modules/services/development/athens.nix index 55ec065f1689..235d234609c0 100644 --- a/nixos/modules/services/development/athens.nix +++ b/nixos/modules/services/development/athens.nix @@ -1,11 +1,8 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.athens; - athensConfig = flip recursiveUpdate cfg.extraConfig ( + athensConfig = lib.flip lib.recursiveUpdate cfg.extraConfig ( { GoBinary = "${cfg.goBinary}/bin/go"; GoEnv = cfg.goEnv; @@ -157,20 +154,20 @@ in }; options.services.athens = { - enable = mkEnableOption "Go module datastore and proxy"; + enable = lib.mkEnableOption "Go module datastore and proxy"; - package = mkOption { + package = lib.mkOption { default = pkgs.athens; - defaultText = literalExpression "pkgs.athens"; + defaultText = lib.literalExpression "pkgs.athens"; example = "pkgs.athens"; description = "Which athens derivation to use"; - type = types.package; + type = lib.types.package; }; - goBinary = mkOption { - type = types.package; + goBinary = lib.mkOption { + type = lib.types.package; default = pkgs.go; - defaultText = literalExpression "pkgs.go"; + defaultText = lib.literalExpression "pkgs.go"; example = "pkgs.go_1_21"; description = '' The Go package used by Athens at runtime. @@ -181,15 +178,15 @@ in ''; }; - goEnv = mkOption { - type = types.enum [ "development" "production" ]; + goEnv = lib.mkOption { + type = lib.types.enum [ "development" "production" ]; description = "Specifies the type of environment to run. One of 'development' or 'production'."; default = "development"; example = "production"; }; - goBinaryEnvVars = mkOption { - type = types.attrs; + goBinaryEnvVars = lib.mkOption { + type = lib.types.attrs; description = "Environment variables to pass to the Go binary."; example = '' { "GOPROXY" = "direct", "GODEBUG" = "true" } @@ -197,15 +194,15 @@ in default = { }; }; - goGetWorkers = mkOption { - type = types.int; + goGetWorkers = lib.mkOption { + type = lib.types.int; description = "Number of workers concurrently downloading modules."; default = 10; example = 32; }; - goGetDir = mkOption { - type = types.nullOr types.path; + goGetDir = lib.mkOption { + type = lib.types.nullOr lib.types.path; description = '' Temporary directory that Athens will use to fetch modules from VCS prior to persisting @@ -218,14 +215,14 @@ in example = "/tmp/athens"; }; - protocolWorkers = mkOption { - type = types.int; + protocolWorkers = lib.mkOption { + type = lib.types.int; description = "Number of workers concurrently serving protocol paths."; default = 30; }; - logLevel = mkOption { - type = types.nullOr (types.enum [ "panic" "fatal" "error" "warning" "info" "debug" "trace" ]); + logLevel = lib.mkOption { + type = lib.types.nullOr (lib.types.enum [ "panic" "fatal" "error" "warning" "info" "debug" "trace" ]); description = '' Log level for Athens. Supports all logrus log levels (https://github.com/Sirupsen/logrus#level-logging)". @@ -234,8 +231,8 @@ in example = "debug"; }; - cloudRuntime = mkOption { - type = types.enum [ "GCP" "none" ]; + cloudRuntime = lib.mkOption { + type = lib.types.enum [ "GCP" "none" ]; description = '' Specifies the Cloud Provider on which the Proxy/registry is running. ''; @@ -243,24 +240,24 @@ in example = "GCP"; }; - enablePprof = mkOption { - type = types.bool; + enablePprof = lib.mkOption { + type = lib.types.bool; description = "Enable pprof endpoints."; default = false; }; - pprofPort = mkOption { - type = types.port; + pprofPort = lib.mkOption { + type = lib.types.port; description = "Port number for pprof endpoints."; default = 3301; example = 443; }; - filterFile = mkOption { - type = types.nullOr types.path; + filterFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; description = ''Filename for the include exclude filter.''; default = null; - example = literalExpression '' + example = lib.literalExpression '' pkgs.writeText "filterFile" ''' - github.com/azure + github.com/azure/azure-sdk-for-go @@ -269,42 +266,42 @@ in ''; }; - robotsFile = mkOption { - type = types.nullOr types.path; + robotsFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; description = ''Provides /robots.txt for net crawlers.''; default = null; - example = literalExpression ''pkgs.writeText "robots.txt" "# my custom robots.txt ..."''; + example = lib.literalExpression ''pkgs.writeText "robots.txt" "# my custom robots.txt ..."''; }; - timeout = mkOption { - type = types.int; + timeout = lib.mkOption { + type = lib.types.int; description = "Timeout for external network calls in seconds."; default = 300; example = 3; }; - storageType = mkOption { - type = types.enum [ "memory" "disk" "mongo" "gcp" "minio" "s3" "azureblob" "external" ]; + storageType = lib.mkOption { + type = lib.types.enum [ "memory" "disk" "mongo" "gcp" "minio" "s3" "azureblob" "external" ]; description = "Specifies the type of storage backend to use."; default = "disk"; }; - tlsCertFile = mkOption { - type = types.nullOr types.path; + tlsCertFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; description = "Path to the TLS certificate file."; default = null; example = "/etc/ssl/certs/athens.crt"; }; - tlsKeyFile = mkOption { - type = types.nullOr types.path; + tlsKeyFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; description = "Path to the TLS key file."; default = null; example = "/etc/ssl/certs/athens.key"; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 3000; description = '' Port number Athens listens on. @@ -312,8 +309,8 @@ in example = 443; }; - unixSocket = mkOption { - type = types.nullOr types.path; + unixSocket = lib.mkOption { + type = lib.types.nullOr lib.types.path; description = '' Path to the unix socket file. If set, Athens will listen on the unix socket instead of TCP socket. @@ -322,8 +319,8 @@ in example = "/run/athens.sock"; }; - globalEndpoint = mkOption { - type = types.str; + globalEndpoint = lib.mkOption { + type = lib.types.str; description = '' Endpoint for a package registry in case of a proxy cache miss. ''; @@ -331,8 +328,8 @@ in example = "http://upstream-athens.example.com:3000"; }; - basicAuthUser = mkOption { - type = types.nullOr types.str; + basicAuthUser = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = '' Username for basic auth. ''; @@ -340,8 +337,8 @@ in example = "user"; }; - basicAuthPass = mkOption { - type = types.nullOr types.str; + basicAuthPass = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = '' Password for basic auth. Warning: this is stored in plain text in the config file. ''; @@ -349,16 +346,16 @@ in example = "swordfish"; }; - forceSSL = mkOption { - type = types.bool; + forceSSL = lib.mkOption { + type = lib.types.bool; description = '' Force SSL redirects for incoming requests. ''; default = false; }; - validatorHook = mkOption { - type = types.nullOr types.str; + validatorHook = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = '' Endpoint to validate modules against. @@ -368,8 +365,8 @@ in example = "https://validation.example.com"; }; - pathPrefix = mkOption { - type = types.nullOr types.str; + pathPrefix = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = '' Sets basepath for all routes. ''; @@ -377,8 +374,8 @@ in example = "/athens"; }; - netrcPath = mkOption { - type = types.nullOr types.path; + netrcPath = lib.mkOption { + type = lib.types.nullOr lib.types.path; description = '' Path to the .netrc file. ''; @@ -386,8 +383,8 @@ in example = "/home/user/.netrc"; }; - githubToken = mkOption { - type = types.nullOr types.str; + githubToken = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = '' Creates .netrc file with the given token to be used for GitHub. Warning: this is stored in plain text in the config file. @@ -396,8 +393,8 @@ in example = "ghp_1234567890"; }; - hgrcPath = mkOption { - type = types.nullOr types.path; + hgrcPath = lib.mkOption { + type = lib.types.nullOr lib.types.path; description = '' Path to the .hgrc file. ''; @@ -405,16 +402,16 @@ in example = "/home/user/.hgrc"; }; - traceExporter = mkOption { - type = types.nullOr (types.enum [ "jaeger" "datadog" ]); + traceExporter = lib.mkOption { + type = lib.types.nullOr (lib.types.enum [ "jaeger" "datadog" ]); description = '' Trace exporter to use. ''; default = null; }; - traceExporterURL = mkOption { - type = types.nullOr types.str; + traceExporterURL = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = '' URL endpoint that traces will be sent to. ''; @@ -422,14 +419,14 @@ in example = "http://localhost:14268"; }; - statsExporter = mkOption { - type = types.nullOr (types.enum [ "prometheus" ]); + statsExporter = lib.mkOption { + type = lib.types.nullOr (lib.types.enum [ "prometheus" ]); description = "Stats exporter to use."; default = null; }; - sumDBs = mkOption { - type = types.listOf types.str; + sumDBs = lib.mkOption { + type = lib.types.listOf lib.types.str; description = '' List of fully qualified URLs that Athens will proxy that the go command can use a checksum verifier. @@ -437,8 +434,8 @@ in default = [ "https://sum.golang.org" ]; }; - noSumPatterns = mkOption { - type = types.listOf types.str; + noSumPatterns = lib.mkOption { + type = lib.types.listOf lib.types.str; description = '' List of patterns that Athens sum db proxy will return a 403 for. ''; @@ -446,8 +443,8 @@ in example = [ "github.com/mycompany/*" ]; }; - downloadMode = mkOption { - type = types.oneOf [ (types.enum [ "sync" "async" "redirect" "async_redirect" "none" ]) (types.strMatching "^file:.*$|^custom:.*$") ]; + downloadMode = lib.mkOption { + type = lib.types.oneOf [ (lib.types.enum [ "sync" "async" "redirect" "async_redirect" "none" ]) (lib.types.strMatching "^file:.*$|^custom:.*$") ]; description = '' Defines how Athens behaves when a module@version is not found in storage. There are 7 options: @@ -470,8 +467,8 @@ in default = "async_redirect"; }; - networkMode = mkOption { - type = types.enum [ "strict" "offline" "fallback" ]; + networkMode = lib.mkOption { + type = lib.types.enum [ "strict" "offline" "fallback" ]; description = '' Configures how Athens will return the results of the /list endpoint as it can be assembled from both its own @@ -490,30 +487,30 @@ in default = "strict"; }; - downloadURL = mkOption { - type = types.str; + downloadURL = lib.mkOption { + type = lib.types.str; description = "URL used if DownloadMode is set to redirect."; default = "https://proxy.golang.org"; }; - singleFlightType = mkOption { - type = types.enum [ "memory" "etcd" "redis" "redis-sentinel" "gcp" "azureblob" ]; + singleFlightType = lib.mkOption { + type = lib.types.enum [ "memory" "etcd" "redis" "redis-sentinel" "gcp" "azureblob" ]; description = '' Determines what mechanism Athens uses to manage concurrency flowing into the Athens backend. ''; default = "memory"; }; - indexType = mkOption { - type = types.enum [ "none" "memory" "mysql" "postgres" ]; + indexType = lib.mkOption { + type = lib.types.enum [ "none" "memory" "mysql" "postgres" ]; description = '' Type of index backend Athens will use. ''; default = "none"; }; - shutdownTimeout = mkOption { - type = types.int; + shutdownTimeout = lib.mkOption { + type = lib.types.int; description = '' Number of seconds to wait for the server to shutdown gracefully. ''; @@ -523,42 +520,42 @@ in singleFlight = { etcd = { - endpoints = mkOption { - type = types.listOf types.str; + endpoints = lib.mkOption { + type = lib.types.listOf lib.types.str; description = "URLs that determine all distributed etcd servers."; default = [ ]; example = [ "localhost:2379" ]; }; }; redis = { - endpoint = mkOption { - type = types.str; + endpoint = lib.mkOption { + type = lib.types.str; description = "URL of the redis server."; default = ""; example = "localhost:6379"; }; - password = mkOption { - type = types.str; + password = lib.mkOption { + type = lib.types.str; description = "Password for the redis server. Warning: this is stored in plain text in the config file."; default = ""; example = "swordfish"; }; lockConfig = { - ttl = mkOption { - type = types.int; + ttl = lib.mkOption { + type = lib.types.int; description = "TTL for the lock in seconds."; default = 900; example = 1; }; - timeout = mkOption { - type = types.int; + timeout = lib.mkOption { + type = lib.types.int; description = "Timeout for the lock in seconds."; default = 15; example = 1; }; - maxRetries = mkOption { - type = types.int; + maxRetries = lib.mkOption { + type = lib.types.int; description = "Maximum number of retries for the lock."; default = 10; example = 1; @@ -567,40 +564,40 @@ in }; redisSentinel = { - endpoints = mkOption { - type = types.listOf types.str; + endpoints = lib.mkOption { + type = lib.types.listOf lib.types.str; description = "URLs that determine all distributed redis servers."; default = [ ]; example = [ "localhost:26379" ]; }; - masterName = mkOption { - type = types.str; + masterName = lib.mkOption { + type = lib.types.str; description = "Name of the sentinel master server."; default = ""; example = "redis-1"; }; - sentinelPassword = mkOption { - type = types.str; + sentinelPassword = lib.mkOption { + type = lib.types.str; description = "Password for the sentinel server. Warning: this is stored in plain text in the config file."; default = ""; example = "swordfish"; }; lockConfig = { - ttl = mkOption { - type = types.int; + ttl = lib.mkOption { + type = lib.types.int; description = "TTL for the lock in seconds."; default = 900; example = 1; }; - timeout = mkOption { - type = types.int; + timeout = lib.mkOption { + type = lib.types.int; description = "Timeout for the lock in seconds."; default = 15; example = 1; }; - maxRetries = mkOption { - type = types.int; + maxRetries = lib.mkOption { + type = lib.types.int; description = "Maximum number of retries for the lock."; default = 10; example = 1; @@ -611,8 +608,8 @@ in storage = { cdn = { - endpoint = mkOption { - type = types.nullOr types.str; + endpoint = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "hostname of the CDN server."; example = "cdn.example.com"; default = null; @@ -620,65 +617,65 @@ in }; disk = { - rootPath = mkOption { - type = types.nullOr types.path; + rootPath = lib.mkOption { + type = lib.types.nullOr lib.types.path; description = "Athens disk root folder."; default = "/var/lib/athens"; }; }; gcp = { - projectID = mkOption { - type = types.nullOr types.str; + projectID = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "GCP project ID."; example = "my-project"; default = null; }; - bucket = mkOption { - type = types.nullOr types.str; + bucket = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "GCP backend storage bucket."; example = "my-bucket"; default = null; }; - jsonKey = mkOption { - type = types.nullOr types.str; + jsonKey = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Base64 encoded GCP service account key. Warning: this is stored in plain text in the config file."; default = null; }; }; minio = { - endpoint = mkOption { - type = types.nullOr types.str; + endpoint = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Endpoint of the minio storage backend."; example = "minio.example.com:9001"; default = null; }; - key = mkOption { - type = types.nullOr types.str; + key = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Access key id for the minio storage backend."; example = "minio"; default = null; }; - secret = mkOption { - type = types.nullOr types.str; + secret = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Secret key for the minio storage backend. Warning: this is stored in plain text in the config file."; example = "minio123"; default = null; }; - enableSSL = mkOption { - type = types.bool; + enableSSL = lib.mkOption { + type = lib.types.bool; description = "Enable SSL for the minio storage backend."; default = false; }; - bucket = mkOption { - type = types.nullOr types.str; + bucket = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Bucket name for the minio storage backend."; example = "gomods"; default = null; }; - region = mkOption { - type = types.nullOr types.str; + region = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Region for the minio storage backend."; example = "us-east-1"; default = null; @@ -686,108 +683,108 @@ in }; mongo = { - url = mkOption { - type = types.nullOr types.str; + url = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "URL of the mongo database."; example = "mongodb://localhost:27017"; default = null; }; - defaultDBName = mkOption { - type = types.nullOr types.str; + defaultDBName = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Name of the mongo database."; example = "athens"; default = null; }; - certPath = mkOption { - type = types.nullOr types.path; + certPath = lib.mkOption { + type = lib.types.nullOr lib.types.path; description = "Path to the certificate file for the mongo database."; example = "/etc/ssl/mongo.pem"; default = null; }; - insecure = mkOption { - type = types.bool; + insecure = lib.mkOption { + type = lib.types.bool; description = "Allow insecure connections to the mongo database."; default = false; }; }; s3 = { - region = mkOption { - type = types.nullOr types.str; + region = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Region of the S3 storage backend."; example = "eu-west-3"; default = null; }; - key = mkOption { - type = types.nullOr types.str; + key = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Access key id for the S3 storage backend."; example = "minio"; default = null; }; - secret = mkOption { - type = types.str; + secret = lib.mkOption { + type = lib.types.str; description = "Secret key for the S3 storage backend. Warning: this is stored in plain text in the config file."; default = ""; }; - token = mkOption { - type = types.nullOr types.str; + token = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Token for the S3 storage backend. Warning: this is stored in plain text in the config file."; default = null; }; - bucket = mkOption { - type = types.nullOr types.str; + bucket = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Bucket name for the S3 storage backend."; example = "gomods"; default = null; }; - forcePathStyle = mkOption { - type = types.bool; + forcePathStyle = lib.mkOption { + type = lib.types.bool; description = "Force path style for the S3 storage backend."; default = false; }; - useDefaultConfiguration = mkOption { - type = types.bool; + useDefaultConfiguration = lib.mkOption { + type = lib.types.bool; description = "Use default configuration for the S3 storage backend."; default = false; }; - credentialsEndpoint = mkOption { - type = types.str; + credentialsEndpoint = lib.mkOption { + type = lib.types.str; description = "Credentials endpoint for the S3 storage backend."; default = ""; }; - awsContainerCredentialsRelativeURI = mkOption { - type = types.nullOr types.str; + awsContainerCredentialsRelativeURI = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Container relative url (used by fargate)."; default = null; }; - endpoint = mkOption { - type = types.nullOr types.str; + endpoint = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Endpoint for the S3 storage backend."; default = null; }; }; azureblob = { - accountName = mkOption { - type = types.nullOr types.str; + accountName = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Account name for the Azure Blob storage backend."; default = null; }; - accountKey = mkOption { - type = types.nullOr types.str; + accountKey = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Account key for the Azure Blob storage backend. Warning: this is stored in plain text in the config file."; default = null; }; - containerName = mkOption { - type = types.nullOr types.str; + containerName = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Container name for the Azure Blob storage backend."; default = null; }; }; external = { - url = mkOption { - type = types.nullOr types.str; + url = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "URL of the backend storage layer."; example = "https://athens.example.com"; default = null; @@ -797,44 +794,44 @@ in index = { mysql = { - protocol = mkOption { - type = types.str; + protocol = lib.mkOption { + type = lib.types.str; description = "Protocol for the MySQL database."; default = "tcp"; }; - host = mkOption { - type = types.str; + host = lib.mkOption { + type = lib.types.str; description = "Host for the MySQL database."; default = "localhost"; }; - port = mkOption { - type = types.int; + port = lib.mkOption { + type = lib.types.int; description = "Port for the MySQL database."; default = 3306; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; description = "User for the MySQL database."; default = "root"; }; - password = mkOption { - type = types.nullOr types.str; + password = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Password for the MySQL database. Warning: this is stored in plain text in the config file."; default = null; }; - database = mkOption { - type = types.str; + database = lib.mkOption { + type = lib.types.str; description = "Database name for the MySQL database."; default = "athens"; }; params = { - parseTime = mkOption { - type = types.nullOr types.str; + parseTime = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Parse time for the MySQL database."; default = "true"; }; - timeout = mkOption { - type = types.nullOr types.str; + timeout = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Timeout for the MySQL database."; default = "30s"; }; @@ -842,39 +839,39 @@ in }; postgres = { - host = mkOption { - type = types.str; + host = lib.mkOption { + type = lib.types.str; description = "Host for the Postgres database."; default = "localhost"; }; - port = mkOption { - type = types.int; + port = lib.mkOption { + type = lib.types.int; description = "Port for the Postgres database."; default = 5432; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; description = "User for the Postgres database."; default = "postgres"; }; - password = mkOption { - type = types.nullOr types.str; + password = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Password for the Postgres database. Warning: this is stored in plain text in the config file."; default = null; }; - database = mkOption { - type = types.str; + database = lib.mkOption { + type = lib.types.str; description = "Database name for the Postgres database."; default = "athens"; }; params = { - connect_timeout = mkOption { - type = types.nullOr types.str; + connect_timeout = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "Connect timeout for the Postgres database."; default = "30s"; }; - sslmode = mkOption { - type = types.nullOr types.str; + sslmode = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = "SSL mode for the Postgres database."; default = "disable"; }; @@ -882,8 +879,8 @@ in }; }; - extraConfig = mkOption { - type = types.attrs; + extraConfig = lib.mkOption { + type = lib.types.attrs; description = '' Extra configuration options for the athens config file. ''; @@ -891,7 +888,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.athens = { description = "Athens Go module proxy"; documentation = [ "https://docs.gomods.io" ]; @@ -918,8 +915,8 @@ in ProtectHome = "read-only"; ProtectSystem = "full"; - ReadWritePaths = mkIf (cfg.storage.disk.rootPath != null && (! hasPrefix "/var/lib/" cfg.storage.disk.rootPath)) [ cfg.storage.disk.rootPath ]; - StateDirectory = mkIf (hasPrefix "/var/lib/" cfg.storage.disk.rootPath) [ (removePrefix "/var/lib/" cfg.storage.disk.rootPath) ]; + ReadWritePaths = lib.mkIf (cfg.storage.disk.rootPath != null && (! lib.hasPrefix "/var/lib/" cfg.storage.disk.rootPath)) [ cfg.storage.disk.rootPath ]; + StateDirectory = lib.mkIf (lib.hasPrefix "/var/lib/" cfg.storage.disk.rootPath) [ (lib.removePrefix "/var/lib/" cfg.storage.disk.rootPath) ]; CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; @@ -928,8 +925,8 @@ in }; networking.firewall = { - allowedTCPPorts = optionals (cfg.unixSocket == null) [ cfg.port ] - ++ optionals cfg.enablePprof [ cfg.pprofPort ]; + allowedTCPPorts = lib.optionals (cfg.unixSocket == null) [ cfg.port ] + ++ lib.optionals cfg.enablePprof [ cfg.pprofPort ]; }; }; From 09ac87ffd1349bf9cdcf5933acbf39efe2a30db9 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:12 +0200 Subject: [PATCH 015/197] nixos/services.factorio: remove `with lib;` --- nixos/modules/services/games/factorio.nix | 119 +++++++++++----------- 1 file changed, 58 insertions(+), 61 deletions(-) diff --git a/nixos/modules/services/games/factorio.nix b/nixos/modules/services/games/factorio.nix index 3dce60163a0e..c1d9731b842d 100644 --- a/nixos/modules/services/games/factorio.nix +++ b/nixos/modules/services/games/factorio.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.factorio; name = "Factorio"; @@ -37,7 +34,7 @@ let autosave_only_on_server = true; non_blocking_saving = cfg.nonBlockingSaving; } // cfg.extraSettings; - serverSettingsString = builtins.toJSON (filterAttrsRecursive (n: v: v != null) serverSettings); + serverSettingsString = builtins.toJSON (lib.filterAttrsRecursive (n: v: v != null) serverSettings); serverSettingsFile = pkgs.writeText "server-settings.json" serverSettingsString; serverAdminsFile = pkgs.writeText "server-adminlist.json" (builtins.toJSON cfg.admins); modDir = pkgs.factorio-utils.mkModDirDrv cfg.mods cfg.mods-dat; @@ -45,25 +42,25 @@ in { options = { services.factorio = { - enable = mkEnableOption name; - port = mkOption { - type = types.port; + enable = lib.mkEnableOption name; + port = lib.mkOption { + type = lib.types.port; default = 34197; description = '' The port to which the service should bind. ''; }; - bind = mkOption { - type = types.str; + bind = lib.mkOption { + type = lib.types.str; default = "0.0.0.0"; description = '' The address to which the service should bind. ''; }; - admins = mkOption { - type = types.listOf types.str; + admins = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; example = [ "username" ]; description = '' @@ -71,15 +68,15 @@ in ''; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to automatically open the specified UDP port in the firewall. ''; }; - saveName = mkOption { - type = types.str; + saveName = lib.mkOption { + type = lib.types.str; default = "default"; description = '' The name of the savegame that will be used by the server. @@ -88,8 +85,8 @@ in a new map with default settings will be generated before starting the service. ''; }; - loadLatestSave = mkOption { - type = types.bool; + loadLatestSave = lib.mkOption { + type = lib.types.bool; default = false; description = '' Load the latest savegame on startup. This overrides saveName, in that the latest @@ -104,10 +101,10 @@ in # TODO XXX The server tries to copy a newly created config file over the old one # on shutdown, but fails, because it's in the nix store. When is this needed? # Can an admin set options in-game and expect to have them persisted? - configFile = mkOption { - type = types.path; + configFile = lib.mkOption { + type = lib.types.path; default = configFile; - defaultText = literalExpression "configFile"; + defaultText = lib.literalExpression "configFile"; description = '' The server's configuration file. @@ -116,8 +113,8 @@ in customizations. ''; }; - extraSettingsFile = mkOption { - type = types.nullOr types.path; + extraSettingsFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' File, which is dynamically applied to server-settings.json before @@ -133,8 +130,8 @@ in ``` ''; }; - stateDirName = mkOption { - type = types.str; + stateDirName = lib.mkOption { + type = lib.types.str; default = "factorio"; description = '' Name of the directory under /var/lib holding the server's data. @@ -142,8 +139,8 @@ in The configuration and map will be stored here. ''; }; - mods = mkOption { - type = types.listOf types.package; + mods = lib.mkOption { + type = lib.types.listOf lib.types.package; default = []; description = '' Mods the server should install and activate. @@ -154,8 +151,8 @@ in derivations via nixos-channel. Until then, this is for experts only. ''; }; - mods-dat = mkOption { - type = types.nullOr types.path; + mods-dat = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' Mods settings can be changed by specifying a dat file, in the [mod @@ -163,44 +160,44 @@ in format](https://wiki.factorio.com/Mod_settings_file_format). ''; }; - game-name = mkOption { - type = types.nullOr types.str; + game-name = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = "Factorio Game"; description = '' Name of the game as it will appear in the game listing. ''; }; - description = mkOption { - type = types.nullOr types.str; + description = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = ""; description = '' Description of the game that will appear in the listing. ''; }; - extraSettings = mkOption { - type = types.attrs; + extraSettings = lib.mkOption { + type = lib.types.attrs; default = {}; example = { admins = [ "username" ];}; description = '' Extra game configuration that will go into server-settings.json ''; }; - public = mkOption { - type = types.bool; + public = lib.mkOption { + type = lib.types.bool; default = false; description = '' Game will be published on the official Factorio matching server. ''; }; - lan = mkOption { - type = types.bool; + lan = lib.mkOption { + type = lib.types.bool; default = false; description = '' Game will be broadcast on LAN. ''; }; - username = mkOption { - type = types.nullOr types.str; + username = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Your factorio.com login credentials. Required for games with visibility public. @@ -208,11 +205,11 @@ in This option is insecure. Use extraSettingsFile instead. ''; }; - package = mkPackageOption pkgs "factorio-headless" { + package = lib.mkPackageOption pkgs "factorio-headless" { example = "factorio-headless-experimental"; }; - password = mkOption { - type = types.nullOr types.str; + password = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Your factorio.com login credentials. Required for games with visibility public. @@ -220,15 +217,15 @@ in This option is insecure. Use extraSettingsFile instead. ''; }; - token = mkOption { - type = types.nullOr types.str; + token = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Authentication token. May be used instead of 'password' above. ''; }; - game-password = mkOption { - type = types.nullOr types.str; + game-password = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Game password. @@ -236,23 +233,23 @@ in This option is insecure. Use extraSettingsFile instead. ''; }; - requireUserVerification = mkOption { - type = types.bool; + requireUserVerification = lib.mkOption { + type = lib.types.bool; default = true; description = '' When set to true, the server will only allow clients that have a valid factorio.com account. ''; }; - autosave-interval = mkOption { - type = types.nullOr types.int; + autosave-interval = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; example = 10; description = '' Autosave interval in minutes. ''; }; - nonBlockingSaving = mkOption { - type = types.bool; + nonBlockingSaving = lib.mkOption { + type = lib.types.bool; default = false; description = '' Highly experimental feature, enable only at your own risk of losing your saves. @@ -263,7 +260,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.factorio = { description = "Factorio headless server"; wantedBy = [ "multi-user.target" ]; @@ -276,9 +273,9 @@ in "${cfg.package}/bin/factorio" "--config=${cfg.configFile}" "--create=${mkSavePath cfg.saveName}" - (optionalString (cfg.mods != []) "--mod-directory=${modDir}") + (lib.optionalString (cfg.mods != []) "--mod-directory=${modDir}") ]) - + (optionalString (cfg.extraSettingsFile != null) ("\necho ${lib.strings.escapeShellArg serverSettingsString}" + + (lib.optionalString (cfg.extraSettingsFile != null) ("\necho ${lib.strings.lib.escapeShellArg serverSettingsString}" + " \"$(cat ${cfg.extraSettingsFile})\" | ${lib.getExe pkgs.jq} -s add" + " > ${stateDir}/server-settings.json")); @@ -293,15 +290,15 @@ in "--config=${cfg.configFile}" "--port=${toString cfg.port}" "--bind=${cfg.bind}" - (optionalString (!cfg.loadLatestSave) "--start-server=${mkSavePath cfg.saveName}") + (lib.optionalString (!cfg.loadLatestSave) "--start-server=${mkSavePath cfg.saveName}") "--server-settings=${ if (cfg.extraSettingsFile != null) then "${stateDir}/server-settings.json" else serverSettingsFile }" - (optionalString cfg.loadLatestSave "--start-server-load-latest") - (optionalString (cfg.mods != []) "--mod-directory=${modDir}") - (optionalString (cfg.admins != []) "--server-adminlist=${serverAdminsFile}") + (lib.optionalString cfg.loadLatestSave "--start-server-load-latest") + (lib.optionalString (cfg.mods != []) "--mod-directory=${modDir}") + (lib.optionalString (cfg.admins != []) "--server-adminlist=${serverAdminsFile}") ]; # Sandboxing @@ -320,6 +317,6 @@ in }; }; - networking.firewall.allowedUDPPorts = optional cfg.openFirewall cfg.port; + networking.firewall.allowedUDPPorts = lib.optional cfg.openFirewall cfg.port; }; } From 40d905935e0d2b5ff9515c4426a2931b7099a15b Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:13 +0200 Subject: [PATCH 016/197] nixos/services.teeworlds: remove `with lib;` --- nixos/modules/services/games/teeworlds.nix | 143 ++++++++++----------- 1 file changed, 70 insertions(+), 73 deletions(-) diff --git a/nixos/modules/services/games/teeworlds.nix b/nixos/modules/services/games/teeworlds.nix index b9ed49937a7f..b21fe008896a 100644 --- a/nixos/modules/services/games/teeworlds.nix +++ b/nixos/modules/services/games/teeworlds.nix @@ -1,13 +1,10 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.teeworlds; register = cfg.register; bool = b: if b != null && b then "1" else "0"; - optionalSetting = s: setting: optionalString (s != null) "${setting} ${s}"; + optionalSetting = s: setting: lib.optionalString (s != null) "${setting} ${s}"; lookup = attrs: key: default: if attrs ? key then attrs."${key}" else default; inactivePenaltyOptions = { @@ -86,33 +83,33 @@ let sv_vote_kick_bantime ${toString cfg.game.voteKickBanTime} sv_vote_kick_min ${toString cfg.game.voteKickMinimumPlayers} - ${concatStringsSep "\n" cfg.extraOptions} + ${lib.concatStringsSep "\n" cfg.extraOptions} ''; in { options = { services.teeworlds = { - enable = mkEnableOption "Teeworlds Server"; + enable = lib.mkEnableOption "Teeworlds Server"; - package = mkPackageOption pkgs "teeworlds-server" { }; + package = lib.mkPackageOption pkgs "teeworlds-server" { }; - openPorts = mkOption { - type = types.bool; + openPorts = lib.mkOption { + type = lib.types.bool; default = false; description = "Whether to open firewall ports for Teeworlds."; }; - name = mkOption { - type = types.str; + name = lib.mkOption { + type = lib.types.str; default = "unnamed server"; description = '' Name of the server. ''; }; - register = mkOption { - type = types.bool; + register = lib.mkOption { + type = lib.types.bool; example = true; default = false; description = '' @@ -120,40 +117,40 @@ in ''; }; - motd = mkOption { - type = types.nullOr types.str; + motd = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' The server's message of the day text. ''; }; - password = mkOption { - type = types.nullOr types.str; + password = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Password to connect to the server. ''; }; - rconPassword = mkOption { - type = types.nullOr types.str; + rconPassword = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Password to access the remote console. If not set, a randomly generated one is displayed in the server log. ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 8303; description = '' Port the server will listen on. ''; }; - extraOptions = mkOption { - type = types.listOf types.str; + extraOptions = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; description = '' Extra configuration lines for the {file}`teeworlds.cfg`. See [Teeworlds Documentation](https://www.teeworlds.com/?page=docs&wiki=server_settings). @@ -162,32 +159,32 @@ in }; server = { - bindAddr = mkOption { - type = types.nullOr types.str; + bindAddr = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' The address the server will bind to. ''; }; - enableHighBandwidth = mkOption { - type = types.bool; + enableHighBandwidth = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable high bandwidth mode on LAN servers. This will double the amount of bandwidth required for running the server. ''; }; - hostName = mkOption { - type = types.nullOr types.str; + hostName = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Hostname for the server. ''; }; - inactivePenalty = mkOption { - type = types.enum [ "spectator" "spectator/kick" "kick" ]; + inactivePenalty = lib.mkOption { + type = lib.types.enum [ "spectator" "spectator/kick" "kick" ]; example = "spectator"; default = "spectator/kick"; description = '' @@ -201,48 +198,48 @@ in ''; }; - kickInactiveSpectators = mkOption { - type = types.bool; + kickInactiveSpectators = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to kick inactive spectators. ''; }; - inactiveTime = mkOption { - type = types.ints.unsigned; + inactiveTime = lib.mkOption { + type = lib.types.ints.unsigned; default = 3; description = '' The amount of minutes a client has to idle before it is considered inactive. ''; }; - maxClients = mkOption { - type = types.ints.unsigned; + maxClients = lib.mkOption { + type = lib.types.ints.unsigned; default = 12; description = '' The maximum amount of clients that can be connected to the server at the same time. ''; }; - maxClientsPerIP = mkOption { - type = types.ints.unsigned; + maxClientsPerIP = lib.mkOption { + type = lib.types.ints.unsigned; default = 12; description = '' The maximum amount of clients with the same IP address that can be connected to the server at the same time. ''; }; - skillLevel = mkOption { - type = types.enum [ "casual" "normal" "competitive" ]; + skillLevel = lib.mkOption { + type = lib.types.enum [ "casual" "normal" "competitive" ]; default = "normal"; description = '' The skill level shown in the server browser. ''; }; - enableSpamProtection = mkOption { - type = types.bool; + enableSpamProtection = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to enable chat spam protection. @@ -251,8 +248,8 @@ in }; game = { - gameType = mkOption { - type = types.str; + gameType = lib.mkOption { + type = lib.types.str; example = "ctf"; default = "dm"; description = '' @@ -262,8 +259,8 @@ in ''; }; - map = mkOption { - type = types.str; + map = lib.mkOption { + type = lib.types.str; example = "ctf5"; default = "dm1"; description = '' @@ -271,16 +268,16 @@ in ''; }; - swapTeams = mkOption { - type = types.bool; + swapTeams = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to swap teams each round. ''; }; - enableReadyMode = mkOption { - type = types.bool; + enableReadyMode = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable "ready mode"; where players can pause/unpause the game @@ -288,24 +285,24 @@ in ''; }; - playerSlots = mkOption { - type = types.ints.unsigned; + playerSlots = lib.mkOption { + type = lib.types.ints.unsigned; default = 8; description = '' The amount of slots to reserve for players (as opposed to spectators). ''; }; - enablePowerups = mkOption { - type = types.bool; + enablePowerups = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to allow powerups such as the ninja. ''; }; - scoreLimit = mkOption { - type = types.ints.unsigned; + scoreLimit = lib.mkOption { + type = lib.types.ints.unsigned; example = 400; default = 20; description = '' @@ -313,24 +310,24 @@ in ''; }; - restrictSpectators = mkOption { - type = types.bool; + restrictSpectators = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to restrict access to information such as health, ammo and armour in spectator mode. ''; }; - enableTeamDamage = mkOption { - type = types.bool; + enableTeamDamage = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable team damage; whether to allow team mates to inflict damage on one another. ''; }; - timeLimit = mkOption { - type = types.ints.unsigned; + timeLimit = lib.mkOption { + type = lib.types.ints.unsigned; default = 0; description = '' Time limit of the game. In cases of equal points, there will be sudden death. @@ -338,8 +335,8 @@ in ''; }; - tournamentMode = mkOption { - type = types.enum [ "disable" "enable" "restrictSpectators" ]; + tournamentMode = lib.mkOption { + type = lib.types.enum [ "disable" "enable" "restrictSpectators" ]; default = "disable"; description = '' Whether to enable tournament mode. In tournament mode, players join as spectators. @@ -347,24 +344,24 @@ in ''; }; - enableVoteKick = mkOption { - type = types.bool; + enableVoteKick = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to enable voting to kick players. ''; }; - voteKickBanTime = mkOption { - type = types.ints.unsigned; + voteKickBanTime = lib.mkOption { + type = lib.types.ints.unsigned; default = 5; description = '' The amount of minutes that a player is banned for if they get kicked by a vote. ''; }; - voteKickMinimumPlayers = mkOption { - type = types.ints.unsigned; + voteKickMinimumPlayers = lib.mkOption { + type = lib.types.ints.unsigned; default = 5; description = '' The minimum amount of players required to start a kick vote. @@ -374,8 +371,8 @@ in }; }; - config = mkIf cfg.enable { - networking.firewall = mkIf cfg.openPorts { + config = lib.mkIf cfg.enable { + networking.firewall = lib.mkIf cfg.openPorts { allowedUDPPorts = [ cfg.port ]; }; From d27bffefab5e56ad86ed1d7c661d78696a594ab9 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:33 +0200 Subject: [PATCH 017/197] nixos/power.ups: remove `with lib;` --- nixos/modules/services/monitoring/ups.nix | 207 +++++++++++----------- 1 file changed, 102 insertions(+), 105 deletions(-) diff --git a/nixos/modules/services/monitoring/ups.nix b/nixos/modules/services/monitoring/ups.nix index b86e93a661ca..0d157afd51a0 100644 --- a/nixos/modules/services/monitoring/ups.nix +++ b/nixos/modules/services/monitoring/ups.nix @@ -1,9 +1,6 @@ { config, lib, pkgs, ... }: - # TODO: This is not secure, have a look at the file docs/security.txt inside # the project sources. -with lib; - let cfg = config.power.ups; defaultPort = 3493; @@ -31,24 +28,24 @@ let normalizedValue = lib.mapAttrs (key: val: if lib.isList val - then forEach val (elem: if lib.isList elem then elem else [elem]) + then lib.forEach val (elem: if lib.isList elem then elem else [elem]) else if val == null then [] else [[val]] ) value; - mkValueString = concatMapStringsSep " " (v: - let str = generators.mkValueStringDefault {} v; + mkValueString = lib.concatMapStringsSep " " (v: + let str = lib.generators.mkValueStringDefault {} v; in # Quote the value if it has spaces and isn't already quoted. - if (hasInfix " " str) && !(hasPrefix "\"" str && hasSuffix "\"" str) + if (lib.hasInfix " " str) && !(lib.hasPrefix "\"" str && lib.hasSuffix "\"" str) then "\"${str}\"" else str ); in pkgs.writeText name (lib.generators.toKeyValue { - mkKeyValue = generators.mkKeyValueDefault { inherit mkValueString; } " "; + mkKeyValue = lib.generators.mkKeyValueDefault { inherit mkValueString; } " "; listsAsDuplicateKeys = true; } normalizedValue); @@ -57,7 +54,7 @@ let installSecrets = source: target: secrets: pkgs.writeShellScript "installSecrets.sh" '' install -m0600 -D ${source} "${target}" - ${concatLines (forEach secrets (name: '' + ${lib.concatLines (lib.forEach secrets (name: '' ${pkgs.replace-secret}/bin/replace-secret \ '@${name}@' \ "$CREDENTIALS_DIRECTORY/${name}" \ @@ -71,16 +68,16 @@ let upsdUsers = pkgs.writeText "upsd.users" (let # This looks like INI, but it's not quite because the # 'upsmon' option lacks a '='. See: man upsd.users - userConfig = name: user: concatStringsSep "\n " (concatLists [ + userConfig = name: user: lib.concatStringsSep "\n " (lib.concatLists [ [ "[${name}]" "password = \"@upsdusers_password_${name}@\"" ] - (optional (user.upsmon != null) "upsmon ${user.upsmon}") - (forEach user.actions (action: "actions = ${action}")) - (forEach user.instcmds (instcmd: "instcmds = ${instcmd}")) + (lib.optional (user.upsmon != null) "upsmon ${user.upsmon}") + (lib.forEach user.actions (action: "actions = ${action}")) + (lib.forEach user.instcmds (instcmd: "instcmds = ${instcmd}")) ]); - in concatStringsSep "\n\n" (mapAttrsToList userConfig cfg.users)); + in lib.concatStringsSep "\n\n" (lib.mapAttrsToList userConfig cfg.users)); upsOptions = {name, config, ...}: @@ -88,25 +85,25 @@ let options = { # This can be inferred from the UPS model by looking at # /nix/store/nut/share/driver.list - driver = mkOption { - type = types.str; + driver = lib.mkOption { + type = lib.types.str; description = '' Specify the program to run to talk to this UPS. apcsmart, bestups, and sec are some examples. ''; }; - port = mkOption { - type = types.str; + port = lib.mkOption { + type = lib.types.str; description = '' The serial port to which your UPS is connected. /dev/ttyS0 is usually the first port on Linux boxes, for example. ''; }; - shutdownOrder = mkOption { + shutdownOrder = lib.mkOption { default = 0; - type = types.int; + type = lib.types.int; description = '' When you have multiple UPSes on your system, you usually need to turn them off in a certain order. upsdrvctl shuts down all the @@ -115,9 +112,9 @@ let ''; }; - maxStartDelay = mkOption { + maxStartDelay = lib.mkOption { default = null; - type = types.uniq (types.nullOr types.int); + type = lib.types.uniq (lib.types.nullOr lib.types.int); description = '' This can be set as a global variable above your first UPS definition and it can also be set in a UPS section. This value @@ -127,25 +124,25 @@ let ''; }; - description = mkOption { + description = lib.mkOption { default = ""; - type = types.str; + type = lib.types.str; description = '' Description of the UPS. ''; }; - directives = mkOption { + directives = lib.mkOption { default = []; - type = types.listOf types.str; + type = lib.types.listOf lib.types.str; description = '' List of configuration directives for this UPS. ''; }; - summary = mkOption { + summary = lib.mkOption { default = ""; - type = types.lines; + type = lib.types.lines; description = '' Lines which would be added inside ups.conf for handling this UPS. ''; @@ -154,33 +151,33 @@ let }; config = { - directives = mkOrder 10 ([ + directives = lib.mkOrder 10 ([ "driver = ${config.driver}" "port = ${config.port}" ''desc = "${config.description}"'' "sdorder = ${toString config.shutdownOrder}" - ] ++ (optional (config.maxStartDelay != null) + ] ++ (lib.optional (config.maxStartDelay != null) "maxstartdelay = ${toString config.maxStartDelay}") ); summary = - concatStringsSep "\n " + lib.concatStringsSep "\n " (["[${name}]"] ++ config.directives); }; }; listenOptions = { options = { - address = mkOption { - type = types.str; + address = lib.mkOption { + type = lib.types.str; description = '' Address of the interface for `upsd` to listen on. See `man upsd.conf` for details. ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = defaultPort; description = '' TCP port for `upsd` to listen on. @@ -192,14 +189,14 @@ let upsdOptions = { options = { - enable = mkOption { - type = types.bool; - defaultText = literalMD "`true` if `mode` is one of `standalone`, `netserver`"; + enable = lib.mkOption { + type = lib.types.bool; + defaultText = lib.literalMD "`true` if `mode` is one of `standalone`, `netserver`"; description = "Whether to enable `upsd`."; }; - listen = mkOption { - type = with types; listOf (submodule listenOptions); + listen = lib.mkOption { + type = with lib.types; listOf (submodule listenOptions); default = []; example = [ { @@ -216,8 +213,8 @@ let ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = '' Additional lines to add to `upsd.conf`. @@ -226,15 +223,15 @@ let }; config = { - enable = mkDefault (elem cfg.mode [ "standalone" "netserver" ]); + enable = lib.mkDefault (lib.elem cfg.mode [ "standalone" "netserver" ]); }; }; monitorOptions = { name, config, ... }: { options = { - system = mkOption { - type = types.str; + system = lib.mkOption { + type = lib.types.str; default = name; description = '' Identifier of the UPS to monitor, in this form: `[@[:]]` @@ -242,8 +239,8 @@ let ''; }; - powerValue = mkOption { - type = types.int; + powerValue = lib.mkOption { + type = lib.types.int; default = 1; description = '' Number of power supplies that the UPS feeds on this system. @@ -251,17 +248,17 @@ let ''; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; description = '' Username from `upsd.users` for accessing this UPS. See `upsmon.conf` for details. ''; }; - passwordFile = mkOption { - type = types.str; - defaultText = literalMD "power.ups.users.\${user}.passwordFile"; + passwordFile = lib.mkOption { + type = lib.types.str; + defaultText = lib.literalMD "power.ups.users.\${user}.passwordFile"; description = '' The full path to a file containing the password from `upsd.users` for accessing this UPS. The password file @@ -270,8 +267,8 @@ let ''; }; - type = mkOption { - type = types.str; + type = lib.mkOption { + type = lib.types.str; default = "master"; description = '' The relationship with `upsd`. @@ -281,30 +278,30 @@ let }; config = { - passwordFile = mkDefault cfg.users.${config.user}.passwordFile; + passwordFile = lib.mkDefault cfg.users.${config.user}.passwordFile; }; }; upsmonOptions = { options = { - enable = mkOption { - type = types.bool; - defaultText = literalMD "`true` if `mode` is one of `standalone`, `netserver`, `netclient`"; + enable = lib.mkOption { + type = lib.types.bool; + defaultText = lib.literalMD "`true` if `mode` is one of `standalone`, `netserver`, `netclient`"; description = "Whether to enable `upsmon`."; }; - monitor = mkOption { - type = with types; attrsOf (submodule monitorOptions); + monitor = lib.mkOption { + type = with lib.types; attrsOf (submodule monitorOptions); default = {}; description = '' Set of UPS to monitor. See `man upsmon.conf` for details. ''; }; - settings = mkOption { + settings = lib.mkOption { type = nutFormat.type; default = {}; - defaultText = literalMD '' + defaultText = lib.literalMD '' { MINSUPPLIES = 1; RUN_AS_USER = "root"; @@ -313,7 +310,7 @@ let } ''; description = "Additional settings to add to `upsmon.conf`."; - example = literalMD '' + example = lib.literalMD '' { MINSUPPLIES = 2; NOTIFYFLAG = [ @@ -326,29 +323,29 @@ let }; config = { - enable = mkDefault (elem cfg.mode [ "standalone" "netserver" "netclient" ]); + enable = lib.mkDefault (lib.elem cfg.mode [ "standalone" "netserver" "netclient" ]); settings = { RUN_AS_USER = "root"; # TODO: replace 'root' by another username. - MINSUPPLIES = mkDefault 1; - NOTIFYCMD = mkDefault "${pkgs.nut}/bin/upssched"; - SHUTDOWNCMD = mkDefault "${pkgs.systemd}/bin/shutdown now"; - MONITOR = flip mapAttrsToList cfg.upsmon.monitor (name: monitor: with monitor; [ system powerValue user "\"@upsmon_password_${name}@\"" type ]); + MINSUPPLIES = lib.mkDefault 1; + NOTIFYCMD = lib.mkDefault "${pkgs.nut}/bin/upssched"; + SHUTDOWNCMD = lib.mkDefault "${pkgs.systemd}/bin/shutdown now"; + MONITOR = lib.flip lib.mapAttrsToList cfg.upsmon.monitor (name: monitor: with monitor; [ system powerValue user "\"@upsmon_password_${name}@\"" type ]); }; }; }; userOptions = { options = { - passwordFile = mkOption { - type = types.str; + passwordFile = lib.mkOption { + type = lib.types.str; description = '' The full path to a file that contains the user's (clear text) password. The password file is read on service start. ''; }; - actions = mkOption { - type = with types; listOf str; + actions = lib.mkOption { + type = with lib.types; listOf str; default = []; description = '' Allow the user to do certain things with upsd. @@ -356,8 +353,8 @@ let ''; }; - instcmds = mkOption { - type = with types; listOf str; + instcmds = lib.mkOption { + type = with lib.types; listOf str; default = []; description = '' Let the user initiate specific instant commands. Use "ALL" to grant all commands automatically. For the full list of what your UPS supports, use "upscmd -l". @@ -365,8 +362,8 @@ let ''; }; - upsmon = mkOption { - type = with types; nullOr (enum [ "primary" "secondary" ]); + upsmon = lib.mkOption { + type = with lib.types; nullOr (enum [ "primary" "secondary" ]); default = null; description = '' Add the necessary actions for a upsmon process to work. @@ -384,14 +381,14 @@ in # powerManagement.powerDownCommands power.ups = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' support for Power Devices, such as Uninterruptible Power Supplies, Power Distribution Units and Solar Controllers ''; - mode = mkOption { + mode = lib.mkOption { default = "standalone"; - type = types.enum [ "none" "standalone" "netserver" "netclient" ]; + type = lib.types.enum [ "none" "standalone" "netserver" "netclient" ]; description = '' The MODE determines which part of the NUT is to be started, and which configuration files must be modified. @@ -416,25 +413,25 @@ in ''; }; - schedulerRules = mkOption { + schedulerRules = lib.mkOption { example = "/etc/nixos/upssched.conf"; - type = types.str; + type = lib.types.str; description = '' File which contains the rules to handle UPS events. ''; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = '' Open ports in the firewall for `upsd`. ''; }; - maxStartDelay = mkOption { + maxStartDelay = lib.mkOption { default = 45; - type = types.int; + type = lib.types.int; description = '' This can be set as a global variable above your first UPS definition and it can also be set in a UPS section. This value @@ -444,23 +441,23 @@ in ''; }; - upsmon = mkOption { + upsmon = lib.mkOption { default = {}; description = '' Options for the `upsmon.conf` configuration file. ''; - type = types.submodule upsmonOptions; + type = lib.types.submodule upsmonOptions; }; - upsd = mkOption { + upsd = lib.mkOption { default = {}; description = '' Options for the `upsd.conf` configuration file. ''; - type = types.submodule upsdOptions; + type = lib.types.submodule upsdOptions; }; - ups = mkOption { + ups = lib.mkOption { default = {}; # see nut/etc/ups.conf.sample description = '' @@ -468,27 +465,27 @@ in monitoring directly. These are usually attached to serial ports, but USB devices are also supported. ''; - type = with types; attrsOf (submodule upsOptions); + type = with lib.types; attrsOf (submodule upsOptions); }; - users = mkOption { + users = lib.mkOption { default = {}; description = '' Users that can access upsd. See `man upsd.users`. ''; - type = with types; attrsOf (submodule userOptions); + type = with lib.types; attrsOf (submodule userOptions); }; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { assertions = [ (let - totalPowerValue = foldl' add 0 (map (monitor: monitor.powerValue) (attrValues cfg.upsmon.monitor)); + totalPowerValue = lib.foldl' lib.add 0 (map (monitor: monitor.powerValue) (lib.attrValues cfg.upsmon.monitor)); minSupplies = cfg.upsmon.settings.MINSUPPLIES; - in mkIf cfg.upsmon.enable { + in lib.mkIf cfg.upsmon.enable { assertion = totalPowerValue >= minSupplies; message = '' `power.ups.upsmon`: Total configured power value (${toString totalPowerValue}) must be at least MINSUPPLIES (${toString minSupplies}). @@ -498,15 +495,15 @@ in environment.systemPackages = [ pkgs.nut ]; - networking.firewall = mkIf cfg.openFirewall { + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = if cfg.upsd.listen == [] then [ defaultPort ] - else unique (forEach cfg.upsd.listen (listen: listen.port)); + else lib.unique (lib.forEach cfg.upsd.listen (listen: listen.port)); }; systemd.services.upsmon = let - secrets = mapAttrsToList (name: monitor: "upsmon_password_${name}") cfg.upsmon.monitor; + secrets = lib.mapAttrsToList (name: monitor: "upsmon_password_${name}") cfg.upsmon.monitor; createUpsmonConf = installSecrets upsmonConf "/run/nut/upsmon.conf" secrets; in { enable = cfg.upsmon.enable; @@ -518,14 +515,14 @@ in ExecStartPre = "${createUpsmonConf}"; ExecStart = "${pkgs.nut}/sbin/upsmon"; ExecReload = "${pkgs.nut}/sbin/upsmon -c reload"; - LoadCredential = mapAttrsToList (name: monitor: "upsmon_password_${name}:${monitor.passwordFile}") cfg.upsmon.monitor; + LoadCredential = lib.mapAttrsToList (name: monitor: "upsmon_password_${name}:${monitor.passwordFile}") cfg.upsmon.monitor; }; environment.NUT_CONFPATH = "/etc/nut"; environment.NUT_STATEPATH = "/var/lib/nut"; }; systemd.services.upsd = let - secrets = mapAttrsToList (name: user: "upsdusers_password_${name}") cfg.users; + secrets = lib.mapAttrsToList (name: user: "upsdusers_password_${name}") cfg.users; createUpsdUsers = installSecrets upsdUsers "/run/nut/upsd.users" secrets; in { enable = cfg.upsd.enable; @@ -538,7 +535,7 @@ in # TODO: replace 'root' by another username. ExecStart = "${pkgs.nut}/sbin/upsd -u root"; ExecReload = "${pkgs.nut}/sbin/upsd -c reload"; - LoadCredential = mapAttrsToList (name: user: "upsdusers_password_${name}:${user.passwordFile}") cfg.users; + LoadCredential = lib.mapAttrsToList (name: user: "upsdusers_password_${name}:${user.passwordFile}") cfg.users; }; environment.NUT_CONFPATH = "/etc/nut"; environment.NUT_STATEPATH = "/var/lib/nut"; @@ -574,11 +571,11 @@ in '' maxstartdelay = ${toString cfg.maxStartDelay} - ${concatStringsSep "\n\n" (forEach (attrValues cfg.ups) (ups: ups.summary))} + ${lib.concatStringsSep "\n\n" (lib.forEach (lib.attrValues cfg.ups) (ups: ups.summary))} ''; "nut/upsd.conf".source = pkgs.writeText "upsd.conf" '' - ${concatStringsSep "\n" (forEach cfg.upsd.listen (listen: "LISTEN ${listen.address} ${toString listen.port}"))} + ${lib.concatStringsSep "\n" (lib.forEach cfg.upsd.listen (listen: "LISTEN ${listen.address} ${toString listen.port}"))} ${cfg.upsd.extraConfig} ''; "nut/upssched.conf".source = cfg.schedulerRules; @@ -586,7 +583,7 @@ in "nut/upsmon.conf".source = "/run/nut/upsmon.conf"; }; - power.ups.schedulerRules = mkDefault "${pkgs.nut}/etc/upssched.conf.sample"; + power.ups.schedulerRules = lib.mkDefault "${pkgs.nut}/etc/upssched.conf.sample"; systemd.tmpfiles.rules = [ "d /var/state/ups -" From 6f5ad9b6945dbed205e57341adab05eeb5dab84c Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 00:07:10 +0000 Subject: [PATCH 018/197] eigenlayer: 0.10.2 -> 0.10.3 --- pkgs/by-name/ei/eigenlayer/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ei/eigenlayer/package.nix b/pkgs/by-name/ei/eigenlayer/package.nix index 0e2970f04097..e7553cf4ad72 100644 --- a/pkgs/by-name/ei/eigenlayer/package.nix +++ b/pkgs/by-name/ei/eigenlayer/package.nix @@ -6,13 +6,13 @@ }: buildGoModule rec { pname = "eigenlayer"; - version = "0.10.2"; + version = "0.10.3"; src = fetchFromGitHub { owner = "Layr-Labs"; repo = "eigenlayer-cli"; rev = "v${version}"; - hash = "sha256-RfDDmGuG+WRGLTrCdqgGsNWlsfn6x0w21Sh+yc4MwpA="; + hash = "sha256-5xskx/Bd8h344EH/up0jofcUNS9lZxgboySIO2i2vr8="; }; vendorHash = "sha256-mvV/AsSSRsCf7TrKLZgo+AHEWXCnPUEsnLOvt73eFf4="; From b2b4cfc75bd305eb5a7b49a4e530f64013dda512 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 00:23:45 +0000 Subject: [PATCH 019/197] supabase-cli: 1.190.0 -> 1.191.3 --- pkgs/development/tools/supabase-cli/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/supabase-cli/default.nix b/pkgs/development/tools/supabase-cli/default.nix index f60be0c287f1..5baad629a273 100644 --- a/pkgs/development/tools/supabase-cli/default.nix +++ b/pkgs/development/tools/supabase-cli/default.nix @@ -9,13 +9,13 @@ buildGoModule rec { pname = "supabase-cli"; - version = "1.190.0"; + version = "1.191.3"; src = fetchFromGitHub { owner = "supabase"; repo = "cli"; rev = "v${version}"; - hash = "sha256-n5fIvt6eeSZBStFR/GE9YG8s56ZyCBGzFCpjuyMpujY="; + hash = "sha256-8T58CrXbLxrw8TNRNB48w3zGOgBW+L/zWpsaGyWnLy8="; }; vendorHash = "sha256-RiSZaNbMwOmKGzgFpeLmAjsiNg1ADMNAtMH7wHj/vlw="; From b0559cac2d60a09090b3c556724ecf486f4225b6 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 00:29:18 +0000 Subject: [PATCH 020/197] autorestic: 1.8.2 -> 1.8.3 --- pkgs/tools/backup/autorestic/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/backup/autorestic/default.nix b/pkgs/tools/backup/autorestic/default.nix index 5c718603fa98..2d0f5b019626 100644 --- a/pkgs/tools/backup/autorestic/default.nix +++ b/pkgs/tools/backup/autorestic/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "autorestic"; - version = "1.8.2"; + version = "1.8.3"; src = fetchFromGitHub { owner = "cupcakearmy"; repo = pname; rev = "v${version}"; - sha256 = "sha256-g7P/q29LMZEibEP6Pmve2WwuxdmSpdqQpwG6/RPDMAM="; + sha256 = "sha256-rladzcW6l5eR6ICj4kKd4e2R9vRIV/1enCzHLFdQDlk="; }; - vendorHash = "sha256-1ya1h/v5uEVoZpPVugxXQC3FCH5GKPhcHIDm8rSY9OU="; + vendorHash = "sha256-riAjjIrG00vJweaFHc3ArhaAQb08v6cYUJsNys4Hwio="; nativeBuildInputs = [ installShellFiles ]; From b477236d5444f4b0b6030e733d8dfe1cb400677a Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 01:35:59 +0000 Subject: [PATCH 021/197] cloud-nuke: 0.37.1 -> 0.37.2 --- pkgs/development/tools/cloud-nuke/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/cloud-nuke/default.nix b/pkgs/development/tools/cloud-nuke/default.nix index 9d516ebe4eb4..f17bad02615b 100644 --- a/pkgs/development/tools/cloud-nuke/default.nix +++ b/pkgs/development/tools/cloud-nuke/default.nix @@ -6,16 +6,16 @@ buildGoModule rec { pname = "cloud-nuke"; - version = "0.37.1"; + version = "0.37.2"; src = fetchFromGitHub { owner = "gruntwork-io"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-+iDcUgyTt4AXDPh4S6YhXuWwvrbyvjXnyRmN3hm6hTc="; + hash = "sha256-EAN2O4DisHEQ5ID96BtZXQHz0eQFDSu/0r0WO+Ihleo="; }; - vendorHash = "sha256-4ZPLscZWF9GfNMU70TjR5+Hi/rvm43n+GvqxFUu13JU="; + vendorHash = "sha256-Rw3wSGDorCcAz/8BKmLsy0AVQ922W7FrvRYDgZj2blg="; nativeBuildInputs = [ makeBinaryWrapper From ca8bc056101e8f0823da90da8b28dea58e3bdc7e Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 29 Aug 2024 00:03:44 -0400 Subject: [PATCH 022/197] python312Packages.pdoc: 14.6.0 -> 14.6.1 Diff: https://github.com/mitmproxy/pdoc/compare/v14.6.0...14.6.1 Changelog: https://github.com/mitmproxy/pdoc/blob/v14.6.1/CHANGELOG.md --- pkgs/development/python-modules/pdoc/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pdoc/default.nix b/pkgs/development/python-modules/pdoc/default.nix index a7c2b3feb9b6..6f20b2234cff 100644 --- a/pkgs/development/python-modules/pdoc/default.nix +++ b/pkgs/development/python-modules/pdoc/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { pname = "pdoc"; - version = "14.6.0"; + version = "14.6.1"; disabled = pythonOlder "3.8"; pyproject = true; @@ -24,7 +24,7 @@ buildPythonPackage rec { owner = "mitmproxy"; repo = "pdoc"; rev = "v${version}"; - hash = "sha256-kQBW8bN8WYvWzpqM6JatB3bB/bAQqpHGd98prznyO+g="; + hash = "sha256-9bnkpzHbYYrxVGPPdM1sWkk7IVvNd3GNJ/8CaYV52ko="; }; nativeBuildInputs = [ setuptools ]; From c31b9b8e8c2df40c1c4b2e0bd882cae43c5f2ae6 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 04:28:51 +0000 Subject: [PATCH 023/197] spicedb-zed: 0.20.0 -> 0.21.0 --- pkgs/servers/spicedb/zed.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/spicedb/zed.nix b/pkgs/servers/spicedb/zed.nix index 879e697f5cb9..1046c94c115f 100644 --- a/pkgs/servers/spicedb/zed.nix +++ b/pkgs/servers/spicedb/zed.nix @@ -5,13 +5,13 @@ buildGoModule rec { pname = "zed"; - version = "0.20.0"; + version = "0.21.0"; src = fetchFromGitHub { owner = "authzed"; repo = "zed"; rev = "v${version}"; - hash = "sha256-AdHkSkoxCK0iV4ZmaSYsYRkstGpsmahXpgAFUYt2/DU="; + hash = "sha256-jHKugGQ3tta9vGjMtVEyTrLrmivLc41VFYVqAjH/IGQ="; }; vendorHash = "sha256-nYf/ruU1IPDOcumhQz6LGEpKLyAxgASgxjPT7qz0N8c="; From c7ab6e6fcc1c553a6ff0e4fa39a74880e368d85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 28 Aug 2024 21:34:35 -0700 Subject: [PATCH 024/197] python312Packages.pyblu: 1.0.0 -> 1.0.1 Diff: https://github.com/LouisChrist/pyblu/compare/refs/tags/v1.0.0...v1.0.1 Changelog: https://github.com/LouisChrist/pyblu/releases/tag/v1.0.1 --- pkgs/development/python-modules/pyblu/default.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/pyblu/default.nix b/pkgs/development/python-modules/pyblu/default.nix index 74526592d833..7aa6faf27c3d 100644 --- a/pkgs/development/python-modules/pyblu/default.nix +++ b/pkgs/development/python-modules/pyblu/default.nix @@ -12,20 +12,18 @@ buildPythonPackage rec { pname = "pyblu"; - version = "1.0.0"; + version = "1.0.1"; pyproject = true; src = fetchFromGitHub { owner = "LouisChrist"; repo = "pyblu"; rev = "refs/tags/v${version}"; - hash = "sha256-Ue6czsgeQjqPtbKmvvU+f49gKSzXJ8Yx9EzycUTtxE0="; + hash = "sha256-Qe6GNzF8ffNSwqRL5QlN9x3dqwaX/YCfY/keEDwWW/8="; }; build-system = [ poetry-core ]; - pythonRelaxDeps = [ "lxml" ]; - dependencies = [ aiohttp lxml From b63445a5e817fd1d5f3541efaed892d671136014 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 04:54:01 +0000 Subject: [PATCH 025/197] flix: 0.49.0 -> 0.50.0 --- pkgs/development/compilers/flix/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/flix/default.nix b/pkgs/development/compilers/flix/default.nix index fe6f38dce203..61fbdd6fe9d8 100644 --- a/pkgs/development/compilers/flix/default.nix +++ b/pkgs/development/compilers/flix/default.nix @@ -2,11 +2,11 @@ stdenvNoCC.mkDerivation rec { pname = "flix"; - version = "0.49.0"; + version = "0.50.0"; src = fetchurl { url = "https://github.com/flix/flix/releases/download/v${version}/flix.jar"; - sha256 = "sha256-lVnmj4+n7Zd7uE5+NeGrrU5YyLYBMaWoXSYFnol7gFI="; + sha256 = "sha256-fAEt7JsljnEXubYgiF8uEOuoOXHjv9AHgQbPunaEMw4="; }; dontUnpack = true; From aaee401999cd2ffdbf19fa1510f329596adbc196 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 05:34:48 +0000 Subject: [PATCH 026/197] ginkgo: 2.20.1 -> 2.20.2 --- pkgs/development/tools/ginkgo/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/ginkgo/default.nix b/pkgs/development/tools/ginkgo/default.nix index 42916115601d..4584650436c2 100644 --- a/pkgs/development/tools/ginkgo/default.nix +++ b/pkgs/development/tools/ginkgo/default.nix @@ -2,15 +2,15 @@ buildGoModule rec { pname = "ginkgo"; - version = "2.20.1"; + version = "2.20.2"; src = fetchFromGitHub { owner = "onsi"; repo = "ginkgo"; rev = "v${version}"; - sha256 = "sha256-RbxqFzWJcfoRMHqQUq3it4+eqn98nUirC6a1f2EOpmk="; + sha256 = "sha256-/emP4U2s7/hYJZCJ+TdE5sM45q0C8OrrIFreSupq3ig="; }; - vendorHash = "sha256-RfIkiASUEK1TBSBx/rx9UWVE8NuZssYmoTKggkj/kQE="; + vendorHash = "sha256-6HlCj2Wq+lH6OQxG18fCMj1eC2Xy++IQx35nCAtHQ/U="; # integration tests expect more file changes # types tests are missing CodeLocation From d2eadf6cf8699044e9956ebb58e2526f7d2789ce Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 05:35:19 +0000 Subject: [PATCH 027/197] python312Packages.labelbox: 3.77.0 -> 3.77.1 --- pkgs/development/python-modules/labelbox/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/labelbox/default.nix b/pkgs/development/python-modules/labelbox/default.nix index cdd195c7a260..25d5df9ee012 100644 --- a/pkgs/development/python-modules/labelbox/default.nix +++ b/pkgs/development/python-modules/labelbox/default.nix @@ -31,7 +31,7 @@ buildPythonPackage rec { pname = "labelbox"; - version = "3.77.0"; + version = "3.77.1"; pyproject = true; disabled = pythonOlder "3.8"; @@ -40,7 +40,7 @@ buildPythonPackage rec { owner = "Labelbox"; repo = "labelbox-python"; rev = "refs/tags/v.${version}"; - hash = "sha256-kB+w4UWBlnYSqLnv14iB9+10O9z1mwKGit8XLUUdhnk="; + hash = "sha256-sp0lgUnFRmQLix530xoR/qibYFjGwG7i7+mvEQX0x4k="; }; sourceRoot = "${src.name}/libs/labelbox"; From 6ba47d37f8bfe0c4aa781fc9294d76779ffe188e Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 05:35:27 +0000 Subject: [PATCH 028/197] python312Packages.pytibber: 0.30.1 -> 0.30.2 --- pkgs/development/python-modules/pytibber/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pytibber/default.nix b/pkgs/development/python-modules/pytibber/default.nix index 4de4b73984a0..94810bfac05d 100644 --- a/pkgs/development/python-modules/pytibber/default.nix +++ b/pkgs/development/python-modules/pytibber/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { pname = "pytibber"; - version = "0.30.1"; + version = "0.30.2"; pyproject = true; disabled = pythonOlder "3.11"; @@ -21,7 +21,7 @@ buildPythonPackage rec { owner = "Danielhiversen"; repo = "pyTibber"; rev = "refs/tags/${version}"; - hash = "sha256-bIFWI1pfX2C5H1/lHXiFs6FeaFn5r5uZZERlyAuJp8s="; + hash = "sha256-9Tnn68RxKwEruYEGo2pZQTQTlYnVMfa3MRzA55HlBRc="; }; build-system = [ setuptools ]; From b39bd53f352f792b82fad07802068fdf1945df62 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 06:10:02 +0000 Subject: [PATCH 029/197] fulcio: 1.6.2 -> 1.6.3 --- pkgs/tools/security/fulcio/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/fulcio/default.nix b/pkgs/tools/security/fulcio/default.nix index 4e3dac56ab18..494486021c67 100644 --- a/pkgs/tools/security/fulcio/default.nix +++ b/pkgs/tools/security/fulcio/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "fulcio"; - version = "1.6.2"; + version = "1.6.3"; src = fetchFromGitHub { owner = "sigstore"; repo = pname; rev = "v${version}"; - hash = "sha256-7J0ooEFCVe03PTKHNQm3wgY6ldxx5r1LS9JPcFvfgSY="; + hash = "sha256-JoJ7kYL5EJOI6TwMh0arMXXnj/Y93szrvlFsv0FJn3w="; # populate values that require us to use git. By doing this in postFetch we # can delete .git afterwards and maintain better reproducibility of the src. leaveDotGit = true; @@ -20,7 +20,7 @@ buildGoModule rec { find "$out" -name .git -print0 | xargs -0 rm -rf ''; }; - vendorHash = "sha256-NykypuvkHtGWWhVElY+j7n6PXANL5VaKAT5ZvF0zim8="; + vendorHash = "sha256-Xv+wiG3MRAE49Wu+FoHBIXz8B2mnqzzcDCchgYjZC/o="; nativeBuildInputs = [ installShellFiles ]; From 6cfcc3c8f62067035e21d21bc4d9249568135024 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 07:28:29 +0000 Subject: [PATCH 030/197] cargo-binstall: 1.10.2 -> 1.10.3 --- pkgs/development/tools/rust/cargo-binstall/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/rust/cargo-binstall/default.nix b/pkgs/development/tools/rust/cargo-binstall/default.nix index 60f598bca146..45ddee8da311 100644 --- a/pkgs/development/tools/rust/cargo-binstall/default.nix +++ b/pkgs/development/tools/rust/cargo-binstall/default.nix @@ -11,16 +11,16 @@ rustPlatform.buildRustPackage rec { pname = "cargo-binstall"; - version = "1.10.2"; + version = "1.10.3"; src = fetchFromGitHub { owner = "cargo-bins"; repo = "cargo-binstall"; rev = "v${version}"; - hash = "sha256-/VBuRrTrqmLZDnSpuQLpD1wCLGlOViWJQ54YCSkqlvU="; + hash = "sha256-2Vo8zORVyWu0IA44K8BmXCjiFtdKJelZm/D6p5vqI2k="; }; - cargoHash = "sha256-zg10wTrEwPd/fa4S4YIuhUnxRFaG+/+kuDxKQrBPnb4="; + cargoHash = "sha256-iKhP1P/8oz/0ulkLeZFiAdFGhhs3vZh6JGeQpmd1ZdQ="; nativeBuildInputs = [ pkg-config From 44d191b8607ecf58805e78fbae8e66731948f138 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 08:18:18 +0000 Subject: [PATCH 031/197] cshatag: 2.2.0 -> 2.2.1 --- pkgs/os-specific/linux/cshatag/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/cshatag/default.nix b/pkgs/os-specific/linux/cshatag/default.nix index c160b5ab31b6..8ef9425231fb 100644 --- a/pkgs/os-specific/linux/cshatag/default.nix +++ b/pkgs/os-specific/linux/cshatag/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "cshatag"; - version = "2.2.0"; + version = "2.2.1"; src = fetchFromGitHub { owner = "rfjakob"; repo = pname; rev = "v${version}"; - sha256 = "sha256-j9qIHvQNpT282WoWEUWw9tgmvIXqwfzjnxufTvVJPYI="; + sha256 = "sha256-RqQPbqfliKg7XPA/C9D7Aq1SsN+tAW44tAFHt9p8Py0="; }; vendorHash = "sha256-OYMnZub4Yi11uMHzL1O5l6/J1md6ORS5cWm9K4yP92Q="; From 1ff6cfc158931efebb02ec17fddc5e81b16ad80a Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Thu, 29 Aug 2024 10:29:26 +0200 Subject: [PATCH 032/197] chez-matchable: v20160306 -> v0.2 --- .../chez-modules/chez-matchable/default.nix | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pkgs/development/chez-modules/chez-matchable/default.nix b/pkgs/development/chez-modules/chez-matchable/default.nix index 738d4b06aeee..b815567e4b4f 100644 --- a/pkgs/development/chez-modules/chez-matchable/default.nix +++ b/pkgs/development/chez-modules/chez-matchable/default.nix @@ -2,24 +2,18 @@ stdenv.mkDerivation rec { pname = "chez-matchable"; - version = "20160306"; + version = "0.2"; src = fetchFromGitHub { owner = "fedeinthemix"; repo = "chez-matchable"; rev = "v${version}"; - sha256 = "02qn7x348p23z1x5lwhkyj7i8z6mgwpzpnwr8dyina0yzsdkr71s"; + sha256 = "sha256-UYoT8Kp1FTfiL22ntrFXFcAB1HGVrJ6p9JgvhUKi+Yo="; }; buildInputs = [ chez ]; - buildPhase = '' - make PREFIX=$out CHEZ=${chez}/bin/scheme - ''; - - installPhase = '' - make install PREFIX=$out CHEZ=${chez}/bin/scheme - ''; + makeFlags = [ "CHEZ=${lib.getExe chez}" "PREFIX=$(out)" ]; doCheck = false; From fc6c50e76a1a0996bbe91e1592aff77725853761 Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Thu, 29 Aug 2024 10:36:10 +0200 Subject: [PATCH 033/197] chez-srfi: v1.0 -> v1.1 --- .../chez-modules/chez-srfi/default.nix | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pkgs/development/chez-modules/chez-srfi/default.nix b/pkgs/development/chez-modules/chez-srfi/default.nix index d821e6d01556..317ce8f713ba 100644 --- a/pkgs/development/chez-modules/chez-srfi/default.nix +++ b/pkgs/development/chez-modules/chez-srfi/default.nix @@ -1,25 +1,19 @@ { stdenv, lib, fetchFromGitHub, chez }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "chez-srfi"; - version = "1.0"; + version = "1.1"; src = fetchFromGitHub { owner = "fedeinthemix"; repo = "chez-srfi"; - rev = "5770486c2a85d0e3dd4ac62a97918e7c394ea507"; - sha256 = "sha256-8icdkbYmpTpossirFoulUhJY/8Jo+2eeaMwDftbZh+g="; + rev = "v${version}"; + sha256 = "sha256-yBhRNfoEt1LOn3/zd/yOWwfErN/qG/tQZnDRqEf8j/0="; }; buildInputs = [ chez ]; - buildPhase = '' - make PREFIX=$out CHEZ=${chez}/bin/scheme - ''; - - installPhase = '' - make install PREFIX=$out CHEZ=${chez}/bin/scheme - ''; + makeFlags = [ "CHEZ=${lib.getExe chez}" "PREFIX=$(out)" ]; doCheck = false; From cd111171444d1bc7697b9d84916db49a949e6feb Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Thu, 29 Aug 2024 10:09:10 +0200 Subject: [PATCH 034/197] chez-mit: 0.1 -> 0.2 --- pkgs/development/chez-modules/chez-mit/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/chez-modules/chez-mit/default.nix b/pkgs/development/chez-modules/chez-mit/default.nix index 285ee7f14ec9..154c7362de18 100644 --- a/pkgs/development/chez-modules/chez-mit/default.nix +++ b/pkgs/development/chez-modules/chez-mit/default.nix @@ -2,18 +2,22 @@ stdenv.mkDerivation rec { pname = "chez-mit"; - version = "0.1"; + version = "0.2"; src = fetchFromGitHub { owner = "fedeinthemix"; repo = "chez-mit"; rev = "v${version}"; - sha256 = "sha256-YM4/Sj8otuWJCrUBsglVnihxRGI32F6tSbODFM0a8TA="; + sha256 = "sha256-TmoLA0zLETKE+PsrGS5dce9xLQUIKwSNixRSVjbrOlk="; }; buildInputs = [ chez chez-srfi ]; - makeFlags = [ "CHEZ=${lib.getExe chez}" ]; + makeFlags = [ + "CHEZ=${lib.getExe chez}" + "PREFIX=$(out)" + "CHEZSCHEMELIBDIRS=${chez-srfi}/lib/csv${lib.versions.majorMinor chez.version}-site" + ]; doCheck = false; @@ -22,7 +26,6 @@ stdenv.mkDerivation rec { homepage = "https://github.com/fedeinthemix/chez-mit/"; maintainers = [ maintainers.jitwit ]; license = licenses.gpl3Plus; - broken = true; }; } From 0b6e23f5c03f1c79a1697939934a8f999c65572b Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Thu, 29 Aug 2024 11:05:08 +0200 Subject: [PATCH 035/197] chez-scmutils: 0.1 -> 0.2 --- .../chez-modules/chez-scmutils/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/chez-modules/chez-scmutils/default.nix b/pkgs/development/chez-modules/chez-scmutils/default.nix index 59aedd29f0ec..843a8752df38 100644 --- a/pkgs/development/chez-modules/chez-scmutils/default.nix +++ b/pkgs/development/chez-modules/chez-scmutils/default.nix @@ -2,24 +2,24 @@ stdenv.mkDerivation rec { pname = "chez-scmutils"; - version = "0.1"; + version = "0.2"; src = fetchFromGitHub { owner = "fedeinthemix"; repo = "chez-scmutils"; rev = "v${version}"; - sha256 = "sha256-9GBoHbLNEnPz81s2rBYO3S0bXldetwc8eu9i5CgvYFE="; + sha256 = "sha256-y2ug7GfmkJC6jddgB8YllsumjmGxFJxTGTpPf1Vcs/s="; }; buildInputs = [ chez chez-srfi chez-mit ]; - buildPhase = '' - make PREFIX=$out CHEZ=${chez}/bin/scheme - ''; + lib-path = "lib/csv${lib.versions.majorMinor chez.version}-site"; - installPhase = '' - make install PREFIX=$out CHEZ=${chez}/bin/scheme - ''; + makeFlags = [ + "CHEZ=${lib.getExe chez}" + "PREFIX=$(out)" + "CHEZSCHEMELIBDIRS=${chez-srfi}/${lib-path}:${chez-mit}/${lib-path}" + ]; doCheck = false; From bf7d1857021448dfa5ba3dee2b0501709b5f7c2b Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Thu, 22 Aug 2024 16:07:19 +0300 Subject: [PATCH 036/197] libjodycode: fix on darwin by adding fixDarwinDylibNames Packages dependent on `libjodycode` on macOS (read: `jdupes`) fail to launch because the dylib generated does not set an absolute install path. `fixDarwinDylibNames` rectifies this. --- .../libraries/libjodycode/default.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/libjodycode/default.nix b/pkgs/development/libraries/libjodycode/default.nix index b2ce994dc5b9..28a564c9bc91 100644 --- a/pkgs/development/libraries/libjodycode/default.nix +++ b/pkgs/development/libraries/libjodycode/default.nix @@ -3,9 +3,10 @@ stdenv, fetchFromGitea, jdupes, + fixDarwinDylibNames, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "libjodycode"; version = "3.1.1"; @@ -19,21 +20,23 @@ stdenv.mkDerivation rec { domain = "codeberg.org"; owner = "jbruchon"; repo = "libjodycode"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-sVEa2gNvgRJK1Ycmv4inbViTBPQFjzcZ8XHlAdsNzOk="; }; + nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + env.PREFIX = placeholder "out"; passthru.tests = { inherit jdupes; }; - meta = with lib; { + meta = { description = "Shared code used by several utilities written by Jody Bruchon"; - homepage = "https://github.com/jbruchon/libjodycode"; - changelog = "https://github.com/jbruchon/libjodycode/blob/${src.rev}/CHANGES.txt"; - license = licenses.mit; - maintainers = with maintainers; [ pbsds ]; + homepage = "https://codeberg.org/jbruchon/libjodycode"; + changelog = "https://codeberg.org/jbruchon/libjodycode/src/branch/master/CHANGES.txt"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ pbsds ]; }; -} +}) From ed343166a32f4bd3428c56da78f638e7f4c49c8f Mon Sep 17 00:00:00 2001 From: David Morgan Date: Thu, 29 Aug 2024 11:30:56 +0000 Subject: [PATCH 037/197] chatblade: 0.6.2 -> 0.6.3 --- pkgs/applications/misc/chatblade/default.nix | 21 ++------------------ 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/pkgs/applications/misc/chatblade/default.nix b/pkgs/applications/misc/chatblade/default.nix index 5105abd271c6..8ffb326572ef 100644 --- a/pkgs/applications/misc/chatblade/default.nix +++ b/pkgs/applications/misc/chatblade/default.nix @@ -2,41 +2,24 @@ python3Packages.buildPythonApplication rec { pname = "chatblade"; - version = "0.6.2"; + version = "0.6.3"; format = "setuptools"; src = fetchPypi { inherit pname version; - hash = "sha256-N4YzXOlD1ULhiHrqA6CLOwBStQSEbz8yqtOt5mCRWLQ="; + hash = "sha256-4zLyIrBkilZ2ciBRkU41iK6Q8xDTdFJYOYalNeEMApg="; }; doCheck = false; # there are no tests pythonImportsCheck = [ "chatblade" ]; propagatedBuildInputs = with python3Packages; [ - aiohttp - aiosignal - async-timeout - attrs - certifi - charset-normalizer - frozenlist - idna - markdown-it-py - mdurl - multidict openai platformdirs - pygments pylatexenc pyyaml - regex - requests rich tiktoken - tqdm - urllib3 - yarl ]; meta = with lib; { From 2b7571a7a055d20b0fb9b8cadf994b96d912ee12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Thu, 29 Aug 2024 09:16:03 -0400 Subject: [PATCH 038/197] mpvScripts.mpv-notify-send: fix build when wrapping --- pkgs/applications/video/mpv/scripts/mpv-notify-send.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix b/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix index b103a45d275b..523914543900 100644 --- a/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix +++ b/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix @@ -31,7 +31,7 @@ buildLua rec { "--prefix" "PATH" ":" - (lib.makeBinPath libnotify) + (lib.makeBinPath [ libnotify ]) ]; passthru.updateScript = unstableGitUpdater { }; From f003a26a14d71eb7b7ec21f49842ed006ce69793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Thu, 29 Aug 2024 09:16:10 -0400 Subject: [PATCH 039/197] mpvScripts.mpv-notify-send: modernise --- .../applications/video/mpv/scripts/mpv-notify-send.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix b/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix index 523914543900..4bc2bedde8f4 100644 --- a/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix +++ b/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix @@ -13,9 +13,9 @@ buildLua rec { src = fetchFromGitHub { owner = "emilazy"; - repo = pname; + repo = "mpv-notify-send"; rev = "a2bab8b2fd8e8d14faa875b5cc3a73f1276cd88a"; - sha256 = "sha256-EwVkhyB87TJ3i9xJmmZMSTMUKvfbImI1S+y1vgRWbDk="; + hash = "sha256-EwVkhyB87TJ3i9xJmmZMSTMUKvfbImI1S+y1vgRWbDk="; }; patches = [ @@ -36,10 +36,10 @@ buildLua rec { passthru.updateScript = unstableGitUpdater { }; - meta = with lib; { + meta = { description = "Lua script for mpv to send notifications with notify-send"; homepage = "https://github.com/emilazy/mpv-notify-send"; - license = licenses.wtfpl; - maintainers = with maintainers; [ r3n3gad3p3arl ]; + license = lib.licenses.wtfpl; + maintainers = with lib.maintainers; [ r3n3gad3p3arl ]; }; } From 3c005b2730522e22bb293131fc8e601579979d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:08:30 -0400 Subject: [PATCH 040/197] mpvScripts.mpv-notify-send: update repo url --- pkgs/applications/video/mpv/scripts/mpv-notify-send.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix b/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix index 4bc2bedde8f4..60ca030c5720 100644 --- a/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix +++ b/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix @@ -12,7 +12,7 @@ buildLua rec { version = "0-unstable-2020-02-24"; src = fetchFromGitHub { - owner = "emilazy"; + owner = "Parranoh"; repo = "mpv-notify-send"; rev = "a2bab8b2fd8e8d14faa875b5cc3a73f1276cd88a"; hash = "sha256-EwVkhyB87TJ3i9xJmmZMSTMUKvfbImI1S+y1vgRWbDk="; @@ -38,7 +38,7 @@ buildLua rec { meta = { description = "Lua script for mpv to send notifications with notify-send"; - homepage = "https://github.com/emilazy/mpv-notify-send"; + homepage = "https://github.com/Parranoh/mpv-notify-send"; license = lib.licenses.wtfpl; maintainers = with lib.maintainers; [ r3n3gad3p3arl ]; }; From e9f0695f3c6ff588f2691e76adea4dd17006090c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:08:57 -0400 Subject: [PATCH 041/197] mpvScripts.mpv-notify-send: 0-unstable-2020-02-24 -> 0-unstable-2024-07-11 --- .../video/mpv/scripts/mpv-notify-send.nix | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix b/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix index 60ca030c5720..0a00b04c7192 100644 --- a/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix +++ b/pkgs/applications/video/mpv/scripts/mpv-notify-send.nix @@ -9,24 +9,15 @@ buildLua rec { pname = "mpv-notify-send"; - version = "0-unstable-2020-02-24"; + version = "0-unstable-2024-07-11"; src = fetchFromGitHub { owner = "Parranoh"; repo = "mpv-notify-send"; - rev = "a2bab8b2fd8e8d14faa875b5cc3a73f1276cd88a"; - hash = "sha256-EwVkhyB87TJ3i9xJmmZMSTMUKvfbImI1S+y1vgRWbDk="; + rev = "d98d9fe566b222c5b909e3905e9e201eaec34959"; + hash = "sha256-H8WIKfQnle27eiwnz2sxC8D1EwQplY4N7Qg5+c1e/uU="; }; - patches = [ - # show title of online videos instead of url - (fetchpatch { - name = "6.patch"; # https://github.com/emilazy/mpv-notify-send/pull/6 - url = "https://github.com/emilazy/mpv-notify-send/commit/948347e14890e15e89cd1e069beb1140e2d01dce.patch"; - hash = "sha256-7aXQ8qeqG4yX0Uyn09xCIESnwPZsb6Frd7C49XgbpFw="; - }) - ]; - passthru.extraWrapperArgs = [ "--prefix" "PATH" From 976d530753ddd1fa12a24e5dd9f066a648d6135e Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 29 Aug 2024 17:22:28 +0200 Subject: [PATCH 042/197] ruff: 0.6.2 -> 0.6.3 Diff: https://github.com/astral-sh/ruff/compare/refs/tags/0.6.2...0.6.3 Changelog: https://github.com/astral-sh/ruff/releases/tag/0.6.3 --- pkgs/by-name/ru/ruff/Cargo.lock | 33 +++++++++++++++++--------------- pkgs/by-name/ru/ruff/package.nix | 4 ++-- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/pkgs/by-name/ru/ruff/Cargo.lock b/pkgs/by-name/ru/ruff/Cargo.lock index e5924fa28a69..67ad7f651000 100644 --- a/pkgs/by-name/ru/ruff/Cargo.lock +++ b/pkgs/by-name/ru/ruff/Cargo.lock @@ -1256,9 +1256,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.157" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374af5f94e54fa97cf75e945cce8a6b201e88a1a07e688b47dfd2a59c66dbd86" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libcst" @@ -1827,9 +1827,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1926,6 +1926,7 @@ dependencies = [ "ruff_db", "ruff_index", "ruff_python_ast", + "ruff_python_literal", "ruff_python_parser", "ruff_python_stdlib", "ruff_source_file", @@ -1988,6 +1989,7 @@ dependencies = [ "anyhow", "crossbeam", "notify", + "rayon", "red_knot_python_semantic", "ruff_cache", "ruff_db", @@ -2088,7 +2090,7 @@ dependencies = [ [[package]] name = "ruff" -version = "0.6.2" +version = "0.6.3" dependencies = [ "anyhow", "argfile", @@ -2146,6 +2148,7 @@ dependencies = [ "criterion", "mimalloc", "once_cell", + "rayon", "red_knot_python_semantic", "red_knot_workspace", "ruff_db", @@ -2280,7 +2283,7 @@ dependencies = [ [[package]] name = "ruff_linter" -version = "0.6.2" +version = "0.6.3" dependencies = [ "aho-corasick", "annotate-snippets 0.9.2", @@ -2600,7 +2603,7 @@ dependencies = [ [[package]] name = "ruff_wasm" -version = "0.6.2" +version = "0.6.3" dependencies = [ "console_error_panic_hook", "console_log", @@ -2827,9 +2830,9 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -2847,9 +2850,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", @@ -2869,9 +2872,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", @@ -3030,9 +3033,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.75" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", diff --git a/pkgs/by-name/ru/ruff/package.nix b/pkgs/by-name/ru/ruff/package.nix index 279b01ce637f..472f46d10a88 100644 --- a/pkgs/by-name/ru/ruff/package.nix +++ b/pkgs/by-name/ru/ruff/package.nix @@ -14,13 +14,13 @@ rustPlatform.buildRustPackage rec { pname = "ruff"; - version = "0.6.2"; + version = "0.6.3"; src = fetchFromGitHub { owner = "astral-sh"; repo = "ruff"; rev = "refs/tags/${version}"; - hash = "sha256-pdaOTMzEOfAKFK+P/4f51bQbmCssMNvq2OGvGVPzvhw="; + hash = "sha256-5jS2NCl01kgUAd8hFtjJCOwRxi0XMM2x7VMpJLEgbOQ="; }; cargoLock = { From ae92f312bf0f80b0e22a177152d54254349d010e Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Thu, 29 Aug 2024 09:04:57 -0700 Subject: [PATCH 043/197] treewide: use a consistent meta.priority default --- lib/meta.nix | 15 +++++++++------ nixos/modules/config/system-path.nix | 4 ++-- pkgs/applications/editors/kakoune/wrapper.nix | 4 ++-- pkgs/applications/editors/neovim/wrapper.nix | 2 +- pkgs/applications/misc/rofi/wrapper.nix | 2 +- .../networking/browsers/firefox/wrapper.nix | 2 +- .../networking/cluster/helm/wrapper.nix | 2 +- .../window-managers/wayfire/wrapper.nix | 2 +- pkgs/build-support/buildenv/default.nix | 2 +- pkgs/data/fonts/powerline-symbols/default.nix | 2 +- .../lomiri-system-settings/wrapper.nix | 2 +- pkgs/development/python-modules/dnf4/wrapper.nix | 2 +- pkgs/development/r-modules/wrapper-radian.nix | 2 +- pkgs/development/r-modules/wrapper.nix | 4 ++-- pkgs/development/tools/analysis/rizin/wrapper.nix | 2 +- .../tools/build-managers/gradle/default.nix | 2 +- pkgs/tools/networking/inetutils/default.nix | 5 +---- pkgs/tools/networking/maubot/wrapper.nix | 2 +- pkgs/tools/networking/openssh/copyid.nix | 4 ++-- 19 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lib/meta.nix b/lib/meta.nix index 57f3a46d0698..798e7e74918c 100644 --- a/lib/meta.nix +++ b/lib/meta.nix @@ -133,12 +133,17 @@ rec { mapDerivationAttrset = f: set: lib.mapAttrs (name: pkg: if lib.isDerivation pkg then (f pkg) else pkg) set; /** - Set the nix-env priority of the package. + The default priority of packages in Nix. See `defaultPriority` in [`src/nix/profile.cc`](https://github.com/NixOS/nix/blob/master/src/nix/profile.cc#L47). + */ + defaultPriority = 5; + + /** + Set the nix-env priority of the package. Note that higher values are lower priority, and vice versa. # Inputs `priority` - : 1\. Function argument + : 1\. The priority to set. `drv` : 2\. Function argument @@ -159,8 +164,7 @@ rec { lowPrio = setPrio 10; /** - Apply lowPrio to an attrset with derivations - + Apply lowPrio to an attrset with derivations. # Inputs @@ -184,8 +188,7 @@ rec { hiPrio = setPrio (-10); /** - Apply hiPrio to an attrset with derivations - + Apply hiPrio to an attrset with derivations. # Inputs diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index 21280d023a4c..83353761b7b8 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -7,7 +7,7 @@ with lib; let - requiredPackages = map (pkg: setPrio ((pkg.meta.priority or 5) + 3) pkg) + requiredPackages = map (pkg: setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg) [ pkgs.acl pkgs.attr pkgs.bashInteractive # bash with ncurses support @@ -48,7 +48,7 @@ let ]; defaultPackages = map - (n: let pkg = pkgs.${n}; in setPrio ((pkg.meta.priority or 5) + 3) pkg) + (n: let pkg = pkgs.${n}; in setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg) defaultPackageNames; defaultPackagesText = "[ ${concatMapStringsSep " " (n: "pkgs.${n}") defaultPackageNames } ]"; diff --git a/pkgs/applications/editors/kakoune/wrapper.nix b/pkgs/applications/editors/kakoune/wrapper.nix index 578da52475f9..60ae58aa72c3 100644 --- a/pkgs/applications/editors/kakoune/wrapper.nix +++ b/pkgs/applications/editors/kakoune/wrapper.nix @@ -1,4 +1,4 @@ -{ symlinkJoin, makeWrapper, kakoune, plugins ? [], configure ? {} }: +{ lib, symlinkJoin, makeWrapper, kakoune, plugins ? [], configure ? {} }: let # "plugins" is the preferred way, but some configurations may be @@ -34,5 +34,5 @@ in rm -Rf "$out/DELETE_ME" ''; - meta = kakoune.meta // { priority = (kakoune.meta.priority or 0) - 1; }; + meta = kakoune.meta // { priority = (kakoune.meta.priority or lib.meta.defaultPriority) - 1; }; } diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index 61f0230724cd..02d6ad85b367 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -214,7 +214,7 @@ let # To prevent builds on hydra hydraPlatforms = []; # prefer wrapper over the package - priority = (neovim-unwrapped.meta.priority or 0) - 1; + priority = (neovim-unwrapped.meta.priority or lib.meta.defaultPriority) - 1; }; }); in diff --git a/pkgs/applications/misc/rofi/wrapper.nix b/pkgs/applications/misc/rofi/wrapper.nix index f8da5074b52a..3f08a5047590 100644 --- a/pkgs/applications/misc/rofi/wrapper.nix +++ b/pkgs/applications/misc/rofi/wrapper.nix @@ -37,6 +37,6 @@ symlinkJoin { ''; meta = rofi-unwrapped.meta // { - priority = (rofi-unwrapped.meta.priority or 0) - 1; + priority = (rofi-unwrapped.meta.priority or lib.meta.defaultPriority) - 1; }; } diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix index 24319ea1a4f7..bbc88581e1e5 100644 --- a/pkgs/applications/networking/browsers/firefox/wrapper.nix +++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix @@ -421,7 +421,7 @@ let inherit (browser.meta) description; mainProgram = launcherName; hydraPlatforms = []; - priority = (browser.meta.priority or 0) - 1; # prefer wrapper over the package + priority = (browser.meta.priority or lib.meta.defaultPriority) - 1; # prefer wrapper over the package }; }; in lib.makeOverridable wrapper diff --git a/pkgs/applications/networking/cluster/helm/wrapper.nix b/pkgs/applications/networking/cluster/helm/wrapper.nix index 3b13668abf68..d933d84db336 100644 --- a/pkgs/applications/networking/cluster/helm/wrapper.nix +++ b/pkgs/applications/networking/cluster/helm/wrapper.nix @@ -40,7 +40,7 @@ in # To prevent builds on hydra hydraPlatforms = []; # prefer wrapper over the package - priority = (helm.meta.priority or 0) - 1; + priority = (helm.meta.priority or lib.meta.defaultPriority) - 1; }; }; in diff --git a/pkgs/applications/window-managers/wayfire/wrapper.nix b/pkgs/applications/window-managers/wayfire/wrapper.nix index 35bb3ad15837..a3ec85722717 100644 --- a/pkgs/applications/window-managers/wayfire/wrapper.nix +++ b/pkgs/applications/window-managers/wayfire/wrapper.nix @@ -27,6 +27,6 @@ symlinkJoin { # To prevent builds on hydra hydraPlatforms = []; # prefer wrapper over the package - priority = (wayfire.meta.priority or 0) - 1; + priority = (wayfire.meta.priority or lib.meta.defaultPriority) - 1; }; } diff --git a/pkgs/build-support/buildenv/default.nix b/pkgs/build-support/buildenv/default.nix index 560f59bcce7d..cb0c308ec2fa 100644 --- a/pkgs/build-support/buildenv/default.nix +++ b/pkgs/build-support/buildenv/default.nix @@ -68,7 +68,7 @@ runCommand name # Add any extra outputs specified by the caller of `buildEnv`. ++ lib.filter (p: p!=null) (builtins.map (outName: drv.${outName} or null) extraOutputsToInstall); - priority = drv.meta.priority or 5; + priority = drv.meta.priority or lib.meta.defaultPriority; }) paths); preferLocalBuild = true; allowSubstitutes = false; diff --git a/pkgs/data/fonts/powerline-symbols/default.nix b/pkgs/data/fonts/powerline-symbols/default.nix index f8b9935d6439..39bdc4d37345 100644 --- a/pkgs/data/fonts/powerline-symbols/default.nix +++ b/pkgs/data/fonts/powerline-symbols/default.nix @@ -5,7 +5,7 @@ let in runCommand "powerline-symbols-${version}" { meta = { inherit (powerline.meta) license; - priority = (powerline.meta.priority or 0) + 1; + priority = (powerline.meta.priority or lib.meta.defaultPriority) + 1; maintainers = with lib.maintainers; [ midchildan ]; }; } '' diff --git a/pkgs/desktops/lomiri/applications/lomiri-system-settings/wrapper.nix b/pkgs/desktops/lomiri/applications/lomiri-system-settings/wrapper.nix index 94af88eba97c..7a550370ef54 100644 --- a/pkgs/desktops/lomiri/applications/lomiri-system-settings/wrapper.nix +++ b/pkgs/desktops/lomiri/applications/lomiri-system-settings/wrapper.nix @@ -65,6 +65,6 @@ stdenvNoCC.mkDerivation (finalAttrs: { meta = lomiri-system-settings-unwrapped.meta // { description = "System Settings application for Lomiri (wrapped)"; - priority = (lomiri-system-settings-unwrapped.meta.priority or 0) - 1; + priority = (lomiri-system-settings-unwrapped.meta.priority or lib.meta.defaultPriority) - 1; }; }) diff --git a/pkgs/development/python-modules/dnf4/wrapper.nix b/pkgs/development/python-modules/dnf4/wrapper.nix index 79a3fd835912..b84584f52fad 100644 --- a/pkgs/development/python-modules/dnf4/wrapper.nix +++ b/pkgs/development/python-modules/dnf4/wrapper.nix @@ -51,6 +51,6 @@ stdenv.mkDerivation { }; meta = dnf4-unwrapped.meta // { - priority = (dnf4-unwrapped.meta.priority or 0) - 1; + priority = (dnf4-unwrapped.meta.priority or lib.meta.defaultPriority) - 1; }; } diff --git a/pkgs/development/r-modules/wrapper-radian.nix b/pkgs/development/r-modules/wrapper-radian.nix index cdac14d3300b..44099206b5b5 100644 --- a/pkgs/development/r-modules/wrapper-radian.nix +++ b/pkgs/development/r-modules/wrapper-radian.nix @@ -22,7 +22,7 @@ runCommand (radian.name + "-wrapper") { # To prevent builds on hydra hydraPlatforms = [ ]; # prefer wrapper over the package - priority = (radian.meta.priority or 0) - 1; + priority = (radian.meta.priority or lib.meta.defaultPriority) - 1; }; } ('' makeWrapper "${radian}/bin/radian" "$out/bin/radian" \ diff --git a/pkgs/development/r-modules/wrapper.nix b/pkgs/development/r-modules/wrapper.nix index 12704149666c..9dffbd83187b 100644 --- a/pkgs/development/r-modules/wrapper.nix +++ b/pkgs/development/r-modules/wrapper.nix @@ -1,4 +1,4 @@ -{ symlinkJoin, R, makeWrapper, recommendedPackages, packages }: +{ lib, symlinkJoin, R, makeWrapper, recommendedPackages, packages }: symlinkJoin { name = R.name + "-wrapper"; preferLocalBuild = true; @@ -26,6 +26,6 @@ symlinkJoin { # To prevent builds on hydra hydraPlatforms = []; # prefer wrapper over the package - priority = (R.meta.priority or 0) - 1; + priority = (R.meta.priority or lib.meta.defaultPriority) - 1; }; } diff --git a/pkgs/development/tools/analysis/rizin/wrapper.nix b/pkgs/development/tools/analysis/rizin/wrapper.nix index 11d046c27f6d..92fe042856cb 100644 --- a/pkgs/development/tools/analysis/rizin/wrapper.nix +++ b/pkgs/development/tools/analysis/rizin/wrapper.nix @@ -39,6 +39,6 @@ symlinkJoin { meta = unwrapped.meta // { # prefer wrapped over unwrapped - priority = (unwrapped.meta.priority or 0) - 1; + priority = (unwrapped.meta.priority or lib.meta.defaultPriority) - 1; }; } diff --git a/pkgs/development/tools/build-managers/gradle/default.nix b/pkgs/development/tools/build-managers/gradle/default.nix index 1522411656cd..de85ea67eb96 100644 --- a/pkgs/development/tools/build-managers/gradle/default.nix +++ b/pkgs/development/tools/build-managers/gradle/default.nix @@ -217,7 +217,7 @@ rec { meta = gradle.meta // { # prefer normal gradle/mitm-cache over this wrapper, this wrapper only provides the setup hook # and passthru - priority = (gradle.meta.priority or 0) + 1; + priority = (gradle.meta.priority or lib.meta.defaultPriority) + 1; }; }) { }; } diff --git a/pkgs/tools/networking/inetutils/default.nix b/pkgs/tools/networking/inetutils/default.nix index cbd327b07297..5bbe7e4f8d40 100644 --- a/pkgs/tools/networking/inetutils/default.nix +++ b/pkgs/tools/networking/inetutils/default.nix @@ -93,10 +93,7 @@ stdenv.mkDerivation rec { The `logger` binary from `util-linux` is preferred over `inetutils`. To instead prioritize this package, set a _lower_ `meta.priority`, or use e.g. `lib.setPrio 5 inetutils`. - - Note that the default `meta.priority` is defined in `buildEnv` and is - currently 5. */ - priority = (util-linux.meta.priority or 5) + 1; + priority = (util-linux.meta.priority or lib.meta.defaultPriority) + 1; }; } diff --git a/pkgs/tools/networking/maubot/wrapper.nix b/pkgs/tools/networking/maubot/wrapper.nix index 6f4c577110be..b145e802a105 100644 --- a/pkgs/tools/networking/maubot/wrapper.nix +++ b/pkgs/tools/networking/maubot/wrapper.nix @@ -64,7 +64,7 @@ let wrapper = { pythonPackages ? (_: [ ]), plugins ? (_: [ ]), baseConfig ? null }; }; - meta.priority = (unwrapped.meta.priority or 0) - 1; + meta.priority = (unwrapped.meta.priority or lib.meta.defaultPriority) - 1; }; in wrapper diff --git a/pkgs/tools/networking/openssh/copyid.nix b/pkgs/tools/networking/openssh/copyid.nix index b0b0d9c96a32..7895e598e733 100644 --- a/pkgs/tools/networking/openssh/copyid.nix +++ b/pkgs/tools/networking/openssh/copyid.nix @@ -1,9 +1,9 @@ -{ runCommand, openssh }: +{ lib, runCommand, openssh }: runCommand "ssh-copy-id-${openssh.version}" { meta = openssh.meta // { description = "Tool to copy SSH public keys to a remote machine"; - priority = (openssh.meta.priority or 0) - 1; + priority = (openssh.meta.priority or lib.meta.defaultPriority) - 1; }; } '' install -Dm 755 {${openssh},$out}/bin/ssh-copy-id From 4c71b5b28043cc6533dab3a96ce3b9dcea3aceeb Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 29 Aug 2024 19:24:41 +0300 Subject: [PATCH 044/197] linux_6_10: 6.10.6 -> 6.10.7 --- pkgs/os-specific/linux/kernel/kernels-org.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/kernels-org.json b/pkgs/os-specific/linux/kernel/kernels-org.json index 949ad2eef5ad..602f2d62dab6 100644 --- a/pkgs/os-specific/linux/kernel/kernels-org.json +++ b/pkgs/os-specific/linux/kernel/kernels-org.json @@ -36,7 +36,7 @@ "hash": "sha256:08ngskni7d9wi93vlwcmbdg7sb2jl1drhhzn62k9nsrg1r7crrss" }, "6.10": { - "version": "6.10.6", - "hash": "sha256:1ldkf2h7ccwq2hdngxjzp96qd4vlmy3z2y8fcrsr6ngqfidhvmg0" + "version": "6.10.7", + "hash": "sha256:1adkbn6dqbpzlr3x87a18mhnygphmvx3ffscwa67090qy1zmc3ch" } } From 7c396432e28f717d46d931f647ad9735469a7e92 Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 29 Aug 2024 19:24:46 +0300 Subject: [PATCH 045/197] linux_6_6: 6.6.47 -> 6.6.48 --- pkgs/os-specific/linux/kernel/kernels-org.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/kernels-org.json b/pkgs/os-specific/linux/kernel/kernels-org.json index 602f2d62dab6..3653c8e8a827 100644 --- a/pkgs/os-specific/linux/kernel/kernels-org.json +++ b/pkgs/os-specific/linux/kernel/kernels-org.json @@ -24,8 +24,8 @@ "hash": "sha256:18a723djyq3y2jhjazwgiwqslh1yz954wb82cg7bf083n091lrwx" }, "6.6": { - "version": "6.6.47", - "hash": "sha256:0l2gav312b12w5gxcjynca5caafkc38ln196p6qjpagax74pccyl" + "version": "6.6.48", + "hash": "sha256:0a90fx0r25nkcr5b16dn1j7vwyndnshaxn6ziyviccds59xxy5kb" }, "6.8": { "version": "6.8.12", From 080235871b05919d06a27ac9c16b02d4da1091d3 Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 29 Aug 2024 19:24:54 +0300 Subject: [PATCH 046/197] linux_6_1: 6.1.106 -> 6.1.107 --- pkgs/os-specific/linux/kernel/kernels-org.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/kernels-org.json b/pkgs/os-specific/linux/kernel/kernels-org.json index 3653c8e8a827..f68ef004e4d1 100644 --- a/pkgs/os-specific/linux/kernel/kernels-org.json +++ b/pkgs/os-specific/linux/kernel/kernels-org.json @@ -4,8 +4,8 @@ "hash": "sha256:06qq6y7cryq0xy4b68ky2hr44cw2nqhbna0dbzfbmr9d5sh9c0gn" }, "6.1": { - "version": "6.1.106", - "hash": "sha256:03zqsm60rqwsp5r2pmprrr6akh8mw6z89jiphcp479vv5h2wjwrp" + "version": "6.1.107", + "hash": "sha256:1s5h51r41l0d3k1h9i4mya7nz53jd6i200s06w5gl49hsz8jjcpl" }, "5.15": { "version": "5.15.165", From 0532e4c174089084bfc1ed1854fb351325415fb9 Mon Sep 17 00:00:00 2001 From: TornaxO7 Date: Thu, 29 Aug 2024 16:42:38 +0200 Subject: [PATCH 047/197] rio: 0.1.8 -> 0.1.10 --- pkgs/applications/terminal-emulators/rio/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/terminal-emulators/rio/default.nix b/pkgs/applications/terminal-emulators/rio/default.nix index 64f98b3ddcd9..b232bec2c5b2 100644 --- a/pkgs/applications/terminal-emulators/rio/default.nix +++ b/pkgs/applications/terminal-emulators/rio/default.nix @@ -55,16 +55,16 @@ let in rustPlatform.buildRustPackage rec { pname = "rio"; - version = "0.1.8"; + version = "0.1.10"; src = fetchFromGitHub { owner = "raphamorim"; repo = "rio"; rev = "refs/tags/v${version}"; - hash = "sha256-NLvCLyIts3NoSqbR9PIhXj3GCeURrBXXv/zVgZecfNQ="; + hash = "sha256-S42is3wqjBvYgysQ6yDUAn7ZEy9xJBmQD/emYAQfCkw="; }; - cargoHash = "sha256-TvNmTI3At2ezsdEOd5mAc6uUQXgGP47d0AMVVUUJr/A="; + cargoHash = "sha256-ILX3xrcz3tMnl7mUrwUAXv9ffaZKjSoSf8cZVQB10zk="; nativeBuildInputs = [ ncurses From 87d29e6770206633e1c4779b8c56b8e4705b5762 Mon Sep 17 00:00:00 2001 From: networkException Date: Thu, 29 Aug 2024 19:08:30 +0200 Subject: [PATCH 048/197] ungoogled-chromium: 128.0.6613.84-1 -> 128.0.6613.113-1 https://chromereleases.googleblog.com/2024/08/stable-channel-update-for-desktop_28.html This update includes 4 security fixes. CVEs: CVE-2024-7969 CVE-2024-8193 CVE-2024-8194 CVE-2024-8198 --- .../networking/browsers/chromium/upstream-info.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/upstream-info.nix b/pkgs/applications/networking/browsers/chromium/upstream-info.nix index efd486ede2d7..786991c11c79 100644 --- a/pkgs/applications/networking/browsers/chromium/upstream-info.nix +++ b/pkgs/applications/networking/browsers/chromium/upstream-info.nix @@ -27,11 +27,11 @@ version = "2024-06-11"; }; ungoogled-patches = { - hash = "sha256-UneOTEWgAbWCuzqtJgw+t5LJXBYmjpXBTxjhMMqzd/A="; - rev = "128.0.6613.84-1"; + hash = "sha256-2P9c+zS741H4/jTp92mno4egju9r0tGTLkXHAFhM9mA="; + rev = "128.0.6613.113-1"; }; }; - hash = "sha256-kUHJtJ4X8UDMP2TgHdFd6gEPzU28mBgxtGceVZCl5xM="; - version = "128.0.6613.84"; + hash = "sha256-wqhaK1VuE1qPLt+f/x2KrtwZGxKFluTOWYMau+cSl2E="; + version = "128.0.6613.113"; }; } From 6e35478f2829d816d645f23e126c887f17be7759 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 29 Aug 2024 17:24:11 +0200 Subject: [PATCH 049/197] python312Packages.uproot: 5.3.11 -> 5.3.12 Diff: https://github.com/scikit-hep/uproot5/compare/refs/tags/v5.3.11...v5.3.12 Changelog: https://github.com/scikit-hep/uproot5/releases/tag/v5.3.12 --- pkgs/development/python-modules/uproot/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/uproot/default.nix b/pkgs/development/python-modules/uproot/default.nix index 1a5bd07a01be..7806daf5ff7d 100644 --- a/pkgs/development/python-modules/uproot/default.nix +++ b/pkgs/development/python-modules/uproot/default.nix @@ -26,7 +26,7 @@ buildPythonPackage rec { pname = "uproot"; - version = "5.3.11"; + version = "5.3.12"; pyproject = true; disabled = pythonOlder "3.8"; @@ -35,7 +35,7 @@ buildPythonPackage rec { owner = "scikit-hep"; repo = "uproot5"; rev = "refs/tags/v${version}"; - hash = "sha256-MQdSUB9m1BNg+/ybdNrho0V+LlNKavmFdBdBKLhHt2w="; + hash = "sha256-ozrC/I6CNHE/7S0ioL+ED9Vk6q0v3i4lNxv7ipvProk="; }; build-system = [ From c5e06127be81b69ff76a3a5ea6ac40014d41e3dc Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 29 Aug 2024 17:24:52 +0200 Subject: [PATCH 050/197] python312Packages.coffea: 2024.8.1 -> 2024.8.2 Diff: https://github.com/CoffeaTeam/coffea/compare/refs/tags/v2024.8.1...v2024.8.2 Changelog: https://github.com/CoffeaTeam/coffea/releases/tag/v2024.8.2 --- pkgs/development/python-modules/coffea/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/coffea/default.nix b/pkgs/development/python-modules/coffea/default.nix index 12362b4dc16f..72f54424756c 100644 --- a/pkgs/development/python-modules/coffea/default.nix +++ b/pkgs/development/python-modules/coffea/default.nix @@ -42,7 +42,7 @@ buildPythonPackage rec { pname = "coffea"; - version = "2024.8.1"; + version = "2024.8.2"; pyproject = true; disabled = pythonOlder "3.8"; @@ -51,7 +51,7 @@ buildPythonPackage rec { owner = "CoffeaTeam"; repo = "coffea"; rev = "refs/tags/v${version}"; - hash = "sha256-tFNBtjIxcn+Ux+QNWBbRCmCkgMuddodnKmeRCfT3PEs="; + hash = "sha256-Lgen4HNZpnd+IDXRHk3U0kFiFZh72RcqAOIg+eyd150="; }; build-system = [ From 39190e44d41bd51110deb4cf8c2f41827c3909d8 Mon Sep 17 00:00:00 2001 From: hand7s Date: Tue, 27 Aug 2024 23:10:09 +0300 Subject: [PATCH 051/197] spoofdpi: init at 0.10.12 Co-authored-by: Radik Islamov --- pkgs/by-name/sp/spoofdpi/package.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pkgs/by-name/sp/spoofdpi/package.nix diff --git a/pkgs/by-name/sp/spoofdpi/package.nix b/pkgs/by-name/sp/spoofdpi/package.nix new file mode 100644 index 000000000000..5c3e30f342a6 --- /dev/null +++ b/pkgs/by-name/sp/spoofdpi/package.nix @@ -0,0 +1,28 @@ +{ + lib, + stdenv, + fetchFromGitHub, + buildGoModule, + ... +}: + +buildGoModule rec { + pname = "SpoofDPI"; + version = "0.11.1"; + + src = fetchFromGitHub { + owner = "xvzc"; + repo = "SpoofDPI"; + rev = "v${version}"; + hash = "sha256-GdGOnaIDy7XWWo0MOu+HfQcLrW/PDlRxf0y1jjJrZNQ="; + }; + + vendorHash = "sha256-47Gt5SI6VXq4+1T0LxFvQoYNk+JqTt3DonDXLfmFBzw="; + + meta = { + homepage = "https://github.com/xvzc/SpoofDPI"; + description = "A simple and fast anti-censorship tool written in Go"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ s0me1newithhand7s ]; + }; +} From 6186bea91f6e97b39153ba77d55808c2e4c65e2d Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 29 Aug 2024 19:51:25 +0000 Subject: [PATCH 052/197] skypeforlinux: 8.126.0.208 -> 8.127.0.200 --- pkgs/by-name/sk/skypeforlinux/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/sk/skypeforlinux/package.nix b/pkgs/by-name/sk/skypeforlinux/package.nix index 62148ea14f7b..0de05f358a5a 100644 --- a/pkgs/by-name/sk/skypeforlinux/package.nix +++ b/pkgs/by-name/sk/skypeforlinux/package.nix @@ -42,8 +42,8 @@ let # Please keep the version x.y.0.z and do not update to x.y.76.z because the # source of the latter disappears much faster. - version = "8.126.0.208"; - revision = "357"; + version = "8.127.0.200"; + revision = "359"; rpath = lib.makeLibraryPath [ @@ -103,7 +103,7 @@ let fetchurl { name = "skypeforlinux-${version}-${revision}.snap"; url = "https://api.snapcraft.io/api/v1/snaps/download/QRDEfjn4WJYnm0FzDKwqqRZZI77awQEV_${revision}.snap"; - hash = "sha512-3p/NtcIgxNgVy4KtnZFI9+zNs/UoPHwqw3mCb5nz7OoLjodu5bIVmGRBt1IcboytNx2yO51WEdxIrEKM6kX/Jg=="; + hash = "sha512-C0UQ9mUhrt3CXBPG1BEz4CjjYfy/mRkgrBpjTxhYpeACJq0rNwTUMacicF7BHDgllQmfAdr2/feLyqbsr9HTBQ=="; } else throw "Skype for linux is not supported on ${stdenv.hostPlatform.system}"; From 5f5e0589c8094b0f03b82f8466cf2ac69a513eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 29 Aug 2024 13:07:58 -0700 Subject: [PATCH 053/197] python312Packages.pycaption: 2.2.11 -> 2.2.12 Diff: https://github.com/pbs/pycaption/compare/refs/tags/2.2.11...2.2.12 Changelog: https://github.com/pbs/pycaption/blob/2.2.12/docs/changelog.rst --- pkgs/development/python-modules/pycaption/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/pycaption/default.nix b/pkgs/development/python-modules/pycaption/default.nix index 61cde1daca70..0707726f58e9 100644 --- a/pkgs/development/python-modules/pycaption/default.nix +++ b/pkgs/development/python-modules/pycaption/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "pycaption"; - version = "2.2.11"; + version = "2.2.12"; disabled = pythonOlder "3.8"; @@ -24,18 +24,18 @@ buildPythonPackage rec { owner = "pbs"; repo = "pycaption"; rev = "refs/tags/${version}"; - hash = "sha256-ae3aldx/8nRnqut7py2KmqETQuAUt2wpDwFA/30UiGg="; + hash = "sha256-vdSoqNWEubK0np14EiI/hRbrEx0722qg6Ggcpmhz8FM="; }; - nativeBuildInputs = [ setuptools ]; + build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ beautifulsoup4 lxml cssutils ]; - passthru.optional-dependencies = { + optional-dependencies = { transcript = [ nltk ]; }; From 280defa9bfc1f552ab07a54aba77894241a59996 Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 29 Aug 2024 23:43:52 +0300 Subject: [PATCH 054/197] Revert "widevine-cdm: add aarch64 support" --- maintainers/maintainer-list.nix | 6 --- .../networking/browsers/misc/widevine-cdm.nix | 44 ++----------------- 2 files changed, 4 insertions(+), 46 deletions(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 3da9775909d3..42072e3dad97 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -5630,12 +5630,6 @@ githubId = 6689924; name = "David Terry"; }; - dxwil = { - email = "dovydas@kersys.lt"; - github = "dxwil"; - githubId = 90563298; - name = "Dovydas Kersys"; - }; dylan-gonzalez = { email = "dylcg10@gmail.com"; github = "dylan-gonzalez"; diff --git a/pkgs/applications/networking/browsers/misc/widevine-cdm.nix b/pkgs/applications/networking/browsers/misc/widevine-cdm.nix index bd5813ddcccc..0c8d8fb24edd 100644 --- a/pkgs/applications/networking/browsers/misc/widevine-cdm.nix +++ b/pkgs/applications/networking/browsers/misc/widevine-cdm.nix @@ -1,70 +1,34 @@ { lib , stdenv -, fetchurl , fetchzip -, fetchFromGitHub -, squashfsTools -, curl -, python3 }: stdenv.mkDerivation rec { pname = "widevine-cdm"; version = "4.10.2710.0"; - lacrosVersion = "120.0.6098.0"; - widevineInstaller = if stdenv.isAarch64 then fetchFromGitHub { - owner = "AsahiLinux"; - repo = "widevine-installer"; - rev = "7a3928fe1342fb07d96f61c2b094e3287588958b"; - sha256 = "sha256-XI1y4pVNpXS+jqFs0KyVMrxcULOJ5rADsgvwfLF6e0Y="; - } else null; - - src = if stdenv.isAarch64 then fetchurl { - url = "https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/chromeos-lacros-arm64-squash-zstd-${lacrosVersion}"; - hash = "sha256-OKV8w5da9oZ1oSGbADVPCIkP9Y0MVLaQ3PXS3ZBLFXY="; - } else fetchzip { + src = fetchzip { url = "https://dl.google.com/widevine-cdm/${version}-linux-x64.zip"; hash = "sha256-lGTrSzUk5FluH1o4E/9atLIabEpco3C3gZw+y6H6LJo="; stripRoot = false; }; - buildInputs = [ squashfsTools curl python3 ]; - - unpackPhase = if stdenv.isAarch64 then '' - curl -# -o lacros.squashfs "file://$src" - unsquashfs -q lacros.squashfs 'WidevineCdm/*' - python3 ${widevineInstaller}/widevine_fixup.py squashfs-root/WidevineCdm/_platform_specific/cros_arm64/libwidevinecdm.so libwidevinecdm.so - cp squashfs-root/WidevineCdm/manifest.json . - cp squashfs-root/WidevineCdm/LICENSE LICENSE.txt - '' else null; - installPhase = '' runHook preInstall install -vD manifest.json $out/share/google/chrome/WidevineCdm/manifest.json install -vD LICENSE.txt $out/share/google/chrome/WidevineCdm/LICENSE.txt - install -vD libwidevinecdm.so $out/share/google/chrome/WidevineCdm/_platform_specific/linux_${ - if stdenv.targetPlatform.isAarch64 then "arm64" - else if stdenv.targetPlatform.isx86_64 then "x64" - else throw "Unsupported platform ${stdenv.targetPlatform.config}" - }/libwidevinecdm.so + install -vD libwidevinecdm.so $out/share/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so runHook postInstall ''; -# Accoring to widevine-installer: "Hack because Chromium hardcodes a check for this right now..." - postInstall = lib.optionalString stdenv.isAarch64 '' - mkdir -p "$out/share/google/chrome/WidevineCdm/_platform_specific/linux_x64" - touch "$out/share/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so" - ''; - meta = with lib; { description = "Widevine CDM"; homepage = "https://www.widevine.com"; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; license = licenses.unfree; - maintainers = with maintainers; [ jlamur dxwil ]; - platforms = [ "x86_64-linux" "aarch64-linux" ]; + maintainers = with maintainers; [ jlamur ]; + platforms = [ "x86_64-linux" ]; }; } From 15b6c50fa91a0a0cc8d681e43a1c577853e1940a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:48 +0200 Subject: [PATCH 055/197] nixos/users.mysql: remove `with lib;` --- nixos/modules/config/mysql.nix | 195 ++++++++++++++++----------------- 1 file changed, 96 insertions(+), 99 deletions(-) diff --git a/nixos/modules/config/mysql.nix b/nixos/modules/config/mysql.nix index e1f9e223cc59..6b82603aa455 100644 --- a/nixos/modules/config/mysql.nix +++ b/nixos/modules/config/mysql.nix @@ -1,47 +1,44 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.users.mysql; in { - meta.maintainers = [ maintainers.netali ]; + meta.maintainers = [ lib.maintainers.netali ]; options = { users.mysql = { - enable = mkEnableOption "authentication against a MySQL/MariaDB database"; - host = mkOption { - type = types.str; + enable = lib.mkEnableOption "authentication against a MySQL/MariaDB database"; + host = lib.mkOption { + type = lib.types.str; example = "localhost"; description = "The hostname of the MySQL/MariaDB server"; }; - database = mkOption { - type = types.str; + database = lib.mkOption { + type = lib.types.str; example = "auth"; description = "The name of the database containing the users"; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; example = "nss-user"; description = "The username to use when connecting to the database"; }; - passwordFile = mkOption { - type = types.path; + passwordFile = lib.mkOption { + type = lib.types.path; example = "/run/secrets/mysql-auth-db-passwd"; description = "The path to the file containing the password for the user"; }; - pam = mkOption { + pam = lib.mkOption { description = "Settings for `pam_mysql`"; - type = types.submodule { + type = lib.types.submodule { options = { - table = mkOption { - type = types.str; + table = lib.mkOption { + type = lib.types.str; example = "users"; description = "The name of table that maps unique login names to the passwords."; }; - updateTable = mkOption { - type = types.nullOr types.str; + updateTable = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; example = "users_updates"; description = '' @@ -49,18 +46,18 @@ in of the `table` option will be used instead. ''; }; - userColumn = mkOption { - type = types.str; + userColumn = lib.mkOption { + type = lib.types.str; example = "username"; description = "The name of the column that contains a unix login name."; }; - passwordColumn = mkOption { - type = types.str; + passwordColumn = lib.mkOption { + type = lib.types.str; example = "password"; description = "The name of the column that contains a (encrypted) password string."; }; - statusColumn = mkOption { - type = types.nullOr types.str; + statusColumn = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; example = "status"; description = '' @@ -79,9 +76,9 @@ in This ends up requiring that the user enter a new password. ''; }; - passwordCrypt = mkOption { + passwordCrypt = lib.mkOption { example = "2"; - type = types.enum [ + type = lib.types.enum [ "0" "plain" "1" "Y" "2" "mysql" @@ -121,28 +118,28 @@ in Use sha256 hashed passwords. ''; }; - cryptDefault = mkOption { - type = types.nullOr (types.enum [ "md5" "sha256" "sha512" "blowfish" ]); + cryptDefault = lib.mkOption { + type = lib.types.nullOr (lib.types.enum [ "md5" "sha256" "sha512" "blowfish" ]); default = null; example = "blowfish"; description = "The default encryption method to use for `passwordCrypt = 1`."; }; - where = mkOption { - type = types.nullOr types.str; + where = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; example = "host.name='web' AND user.active=1"; description = "Additional criteria for the query."; }; - verbose = mkOption { - type = types.bool; + verbose = lib.mkOption { + type = lib.types.bool; default = false; description = '' If enabled, produces logs with detailed messages that describes what `pam_mysql` is doing. May be useful for debugging. ''; }; - disconnectEveryOperation = mkOption { - type = types.bool; + disconnectEveryOperation = lib.mkOption { + type = lib.types.bool; default = false; description = '' By default, `pam_mysql` keeps the connection to the MySQL @@ -152,34 +149,34 @@ in ''; }; logging = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = "Enables logging of authentication attempts in the MySQL database."; }; - table = mkOption { - type = types.str; + table = lib.mkOption { + type = lib.types.str; example = "logs"; description = "The name of the table to which logs are written."; }; - msgColumn = mkOption { - type = types.str; + msgColumn = lib.mkOption { + type = lib.types.str; example = "msg"; description = '' The name of the column in the log table to which the description of the performed operation is stored. ''; }; - userColumn = mkOption { - type = types.str; + userColumn = lib.mkOption { + type = lib.types.str; example = "user"; description = '' The name of the column in the log table to which the name of the user being authenticated is stored. ''; }; - pidColumn = mkOption { - type = types.str; + pidColumn = lib.mkOption { + type = lib.types.str; example = "pid"; description = '' The name of the column in the log table to which the pid of the @@ -187,16 +184,16 @@ in service is stored. ''; }; - hostColumn = mkOption { - type = types.str; + hostColumn = lib.mkOption { + type = lib.types.str; example = "host"; description = '' The name of the column in the log table to which the name of the user being authenticated is stored. ''; }; - rHostColumn = mkOption { - type = types.str; + rHostColumn = lib.mkOption { + type = lib.types.str; example = "rhost"; description = '' The name of the column in the log table to which the name of the remote @@ -204,8 +201,8 @@ in set by the PAM-aware application with `pam_set_item(PAM_RHOST)`. ''; }; - timeColumn = mkOption { - type = types.str; + timeColumn = lib.mkOption { + type = lib.types.str; example = "timestamp"; description = '' The name of the column in the log table to which the timestamp of the @@ -216,19 +213,19 @@ in }; }; }; - nss = mkOption { + nss = lib.mkOption { description = '' Settings for `libnss-mysql`. All examples are from the [minimal example](https://github.com/saknopper/libnss-mysql/tree/master/sample/minimal) of `libnss-mysql`, but they are modified with NixOS paths for bash. ''; - type = types.submodule { + type = lib.types.submodule { options = { - getpwnam = mkOption { - type = types.nullOr types.str; + getpwnam = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; - example = literalExpression '' + example = lib.literalExpression '' SELECT username,'x',uid,'5000','MySQL User', CONCAT('/home/',username),'/run/sw/current-system/bin/bash' \ FROM users \ WHERE username='%1$s' \ @@ -239,10 +236,10 @@ in syscall. ''; }; - getpwuid = mkOption { - type = types.nullOr types.str; + getpwuid = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; - example = literalExpression '' + example = lib.literalExpression '' SELECT username,'x',uid,'5000','MySQL User', CONCAT('/home/',username),'/run/sw/current-system/bin/bash' \ FROM users \ WHERE uid='%1$u' \ @@ -253,10 +250,10 @@ in syscall. ''; }; - getspnam = mkOption { - type = types.nullOr types.str; + getspnam = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; - example = literalExpression '' + example = lib.literalExpression '' SELECT username,password,'1','0','99999','0','0','-1','0' \ FROM users \ WHERE username='%1$s' \ @@ -267,10 +264,10 @@ in syscall. ''; }; - getpwent = mkOption { - type = types.nullOr types.str; + getpwent = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; - example = literalExpression '' + example = lib.literalExpression '' SELECT username,'x',uid,'5000','MySQL User', CONCAT('/home/',username),'/run/sw/current-system/bin/bash' FROM users ''; description = '' @@ -278,10 +275,10 @@ in syscall. ''; }; - getspent = mkOption { - type = types.nullOr types.str; + getspent = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; - example = literalExpression '' + example = lib.literalExpression '' SELECT username,password,'1','0','99999','0','0','-1','0' FROM users ''; description = '' @@ -289,10 +286,10 @@ in syscall. ''; }; - getgrnam = mkOption { - type = types.nullOr types.str; + getgrnam = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; - example = literalExpression '' + example = lib.literalExpression '' SELECT name,password,gid FROM groups WHERE name='%1$s' LIMIT 1 ''; description = '' @@ -300,10 +297,10 @@ in syscall. ''; }; - getgrgid = mkOption { - type = types.nullOr types.str; + getgrgid = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; - example = literalExpression '' + example = lib.literalExpression '' SELECT name,password,gid FROM groups WHERE gid='%1$u' LIMIT 1 ''; description = '' @@ -311,10 +308,10 @@ in syscall. ''; }; - getgrent = mkOption { - type = types.nullOr types.str; + getgrent = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; - example = literalExpression '' + example = lib.literalExpression '' SELECT name,password,gid FROM groups ''; description = '' @@ -322,10 +319,10 @@ in syscall. ''; }; - memsbygid = mkOption { - type = types.nullOr types.str; + memsbygid = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; - example = literalExpression '' + example = lib.literalExpression '' SELECT username FROM grouplist WHERE gid='%1$u' ''; description = '' @@ -333,10 +330,10 @@ in syscall. ''; }; - gidsbymem = mkOption { - type = types.nullOr types.str; + gidsbymem = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; - example = literalExpression '' + example = lib.literalExpression '' SELECT gid FROM grouplist WHERE username='%1$s' ''; description = '' @@ -350,7 +347,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { system.nssModules = [ pkgs.libnss-mysql ]; system.nssDatabases.shadow = [ "mysql" ]; system.nssDatabases.group = [ "mysql" ]; @@ -371,15 +368,15 @@ in users.password_crypt=${cfg.pam.passwordCrypt} users.disconnect_every_operation=${if cfg.pam.disconnectEveryOperation then "1" else "0"} verbose=${if cfg.pam.verbose then "1" else "0"} - '' + optionalString (cfg.pam.cryptDefault != null) '' + '' + lib.optionalString (cfg.pam.cryptDefault != null) '' users.use_${cfg.pam.cryptDefault}=1 - '' + optionalString (cfg.pam.where != null) '' + '' + lib.optionalString (cfg.pam.where != null) '' users.where_clause=${cfg.pam.where} - '' + optionalString (cfg.pam.statusColumn != null) '' + '' + lib.optionalString (cfg.pam.statusColumn != null) '' users.status_column=${cfg.pam.statusColumn} - '' + optionalString (cfg.pam.updateTable != null) '' + '' + lib.optionalString (cfg.pam.updateTable != null) '' users.update_table=${cfg.pam.updateTable} - '' + optionalString cfg.pam.logging.enable '' + '' + lib.optionalString cfg.pam.logging.enable '' log.enabled=true log.table=${cfg.pam.logging.table} log.message_column=${cfg.pam.logging.msgColumn} @@ -395,25 +392,25 @@ in mode = "0600"; user = config.services.nscd.user; group = config.services.nscd.group; - text = optionalString (cfg.nss.getpwnam != null) '' + text = lib.optionalString (cfg.nss.getpwnam != null) '' getpwnam ${cfg.nss.getpwnam} - '' + optionalString (cfg.nss.getpwuid != null) '' + '' + lib.optionalString (cfg.nss.getpwuid != null) '' getpwuid ${cfg.nss.getpwuid} - '' + optionalString (cfg.nss.getspnam != null) '' + '' + lib.optionalString (cfg.nss.getspnam != null) '' getspnam ${cfg.nss.getspnam} - '' + optionalString (cfg.nss.getpwent != null) '' + '' + lib.optionalString (cfg.nss.getpwent != null) '' getpwent ${cfg.nss.getpwent} - '' + optionalString (cfg.nss.getspent != null) '' + '' + lib.optionalString (cfg.nss.getspent != null) '' getspent ${cfg.nss.getspent} - '' + optionalString (cfg.nss.getgrnam != null) '' + '' + lib.optionalString (cfg.nss.getgrnam != null) '' getgrnam ${cfg.nss.getgrnam} - '' + optionalString (cfg.nss.getgrgid != null) '' + '' + lib.optionalString (cfg.nss.getgrgid != null) '' getgrgid ${cfg.nss.getgrgid} - '' + optionalString (cfg.nss.getgrent != null) '' + '' + lib.optionalString (cfg.nss.getgrent != null) '' getgrent ${cfg.nss.getgrent} - '' + optionalString (cfg.nss.memsbygid != null) '' + '' + lib.optionalString (cfg.nss.memsbygid != null) '' memsbygid ${cfg.nss.memsbygid} - '' + optionalString (cfg.nss.gidsbymem != null) '' + '' + lib.optionalString (cfg.nss.gidsbymem != null) '' gidsbymem ${cfg.nss.gidsbymem} '' + '' host ${cfg.host} From f80a40105a5aefd7d83bb58be4f8d0dee3f9ddda Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:53 +0200 Subject: [PATCH 056/197] nixos/services.hydra: remove `with lib;` --- .../continuous-integration/hydra/default.nix | 121 +++++++++--------- 1 file changed, 59 insertions(+), 62 deletions(-) diff --git a/nixos/modules/services/continuous-integration/hydra/default.nix b/nixos/modules/services/continuous-integration/hydra/default.nix index ffee95fefc4b..6702cec1f4f2 100644 --- a/nixos/modules/services/continuous-integration/hydra/default.nix +++ b/nixos/modules/services/continuous-integration/hydra/default.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.hydra; @@ -20,8 +17,8 @@ let { NIX_REMOTE = "daemon"; SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt"; # Remove in 16.03 PGPASSFILE = "${baseDir}/pgpass"; - NIX_REMOTE_SYSTEMS = concatStringsSep ":" cfg.buildMachinesFiles; - } // optionalAttrs (cfg.smtpHost != null) { + NIX_REMOTE_SYSTEMS = lib.concatStringsSep ":" cfg.buildMachinesFiles; + } // lib.optionalAttrs (cfg.smtpHost != null) { EMAIL_SENDER_TRANSPORT = "SMTP"; EMAIL_SENDER_TRANSPORT_host = cfg.smtpHost; } // hydraEnv // cfg.extraEnv; @@ -31,7 +28,7 @@ let XDG_CACHE_HOME = "${baseDir}/www/.cache"; COLUMNS = "80"; PGPASSFILE = "${baseDir}/pgpass-www"; # grrr - } // (optionalAttrs cfg.debugServer { DBIC_TRACE = "1"; }); + } // (lib.optionalAttrs cfg.debugServer { DBIC_TRACE = "1"; }); localDB = "dbi:Pg:dbname=hydra;user=hydra;"; @@ -39,7 +36,7 @@ let hydra-package = let - makeWrapperArgs = concatStringsSep " " (mapAttrsToList (key: value: "--set-default \"${key}\" \"${value}\"") hydraEnv); + makeWrapperArgs = lib.concatStringsSep " " (lib.mapAttrsToList (key: value: "--set-default \"${key}\" \"${value}\"") hydraEnv); in pkgs.buildEnv rec { name = "hydra-env"; nativeBuildInputs = [ pkgs.makeWrapper ]; @@ -51,7 +48,7 @@ let fi mkdir -p "$out/bin" - for path in ${concatStringsSep " " paths}; do + for path in ${lib.concatStringsSep " " paths}; do if [ -d "$path/bin" ]; then cd "$path/bin" for prg in *; do @@ -75,16 +72,16 @@ in services.hydra = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to run Hydra services. ''; }; - dbi = mkOption { - type = types.str; + dbi = lib.mkOption { + type = lib.types.str; default = localDB; example = "dbi:Pg:dbname=hydra;host=postgres.example.org;user=foo;"; description = '' @@ -97,17 +94,17 @@ in ''; }; - package = mkPackageOption pkgs "hydra" { }; + package = lib.mkPackageOption pkgs "hydra" { }; - hydraURL = mkOption { - type = types.str; + hydraURL = lib.mkOption { + type = lib.types.str; description = '' The base URL for the Hydra webserver instance. Used for links in emails. ''; }; - listenHost = mkOption { - type = types.str; + listenHost = lib.mkOption { + type = lib.types.str; default = "*"; example = "localhost"; description = '' @@ -116,39 +113,39 @@ in ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 3000; description = '' TCP port the web server should listen to. ''; }; - minimumDiskFree = mkOption { - type = types.int; + minimumDiskFree = lib.mkOption { + type = lib.types.int; default = 0; description = '' Threshold of minimum disk space (GiB) to determine if the queue runner should run or not. ''; }; - minimumDiskFreeEvaluator = mkOption { - type = types.int; + minimumDiskFreeEvaluator = lib.mkOption { + type = lib.types.int; default = 0; description = '' Threshold of minimum disk space (GiB) to determine if the evaluator should run or not. ''; }; - notificationSender = mkOption { - type = types.str; + notificationSender = lib.mkOption { + type = lib.types.str; description = '' Sender email address used for email notifications. ''; }; - smtpHost = mkOption { - type = types.nullOr types.str; + smtpHost = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; example = "localhost"; description = '' @@ -156,73 +153,73 @@ in ''; }; - tracker = mkOption { - type = types.str; + tracker = lib.mkOption { + type = lib.types.str; default = ""; description = '' Piece of HTML that is included on all pages. ''; }; - logo = mkOption { - type = types.nullOr types.path; + logo = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' Path to a file containing the logo of your Hydra instance. ''; }; - debugServer = mkOption { - type = types.bool; + debugServer = lib.mkOption { + type = lib.types.bool; default = false; description = "Whether to run the server in debug mode."; }; - maxServers = mkOption { - type = types.int; + maxServers = lib.mkOption { + type = lib.types.int; default = 25; description = "Maximum number of starman workers to spawn."; }; - minSpareServers = mkOption { - type = types.int; + minSpareServers = lib.mkOption { + type = lib.types.int; default = 4; description = "Minimum number of spare starman workers to keep."; }; - maxSpareServers = mkOption { - type = types.int; + maxSpareServers = lib.mkOption { + type = lib.types.int; default = 5; description = "Maximum number of spare starman workers to keep."; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; description = "Extra lines for the Hydra configuration."; }; - extraEnv = mkOption { - type = types.attrsOf types.str; + extraEnv = lib.mkOption { + type = lib.types.attrsOf lib.types.str; default = {}; description = "Extra environment variables for Hydra."; }; - gcRootsDir = mkOption { - type = types.path; + gcRootsDir = lib.mkOption { + type = lib.types.path; default = "/nix/var/nix/gcroots/hydra"; description = "Directory that holds Hydra garbage collector roots."; }; - buildMachinesFiles = mkOption { - type = types.listOf types.path; - default = optional (config.nix.buildMachines != []) "/etc/nix/machines"; - defaultText = literalExpression ''optional (config.nix.buildMachines != []) "/etc/nix/machines"''; + buildMachinesFiles = lib.mkOption { + type = lib.types.listOf lib.types.path; + default = lib.optional (config.nix.buildMachines != []) "/etc/nix/machines"; + defaultText = lib.literalExpression ''lib.optional (config.nix.buildMachines != []) "/etc/nix/machines"''; example = [ "/etc/nix/machines" "/var/lib/hydra/provisioner/machines" ]; description = "List of files containing build machines."; }; - useSubstitutes = mkOption { - type = types.bool; + useSubstitutes = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to use binary caches for downloading store paths. Note that @@ -241,7 +238,7 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { assertions = [ { assertion = cfg.maxServers != 0 && cfg.maxSpareServers != 0 && cfg.minSpareServers != 0; @@ -287,7 +284,7 @@ in base_uri = ${cfg.hydraURL} notification_sender = ${cfg.notificationSender} max_servers = ${toString cfg.maxServers} - ${optionalString (cfg.logo != null) '' + ${lib.optionalString (cfg.logo != null) '' hydra_logo = ${cfg.logo} ''} gc_roots_dir = ${cfg.gcRootsDir} @@ -298,14 +295,14 @@ in environment.variables = hydraEnv; - nix.settings = mkMerge [ + nix.settings = lib.mkMerge [ { keep-outputs = true; keep-derivations = true; trusted-users = [ "hydra-queue-runner" ]; } - (mkIf (versionOlder (getVersion config.nix.package.out) "2.4pre") + (lib.mkIf (lib.versionOlder (lib.getVersion config.nix.package.out) "2.4pre") { # The default (`true') slows Nix down a lot since the build farm # has so many GC roots. @@ -316,8 +313,8 @@ in systemd.services.hydra-init = { wantedBy = [ "multi-user.target" ]; - requires = optional haveLocalDB "postgresql.service"; - after = optional haveLocalDB "postgresql.service"; + requires = lib.optional haveLocalDB "postgresql.service"; + after = lib.optional haveLocalDB "postgresql.service"; environment = env // { HYDRA_DBI = "${env.HYDRA_DBI};application_name=hydra-init"; }; @@ -340,7 +337,7 @@ in ${baseDir}/build-logs \ ${baseDir}/runcommand-logs - ${optionalString haveLocalDB '' + ${lib.optionalString haveLocalDB '' if ! [ -e ${baseDir}/.db-created ]; then runuser -u ${config.services.postgresql.superUser} ${config.services.postgresql.package}/bin/createuser hydra runuser -u ${config.services.postgresql.superUser} ${config.services.postgresql.package}/bin/createdb -- -O hydra hydra @@ -388,7 +385,7 @@ in { ExecStart = "@${hydra-package}/bin/hydra-server hydra-server -f -h '${cfg.listenHost}' " + "-p ${toString cfg.port} --min_spare_servers ${toString cfg.minSpareServers} --max_spare_servers ${toString cfg.maxSpareServers} " - + "--max_servers ${toString cfg.maxServers} --max_requests 100 ${optionalString cfg.debugServer "-d"}"; + + "--max_servers ${toString cfg.maxServers} --max_requests 100 ${lib.optionalString cfg.debugServer "-d"}"; User = "hydra-www"; PermissionsStartOnly = true; Restart = "always"; @@ -514,9 +511,9 @@ in startAt = "Sun 01:45"; }; - services.postgresql.enable = mkIf haveLocalDB true; + services.postgresql.enable = lib.mkIf haveLocalDB true; - services.postgresql.identMap = optionalString haveLocalDB + services.postgresql.identMap = lib.optionalString haveLocalDB '' hydra-users hydra hydra hydra-users hydra-queue-runner hydra @@ -526,7 +523,7 @@ in hydra-users postgres postgres ''; - services.postgresql.authentication = optionalString haveLocalDB + services.postgresql.authentication = lib.optionalString haveLocalDB '' local hydra all ident map=hydra-users ''; From 624f590fbaf8df6fb107f0a84ad14811a0096657 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:46 +0200 Subject: [PATCH 057/197] nixos/appstream: remove `with lib;` --- nixos/modules/config/appstream.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nixos/modules/config/appstream.nix b/nixos/modules/config/appstream.nix index 1712273eff7d..edac18b9ba36 100644 --- a/nixos/modules/config/appstream.nix +++ b/nixos/modules/config/appstream.nix @@ -1,10 +1,8 @@ { config, lib, ... }: - -with lib; { options = { - appstream.enable = mkOption { - type = types.bool; + appstream.enable = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to install files to support the @@ -13,7 +11,7 @@ with lib; }; }; - config = mkIf config.appstream.enable { + config = lib.mkIf config.appstream.enable { environment.pathsToLink = [ # per component metadata "/share/metainfo" From 9da369764a13d8cc3d200ae91b6e191ebf411e3d Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:46 +0200 Subject: [PATCH 058/197] nixos/console: remove `with lib;` --- nixos/modules/config/console.nix | 78 +++++++++++++++----------------- 1 file changed, 37 insertions(+), 41 deletions(-) diff --git a/nixos/modules/config/console.nix b/nixos/modules/config/console.nix index 5aadc0836fe7..9beb7dc58703 100644 --- a/nixos/modules/config/console.nix +++ b/nixos/modules/config/console.nix @@ -1,27 +1,23 @@ - { config, lib, pkgs, ... }: - -with lib; - let cfg = config.console; - makeColor = i: concatMapStringsSep "," (x: "0x" + substring (2*i) 2 x); + makeColor = i: lib.concatMapStringsSep "," (x: "0x" + lib.substring (2*i) 2 x); - isUnicode = hasSuffix "UTF-8" (toUpper config.i18n.defaultLocale); + isUnicode = lib.hasSuffix "UTF-8" (lib.toUpper config.i18n.defaultLocale); optimizedKeymap = pkgs.runCommand "keymap" { nativeBuildInputs = [ pkgs.buildPackages.kbd ]; LOADKEYS_KEYMAP_PATH = "${consoleEnv pkgs.kbd}/share/keymaps/**"; preferLocalBuild = true; } '' - loadkeys -b ${optionalString isUnicode "-u"} "${cfg.keyMap}" > $out + loadkeys -b ${lib.optionalString isUnicode "-u"} "${cfg.keyMap}" > $out ''; # Sadly, systemd-vconsole-setup doesn't support binary keymaps. vconsoleConf = pkgs.writeText "vconsole.conf" '' KEYMAP=${cfg.keyMap} - ${optionalString (cfg.font != null) "FONT=${cfg.font}"} + ${lib.optionalString (cfg.font != null) "FONT=${cfg.font}"} ''; consoleEnv = kbd: pkgs.buildEnv { @@ -40,12 +36,12 @@ in ###### interface options.console = { - enable = mkEnableOption "virtual console" // { + enable = lib.mkEnableOption "virtual console" // { default = true; }; - font = mkOption { - type = with types; nullOr (either str path); + font = lib.mkOption { + type = with lib.types; nullOr (either str path); default = null; example = "LatArCyrHeb-16"; description = '' @@ -61,8 +57,8 @@ in ''; }; - keyMap = mkOption { - type = with types; either str path; + keyMap = lib.mkOption { + type = with lib.types; either str path; default = "us"; example = "fr"; description = '' @@ -70,8 +66,8 @@ in ''; }; - colors = mkOption { - type = with types; listOf (strMatching "[[:xdigit:]]{6}"); + colors = lib.mkOption { + type = with lib.types; listOf (strMatching "[[:xdigit:]]{6}"); default = [ ]; example = [ "002b36" "dc322f" "859900" "b58900" @@ -88,8 +84,8 @@ in }; - packages = mkOption { - type = types.listOf types.package; + packages = lib.mkOption { + type = lib.types.listOf lib.types.package; default = [ ]; description = '' List of additional packages that provide console fonts, keymaps and @@ -97,8 +93,8 @@ in ''; }; - useXkbConfig = mkOption { - type = types.bool; + useXkbConfig = lib.mkOption { + type = lib.types.bool; default = false; description = '' If set, configure the virtual console keymap from the xserver @@ -106,9 +102,9 @@ in ''; }; - earlySetup = mkOption { + earlySetup = lib.mkOption { default = false; - type = types.bool; + type = lib.types.bool; description = '' Enable setting virtual console options as early as possible (in initrd). ''; @@ -119,12 +115,12 @@ in ###### implementation - config = mkMerge [ + config = lib.mkMerge [ { console.keyMap = with config.services.xserver; - mkIf cfg.useXkbConfig + lib.mkIf cfg.useXkbConfig (pkgs.runCommand "xkb-console-keymap" { preferLocalBuild = true; } '' '${pkgs.buildPackages.ckbcomp}/bin/ckbcomp' \ - ${optionalString (config.environment.sessionVariables ? XKB_CONFIG_ROOT) + ${lib.optionalString (config.environment.sessionVariables ? XKB_CONFIG_ROOT) "-I${config.environment.sessionVariables.XKB_CONFIG_ROOT}" } \ -model '${xkb.model}' -layout '${xkb.layout}' \ @@ -132,7 +128,7 @@ in ''); } - (mkIf (!cfg.enable) { + (lib.mkIf (!cfg.enable) { systemd.services = { "serial-getty@ttyS0".enable = false; "serial-getty@hvc0".enable = false; @@ -142,7 +138,7 @@ in }; }) - (mkIf cfg.enable (mkMerge [ + (lib.mkIf cfg.enable (lib.mkMerge [ { environment.systemPackages = [ pkgs.kbd ]; # Let systemd-vconsole-setup.service do the work of setting up the @@ -151,12 +147,12 @@ in # Provide kbd with additional packages. environment.etc.kbd.source = "${consoleEnv pkgs.kbd}/share"; - boot.initrd.preLVMCommands = mkIf (!config.boot.initrd.systemd.enable) (mkBefore '' + boot.initrd.preLVMCommands = lib.mkIf (!config.boot.initrd.systemd.enable) (lib.mkBefore '' kbd_mode ${if isUnicode then "-u" else "-a"} -C /dev/console printf "\033%%${if isUnicode then "G" else "@"}" >> /dev/console loadkmap < ${optimizedKeymap} - ${optionalString (cfg.earlySetup && cfg.font != null) '' + ${lib.optionalString (cfg.earlySetup && cfg.font != null) '' setfont -C /dev/console $extraUtils/share/consolefonts/font.psf ''} ''); @@ -176,9 +172,9 @@ in "${config.boot.initrd.systemd.package.kbd}/bin/setfont" "${config.boot.initrd.systemd.package.kbd}/bin/loadkeys" "${config.boot.initrd.systemd.package.kbd.gzip}/bin/gzip" # Fonts and keyboard layouts are compressed - ] ++ optionals (cfg.font != null && hasPrefix builtins.storeDir cfg.font) [ + ] ++ lib.optionals (cfg.font != null && lib.hasPrefix builtins.storeDir cfg.font) [ "${cfg.font}" - ] ++ optionals (hasPrefix builtins.storeDir cfg.keyMap) [ + ] ++ lib.optionals (lib.hasPrefix builtins.storeDir cfg.keyMap) [ "${cfg.keyMap}" ]; @@ -195,7 +191,7 @@ in }; } - (mkIf (cfg.colors != []) { + (lib.mkIf (cfg.colors != []) { boot.kernelParams = [ "vt.default_red=${makeColor 0 cfg.colors}" "vt.default_grn=${makeColor 1 cfg.colors}" @@ -203,10 +199,10 @@ in ]; }) - (mkIf (cfg.earlySetup && cfg.font != null && !config.boot.initrd.systemd.enable) { + (lib.mkIf (cfg.earlySetup && cfg.font != null && !config.boot.initrd.systemd.enable) { boot.initrd.extraUtilsCommands = '' mkdir -p $out/share/consolefonts - ${if substring 0 1 cfg.font == "/" then '' + ${if lib.substring 0 1 cfg.font == "/" then '' font="${cfg.font}" '' else '' font="$(echo ${consoleEnv pkgs.kbd}/share/consolefonts/${cfg.font}.*)" @@ -222,14 +218,14 @@ in ]; imports = [ - (mkRenamedOptionModule [ "i18n" "consoleFont" ] [ "console" "font" ]) - (mkRenamedOptionModule [ "i18n" "consoleKeyMap" ] [ "console" "keyMap" ]) - (mkRenamedOptionModule [ "i18n" "consoleColors" ] [ "console" "colors" ]) - (mkRenamedOptionModule [ "i18n" "consolePackages" ] [ "console" "packages" ]) - (mkRenamedOptionModule [ "i18n" "consoleUseXkbConfig" ] [ "console" "useXkbConfig" ]) - (mkRenamedOptionModule [ "boot" "earlyVconsoleSetup" ] [ "console" "earlySetup" ]) - (mkRenamedOptionModule [ "boot" "extraTTYs" ] [ "console" "extraTTYs" ]) - (mkRemovedOptionModule [ "console" "extraTTYs" ] '' + (lib.mkRenamedOptionModule [ "i18n" "consoleFont" ] [ "console" "font" ]) + (lib.mkRenamedOptionModule [ "i18n" "consoleKeyMap" ] [ "console" "keyMap" ]) + (lib.mkRenamedOptionModule [ "i18n" "consoleColors" ] [ "console" "colors" ]) + (lib.mkRenamedOptionModule [ "i18n" "consolePackages" ] [ "console" "packages" ]) + (lib.mkRenamedOptionModule [ "i18n" "consoleUseXkbConfig" ] [ "console" "useXkbConfig" ]) + (lib.mkRenamedOptionModule [ "boot" "earlyVconsoleSetup" ] [ "console" "earlySetup" ]) + (lib.mkRenamedOptionModule [ "boot" "extraTTYs" ] [ "console" "extraTTYs" ]) + (lib.mkRemovedOptionModule [ "console" "extraTTYs" ] '' Since NixOS switched to systemd (circa 2012), TTYs have been spawned on demand, so there is no need to configure them manually. '') From 3ad0220687cd9b4abd6c8ffba461d84740253b8d Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:47 +0200 Subject: [PATCH 059/197] debug-info: remove `with lib;` --- nixos/modules/config/debug-info.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nixos/modules/config/debug-info.nix b/nixos/modules/config/debug-info.nix index 05a2fd2ceeea..9bf3d82ace2a 100644 --- a/nixos/modules/config/debug-info.nix +++ b/nixos/modules/config/debug-info.nix @@ -1,13 +1,10 @@ { config, lib, ... }: - -with lib; - { options = { - environment.enableDebugInfo = mkOption { - type = types.bool; + environment.enableDebugInfo = lib.mkOption { + type = lib.types.bool; default = false; description = '' Some NixOS packages provide debug symbols. However, these are @@ -29,7 +26,7 @@ with lib; }; - config = mkIf config.environment.enableDebugInfo { + config = lib.mkIf config.environment.enableDebugInfo { # FIXME: currently disabled because /lib is already in # environment.pathsToLink, and we can't have both. From 58baef7c2cf84d0ced45947a49b2d985cfd1e67f Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:47 +0200 Subject: [PATCH 060/197] nixos/fonts.fontDir: remove `with lib;` --- nixos/modules/config/fonts/fontdir.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nixos/modules/config/fonts/fontdir.nix b/nixos/modules/config/fonts/fontdir.nix index 7b21fe30f607..0181883d6c5c 100644 --- a/nixos/modules/config/fonts/fontdir.nix +++ b/nixos/modules/config/fonts/fontdir.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.fonts.fontDir; @@ -12,7 +9,7 @@ let find ${toString config.fonts.packages} -regex "$font_regexp" \ -exec ln -sf -t "$out/share/X11/fonts" '{}' \; cd "$out/share/X11/fonts" - ${optionalString cfg.decompressFonts '' + ${lib.optionalString cfg.decompressFonts '' ${pkgs.gzip}/bin/gunzip -f *.gz ''} ${pkgs.xorg.mkfontscale}/bin/mkfontscale @@ -27,8 +24,8 @@ in options = { fonts.fontDir = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to create a directory with links to all fonts in @@ -36,10 +33,10 @@ in ''; }; - decompressFonts = mkOption { - type = types.bool; + decompressFonts = lib.mkOption { + type = lib.types.bool; default = config.programs.xwayland.enable; - defaultText = literalExpression "config.programs.xwayland.enable"; + defaultText = lib.literalExpression "config.programs.xwayland.enable"; description = '' Whether to decompress fonts in {file}`/run/current-system/sw/share/X11/fonts`. @@ -49,7 +46,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ x11Fonts ]; environment.pathsToLink = [ "/share/X11/fonts" ]; @@ -61,7 +58,7 @@ in }; imports = [ - (mkRenamedOptionModule [ "fonts" "enableFontDir" ] [ "fonts" "fontDir" "enable" ]) + (lib.mkRenamedOptionModule [ "fonts" "enableFontDir" ] [ "fonts" "fontDir" "enable" ]) ]; } From 7fece7e8ca26b5f5170d4b2c2ce91cd8205488f8 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:47 +0200 Subject: [PATCH 061/197] nixos/fonts.enableGhostscriptFonts: remove `with lib;` --- nixos/modules/config/fonts/ghostscript.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nixos/modules/config/fonts/ghostscript.nix b/nixos/modules/config/fonts/ghostscript.nix index 5db7c0ac7179..dd28c72bba76 100644 --- a/nixos/modules/config/fonts/ghostscript.nix +++ b/nixos/modules/config/fonts/ghostscript.nix @@ -1,11 +1,8 @@ { config, lib, pkgs, ... }: - -with lib; - { options = { - fonts.enableGhostscriptFonts = mkOption { - type = types.bool; + fonts.enableGhostscriptFonts = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to add the fonts provided by Ghostscript (such as @@ -17,7 +14,7 @@ with lib; }; - config = mkIf config.fonts.enableGhostscriptFonts { + config = lib.mkIf config.fonts.enableGhostscriptFonts { fonts.packages = [ pkgs.ghostscript.fonts ]; }; } From 6b9c5be4a6931c7065d4c921a84af1776e627c81 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:47 +0200 Subject: [PATCH 062/197] nixos/gtk.iconCache: remove `with lib;` --- nixos/modules/config/gtk/gtk-icon-cache.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nixos/modules/config/gtk/gtk-icon-cache.nix b/nixos/modules/config/gtk/gtk-icon-cache.nix index 0898260d4a59..d9d6031956a6 100644 --- a/nixos/modules/config/gtk/gtk-icon-cache.nix +++ b/nixos/modules/config/gtk/gtk-icon-cache.nix @@ -1,19 +1,17 @@ { config, lib, pkgs, ... }: - -with lib; { options = { - gtk.iconCache.enable = mkOption { - type = types.bool; + gtk.iconCache.enable = lib.mkOption { + type = lib.types.bool; default = config.services.xserver.enable; - defaultText = literalExpression "config.services.xserver.enable"; + defaultText = lib.literalExpression "config.services.xserver.enable"; description = '' Whether to build icon theme caches for GTK applications. ''; }; }; - config = mkIf config.gtk.iconCache.enable { + config = lib.mkIf config.gtk.iconCache.enable { # (Re)build icon theme caches # --------------------------- From e514851c46e48e1b1b1d65f4ae430c909ea2e8fa Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:47 +0200 Subject: [PATCH 063/197] nixos/networking.iproute2: remove `with lib;` --- nixos/modules/config/iproute2.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/nixos/modules/config/iproute2.nix b/nixos/modules/config/iproute2.nix index 90f53c0eab69..1fa28a7a4c64 100644 --- a/nixos/modules/config/iproute2.nix +++ b/nixos/modules/config/iproute2.nix @@ -1,15 +1,12 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.networking.iproute2; in { options.networking.iproute2 = { - enable = mkEnableOption "copying IP route configuration files"; - rttablesExtraConfig = mkOption { - type = types.lines; + enable = lib.mkEnableOption "copying IP route configuration files"; + rttablesExtraConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = '' Verbatim lines to add to /etc/iproute2/rt_tables @@ -17,7 +14,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.etc."iproute2/rt_tables.d/nixos.conf" = { mode = "0644"; text = cfg.rttablesExtraConfig; From 88e6e9d4ac3dbaecb4349018584c518009f823a8 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:47 +0200 Subject: [PATCH 064/197] nixos/time: remove `with lib;` --- nixos/modules/config/locale.nix | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/nixos/modules/config/locale.nix b/nixos/modules/config/locale.nix index 486246081ec6..2d64f1bce4bc 100644 --- a/nixos/modules/config/locale.nix +++ b/nixos/modules/config/locale.nix @@ -1,12 +1,9 @@ { config, lib, pkgs, ... }: - -with lib; - let tzdir = "${pkgs.tzdata}/share/zoneinfo"; - nospace = str: filter (c: c == " ") (stringToCharacters str) == []; - timezone = types.nullOr (types.addCheck types.str nospace) + nospace = str: lib.filter (c: c == " ") (lib.stringToCharacters str) == []; + timezone = lib.types.nullOr (lib.types.addCheck lib.types.str nospace) // { description = "null or string without spaces"; }; lcfg = config.location; @@ -18,7 +15,7 @@ in time = { - timeZone = mkOption { + timeZone = lib.mkOption { default = null; type = timezone; example = "America/New_York"; @@ -31,9 +28,9 @@ in ''; }; - hardwareClockInLocalTime = mkOption { + hardwareClockInLocalTime = lib.mkOption { default = false; - type = types.bool; + type = lib.types.bool; description = "If set, keep the hardware clock in local time instead of UTC."; }; @@ -41,8 +38,8 @@ in location = { - latitude = mkOption { - type = types.float; + latitude = lib.mkOption { + type = lib.types.float; description = '' Your current latitude, between `-90.0` and `90.0`. Must be provided @@ -50,8 +47,8 @@ in ''; }; - longitude = mkOption { - type = types.float; + longitude = lib.mkOption { + type = lib.types.float; description = '' Your current longitude, between between `-180.0` and `180.0`. Must be @@ -59,8 +56,8 @@ in ''; }; - provider = mkOption { - type = types.enum [ "manual" "geoclue2" ]; + provider = lib.mkOption { + type = lib.types.enum [ "manual" "geoclue2" ]; default = "manual"; description = '' The location provider to use for determining your location. If set to @@ -75,7 +72,7 @@ in environment.sessionVariables.TZDIR = "/etc/zoneinfo"; - services.geoclue2.enable = mkIf (lcfg.provider == "geoclue2") true; + services.geoclue2.enable = lib.mkIf (lcfg.provider == "geoclue2") true; # This way services are restarted when tzdata changes. systemd.globalEnvironment.TZDIR = tzdir; From dd7e20e16ae12ea45d7c1a9a3eacf5e818aabbd3 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:48 +0200 Subject: [PATCH 065/197] nixos/environment.memoryAllocator: remove `with lib;` --- nixos/modules/config/malloc.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/nixos/modules/config/malloc.nix b/nixos/modules/config/malloc.nix index e414970b0be5..665cbdd27874 100644 --- a/nixos/modules/config/malloc.nix +++ b/nixos/modules/config/malloc.nix @@ -1,6 +1,4 @@ { config, lib, pkgs, ... }: -with lib; - let cfg = config.environment.memoryAllocator; @@ -85,12 +83,12 @@ in { meta = { - maintainers = [ maintainers.joachifm ]; + maintainers = [ lib.maintainers.joachifm ]; }; options = { - environment.memoryAllocator.provider = mkOption { - type = types.enum ([ "libc" ] ++ attrNames providers); + environment.memoryAllocator.provider = lib.mkOption { + type = lib.types.enum ([ "libc" ] ++ lib.attrNames providers); default = "libc"; description = '' The system-wide memory allocator. @@ -98,8 +96,8 @@ in Briefly, the system-wide memory allocator providers are: - `libc`: the standard allocator provided by libc - ${concatStringsSep "\n" (mapAttrsToList - (name: value: "- `${name}`: ${replaceStrings [ "\n" ] [ " " ] value.description}") + ${lib.concatStringsSep "\n" (lib.mapAttrsToList + (name: value: "- `${name}`: ${lib.replaceStrings [ "\n" ] [ " " ] value.description}") providers)} ::: {.warning} @@ -111,7 +109,7 @@ in }; }; - config = mkIf (cfg.provider != "libc") { + config = lib.mkIf (cfg.provider != "libc") { environment.etc."ld-nix.so.preload".text = '' ${providerLibPath} ''; From b5b0edaf37e12ee2b6aef7e12317b85609804ea3 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:48 +0200 Subject: [PATCH 066/197] nixos/networking: remove `with lib;` --- nixos/modules/config/networking.nix | 84 ++++++++++++++--------------- 1 file changed, 40 insertions(+), 44 deletions(-) diff --git a/nixos/modules/config/networking.nix b/nixos/modules/config/networking.nix index 72242b263ce0..8665a611e575 100644 --- a/nixos/modules/config/networking.nix +++ b/nixos/modules/config/networking.nix @@ -1,28 +1,24 @@ # /etc files related to networking, such as /etc/services. - { config, lib, options, pkgs, ... }: - -with lib; - let cfg = config.networking; opt = options.networking; - localhostMultiple = any (elem "localhost") (attrValues (removeAttrs cfg.hosts [ "127.0.0.1" "::1" ])); + localhostMultiple = lib.any (lib.elem "localhost") (lib.attrValues (removeAttrs cfg.hosts [ "127.0.0.1" "::1" ])); in { imports = [ - (mkRemovedOptionModule [ "networking" "hostConf" ] "Use environment.etc.\"host.conf\" instead.") + (lib.mkRemovedOptionModule [ "networking" "hostConf" ] "Use environment.etc.\"host.conf\" instead.") ]; options = { networking.hosts = lib.mkOption { - type = types.attrsOf (types.listOf types.str); - example = literalExpression '' + type = lib.types.attrsOf (lib.types.listOf lib.types.str); + example = lib.literalExpression '' { "127.0.0.1" = [ "foo.bar.baz" ]; "192.168.0.2" = [ "fileserver.local" "nameserver.local" ]; @@ -34,16 +30,16 @@ in }; networking.hostFiles = lib.mkOption { - type = types.listOf types.path; - defaultText = literalMD "Hosts from {option}`networking.hosts` and {option}`networking.extraHosts`"; - example = literalExpression ''[ "''${pkgs.my-blocklist-package}/share/my-blocklist/hosts" ]''; + type = lib.types.listOf lib.types.path; + defaultText = lib.literalMD "Hosts from {option}`networking.hosts` and {option}`networking.extraHosts`"; + example = lib.literalExpression ''[ "''${pkgs.my-blocklist-package}/share/my-blocklist/hosts" ]''; description = '' Files that should be concatenated together to form {file}`/etc/hosts`. ''; }; networking.extraHosts = lib.mkOption { - type = types.lines; + type = lib.types.lines; default = ""; example = "192.168.0.1 lanlocalhost"; description = '' @@ -52,14 +48,14 @@ in ''; }; - networking.timeServers = mkOption { + networking.timeServers = lib.mkOption { default = [ "0.nixos.pool.ntp.org" "1.nixos.pool.ntp.org" "2.nixos.pool.ntp.org" "3.nixos.pool.ntp.org" ]; - type = types.listOf types.str; + type = lib.types.listOf lib.types.str; description = '' The set of NTP servers from which to synchronise. ''; @@ -68,7 +64,7 @@ in networking.proxy = { default = lib.mkOption { - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; default = null; description = '' This option specifies the default value for httpProxy, httpsProxy, ftpProxy and rsyncProxy. @@ -77,9 +73,9 @@ in }; httpProxy = lib.mkOption { - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; default = cfg.proxy.default; - defaultText = literalExpression "config.${opt.proxy.default}"; + defaultText = lib.literalExpression "config.${opt.proxy.default}"; description = '' This option specifies the http_proxy environment variable. ''; @@ -87,9 +83,9 @@ in }; httpsProxy = lib.mkOption { - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; default = cfg.proxy.default; - defaultText = literalExpression "config.${opt.proxy.default}"; + defaultText = lib.literalExpression "config.${opt.proxy.default}"; description = '' This option specifies the https_proxy environment variable. ''; @@ -97,9 +93,9 @@ in }; ftpProxy = lib.mkOption { - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; default = cfg.proxy.default; - defaultText = literalExpression "config.${opt.proxy.default}"; + defaultText = lib.literalExpression "config.${opt.proxy.default}"; description = '' This option specifies the ftp_proxy environment variable. ''; @@ -107,9 +103,9 @@ in }; rsyncProxy = lib.mkOption { - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; default = cfg.proxy.default; - defaultText = literalExpression "config.${opt.proxy.default}"; + defaultText = lib.literalExpression "config.${opt.proxy.default}"; description = '' This option specifies the rsync_proxy environment variable. ''; @@ -117,9 +113,9 @@ in }; allProxy = lib.mkOption { - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; default = cfg.proxy.default; - defaultText = literalExpression "config.${opt.proxy.default}"; + defaultText = lib.literalExpression "config.${opt.proxy.default}"; description = '' This option specifies the all_proxy environment variable. ''; @@ -127,7 +123,7 @@ in }; noProxy = lib.mkOption { - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; default = null; description = '' This option specifies the no_proxy environment variable. @@ -138,7 +134,7 @@ in }; envVars = lib.mkOption { - type = types.attrs; + type = lib.types.attrs; internal = true; default = {}; description = '' @@ -163,11 +159,11 @@ in # hostname and FQDN correctly: networking.hosts = let hostnames = # Note: The FQDN (canonical hostname) has to come first: - optional (cfg.hostName != "" && cfg.domain != null) "${cfg.hostName}.${cfg.domain}" - ++ optional (cfg.hostName != "") cfg.hostName; # Then the hostname (without the domain) + lib.optional (cfg.hostName != "" && cfg.domain != null) "${cfg.hostName}.${cfg.domain}" + ++ lib.optional (cfg.hostName != "") cfg.hostName; # Then the hostname (without the domain) in { "127.0.0.2" = hostnames; - } // optionalAttrs cfg.enableIPv6 { + } // lib.optionalAttrs cfg.enableIPv6 { "::1" = hostnames; }; @@ -178,15 +174,15 @@ in # FQDN so that e.g. "hostname -f" works correctly. localhostHosts = pkgs.writeText "localhost-hosts" '' 127.0.0.1 localhost - ${optionalString cfg.enableIPv6 "::1 localhost"} + ${lib.optionalString cfg.enableIPv6 "::1 localhost"} ''; stringHosts = let - oneToString = set: ip: ip + " " + concatStringsSep " " set.${ip} + "\n"; - allToString = set: concatMapStrings (oneToString set) (attrNames set); - in pkgs.writeText "string-hosts" (allToString (filterAttrs (_: v: v != []) cfg.hosts)); + oneToString = set: ip: ip + " " + lib.concatStringsSep " " set.${ip} + "\n"; + allToString = set: lib.concatMapStrings (oneToString set) (lib.attrNames set); + in pkgs.writeText "string-hosts" (allToString (lib.filterAttrs (_: v: v != []) cfg.hosts)); extraHosts = pkgs.writeText "extra-hosts" cfg.extraHosts; - in mkBefore [ localhostHosts stringHosts extraHosts ]; + in lib.mkBefore [ localhostHosts stringHosts extraHosts ]; environment.etc = { # /etc/services: TCP/UDP port assignments. @@ -199,33 +195,33 @@ in hosts.source = pkgs.concatText "hosts" cfg.hostFiles; # /etc/netgroup: Network-wide groups. - netgroup.text = mkDefault ""; + netgroup.text = lib.mkDefault ""; # /etc/host.conf: resolver configuration file "host.conf".text = '' multi on ''; - } // optionalAttrs (pkgs.stdenv.hostPlatform.libc == "glibc") { + } // lib.optionalAttrs (pkgs.stdenv.hostPlatform.libc == "glibc") { # /etc/rpc: RPC program numbers. rpc.source = pkgs.stdenv.cc.libc.out + "/etc/rpc"; }; networking.proxy.envVars = - optionalAttrs (cfg.proxy.default != null) { + lib.optionalAttrs (cfg.proxy.default != null) { # other options already fallback to proxy.default no_proxy = "127.0.0.1,localhost"; - } // optionalAttrs (cfg.proxy.httpProxy != null) { + } // lib.optionalAttrs (cfg.proxy.httpProxy != null) { http_proxy = cfg.proxy.httpProxy; - } // optionalAttrs (cfg.proxy.httpsProxy != null) { + } // lib.optionalAttrs (cfg.proxy.httpsProxy != null) { https_proxy = cfg.proxy.httpsProxy; - } // optionalAttrs (cfg.proxy.rsyncProxy != null) { + } // lib.optionalAttrs (cfg.proxy.rsyncProxy != null) { rsync_proxy = cfg.proxy.rsyncProxy; - } // optionalAttrs (cfg.proxy.ftpProxy != null) { + } // lib.optionalAttrs (cfg.proxy.ftpProxy != null) { ftp_proxy = cfg.proxy.ftpProxy; - } // optionalAttrs (cfg.proxy.allProxy != null) { + } // lib.optionalAttrs (cfg.proxy.allProxy != null) { all_proxy = cfg.proxy.allProxy; - } // optionalAttrs (cfg.proxy.noProxy != null) { + } // lib.optionalAttrs (cfg.proxy.noProxy != null) { no_proxy = cfg.proxy.noProxy; }; From 87c8da00faf61e1751545eb98fd48c249f92820b Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:48 +0200 Subject: [PATCH 067/197] nixos/environment.noXlibs: remove `with lib;` --- nixos/modules/config/no-x-libs.nix | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/nixos/modules/config/no-x-libs.nix b/nixos/modules/config/no-x-libs.nix index 2448d08a2399..e3fd0b34ddf4 100644 --- a/nixos/modules/config/no-x-libs.nix +++ b/nixos/modules/config/no-x-libs.nix @@ -1,14 +1,10 @@ # This module gets rid of all dependencies on X11 client libraries # (including fontconfig). - { config, lib, ... }: - -with lib; - { options = { - environment.noXlibs = mkOption { - type = types.bool; + environment.noXlibs = lib.mkOption { + type = lib.types.bool; default = false; description = '' Switch off the options in the default configuration that @@ -20,13 +16,13 @@ with lib; }; }; - config = mkIf config.environment.noXlibs { + config = lib.mkIf config.environment.noXlibs { programs.ssh.setXAuthLocation = false; security.pam.services.su.forwardXAuth = lib.mkForce false; fonts.fontconfig.enable = false; - nixpkgs.overlays = singleton (const (super: { + nixpkgs.overlays = lib.singleton (lib.const (super: { beam = super.beam_nox; cairo = super.cairo.override { x11Support = false; }; dbus = super.dbus.override { x11Support = false; }; @@ -81,7 +77,7 @@ with lib; ]; qemu = super.qemu.override { gtkSupport = false; spiceSupport = false; sdlSupport = false; }; qrencode = super.qrencode.overrideAttrs (_: { doCheck = false; }); - qt5 = super.qt5.overrideScope (const (super': { + qt5 = super.qt5.overrideScope (lib.const (super': { qtbase = super'.qtbase.override { withGtk3 = false; withQttranslation = false; }; })); stoken = super.stoken.override { withGTK3 = false; }; From d65b7dbb293741840ebf1e2c5b29a1eee1763e2f Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:48 +0200 Subject: [PATCH 068/197] nixos/system.nss*: remove `with lib;` --- nixos/modules/config/nsswitch.nix | 64 +++++++++++++++---------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/nixos/modules/config/nsswitch.nix b/nixos/modules/config/nsswitch.nix index fe0402ee9e66..71c79eafeb09 100644 --- a/nixos/modules/config/nsswitch.nix +++ b/nixos/modules/config/nsswitch.nix @@ -1,16 +1,12 @@ # Configuration for the Name Service Switch (/etc/nsswitch.conf). - { config, lib, pkgs, ... }: - -with lib; - { options = { # NSS modules. Hacky! # Only works with nscd! - system.nssModules = mkOption { - type = types.listOf types.path; + system.nssModules = lib.mkOption { + type = lib.types.listOf lib.types.path; internal = true; default = [ ]; description = '' @@ -21,13 +17,13 @@ with lib; apply = list: { inherit list; - path = makeLibraryPath list; + path = lib.makeLibraryPath list; }; }; system.nssDatabases = { - passwd = mkOption { - type = types.listOf types.str; + passwd = lib.mkOption { + type = lib.types.listOf lib.types.str; description = '' List of passwd entries to configure in {file}`/etc/nsswitch.conf`. @@ -38,8 +34,8 @@ with lib; default = [ ]; }; - group = mkOption { - type = types.listOf types.str; + group = lib.mkOption { + type = lib.types.listOf lib.types.str; description = '' List of group entries to configure in {file}`/etc/nsswitch.conf`. @@ -50,8 +46,8 @@ with lib; default = [ ]; }; - shadow = mkOption { - type = types.listOf types.str; + shadow = lib.mkOption { + type = lib.types.listOf lib.types.str; description = '' List of shadow entries to configure in {file}`/etc/nsswitch.conf`. @@ -62,8 +58,8 @@ with lib; default = [ ]; }; - sudoers = mkOption { - type = types.listOf types.str; + sudoers = lib.mkOption { + type = lib.types.listOf lib.types.str; description = '' List of sudoers entries to configure in {file}`/etc/nsswitch.conf`. @@ -74,8 +70,8 @@ with lib; default = [ ]; }; - hosts = mkOption { - type = types.listOf types.str; + hosts = lib.mkOption { + type = lib.types.listOf lib.types.str; description = '' List of hosts entries to configure in {file}`/etc/nsswitch.conf`. @@ -86,8 +82,8 @@ with lib; default = [ ]; }; - services = mkOption { - type = types.listOf types.str; + services = lib.mkOption { + type = lib.types.listOf lib.types.str; description = '' List of services entries to configure in {file}`/etc/nsswitch.conf`. @@ -101,7 +97,7 @@ with lib; }; imports = [ - (mkRenamedOptionModule [ "system" "nssHosts" ] [ "system" "nssDatabases" "hosts" ]) + (lib.mkRenamedOptionModule [ "system" "nssHosts" ] [ "system" "nssDatabases" "hosts" ]) ]; config = { @@ -121,30 +117,30 @@ with lib; # Name Service Switch configuration file. Required by the C # library. environment.etc."nsswitch.conf".text = '' - passwd: ${concatStringsSep " " config.system.nssDatabases.passwd} - group: ${concatStringsSep " " config.system.nssDatabases.group} - shadow: ${concatStringsSep " " config.system.nssDatabases.shadow} - sudoers: ${concatStringsSep " " config.system.nssDatabases.sudoers} + passwd: ${lib.concatStringsSep " " config.system.nssDatabases.passwd} + group: ${lib.concatStringsSep " " config.system.nssDatabases.group} + shadow: ${lib.concatStringsSep " " config.system.nssDatabases.shadow} + sudoers: ${lib.concatStringsSep " " config.system.nssDatabases.sudoers} - hosts: ${concatStringsSep " " config.system.nssDatabases.hosts} + hosts: ${lib.concatStringsSep " " config.system.nssDatabases.hosts} networks: files ethers: files - services: ${concatStringsSep " " config.system.nssDatabases.services} + services: ${lib.concatStringsSep " " config.system.nssDatabases.services} protocols: files rpc: files ''; system.nssDatabases = { - passwd = mkBefore [ "files" ]; - group = mkBefore [ "files" ]; - shadow = mkBefore [ "files" ]; - sudoers = mkBefore [ "files" ]; - hosts = mkMerge [ - (mkOrder 998 [ "files" ]) - (mkOrder 1499 [ "dns" ]) + passwd = lib.mkBefore [ "files" ]; + group = lib.mkBefore [ "files" ]; + shadow = lib.mkBefore [ "files" ]; + sudoers = lib.mkBefore [ "files" ]; + hosts = lib.mkMerge [ + (lib.mkOrder 998 [ "files" ]) + (lib.mkOrder 1499 [ "dns" ]) ]; - services = mkBefore [ "files" ]; + services = lib.mkBefore [ "files" ]; }; }; } From 58258bd1709649730216709642aaabcf23caea05 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:48 +0200 Subject: [PATCH 069/197] nixos/powerManagement: remove `with lib;` --- nixos/modules/config/power-management.nix | 25 ++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/nixos/modules/config/power-management.nix b/nixos/modules/config/power-management.nix index 70f2d199df10..524a23edab64 100644 --- a/nixos/modules/config/power-management.nix +++ b/nixos/modules/config/power-management.nix @@ -1,7 +1,4 @@ { config, lib, ... }: - -with lib; - let cfg = config.powerManagement; @@ -16,8 +13,8 @@ in powerManagement = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to enable power management. This includes support @@ -25,16 +22,16 @@ in ''; }; - resumeCommands = mkOption { - type = types.lines; + resumeCommands = lib.mkOption { + type = lib.types.lines; default = ""; description = "Commands executed after the system resumes from suspend-to-RAM."; }; - powerUpCommands = mkOption { - type = types.lines; + powerUpCommands = lib.mkOption { + type = lib.types.lines; default = ""; - example = literalExpression '' + example = lib.literalExpression '' "''${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda" ''; description = '' @@ -44,10 +41,10 @@ in ''; }; - powerDownCommands = mkOption { - type = types.lines; + powerDownCommands = lib.mkOption { + type = lib.types.lines; default = ""; - example = literalExpression '' + example = lib.literalExpression '' "''${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda" ''; description = '' @@ -64,7 +61,7 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.targets.post-resume = { description = "Post-Resume Actions"; From c39ad4446245f73593a3a3e4a6153a588c298ee7 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:49 +0200 Subject: [PATCH 070/197] nixos/networking.resolvconf: remove `with lib;` --- nixos/modules/config/resolvconf.nix | 64 ++++++++++++++--------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/nixos/modules/config/resolvconf.nix b/nixos/modules/config/resolvconf.nix index 002a06be39a3..9fee272410dc 100644 --- a/nixos/modules/config/resolvconf.nix +++ b/nixos/modules/config/resolvconf.nix @@ -1,17 +1,13 @@ # /etc files related to networking, such as /etc/services. - { config, lib, pkgs, ... }: - -with lib; - let cfg = config.networking.resolvconf; resolvconfOptions = cfg.extraOptions - ++ optional cfg.dnsSingleRequest "single-request" - ++ optional cfg.dnsExtensionMechanism "edns0" - ++ optional cfg.useLocalResolver "trust-ad"; + ++ lib.optional cfg.dnsSingleRequest "single-request" + ++ lib.optional cfg.dnsExtensionMechanism "edns0" + ++ lib.optional cfg.useLocalResolver "trust-ad"; configText = '' @@ -19,46 +15,46 @@ let # a collision with an apparently unrelated environment # variable with the same name exported by dhcpcd. interface_order='lo lo[0-9]*' - '' + optionalString config.services.nscd.enable '' + '' + lib.optionalString config.services.nscd.enable '' # Invalidate the nscd cache whenever resolv.conf is # regenerated. libc_restart='/run/current-system/systemd/bin/systemctl try-restart --no-block nscd.service 2> /dev/null' - '' + optionalString (length resolvconfOptions > 0) '' + '' + lib.optionalString (lib.length resolvconfOptions > 0) '' # Options as described in resolv.conf(5) - resolv_conf_options='${concatStringsSep " " resolvconfOptions}' - '' + optionalString cfg.useLocalResolver '' + resolv_conf_options='${lib.concatStringsSep " " resolvconfOptions}' + '' + lib.optionalString cfg.useLocalResolver '' # This hosts runs a full-blown DNS resolver. - name_servers='127.0.0.1${optionalString config.networking.enableIPv6 " ::1"}' + name_servers='127.0.0.1${lib.optionalString config.networking.enableIPv6 " ::1"}' '' + cfg.extraConfig; in { imports = [ - (mkRenamedOptionModule [ "networking" "dnsSingleRequest" ] [ "networking" "resolvconf" "dnsSingleRequest" ]) - (mkRenamedOptionModule [ "networking" "dnsExtensionMechanism" ] [ "networking" "resolvconf" "dnsExtensionMechanism" ]) - (mkRenamedOptionModule [ "networking" "extraResolvconfConf" ] [ "networking" "resolvconf" "extraConfig" ]) - (mkRenamedOptionModule [ "networking" "resolvconfOptions" ] [ "networking" "resolvconf" "extraOptions" ]) - (mkRemovedOptionModule [ "networking" "resolvconf" "useHostResolvConf" ] "This option was never used for anything anyways") + (lib.mkRenamedOptionModule [ "networking" "dnsSingleRequest" ] [ "networking" "resolvconf" "dnsSingleRequest" ]) + (lib.mkRenamedOptionModule [ "networking" "dnsExtensionMechanism" ] [ "networking" "resolvconf" "dnsExtensionMechanism" ]) + (lib.mkRenamedOptionModule [ "networking" "extraResolvconfConf" ] [ "networking" "resolvconf" "extraConfig" ]) + (lib.mkRenamedOptionModule [ "networking" "resolvconfOptions" ] [ "networking" "resolvconf" "extraOptions" ]) + (lib.mkRemovedOptionModule [ "networking" "resolvconf" "useHostResolvConf" ] "This option was never used for lib.anything lib.anyways") ]; options = { networking.resolvconf = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = !(config.environment.etc ? "resolv.conf"); - defaultText = literalExpression ''!(config.environment.etc ? "resolv.conf")''; + defaultText = lib.literalExpression ''!(config.environment.etc ? "resolv.conf")''; description = '' Whether DNS configuration is managed by resolvconf. ''; }; - package = mkOption { - type = types.package; + package = lib.mkOption { + type = lib.types.package; default = pkgs.openresolv; - defaultText = literalExpression "pkgs.openresolv"; + defaultText = lib.literalExpression "pkgs.openresolv"; description = '' The package that provides the system-wide resolvconf command. Defaults to `openresolv` if this module is enabled. Otherwise, can be used by other modules (for example {option}`services.resolved`) to @@ -69,7 +65,7 @@ in }; dnsSingleRequest = lib.mkOption { - type = types.bool; + type = lib.types.bool; default = false; description = '' Recent versions of glibc will issue both ipv4 (A) and ipv6 (AAAA) @@ -81,8 +77,8 @@ in ''; }; - dnsExtensionMechanism = mkOption { - type = types.bool; + dnsExtensionMechanism = lib.mkOption { + type = lib.types.bool; default = true; description = '' Enable the `edns0` option in {file}`resolv.conf`. With @@ -92,8 +88,8 @@ in ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; example = "libc=NO"; description = '' @@ -101,8 +97,8 @@ in ''; }; - extraOptions = mkOption { - type = types.listOf types.str; + extraOptions = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; example = [ "ndots:1" "rotate" ]; description = '' @@ -110,8 +106,8 @@ in ''; }; - useLocalResolver = mkOption { - type = types.bool; + useLocalResolver = lib.mkOption { + type = lib.types.bool; default = false; description = '' Use local DNS server for resolving. @@ -122,7 +118,7 @@ in }; - config = mkMerge [ + config = lib.mkMerge [ { environment.etc."resolvconf.conf".text = if !cfg.enable then @@ -135,7 +131,7 @@ in else configText; } - (mkIf cfg.enable { + (lib.mkIf cfg.enable { networking.resolvconf.package = pkgs.openresolv; environment.systemPackages = [ cfg.package ]; From 21d7a61b1ad02a75f382486f64d5a06562626eff Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:49 +0200 Subject: [PATCH 071/197] nixos/environment: remove `with lib;` --- nixos/modules/config/system-environment.nix | 25 +++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/nixos/modules/config/system-environment.nix b/nixos/modules/config/system-environment.nix index 3fd4ac730ab9..ef49701fb492 100644 --- a/nixos/modules/config/system-environment.nix +++ b/nixos/modules/config/system-environment.nix @@ -1,9 +1,6 @@ # This module defines a system-wide environment that will be # initialised by pam_env (that is, not only in shells). { config, lib, options, pkgs, ... }: - -with lib; - let cfg = config.environment; @@ -14,7 +11,7 @@ in options = { - environment.sessionVariables = mkOption { + environment.sessionVariables = lib.mkOption { default = {}; description = '' A set of environment variables used in the global environment. @@ -35,8 +32,8 @@ in inherit (options.environment.variables) type apply; }; - environment.profileRelativeSessionVariables = mkOption { - type = types.attrsOf (types.listOf types.str); + environment.profileRelativeSessionVariables = lib.mkOption { + type = lib.types.attrsOf (lib.types.listOf lib.types.str); example = { PATH = [ "/bin" ]; MANPATH = [ "/man" "/share/man" ]; }; description = '' Attribute set of environment variable used in the global @@ -63,8 +60,8 @@ in config = { environment.etc."pam/environment".text = let suffixedVariables = - flip mapAttrs cfg.profileRelativeSessionVariables (envVar: suffixes: - flip concatMap cfg.profiles (profile: + lib.flip lib.mapAttrs cfg.profileRelativeSessionVariables (envVar: suffixes: + lib.flip lib.concatMap cfg.profiles (profile: map (suffix: "${profile}${suffix}") suffixes ) ); @@ -72,15 +69,15 @@ in # We're trying to use the same syntax for PAM variables and env variables. # That means we need to map the env variables that people might use to their # equivalent PAM variable. - replaceEnvVars = replaceStrings ["$HOME" "$USER"] ["@{HOME}" "@{PAM_USER}"]; + replaceEnvVars = lib.replaceStrings ["$HOME" "$USER"] ["@{HOME}" "@{PAM_USER}"]; pamVariable = n: v: - ''${n} DEFAULT="${concatStringsSep ":" (map replaceEnvVars (toList v))}"''; + ''${n} DEFAULT="${lib.concatStringsSep ":" (map replaceEnvVars (lib.toList v))}"''; pamVariables = - concatStringsSep "\n" - (mapAttrsToList pamVariable - (zipAttrsWith (n: concatLists) + lib.concatStringsSep "\n" + (lib.mapAttrsToList pamVariable + (lib.zipAttrsWith (n: lib.concatLists) [ # Make sure security wrappers are prioritized without polluting # shell environments with an extra entry. Sessions which depend on @@ -89,7 +86,7 @@ in # environment from a shell. { PATH = [ config.security.wrapperDir ]; } - (mapAttrs (n: toList) cfg.sessionVariables) + (lib.mapAttrs (n: lib.toList) cfg.sessionVariables) suffixedVariables ])); in '' From d6666338463e9c33c741b93d076dc6d915a2cecf Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:49 +0200 Subject: [PATCH 072/197] nixos/environment.paths: remove `with lib;` --- nixos/modules/config/system-path.nix | 36 +++++++++++++--------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index 83353761b7b8..6757078dbd9f 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -1,13 +1,9 @@ # This module defines the packages that appear in # /run/current-system/sw. - { config, lib, pkgs, ... }: - -with lib; - let - requiredPackages = map (pkg: setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg) + requiredPackages = map (pkg: lib.setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg) [ pkgs.acl pkgs.attr pkgs.bashInteractive # bash with ncurses support @@ -48,9 +44,9 @@ let ]; defaultPackages = map - (n: let pkg = pkgs.${n}; in setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg) + (n: let pkg = pkgs.${n};in lib.setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg) defaultPackageNames; - defaultPackagesText = "[ ${concatMapStringsSep " " (n: "pkgs.${n}") defaultPackageNames } ]"; + defaultPackagesText = "[ ${lib.concatMapStringsSep " " (n: "pkgs.${n}") defaultPackageNames } ]"; in @@ -59,10 +55,10 @@ in environment = { - systemPackages = mkOption { - type = types.listOf types.package; + systemPackages = lib.mkOption { + type = lib.types.listOf lib.types.package; default = []; - example = literalExpression "[ pkgs.firefox pkgs.thunderbird ]"; + example = lib.literalExpression "[ pkgs.firefox pkgs.thunderbird ]"; description = '' The set of packages that appear in /run/current-system/sw. These packages are @@ -74,10 +70,10 @@ in ''; }; - defaultPackages = mkOption { - type = types.listOf types.package; + defaultPackages = lib.mkOption { + type = lib.types.listOf lib.types.package; default = defaultPackages; - defaultText = literalMD '' + defaultText = lib.literalMD '' these packages, with their `meta.priority` numerically increased (thus lowering their installation priority): @@ -97,8 +93,8 @@ in ''; }; - pathsToLink = mkOption { - type = types.listOf types.str; + pathsToLink = lib.mkOption { + type = lib.types.listOf lib.types.str; # Note: We need `/lib' to be among `pathsToLink' for NSS modules # to work. default = []; @@ -106,8 +102,8 @@ in description = "List of directories to be symlinked in {file}`/run/current-system/sw`."; }; - extraOutputsToInstall = mkOption { - type = types.listOf types.str; + extraOutputsToInstall = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ ]; example = [ "dev" "info" ]; description = '' @@ -119,8 +115,8 @@ in ''; }; - extraSetup = mkOption { - type = types.lines; + extraSetup = lib.mkOption { + type = lib.types.lines; default = ""; description = "Shell fragments to be run after the system environment has been created. This should only be used for things that need to modify the internals of the environment, e.g. generating MIME caches. The environment being built can be accessed at $out."; }; @@ -129,7 +125,7 @@ in system = { - path = mkOption { + path = lib.mkOption { internal = true; description = '' The packages you want in the boot environment. From 6232911ef50fa5372ab2515a4d6b8a1ce67c1900 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:49 +0200 Subject: [PATCH 073/197] nixos/environment.terminfo: remove `with lib;` --- nixos/modules/config/terminfo.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nixos/modules/config/terminfo.nix b/nixos/modules/config/terminfo.nix index b538d749ffcb..bf8bc43d6bb5 100644 --- a/nixos/modules/config/terminfo.nix +++ b/nixos/modules/config/terminfo.nix @@ -1,23 +1,20 @@ # This module manages the terminfo database # and its integration in the system. { config, lib, pkgs, ... }: - -with lib; - { options = with lib; { - environment.enableAllTerminfo = mkOption { + environment.enableAllTerminfo = lib.mkOption { default = false; - type = types.bool; + type = lib.types.bool; description = '' Whether to install all terminfo outputs ''; }; - security.sudo.keepTerminfo = mkOption { + security.sudo.keepTerminfo = lib.mkOption { default = true; - type = types.bool; + type = lib.types.bool; description = '' Whether to preserve the `TERMINFO` and `TERMINFO_DIRS` environment variables, for `root` and the `wheel` group. @@ -28,10 +25,10 @@ with lib; config = { # can be generated with: - # attrNames (filterAttrs - # (_: drv: (builtins.tryEval (isDerivation drv && drv ? terminfo)).value) + # lib.attrNames (lib.filterAttrs + # (_: drv: (builtins.tryEval (lib.isDerivation drv && drv ? terminfo)).value) # pkgs) - environment.systemPackages = mkIf config.environment.enableAllTerminfo (map (x: x.terminfo) (with pkgs.pkgsBuildBuild; [ + environment.systemPackages = lib.mkIf config.environment.enableAllTerminfo (map (x: x.terminfo) (with pkgs.pkgsBuildBuild; [ alacritty contour foot @@ -65,7 +62,7 @@ with lib; export TERM=$TERM ''; - security.sudo.extraConfig = mkIf config.security.sudo.keepTerminfo '' + security.sudo.extraConfig = lib.mkIf config.security.sudo.keepTerminfo '' # Keep terminfo database for root and %wheel. Defaults:root,%wheel env_keep+=TERMINFO_DIRS From a39c4671d8e48d214323560d6c195acbff5fd9f8 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:49 +0200 Subject: [PATCH 074/197] nixos/environment.unix-odbc-drivers.nix: remove `with lib;` --- nixos/modules/config/unix-odbc-drivers.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/nixos/modules/config/unix-odbc-drivers.nix b/nixos/modules/config/unix-odbc-drivers.nix index 28cf7e84b7bc..8bf7f3b28af6 100644 --- a/nixos/modules/config/unix-odbc-drivers.nix +++ b/nixos/modules/config/unix-odbc-drivers.nix @@ -1,7 +1,4 @@ { config, lib, ... }: - -with lib; - # unixODBC drivers (this solution is not perfect.. Because the user has to # ask the admin to add a driver.. but it's simple and works @@ -16,10 +13,10 @@ in { ###### interface options = { - environment.unixODBCDrivers = mkOption { - type = types.listOf types.package; + environment.unixODBCDrivers = lib.mkOption { + type = lib.types.listOf lib.types.package; default = []; - example = literalExpression "with pkgs.unixODBCDrivers; [ sqlite psql ]"; + example = lib.literalExpression "with pkgs.unixODBCDrivers; [ sqlite psql ]"; description = '' Specifies Unix ODBC drivers to be registered in {file}`/etc/odbcinst.ini`. You may also want to @@ -31,8 +28,8 @@ in { ###### implementation - config = mkIf (config.environment.unixODBCDrivers != []) { - environment.etc."odbcinst.ini".text = concatMapStringsSep "\n" iniDescription config.environment.unixODBCDrivers; + config = lib.mkIf (config.environment.unixODBCDrivers != []) { + environment.etc."odbcinst.ini".text = lib.concatMapStringsSep "\n" iniDescription config.environment.unixODBCDrivers; }; } From e50a74b6f9d8e13404ca0abd0ea5b14a0c894da2 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:49 +0200 Subject: [PATCH 075/197] nixos/vte: remove `with lib;` --- nixos/modules/config/vte.nix | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/nixos/modules/config/vte.nix b/nixos/modules/config/vte.nix index e0b48c3fb4a8..a86a148b54f9 100644 --- a/nixos/modules/config/vte.nix +++ b/nixos/modules/config/vte.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - let vteInitSnippet = '' @@ -15,14 +12,14 @@ in { meta = { - maintainers = teams.gnome.members; + maintainers = lib.teams.gnome.members; }; options = { - programs.bash.vteIntegration = mkOption { + programs.bash.vteIntegration = lib.mkOption { default = false; - type = types.bool; + type = lib.types.bool; description = '' Whether to enable Bash integration for VTE terminals. This allows it to preserve the current directory of the shell @@ -30,9 +27,9 @@ in ''; }; - programs.zsh.vteIntegration = mkOption { + programs.zsh.vteIntegration = lib.mkOption { default = false; - type = types.bool; + type = lib.types.bool; description = '' Whether to enable Zsh integration for VTE terminals. This allows it to preserve the current directory of the shell @@ -42,12 +39,12 @@ in }; - config = mkMerge [ - (mkIf config.programs.bash.vteIntegration { - programs.bash.interactiveShellInit = mkBefore vteInitSnippet; + config = lib.mkMerge [ + (lib.mkIf config.programs.bash.vteIntegration { + programs.bash.interactiveShellInit = lib.mkBefore vteInitSnippet; }) - (mkIf config.programs.zsh.vteIntegration { + (lib.mkIf config.programs.zsh.vteIntegration { programs.zsh.interactiveShellInit = vteInitSnippet; }) ]; From 7f5a38f10004ff44b494fc433835e0563c5c1172 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:49 +0200 Subject: [PATCH 076/197] nixos/xdg.autostart: remove `with lib;` --- nixos/modules/config/xdg/autostart.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nixos/modules/config/xdg/autostart.nix b/nixos/modules/config/xdg/autostart.nix index acdb7cd3adc6..6f33f592cf57 100644 --- a/nixos/modules/config/xdg/autostart.nix +++ b/nixos/modules/config/xdg/autostart.nix @@ -1,14 +1,12 @@ { config, lib, ... }: - -with lib; { meta = { - maintainers = teams.freedesktop.members; + maintainers = lib.teams.freedesktop.members; }; options = { - xdg.autostart.enable = mkOption { - type = types.bool; + xdg.autostart.enable = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to install files to support the @@ -17,7 +15,7 @@ with lib; }; }; - config = mkIf config.xdg.autostart.enable { + config = lib.mkIf config.xdg.autostart.enable { environment.pathsToLink = [ "/etc/xdg/autostart" ]; From 1da2c432542927b7f013ded954d620e364b70287 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:50 +0200 Subject: [PATCH 077/197] nixos/xdg.icons: remove `with lib;` --- nixos/modules/config/xdg/icons.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nixos/modules/config/xdg/icons.nix b/nixos/modules/config/xdg/icons.nix index 3f198101d306..9e2b3c2e46e0 100644 --- a/nixos/modules/config/xdg/icons.nix +++ b/nixos/modules/config/xdg/icons.nix @@ -1,14 +1,12 @@ { config, lib, pkgs, ... }: - -with lib; { meta = { - maintainers = teams.freedesktop.members; + maintainers = lib.teams.freedesktop.members; }; options = { - xdg.icons.enable = mkOption { - type = types.bool; + xdg.icons.enable = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to install files to support the @@ -17,7 +15,7 @@ with lib; }; }; - config = mkIf config.xdg.icons.enable { + config = lib.mkIf config.xdg.icons.enable { environment.pathsToLink = [ "/share/icons" "/share/pixmaps" From 56adb6a6b233c9b1de0022586da1c88226e3b10a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:50 +0200 Subject: [PATCH 078/197] nixos/xdg.menus: remove `with lib;` --- nixos/modules/config/xdg/menus.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nixos/modules/config/xdg/menus.nix b/nixos/modules/config/xdg/menus.nix index 8510c2db654e..a71a46dd36cc 100644 --- a/nixos/modules/config/xdg/menus.nix +++ b/nixos/modules/config/xdg/menus.nix @@ -1,14 +1,12 @@ { config, lib, ... }: - -with lib; { meta = { - maintainers = teams.freedesktop.members; + maintainers = lib.teams.freedesktop.members; }; options = { - xdg.menus.enable = mkOption { - type = types.bool; + xdg.menus.enable = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to install files to support the @@ -17,7 +15,7 @@ with lib; }; }; - config = mkIf config.xdg.menus.enable { + config = lib.mkIf config.xdg.menus.enable { environment.pathsToLink = [ "/share/applications" "/share/desktop-directories" From 62782850ea60d8b97f066d28660e8e5288f4992e Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:50 +0200 Subject: [PATCH 079/197] nixos/xdg.mime: remove `with lib;` --- nixos/modules/config/xdg/mime.nix | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/nixos/modules/config/xdg/mime.nix b/nixos/modules/config/xdg/mime.nix index 2cd88be5b023..9bd1af397002 100644 --- a/nixos/modules/config/xdg/mime.nix +++ b/nixos/modules/config/xdg/mime.nix @@ -1,22 +1,19 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.xdg.mime; - associationOptions = with types; attrsOf ( - coercedTo (either (listOf str) str) (x: concatStringsSep ";" (toList x)) str + associationOptions = with lib.types; attrsOf ( + coercedTo (either (listOf str) str) (x: lib.concatStringsSep ";" (lib.toList x)) str ); in { meta = { - maintainers = teams.freedesktop.members ++ (with maintainers; [ figsoda ]); + maintainers = lib.teams.freedesktop.members ++ (with lib.maintainers; [ figsoda ]); }; options = { - xdg.mime.enable = mkOption { - type = types.bool; + xdg.mime.enable = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to install files to support the @@ -25,7 +22,7 @@ in ''; }; - xdg.mime.addedAssociations = mkOption { + xdg.mime.addedAssociations = lib.mkOption { type = associationOptions; default = {}; example = { @@ -39,7 +36,7 @@ in ''; }; - xdg.mime.defaultApplications = mkOption { + xdg.mime.defaultApplications = lib.mkOption { type = associationOptions; default = {}; example = { @@ -53,7 +50,7 @@ in ''; }; - xdg.mime.removedAssociations = mkOption { + xdg.mime.removedAssociations = lib.mkOption { type = associationOptions; default = {}; example = { @@ -68,13 +65,13 @@ in }; }; - config = mkIf cfg.enable { - environment.etc."xdg/mimeapps.list" = mkIf ( + config = lib.mkIf cfg.enable { + environment.etc."xdg/mimeapps.list" = lib.mkIf ( cfg.addedAssociations != {} || cfg.defaultApplications != {} || cfg.removedAssociations != {} ) { - text = generators.toINI { } { + text = lib.generators.toINI { } { "Added Associations" = cfg.addedAssociations; "Default Applications" = cfg.defaultApplications; "Removed Associations" = cfg.removedAssociations; From f3fff00d96fadd6d2fcb1b59ad20bddad8100da9 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:50 +0200 Subject: [PATCH 080/197] nixos/xdg.portal.lxqt: remove `with lib;` --- nixos/modules/config/xdg/portals/lxqt.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nixos/modules/config/xdg/portals/lxqt.nix b/nixos/modules/config/xdg/portals/lxqt.nix index 23a1622308bd..846c9b199437 100644 --- a/nixos/modules/config/xdg/portals/lxqt.nix +++ b/nixos/modules/config/xdg/portals/lxqt.nix @@ -1,18 +1,15 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.xdg.portal.lxqt; in { meta = { - maintainers = teams.lxqt.members; + maintainers = lib.teams.lxqt.members; }; options.xdg.portal.lxqt = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' the desktop portal for the LXQt desktop environment. This will add the `lxqt.xdg-desktop-portal-lxqt` @@ -20,10 +17,10 @@ in {option}`xdg.portal.extraPortals` option ''; - styles = mkOption { - type = types.listOf types.package; + styles = lib.mkOption { + type = lib.types.listOf lib.types.package; default = []; - example = literalExpression ''[ + example = lib.literalExpression ''[ pkgs.libsForQt5.qtstyleplugin-kvantum pkgs.breeze-qt5 pkgs.qtcurve @@ -36,7 +33,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { xdg.portal = { enable = true; extraPortals = [ From 352763b4406e16453fbc66e30b8b65e8fc9d2cee Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:50 +0200 Subject: [PATCH 081/197] nixos/xdg.portal.wlr: remove `with lib;` --- nixos/modules/config/xdg/portals/wlr.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nixos/modules/config/xdg/portals/wlr.nix b/nixos/modules/config/xdg/portals/wlr.nix index 954830eff2d3..ed09a31a86d7 100644 --- a/nixos/modules/config/xdg/portals/wlr.nix +++ b/nixos/modules/config/xdg/portals/wlr.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.xdg.portal.wlr; package = pkgs.xdg-desktop-portal-wlr; @@ -10,11 +7,11 @@ let in { meta = { - maintainers = with maintainers; [ minijackson ]; + maintainers = with lib.maintainers; [ minijackson ]; }; options.xdg.portal.wlr = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' desktop portal for wlroots-based desktops. This will add the `xdg-desktop-portal-wlr` package into @@ -22,7 +19,7 @@ in configuration file ''; - settings = mkOption { + settings = lib.mkOption { description = '' Configuration for `xdg-desktop-portal-wlr`. @@ -30,14 +27,14 @@ in values. ''; - type = types.submodule { + type = lib.types.submodule { freeformType = settingsFormat.type; }; default = { }; # Example taken from the manpage - example = literalExpression '' + example = lib.literalExpression '' { screencast = { output_name = "HDMI-A-1"; @@ -52,7 +49,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { xdg.portal = { enable = true; extraPortals = [ package ]; From 413bd7cb81286476e6ec63d8363d997dc59452cf Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:50 +0200 Subject: [PATCH 082/197] nixos/xdg.sounds: remove `with lib;` --- nixos/modules/config/xdg/sounds.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nixos/modules/config/xdg/sounds.nix b/nixos/modules/config/xdg/sounds.nix index 0aae77fe0107..e19e23d72a47 100644 --- a/nixos/modules/config/xdg/sounds.nix +++ b/nixos/modules/config/xdg/sounds.nix @@ -1,14 +1,12 @@ { config, lib, pkgs, ... }: - -with lib; { meta = { - maintainers = teams.freedesktop.members; + maintainers = lib.teams.freedesktop.members; }; options = { - xdg.sounds.enable = mkOption { - type = types.bool; + xdg.sounds.enable = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to install files to support the @@ -17,7 +15,7 @@ with lib; }; }; - config = mkIf config.xdg.sounds.enable { + config = lib.mkIf config.xdg.sounds.enable { environment.systemPackages = [ pkgs.sound-theme-freedesktop ]; From be8d4ec87e4dff57d3fc26eae69e31ed5d8f9f58 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:51 +0200 Subject: [PATCH 083/197] nixos/hardware.acpilight: remove `with lib;` --- nixos/modules/hardware/acpilight.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nixos/modules/hardware/acpilight.nix b/nixos/modules/hardware/acpilight.nix index 2de448a265c7..211d18ceb11a 100644 --- a/nixos/modules/hardware/acpilight.nix +++ b/nixos/modules/hardware/acpilight.nix @@ -1,15 +1,13 @@ { config, lib, pkgs, ... }: - -with lib; let cfg = config.hardware.acpilight; in { options = { hardware.acpilight = { - enable = mkOption { + enable = lib.mkOption { default = false; - type = types.bool; + type = lib.types.bool; description = '' Enable acpilight. This will allow brightness control via xbacklight from users in the video group @@ -18,7 +16,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = with pkgs; [ acpilight ]; services.udev.packages = with pkgs; [ acpilight ]; }; From 930af3e5333cf8aaae290851b43527a2f734719e Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:51 +0200 Subject: [PATCH 084/197] nixos/hardware.enableAllFirmware: remove `with lib;` --- nixos/modules/hardware/all-firmware.nix | 33 +++++++++++-------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/nixos/modules/hardware/all-firmware.nix b/nixos/modules/hardware/all-firmware.nix index abad6e08611f..6475cfc843d2 100644 --- a/nixos/modules/hardware/all-firmware.nix +++ b/nixos/modules/hardware/all-firmware.nix @@ -1,33 +1,30 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware; in { imports = [ - (mkRenamedOptionModule [ "networking" "enableRT73Firmware" ] [ "hardware" "enableRedistributableFirmware" ]) - (mkRenamedOptionModule [ "networking" "enableIntel3945ABGFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) - (mkRenamedOptionModule [ "networking" "enableIntel2100BGFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) - (mkRenamedOptionModule [ "networking" "enableRalinkFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) - (mkRenamedOptionModule [ "networking" "enableRTL8192cFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) + (lib.mkRenamedOptionModule [ "networking" "enableRT73Firmware" ] [ "hardware" "enableRedistributableFirmware" ]) + (lib.mkRenamedOptionModule [ "networking" "enableIntel3945ABGFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) + (lib.mkRenamedOptionModule [ "networking" "enableIntel2100BGFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) + (lib.mkRenamedOptionModule [ "networking" "enableRalinkFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) + (lib.mkRenamedOptionModule [ "networking" "enableRTL8192cFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) ]; ###### interface options = { - hardware.enableAllFirmware = mkEnableOption "all firmware regardless of license"; + hardware.enableAllFirmware = lib.mkEnableOption "all firmware regardless of license"; - hardware.enableRedistributableFirmware = mkEnableOption "firmware with a license allowing redistribution" // { + hardware.enableRedistributableFirmware = lib.mkEnableOption "firmware with a license allowing redistribution" // { default = config.hardware.enableAllFirmware; defaultText = lib.literalExpression "config.hardware.enableAllFirmware"; }; - hardware.wirelessRegulatoryDatabase = mkEnableOption "loading the wireless regulatory database at boot" // { + hardware.wirelessRegulatoryDatabase = lib.mkEnableOption "loading the wireless regulatory database at boot" // { default = cfg.enableRedistributableFirmware || cfg.enableAllFirmware; - defaultText = literalMD "Enabled if proprietary firmware is allowed via {option}`enableRedistributableFirmware` or {option}`enableAllFirmware`."; + defaultText = lib.literalMD "Enabled if proprietary firmware is allowed via {option}`enableRedistributableFirmware` or {option}`enableAllFirmware`."; }; }; @@ -35,8 +32,8 @@ in { ###### implementation - config = mkMerge [ - (mkIf (cfg.enableAllFirmware || cfg.enableRedistributableFirmware) { + config = lib.mkMerge [ + (lib.mkIf (cfg.enableAllFirmware || cfg.enableRedistributableFirmware) { hardware.firmware = with pkgs; [ linux-firmware intel2200BGFirmware @@ -47,9 +44,9 @@ in { alsa-firmware sof-firmware libreelec-dvb-firmware - ] ++ optional pkgs.stdenv.hostPlatform.isAarch raspberrypiWirelessFirmware; + ] ++ lib.optional pkgs.stdenv.hostPlatform.isAarch raspberrypiWirelessFirmware; }) - (mkIf cfg.enableAllFirmware { + (lib.mkIf cfg.enableAllFirmware { assertions = [{ assertion = !cfg.enableAllFirmware || pkgs.config.allowUnfree; message = '' @@ -63,12 +60,12 @@ in { b43Firmware_5_1_138 b43Firmware_6_30_163_46 xow_dongle-firmware - ] ++ optionals pkgs.stdenv.hostPlatform.isx86 [ + ] ++ lib.optionals pkgs.stdenv.hostPlatform.isx86 [ facetimehd-calibration facetimehd-firmware ]; }) - (mkIf cfg.wirelessRegulatoryDatabase { + (lib.mkIf cfg.wirelessRegulatoryDatabase { hardware.firmware = [ pkgs.wireless-regdb ]; }) ]; From 6c0e1c7a9d4dfb82d37bcdd833a15365b704116d Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:51 +0200 Subject: [PATCH 085/197] nixos/hardware.bladeRF: remove `with lib;` --- nixos/modules/hardware/bladeRF.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nixos/modules/hardware/bladeRF.nix b/nixos/modules/hardware/bladeRF.nix index 35b74b8382e3..877acbbf598c 100644 --- a/nixos/modules/hardware/bladeRF.nix +++ b/nixos/modules/hardware/bladeRF.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.bladeRF; @@ -9,8 +6,8 @@ in { options.hardware.bladeRF = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Enables udev rules for BladeRF devices. By default grants access @@ -21,7 +18,7 @@ in }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { services.udev.packages = [ pkgs.libbladeRF ]; users.groups.bladerf = {}; }; From 374ad8d316efba9d6a78a02e5e45f9744743f759 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:51 +0200 Subject: [PATCH 086/197] nixos/hardware.brillo: remove `with lib;` --- nixos/modules/hardware/brillo.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nixos/modules/hardware/brillo.nix b/nixos/modules/hardware/brillo.nix index 8e36022a9a30..915801c137be 100644 --- a/nixos/modules/hardware/brillo.nix +++ b/nixos/modules/hardware/brillo.nix @@ -1,20 +1,18 @@ { config, lib, pkgs, ... }: - -with lib; let cfg = config.hardware.brillo; in { options = { hardware.brillo = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' brillo in userspace. This will allow brightness control from users in the video group ''; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { services.udev.packages = [ pkgs.brillo ]; environment.systemPackages = [ pkgs.brillo ]; }; From dd9302597298f0ac56399b8d3e781612b8737f96 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:51 +0200 Subject: [PATCH 087/197] nixos/hardware.ckb-next: remove `with lib;` --- nixos/modules/hardware/ckb-next.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nixos/modules/hardware/ckb-next.nix b/nixos/modules/hardware/ckb-next.nix index 1fb97c16d75f..5de5666d20c9 100644 --- a/nixos/modules/hardware/ckb-next.nix +++ b/nixos/modules/hardware/ckb-next.nix @@ -1,22 +1,19 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.ckb-next; in { imports = [ - (mkRenamedOptionModule [ "hardware" "ckb" "enable" ] [ "hardware" "ckb-next" "enable" ]) - (mkRenamedOptionModule [ "hardware" "ckb" "package" ] [ "hardware" "ckb-next" "package" ]) + (lib.mkRenamedOptionModule [ "hardware" "ckb" "enable" ] [ "hardware" "ckb-next" "enable" ]) + (lib.mkRenamedOptionModule [ "hardware" "ckb" "package" ] [ "hardware" "ckb-next" "package" ]) ]; options.hardware.ckb-next = { - enable = mkEnableOption "the Corsair keyboard/mouse driver"; + enable = lib.mkEnableOption "the Corsair keyboard/mouse driver"; - gid = mkOption { - type = types.nullOr types.int; + gid = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; example = 100; description = '' @@ -24,17 +21,17 @@ in ''; }; - package = mkPackageOption pkgs "ckb-next" { }; + package = lib.mkPackageOption pkgs "ckb-next" { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; systemd.services.ckb-next = { description = "Corsair Keyboards and Mice Daemon"; wantedBy = ["multi-user.target"]; serviceConfig = { - ExecStart = "${cfg.package}/bin/ckb-next-daemon ${optionalString (cfg.gid != null) "--gid=${builtins.toString cfg.gid}"}"; + ExecStart = "${cfg.package}/bin/ckb-next-daemon ${lib.optionalString (cfg.gid != null) "--gid=${builtins.toString cfg.gid}"}"; Restart = "on-failure"; }; }; From f41312d75139b832d1684f39632cdd0c57509540 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:51 +0200 Subject: [PATCH 088/197] nixos/hardware.corectrl: remove `with lib;` --- nixos/modules/hardware/corectrl.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nixos/modules/hardware/corectrl.nix b/nixos/modules/hardware/corectrl.nix index 9e8b69cf6277..88b94e12f6b6 100644 --- a/nixos/modules/hardware/corectrl.nix +++ b/nixos/modules/hardware/corectrl.nix @@ -1,27 +1,24 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.programs.corectrl; in { options.programs.corectrl = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' CoreCtrl, a tool to overclock amd graphics cards and processors. Add your user to the corectrl group to run corectrl without needing to enter your password ''; - package = mkPackageOption pkgs "corectrl" { + package = lib.mkPackageOption pkgs "corectrl" { extraDescription = "Useful for overriding the configuration options used for the package."; }; gpuOverclock = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' GPU overclocking ''; - ppfeaturemask = mkOption { - type = types.str; + ppfeaturemask = lib.mkOption { + type = lib.types.str; default = "0xfffd7fff"; example = "0xffffffff"; description = '' @@ -34,7 +31,7 @@ in }; }; - config = mkIf cfg.enable (lib.mkMerge [ + config = lib.mkIf cfg.enable (lib.mkMerge [ { environment.systemPackages = [ cfg.package ]; From 9dfb6b691d3f3cbbc3fa496c6c8bf9568a84a27a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:53 +0200 Subject: [PATCH 089/197] nixos/security.sudo-rs: remove `with lib;` --- nixos/modules/security/sudo-rs.nix | 101 ++++++++++++++--------------- 1 file changed, 49 insertions(+), 52 deletions(-) diff --git a/nixos/modules/security/sudo-rs.nix b/nixos/modules/security/sudo-rs.nix index e63a64d4691c..b920015c4911 100644 --- a/nixos/modules/security/sudo-rs.nix +++ b/nixos/modules/security/sudo-rs.nix @@ -1,21 +1,18 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.security.sudo-rs; - toUserString = user: if (isInt user) then "#${toString user}" else "${user}"; - toGroupString = group: if (isInt group) then "%#${toString group}" else "%${group}"; + toUserString = user: if (lib.isInt user) then "#${toString user}" else "${user}"; + toGroupString = group: if (lib.isInt group) then "%#${toString group}" else "%${group}"; toCommandOptionsString = options: - "${concatStringsSep ":" options}${optionalString (length options != 0) ":"} "; + "${lib.concatStringsSep ":" options}${lib.optionalString (lib.length options != 0) ":"} "; toCommandsString = commands: - concatStringsSep ", " ( + lib.concatStringsSep ", " ( map (command: - if (isString command) then + if (lib.isString command) then command else "${toCommandOptionsString command.options}${command.command}" @@ -30,8 +27,8 @@ in options.security.sudo-rs = { - defaultOptions = mkOption { - type = with types; listOf str; + defaultOptions = lib.mkOption { + type = with lib.types; listOf str; default = []; description = '' Options used for the default rules, granting `root` and the @@ -39,15 +36,15 @@ in ''; }; - enable = mkEnableOption '' + enable = lib.mkEnableOption '' a memory-safe implementation of the {command}`sudo` command, which allows non-root users to execute commands as root ''; - package = mkPackageOption pkgs "sudo-rs" { }; + package = lib.mkPackageOption pkgs "sudo-rs" { }; - wheelNeedsPassword = mkOption { - type = types.bool; + wheelNeedsPassword = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether users of the `wheel` group must @@ -55,8 +52,8 @@ in ''; }; - execWheelOnly = mkOption { - type = types.bool; + execWheelOnly = lib.mkOption { + type = lib.types.bool; default = false; description = '' Only allow members of the `wheel` group to execute sudo by @@ -66,8 +63,8 @@ in ''; }; - configFile = mkOption { - type = types.lines; + configFile = lib.mkOption { + type = lib.types.lines; # Note: if syntax errors are detected in this file, the NixOS # configuration will fail to build. description = '' @@ -76,15 +73,15 @@ in ''; }; - extraRules = mkOption { + extraRules = lib.mkOption { description = '' Define specific rules to be in the {file}`sudoers` file. More specific rules should come after more general ones in order to - yield the expected behavior. You can use mkBefore/mkAfter to ensure + yield the expected behavior. You can use `lib.mkBefore`/`lib.mkAfter` to ensure this is the case when configuration options are merged. ''; default = []; - example = literalExpression '' + example = lib.literalExpression '' [ # Allow execution of any command by all users in group sudo, # requiring a password. @@ -103,34 +100,34 @@ in { command = '''/home/baz/cmd2.sh ""'''; options = [ "SETENV" ]; } ]; } ] ''; - type = with types; listOf (submodule { + type = with lib.types; listOf (submodule { options = { - users = mkOption { - type = with types; listOf (either str int); + users = lib.mkOption { + type = with lib.types; listOf (either str int); description = '' The usernames / UIDs this rule should apply for. ''; default = []; }; - groups = mkOption { - type = with types; listOf (either str int); + groups = lib.mkOption { + type = with lib.types; listOf (either str int); description = '' The groups / GIDs this rule should apply for. ''; default = []; }; - host = mkOption { - type = types.str; + host = lib.mkOption { + type = lib.types.str; default = "ALL"; description = '' For what host this rule should apply. ''; }; - runAs = mkOption { - type = with types; str; + runAs = lib.mkOption { + type = with lib.types; str; default = "ALL:ALL"; description = '' Under which user/group the specified command is allowed to run. @@ -141,15 +138,15 @@ in ''; }; - commands = mkOption { + commands = lib.mkOption { description = '' The commands for which the rule should apply. ''; - type = with types; listOf (either str (submodule { + type = with lib.types; listOf (either str (submodule { options = { - command = mkOption { - type = with types; str; + command = lib.mkOption { + type = with lib.types; str; description = '' A command being either just a path to a binary to allow any arguments, the full command with arguments pre-set or with `""` used as the argument, @@ -157,8 +154,8 @@ in ''; }; - options = mkOption { - type = with types; listOf (enum [ "NOPASSWD" "PASSWD" "NOEXEC" "EXEC" "SETENV" "NOSETENV" "LOG_INPUT" "NOLOG_INPUT" "LOG_OUTPUT" "NOLOG_OUTPUT" ]); + options = lib.mkOption { + type = with lib.types; listOf (enum [ "NOPASSWD" "PASSWD" "NOEXEC" "EXEC" "SETENV" "NOSETENV" "LOG_INPUT" "NOLOG_INPUT" "LOG_OUTPUT" "NOLOG_OUTPUT" ]); description = '' Options for running the command. Refer to the [sudo manual](https://www.sudo.ws/man/1.7.10/sudoers.man.html). ''; @@ -172,8 +169,8 @@ in }); }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = '' Extra configuration text appended to {file}`sudoers`. @@ -184,12 +181,12 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { assertions = [ { assertion = ! config.security.sudo.enable; message = "`security.sudo` and `security.sudo-rs` cannot both be enabled"; }]; - security.sudo.enable = mkDefault false; + security.sudo.enable = lib.mkDefault false; security.sudo-rs.extraRules = let @@ -200,35 +197,35 @@ in options = opts ++ cfg.defaultOptions; } ]; } ]; - in mkMerge [ - # This is ordered before users' `mkBefore` rules, + in lib.mkMerge [ + # This is ordered before users' `lib.mkBefore` rules, # so as not to introduce unexpected changes. - (mkOrder 400 (defaultRule { users = [ "root" ]; })) + (lib.mkOrder 400 (defaultRule { users = [ "root" ]; })) # This is ordered to show before (most) other rules, but - # late-enough for a user to `mkBefore` it. - (mkOrder 600 (defaultRule { + # late-enough for a user to `lib.mkBefore` it. + (lib.mkOrder 600 (defaultRule { groups = [ "wheel" ]; - opts = (optional (!cfg.wheelNeedsPassword) "NOPASSWD"); + opts = (lib.optional (!cfg.wheelNeedsPassword) "NOPASSWD"); })) ]; - security.sudo-rs.configFile = concatStringsSep "\n" (filter (s: s != "") [ + security.sudo-rs.configFile = lib.concatStringsSep "\n" (lib.filter (s: s != "") [ '' # Don't edit this file. Set the NixOS options ‘security.sudo-rs.configFile’ # or ‘security.sudo-rs.extraRules’ instead. '' - (pipe cfg.extraRules [ - (filter (rule: length rule.commands != 0)) + (lib.pipe cfg.extraRules [ + (lib.filter (rule: lib.length rule.commands != 0)) (map (rule: [ (map (user: "${toUserString user} ${rule.host}=(${rule.runAs}) ${toCommandsString rule.commands}") rule.users) (map (group: "${toGroupString group} ${rule.host}=(${rule.runAs}) ${toCommandsString rule.commands}") rule.groups) ])) - flatten - (concatStringsSep "\n") + lib.flatten + (lib.concatStringsSep "\n") ]) "\n" - (optionalString (cfg.extraConfig != "") '' + (lib.optionalString (cfg.extraConfig != "") '' # extraConfig ${cfg.extraConfig} '') From fcfa7fa4418a6f6bfe643882823149e3f3449587 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:53 +0200 Subject: [PATCH 090/197] nixos/services.znapzend: remove `with lib;` --- nixos/modules/services/backup/znapzend.nix | 186 ++++++++++----------- 1 file changed, 91 insertions(+), 95 deletions(-) diff --git a/nixos/modules/services/backup/znapzend.nix b/nixos/modules/services/backup/znapzend.nix index 7f2c89edbf37..a3ea8b209bb6 100644 --- a/nixos/modules/services/backup/znapzend.nix +++ b/nixos/modules/services/backup/znapzend.nix @@ -1,8 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; -with types; - let planDescription = '' @@ -29,46 +25,46 @@ let planExample = "1h=>10min,1d=>1h,1w=>1d,1m=>1w,1y=>1m"; # A type for a string of the form number{b|k|M|G} - mbufferSizeType = str // { - check = x: str.check x && builtins.isList (builtins.match "^[0-9]+[bkMG]$" x); + mbufferSizeType = lib.types.str // { + check = x: lib.types.str.check x && builtins.isList (builtins.match "^[0-9]+[bkMG]$" x); description = "string of the form number{b|k|M|G}"; }; - enabledFeatures = concatLists (mapAttrsToList (name: enabled: optional enabled name) cfg.features); + enabledFeatures = lib.concatLists (lib.mapAttrsToList (name: enabled: lib.optional enabled name) cfg.features); # Type for a string that must contain certain other strings (the list parameter). # Note that these would need regex escaping. stringContainingStrings = list: let matching = s: map (str: builtins.match ".*${str}.*" s) list; - in str // { - check = x: str.check x && all isList (matching x); - description = "string containing all of the characters ${concatStringsSep ", " list}"; + in lib.types.str // { + check = x: lib.types.str.check x && lib.all lib.isList (matching x); + description = "string containing all of the characters ${lib.concatStringsSep ", " list}"; }; timestampType = stringContainingStrings [ "%Y" "%m" "%d" "%H" "%M" "%S" ]; - destType = srcConfig: submodule ({ name, ... }: { + destType = srcConfig: lib.types.submodule ({ name, ... }: { options = { - label = mkOption { - type = str; + label = lib.mkOption { + type = lib.types.str; description = "Label for this destination. Defaults to the attribute name."; }; - plan = mkOption { - type = str; + plan = lib.mkOption { + type = lib.types.str; description = planDescription; example = planExample; }; - dataset = mkOption { - type = str; + dataset = lib.mkOption { + type = lib.types.str; description = "Dataset name to send snapshots to."; example = "tank/main"; }; - host = mkOption { - type = nullOr str; + host = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = '' Host to use for the destination dataset. Can be prefixed with `user@` to specify the ssh user. @@ -77,8 +73,8 @@ let example = "john@example.com"; }; - presend = mkOption { - type = nullOr str; + presend = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = '' Command to run before sending the snapshot to the destination. Intended to run a remote script via {command}`ssh` on the @@ -89,8 +85,8 @@ let example = "ssh root@bserv zpool import -Nf tank"; }; - postsend = mkOption { - type = nullOr str; + postsend = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = '' Command to run after sending the snapshot to the destination. Intended to run a remote script via {command}`ssh` on the @@ -103,37 +99,37 @@ let }; config = { - label = mkDefault name; - plan = mkDefault srcConfig.plan; + label = lib.mkDefault name; + plan = lib.mkDefault srcConfig.plan; }; }); - srcType = submodule ({ name, config, ... }: { + srcType = lib.types.submodule ({ name, config, ... }: { options = { - enable = mkOption { - type = bool; + enable = lib.mkOption { + type = lib.types.bool; description = "Whether to enable this source."; default = true; }; - recursive = mkOption { - type = bool; + recursive = lib.mkOption { + type = lib.types.bool; description = "Whether to do recursive snapshots."; default = false; }; mbuffer = { - enable = mkOption { - type = bool; + enable = lib.mkOption { + type = lib.types.bool; description = "Whether to use {command}`mbuffer`."; default = false; }; - port = mkOption { - type = nullOr ints.u16; + port = lib.mkOption { + type = lib.types.nullOr lib.types.ints.u16; description = '' Port to use for {command}`mbuffer`. @@ -147,7 +143,7 @@ let default = null; }; - size = mkOption { + size = lib.mkOption { type = mbufferSizeType; description = '' The size for {command}`mbuffer`. @@ -158,32 +154,32 @@ let }; }; - presnap = mkOption { - type = nullOr str; + presnap = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = '' Command to run before snapshots are taken on the source dataset, e.g. for database locking/flushing. See also {option}`postsnap`. ''; default = null; - example = literalExpression '' + example = lib.literalExpression '' '''''${pkgs.mariadb}/bin/mysql -e "set autocommit=0;flush tables with read lock;\\! ''${pkgs.coreutils}/bin/sleep 600" & ''${pkgs.coreutils}/bin/echo $! > /tmp/mariadblock.pid ; sleep 10''' ''; }; - postsnap = mkOption { - type = nullOr str; + postsnap = lib.mkOption { + type = lib.types.nullOr lib.types.str; description = '' Command to run after snapshots are taken on the source dataset, e.g. for database unlocking. See also {option}`presnap`. ''; default = null; - example = literalExpression '' + example = lib.literalExpression '' "''${pkgs.coreutils}/bin/kill `''${pkgs.coreutils}/bin/cat /tmp/mariadblock.pid`;''${pkgs.coreutils}/bin/rm /tmp/mariadblock.pid" ''; }; - timestampFormat = mkOption { + timestampFormat = lib.mkOption { type = timestampType; description = '' The timestamp format to use for constructing snapshot names. @@ -197,8 +193,8 @@ let example = "znapzend-%m.%d.%Y-%H%M%SZ"; }; - sendDelay = mkOption { - type = int; + sendDelay = lib.mkOption { + type = lib.types.int; description = '' Specify delay (in seconds) before sending snaps to the destination. May be useful if you want to control sending time. @@ -207,23 +203,23 @@ let example = 60; }; - plan = mkOption { - type = str; + plan = lib.mkOption { + type = lib.types.str; description = planDescription; example = planExample; }; - dataset = mkOption { - type = str; + dataset = lib.mkOption { + type = lib.types.str; description = "The dataset to use for this source."; example = "tank/home"; }; - destinations = mkOption { - type = attrsOf (destType config); + destinations = lib.mkOption { + type = lib.types.attrsOf (destType config); description = "Additional destinations."; default = {}; - example = literalExpression '' + example = lib.literalExpression '' { local = { dataset = "btank/backup"; @@ -240,7 +236,7 @@ let }; config = { - dataset = mkDefault name; + dataset = lib.mkDefault name; }; }); @@ -251,18 +247,18 @@ let onOff = b: if b then "on" else "off"; nullOff = b: if b == null then "off" else toString b; - stripSlashes = replaceStrings [ "/" ] [ "." ]; + stripSlashes = lib.replaceStrings [ "/" ] [ "." ]; - attrsToFile = config: concatStringsSep "\n" (builtins.attrValues ( - mapAttrs (n: v: "${n}=${v}") config)); + attrsToFile = config: lib.concatStringsSep "\n" (builtins.attrValues ( + lib.mapAttrs (n: v: "${n}=${v}") config)); mkDestAttrs = dst: with dst; - mapAttrs' (n: v: nameValuePair "dst_${label}${n}" v) ({ - "" = optionalString (host != null) "${host}:" + dataset; + lib.mapAttrs' (n: v: lib.nameValuePair "dst_${label}${n}" v) ({ + "" = lib.optionalString (host != null) "${host}:" + dataset; _plan = plan; - } // optionalAttrs (presend != null) { + } // lib.optionalAttrs (presend != null) { _precmd = presend; - } // optionalAttrs (postsend != null) { + } // lib.optionalAttrs (postsend != null) { _pstcmd = postsend; }); @@ -270,7 +266,7 @@ let enabled = onOff enable; # mbuffer is not referenced by its full path to accommodate non-NixOS systems or differing mbuffer versions between source and target mbuffer = with mbuffer; if enable then "mbuffer" - + optionalString (port != null) ":${toString port}" else "off"; + + lib.optionalString (port != null) ":${toString port}" else "off"; mbuffer_size = mbuffer.size; post_znap_cmd = nullOff postsnap; pre_znap_cmd = nullOff presnap; @@ -279,11 +275,11 @@ let src_plan = plan; tsformat = timestampFormat; zend_delay = toString sendDelay; - } // foldr (a: b: a // b) {} ( + } // lib.foldr (a: b: a // b) {} ( map mkDestAttrs (builtins.attrValues destinations) ); - files = mapAttrs' (n: srcCfg: let + files = lib.mapAttrs' (n: srcCfg: let fileText = attrsToFile (mkSrcAttrs srcCfg); in { name = srcCfg.dataset; @@ -294,20 +290,20 @@ in { options = { services.znapzend = { - enable = mkEnableOption "ZnapZend ZFS backup daemon"; + enable = lib.mkEnableOption "ZnapZend ZFS backup daemon"; - logLevel = mkOption { + logLevel = lib.mkOption { default = "debug"; example = "warning"; - type = enum ["debug" "info" "warning" "err" "alert"]; + type = lib.types.enum ["debug" "info" "warning" "err" "alert"]; description = '' The log level when logging to file. Any of debug, info, warning, err, alert. Default in daemonized form is debug. ''; }; - logTo = mkOption { - type = str; + logTo = lib.mkOption { + type = lib.types.str; default = "syslog::daemon"; example = "/var/log/znapzend.log"; description = '' @@ -315,31 +311,31 @@ in ''; }; - mailErrorSummaryTo = mkOption { - type = singleLineStr; + mailErrorSummaryTo = lib.mkOption { + type = lib.types.singleLineStr; default = ""; description = '' Email address to send a summary to if "send task(s) failed". ''; }; - noDestroy = mkOption { - type = bool; + noDestroy = lib.mkOption { + type = lib.types.bool; default = false; description = "Does all changes to the filesystem except destroy."; }; - autoCreation = mkOption { - type = bool; + autoCreation = lib.mkOption { + type = lib.types.bool; default = false; description = "Automatically create the destination dataset if it does not exist."; }; - zetup = mkOption { - type = attrsOf srcType; + zetup = lib.mkOption { + type = lib.types.attrsOf srcType; description = "Znapzend configuration."; default = {}; - example = literalExpression '' + example = lib.literalExpression '' { "tank/home" = { # Make snapshots of tank/home every hour, keep those for 1 day, @@ -356,8 +352,8 @@ in ''; }; - pure = mkOption { - type = bool; + pure = lib.mkOption { + type = lib.types.bool; description = '' Do not persist any stateful znapzend setups. If this option is enabled, your previously set znapzend setups will be cleared and only @@ -366,17 +362,17 @@ in default = false; }; - features.oracleMode = mkEnableOption '' + features.oracleMode = lib.mkEnableOption '' destroying snapshots one by one instead of using one long argument list. If source and destination are out of sync for a long time, you may have so many snapshots to destroy that the argument gets is too long and the command fails ''; - features.recvu = mkEnableOption '' + features.recvu = lib.mkEnableOption '' recvu feature which uses `-u` on the receiving end to keep the destination filesystem unmounted ''; - features.compressed = mkEnableOption '' + features.compressed = lib.mkEnableOption '' compressed feature which adds the options `-Lce` to the {command}`zfs send` command. When this is enabled, make sure that both the sending and receiving pool have the same relevant @@ -387,7 +383,7 @@ in and {manpage}`zfs(8)` for more info ''; - features.sendRaw = mkEnableOption '' + features.sendRaw = lib.mkEnableOption '' sendRaw feature which adds the options `-w` to the {command}`zfs send` command. For encrypted source datasets this instructs zfs not to decrypt before sending which results in a remote @@ -396,7 +392,7 @@ in option must be used consistently, raw incrementals cannot be based on non-raw snapshots and vice versa ''; - features.skipIntermediates = mkEnableOption '' + features.skipIntermediates = lib.mkEnableOption '' the skipIntermediates feature to send a single increment between latest common snapshot and the newly made one. It may skip several source snaps if the destination was offline for some time, and @@ -404,14 +400,14 @@ in destinations, the new snapshot is sent as soon as it is created on the source, so there are no automatic increments to skip ''; - features.lowmemRecurse = mkEnableOption '' + features.lowmemRecurse = lib.mkEnableOption '' use lowmemRecurse on systems where you have too many datasets, so a recursive listing of attributes to find backup plans exhausts the memory available to {command}`znapzend`: instead, go the slower way to first list all impacted dataset names, and then query their configs one by one ''; - features.zfsGetType = mkEnableOption '' + features.zfsGetType = lib.mkEnableOption '' using zfsGetType if your {command}`zfs get` supports a `-t` argument for filtering by dataset type at all AND lists properties for snapshots by default when recursing, so that there @@ -425,7 +421,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.znapzend ]; systemd.services = { @@ -436,12 +432,12 @@ in path = with pkgs; [ zfs mbuffer openssh ]; - preStart = optionalString cfg.pure '' + preStart = lib.optionalString cfg.pure '' echo Resetting znapzend zetups ${pkgs.znapzend}/bin/znapzendzetup list \ | grep -oP '(?<=\*\*\* backup plan: ).*(?= \*\*\*)' \ | xargs -I{} ${pkgs.znapzend}/bin/znapzendzetup delete "{}" - '' + concatStringsSep "\n" (mapAttrsToList (dataset: config: '' + '' + lib.concatStringsSep "\n" (lib.mapAttrsToList (dataset: config: '' echo Importing znapzend zetup ${config} for dataset ${dataset} ${pkgs.znapzend}/bin/znapzendzetup import --write ${dataset} ${config} & '') files) + '' @@ -458,15 +454,15 @@ in # Needs to have write access to ZFS User = "root"; ExecStart = let - args = concatStringsSep " " [ + args = lib.concatStringsSep " " [ "--logto=${cfg.logTo}" "--loglevel=${cfg.logLevel}" - (optionalString cfg.noDestroy "--nodestroy") - (optionalString cfg.autoCreation "--autoCreation") - (optionalString (cfg.mailErrorSummaryTo != "") + (lib.optionalString cfg.noDestroy "--nodestroy") + (lib.optionalString cfg.autoCreation "--autoCreation") + (lib.optionalString (cfg.mailErrorSummaryTo != "") "--mailErrorSummaryTo=${cfg.mailErrorSummaryTo}") - (optionalString (enabledFeatures != []) - "--features=${concatStringsSep "," enabledFeatures}") + (lib.optionalString (enabledFeatures != []) + "--features=${lib.concatStringsSep "," enabledFeatures}") ]; in "${pkgs.znapzend}/bin/znapzend ${args}"; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; Restart = "on-failure"; @@ -475,5 +471,5 @@ in }; }; - meta.maintainers = with maintainers; [ SlothOfAnarchy ]; + meta.maintainers = with lib.maintainers; [ SlothOfAnarchy ]; } From 0dac464dc87885c2abac56618172389a30c32053 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:52 +0200 Subject: [PATCH 091/197] nixos/hardware/deviceTree: remove `with lib;` --- nixos/modules/hardware/device-tree.nix | 83 +++++++++++++------------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/nixos/modules/hardware/device-tree.nix b/nixos/modules/hardware/device-tree.nix index a29cc76ea8f9..b3feedf1edad 100644 --- a/nixos/modules/hardware/device-tree.nix +++ b/nixos/modules/hardware/device-tree.nix @@ -1,21 +1,18 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.deviceTree; - overlayType = types.submodule { + overlayType = lib.types.submodule { options = { - name = mkOption { - type = types.str; + name = lib.mkOption { + type = lib.types.str; description = '' Name of this overlay ''; }; - filter = mkOption { - type = types.nullOr types.str; + filter = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; example = "*rpi*.dtb"; description = '' @@ -23,18 +20,18 @@ let ''; }; - dtsFile = mkOption { - type = types.nullOr types.path; + dtsFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; description = '' Path to .dts overlay file, overlay is applied to each .dtb file matching "compatible" of the overlay. ''; default = null; - example = literalExpression "./dts/overlays.dts"; + example = lib.literalExpression "./dts/overlays.dts"; }; - dtsText = mkOption { - type = types.nullOr types.str; + dtsText = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Literal DTS contents, overlay is applied to @@ -55,8 +52,8 @@ let ''; }; - dtboFile = mkOption { - type = types.nullOr types.path; + dtboFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' Path to .dtbo compiled overlay file. @@ -79,9 +76,9 @@ let # Fill in `dtboFile` for each overlay if not set already. # Existence of one of these is guarded by assertion below - withDTBOs = xs: flip map xs (o: o // { dtboFile = + withDTBOs = xs: lib.flip map xs (o: o // { dtboFile = let - includePaths = ["${getDev cfg.kernelPackage}/lib/modules/${cfg.kernelPackage.modDirVersion}/source/scripts/dtc/include-prefixes"] ++ cfg.dtboBuildExtraIncludePaths; + includePaths = ["${lib.getDev cfg.kernelPackage}/lib/modules/${cfg.kernelPackage.modDirVersion}/source/scripts/dtc/include-prefixes"] ++ cfg.dtboBuildExtraIncludePaths; extraPreprocessorFlags = cfg.dtboBuildExtraPreprocessorFlags; in if o.dtboFile == null then @@ -97,67 +94,67 @@ let in { imports = [ - (mkRemovedOptionModule [ "hardware" "deviceTree" "base" ] "Use hardware.deviceTree.kernelPackage instead") + (lib.mkRemovedOptionModule [ "hardware" "deviceTree" "base" ] "Use hardware.deviceTree.kernelPackage instead") ]; options = { hardware.deviceTree = { - enable = mkOption { + enable = lib.mkOption { default = pkgs.stdenv.hostPlatform.linux-kernel.DTB or false; - type = types.bool; + type = lib.types.bool; description = '' Build device tree files. These are used to describe the non-discoverable hardware of a system. ''; }; - kernelPackage = mkOption { + kernelPackage = lib.mkOption { default = config.boot.kernelPackages.kernel; - defaultText = literalExpression "config.boot.kernelPackages.kernel"; - example = literalExpression "pkgs.linux_latest"; - type = types.path; + defaultText = lib.literalExpression "config.boot.kernelPackages.kernel"; + example = lib.literalExpression "pkgs.linux_latest"; + type = lib.types.path; description = '' Kernel package where device tree include directory is from. Also used as default source of dtb package to apply overlays to ''; }; - dtboBuildExtraPreprocessorFlags = mkOption { + dtboBuildExtraPreprocessorFlags = lib.mkOption { default = []; - example = literalExpression "[ \"-DMY_DTB_DEFINE\" ]"; - type = types.listOf types.str; + example = lib.literalExpression "[ \"-DMY_DTB_DEFINE\" ]"; + type = lib.types.listOf lib.types.str; description = '' Additional flags to pass to the preprocessor during dtbo compilations ''; }; - dtboBuildExtraIncludePaths = mkOption { + dtboBuildExtraIncludePaths = lib.mkOption { default = []; - example = literalExpression '' + example = lib.literalExpression '' [ ./my_custom_include_dir_1 ./custom_include_dir_2 ] ''; - type = types.listOf types.path; + type = lib.types.listOf lib.types.path; description = '' Additional include paths that will be passed to the preprocessor when creating the final .dts to compile into .dtbo ''; }; - dtbSource = mkOption { + dtbSource = lib.mkOption { default = "${cfg.kernelPackage}/dtbs"; - defaultText = literalExpression "\${cfg.kernelPackage}/dtbs"; - type = types.path; + defaultText = lib.literalExpression "\${cfg.kernelPackage}/dtbs"; + type = lib.types.path; description = '' Path to dtb directory that overlays and other processing will be applied to. Uses device trees bundled with the Linux kernel by default. ''; }; - name = mkOption { + name = lib.mkOption { default = null; example = "some-dtb.dtb"; - type = types.nullOr types.str; + type = lib.types.nullOr lib.types.str; description = '' The name of an explicit dtb to be loaded, relative to the dtb base. Useful in extlinux scenarios if the bootloader doesn't pick the @@ -165,8 +162,8 @@ in ''; }; - filter = mkOption { - type = types.nullOr types.str; + filter = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; example = "*rpi*.dtb"; description = '' @@ -174,9 +171,9 @@ in ''; }; - overlays = mkOption { + overlays = lib.mkOption { default = []; - example = literalExpression '' + example = lib.literalExpression '' [ { name = "pps"; dtsFile = ./dts/pps.dts; } { name = "spi"; @@ -185,7 +182,7 @@ in { name = "precompiled"; dtboFile = ./dtbos/example.dtbo; } ] ''; - type = types.listOf (types.coercedTo types.path (path: { + type = lib.types.listOf (lib.types.coercedTo lib.types.path (path: { name = baseNameOf path; filter = null; dtboFile = path; @@ -195,9 +192,9 @@ in ''; }; - package = mkOption { + package = lib.mkOption { default = null; - type = types.nullOr types.path; + type = lib.types.nullOr lib.types.path; internal = true; description = '' A path containing the result of applying `overlays` to `kernelPackage`. @@ -206,7 +203,7 @@ in }; }; - config = mkIf (cfg.enable) { + config = lib.mkIf (cfg.enable) { assertions = let invalidOverlay = o: (o.dtsFile == null) && (o.dtsText == null) && (o.dtboFile == null); From 6f3aef9bde9cb88209c90f5a138c48ce25242c86 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:52 +0200 Subject: [PATCH 092/197] nixos/hardware.flipperzero: remove `with lib;` --- nixos/modules/hardware/flipperzero.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/modules/hardware/flipperzero.nix b/nixos/modules/hardware/flipperzero.nix index 3a6d29d0f9eb..bda2e2c8e0a5 100644 --- a/nixos/modules/hardware/flipperzero.nix +++ b/nixos/modules/hardware/flipperzero.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.flipperzero; @@ -9,9 +6,9 @@ let in { - options.hardware.flipperzero.enable = mkEnableOption "udev rules and software for Flipper Zero devices"; + options.hardware.flipperzero.enable = lib.mkEnableOption "udev rules and software for Flipper Zero devices"; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.qFlipper ]; services.udev.packages = [ pkgs.qFlipper ]; }; From 166d20fb4623c0b92189456ee43b610dc37c0988 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:52 +0200 Subject: [PATCH 093/197] nixos/hardware.gkraken: remove `with lib;` --- nixos/modules/hardware/gkraken.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/modules/hardware/gkraken.nix b/nixos/modules/hardware/gkraken.nix index 97d15369db0a..90b0069e80c8 100644 --- a/nixos/modules/hardware/gkraken.nix +++ b/nixos/modules/hardware/gkraken.nix @@ -1,16 +1,13 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.gkraken; in { options.hardware.gkraken = { - enable = mkEnableOption "gkraken's udev rules for NZXT AIO liquid coolers"; + enable = lib.mkEnableOption "gkraken's udev rules for NZXT AIO liquid coolers"; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { services.udev.packages = with pkgs; [ gkraken ]; From 6d731ad2dfa45a38c56391c8b4e3777727336692 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:52 +0200 Subject: [PATCH 094/197] nixos/hardware.gpgSmartcards: remove `with lib;` --- nixos/modules/hardware/gpgsmartcards.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nixos/modules/hardware/gpgsmartcards.nix b/nixos/modules/hardware/gpgsmartcards.nix index cc3f4c769976..3940efd09e22 100644 --- a/nixos/modules/hardware/gpgsmartcards.nix +++ b/nixos/modules/hardware/gpgsmartcards.nix @@ -1,6 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; let # gnupg's manual describes how to setup ccid udev rules: # https://www.gnupg.org/howtos/card-howto/en/ch02s03.html @@ -28,10 +26,10 @@ let cfg = config.hardware.gpgSmartcards; in { options.hardware.gpgSmartcards = { - enable = mkEnableOption "udev rules for gnupg smart cards"; + enable = lib.mkEnableOption "udev rules for gnupg smart cards"; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { services.udev.packages = [ scdaemonUdevRulesPkg ]; }; } From 58e31e0c2600557702885dac2789def907f9d4b1 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:52 +0200 Subject: [PATCH 095/197] nixos/hardware.i2c: remove `with lib;` --- nixos/modules/hardware/i2c.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nixos/modules/hardware/i2c.nix b/nixos/modules/hardware/i2c.nix index b1e5cfd9e025..4dd7a8ccc531 100644 --- a/nixos/modules/hardware/i2c.nix +++ b/nixos/modules/hardware/i2c.nix @@ -1,21 +1,18 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.i2c; in { options.hardware.i2c = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' i2c devices support. By default access is granted to users in the "i2c" group (will be created if non-existent) and any user with a seat, meaning logged on the computer locally ''; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "i2c"; description = '' Grant access to i2c devices (/dev/i2c-*) to users in this group. @@ -23,11 +20,11 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { boot.kernelModules = [ "i2c-dev" ]; - users.groups = mkIf (cfg.group == "i2c") { + users.groups = lib.mkIf (cfg.group == "i2c") { i2c = { }; }; @@ -42,6 +39,6 @@ in }; - meta.maintainers = [ maintainers.rnhmjoj ]; + meta.maintainers = [ lib.maintainers.rnhmjoj ]; } From e880cd15493165069b438e95513614ff0652952f Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:52 +0200 Subject: [PATCH 096/197] nixos/hardware.infiniband: remove `with lib;` --- nixos/modules/hardware/infiniband.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/nixos/modules/hardware/infiniband.nix b/nixos/modules/hardware/infiniband.nix index 6780aee9f36b..b09453116cf9 100644 --- a/nixos/modules/hardware/infiniband.nix +++ b/nixos/modules/hardware/infiniband.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.infiniband; @@ -31,9 +28,9 @@ in { options.hardware.infiniband = { - enable = mkEnableOption "Infiniband support"; - guids = mkOption { - type = with types; listOf str; + enable = lib.mkEnableOption "Infiniband support"; + guids = lib.mkOption { + type = with lib.types; listOf str; default = []; example = [ "0xe8ebd30000eee2e1" ]; description = '' @@ -42,7 +39,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { boot.initrd.kernelModules = [ "mlx5_core" "mlx5_ib" "ib_cm" "rdma_cm" "rdma_ucm" "rpcrdma" From 9856183d59264a4f000b147aa019f72cdfc3ed57 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:52 +0200 Subject: [PATCH 097/197] nixos/security.polkit: remove `with lib;` --- nixos/modules/security/polkit.nix | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/nixos/modules/security/polkit.nix b/nixos/modules/security/polkit.nix index 76f623096fb7..eb783179af55 100644 --- a/nixos/modules/security/polkit.nix +++ b/nixos/modules/security/polkit.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.security.polkit; @@ -12,14 +9,14 @@ in options = { - security.polkit.enable = mkEnableOption "polkit"; + security.polkit.enable = lib.mkEnableOption "polkit"; - security.polkit.package = mkPackageOption pkgs "polkit" { }; + security.polkit.package = lib.mkPackageOption pkgs "polkit" { }; - security.polkit.debug = mkEnableOption "debug logs from polkit. This is required in order to see log messages from rule definitions"; + security.polkit.debug = lib.mkEnableOption "debug logs from polkit. This is required in order to see log messages from rule definitions"; - security.polkit.extraConfig = mkOption { - type = types.lines; + security.polkit.extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; example = '' @@ -41,8 +38,8 @@ in ''; }; - security.polkit.adminIdentities = mkOption { - type = types.listOf types.str; + security.polkit.adminIdentities = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ "unix-group:wheel" ]; example = [ "unix-user:alice" "unix-group:admin" ]; description = @@ -57,7 +54,7 @@ in }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package.bin cfg.package.out ]; @@ -65,7 +62,7 @@ in systemd.services.polkit.serviceConfig.ExecStart = [ "" - "${cfg.package.out}/lib/polkit-1/polkitd ${optionalString (!cfg.debug) "--no-debug"}" + "${cfg.package.out}/lib/polkit-1/polkitd ${lib.optionalString (!cfg.debug) "--no-debug"}" ]; systemd.services.polkit.restartTriggers = [ config.system.path ]; @@ -78,7 +75,7 @@ in environment.etc."polkit-1/rules.d/10-nixos.rules".text = '' polkit.addAdminRule(function(action, subject) { - return [${concatStringsSep ", " (map (i: "\"${i}\"") cfg.adminIdentities)}]; + return [${lib.concatStringsSep ", " (map (i: "\"${i}\"") cfg.adminIdentities)}]; }); ${cfg.extraConfig} From 3e47355b3fdce34611c9d7ea64fd661f52110cd2 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:53 +0200 Subject: [PATCH 098/197] nixos/services.salt.master: remove `with lib;` --- nixos/modules/services/admin/salt/master.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/admin/salt/master.nix b/nixos/modules/services/admin/salt/master.nix index c447540da1f8..1ffe6b6cb27a 100644 --- a/nixos/modules/services/admin/salt/master.nix +++ b/nixos/modules/services/admin/salt/master.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.salt.master; @@ -20,16 +17,16 @@ in { options = { services.salt.master = { - enable = mkEnableOption "Salt configuration management system master service"; - configuration = mkOption { - type = types.attrs; + enable = lib.mkEnableOption "Salt configuration management system master service"; + configuration = lib.mkOption { + type = lib.types.attrs; default = {}; description = "Salt master configuration as Nix attribute set."; }; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment = { # Set this up in /etc/salt/master so `salt`, `salt-key`, etc. work. # The alternatives are From 2d4f871b1a9532b71fc8e926de3e9cd22148b5f9 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:53 +0200 Subject: [PATCH 099/197] nixos/services.rabbitmq: remove `with lib;` --- nixos/modules/services/amqp/rabbitmq.nix | 67 +++++++++++------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/nixos/modules/services/amqp/rabbitmq.nix b/nixos/modules/services/amqp/rabbitmq.nix index b5aebaaf1275..fba26591e0ba 100644 --- a/nixos/modules/services/amqp/rabbitmq.nix +++ b/nixos/modules/services/amqp/rabbitmq.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.rabbitmq; @@ -16,7 +13,7 @@ in { imports = [ - (mkRemovedOptionModule [ "services" "rabbitmq" "cookie" ] '' + (lib.mkRemovedOptionModule [ "services" "rabbitmq" "cookie" ] '' This option wrote the Erlang cookie to the store, while it should be kept secret. Please remove it from your NixOS configuration and deploy a cookie securely instead. The renamed `unsafeCookie` must ONLY be used in isolated non-production environments such as NixOS VM tests. @@ -26,8 +23,8 @@ in ###### interface options = { services.rabbitmq = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable the RabbitMQ server, an Advanced Message @@ -35,9 +32,9 @@ in ''; }; - package = mkPackageOption pkgs "rabbitmq-server" { }; + package = lib.mkPackageOption pkgs "rabbitmq-server" { }; - listenAddress = mkOption { + listenAddress = lib.mkOption { default = "127.0.0.1"; example = ""; description = '' @@ -52,28 +49,28 @@ in configItems."listeners.tcp.1" and it's left for backwards compatibility with previous version of this module. ''; - type = types.str; + type = lib.types.str; }; - port = mkOption { + port = lib.mkOption { default = 5672; description = '' Port on which RabbitMQ will listen for AMQP connections. ''; - type = types.port; + type = lib.types.port; }; - dataDir = mkOption { - type = types.path; + dataDir = lib.mkOption { + type = lib.types.path; default = "/var/lib/rabbitmq"; description = '' Data directory for rabbitmq. ''; }; - unsafeCookie = mkOption { + unsafeCookie = lib.mkOption { default = ""; - type = types.str; + type = lib.types.str; description = '' Erlang cookie is a string of arbitrary length which must be the same for several nodes to be allowed to communicate. @@ -86,10 +83,10 @@ in ''; }; - configItems = mkOption { + configItems = lib.mkOption { default = { }; - type = types.attrsOf types.str; - example = literalExpression '' + type = lib.types.attrsOf lib.types.str; + example = lib.literalExpression '' { "auth_backends.1.authn" = "rabbit_auth_backend_ldap"; "auth_backends.1.authz" = "rabbit_auth_backend_internal"; @@ -112,9 +109,9 @@ in ''; }; - config = mkOption { + config = lib.mkOption { default = ""; - type = types.str; + type = lib.types.str; description = '' Verbatim advanced configuration file contents using the Erlang syntax. This is also known as the `advanced.config` file or the old config format. @@ -130,23 +127,23 @@ in ''; }; - plugins = mkOption { + plugins = lib.mkOption { default = [ ]; - type = types.listOf types.str; + type = lib.types.listOf lib.types.str; description = "The names of plugins to enable"; }; - pluginDirs = mkOption { + pluginDirs = lib.mkOption { default = [ ]; - type = types.listOf types.path; + type = lib.types.listOf lib.types.path; description = "The list of directories containing external plugins"; }; managementPlugin = { - enable = mkEnableOption "the management plugin"; - port = mkOption { + enable = lib.mkEnableOption "the management plugin"; + port = lib.mkOption { default = 15672; - type = types.port; + type = lib.types.port; description = '' On which port to run the management plugin ''; @@ -157,7 +154,7 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { # This is needed so we will have 'rabbitmqctl' in our PATH environment.systemPackages = [ cfg.package ]; @@ -175,13 +172,13 @@ in users.groups.rabbitmq.gid = config.ids.gids.rabbitmq; services.rabbitmq.configItems = { - "listeners.tcp.1" = mkDefault "${cfg.listenAddress}:${toString cfg.port}"; - } // optionalAttrs cfg.managementPlugin.enable { + "listeners.tcp.1" = lib.mkDefault "${cfg.listenAddress}:${toString cfg.port}"; + } // lib.optionalAttrs cfg.managementPlugin.enable { "management.tcp.port" = toString cfg.managementPlugin.port; "management.tcp.ip" = cfg.listenAddress; }; - services.rabbitmq.plugins = optional cfg.managementPlugin.enable "rabbitmq_management"; + services.rabbitmq.plugins = lib.optional cfg.managementPlugin.enable "rabbitmq_management"; systemd.services.rabbitmq = { description = "RabbitMQ Server"; @@ -200,11 +197,11 @@ in RABBITMQ_LOGS = "-"; SYS_PREFIX = ""; RABBITMQ_CONFIG_FILE = config_file; - RABBITMQ_PLUGINS_DIR = concatStringsSep ":" cfg.pluginDirs; + RABBITMQ_PLUGINS_DIR = lib.concatStringsSep ":" cfg.pluginDirs; RABBITMQ_ENABLED_PLUGINS_FILE = pkgs.writeText "enabled_plugins" '' - [ ${concatStringsSep "," cfg.plugins} ]. + [ ${lib.concatStringsSep "," cfg.plugins} ]. ''; - } // optionalAttrs (cfg.config != "") { RABBITMQ_ADVANCED_CONFIG_FILE = advanced_config_file; }; + } // lib.optionalAttrs (cfg.config != "") { RABBITMQ_ADVANCED_CONFIG_FILE = advanced_config_file; }; serviceConfig = { ExecStart = "${cfg.package}/sbin/rabbitmq-server"; @@ -223,7 +220,7 @@ in }; preStart = '' - ${optionalString (cfg.unsafeCookie != "") '' + ${lib.optionalString (cfg.unsafeCookie != "") '' install -m 600 <(echo -n ${cfg.unsafeCookie}) ${cfg.dataDir}/.erlang.cookie ''} ''; From bff67892a738630a3fd6aecb02f66b11fa2927a8 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:53 +0200 Subject: [PATCH 100/197] nixos/services.kubernetes.flannel: remove `with lib;` --- .../services/cluster/kubernetes/flannel.nix | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/nixos/modules/services/cluster/kubernetes/flannel.nix b/nixos/modules/services/cluster/kubernetes/flannel.nix index 93a460971055..f0269cd0bc21 100644 --- a/nixos/modules/services/cluster/kubernetes/flannel.nix +++ b/nixos/modules/services/cluster/kubernetes/flannel.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let top = config.services.kubernetes; cfg = top.flannel; @@ -12,28 +9,28 @@ in { ###### interface options.services.kubernetes.flannel = { - enable = mkEnableOption "flannel networking"; + enable = lib.mkEnableOption "flannel networking"; - openFirewallPorts = mkOption { + openFirewallPorts = lib.mkOption { description = '' Whether to open the Flannel UDP ports in the firewall on all interfaces.''; - type = types.bool; + type = lib.types.bool; default = true; }; }; ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { services.flannel = { - enable = mkDefault true; - network = mkDefault top.clusterCidr; + enable = lib.mkDefault true; + network = lib.mkDefault top.clusterCidr; inherit storageBackend; nodeName = config.services.kubernetes.kubelet.hostname; }; services.kubernetes.kubelet = { - cni.config = mkDefault [{ + cni.config = lib.mkDefault [{ name = "mynet"; type = "flannel"; cniVersion = "0.3.1"; @@ -45,7 +42,7 @@ in }; networking = { - firewall.allowedUDPPorts = mkIf cfg.openFirewallPorts [ + firewall.allowedUDPPorts = lib.mkIf cfg.openFirewallPorts [ 8285 # flannel udp 8472 # flannel vxlan ]; @@ -61,7 +58,7 @@ in }; # give flannel some kubernetes rbac permissions if applicable - services.kubernetes.addonManager.bootstrapAddons = mkIf ((storageBackend == "kubernetes") && (elem "RBAC" top.apiserver.authorizationMode)) { + services.kubernetes.addonManager.bootstrapAddons = lib.mkIf ((storageBackend == "kubernetes") && (lib.elem "RBAC" top.apiserver.authorizationMode)) { flannel-cr = { apiVersion = "rbac.authorization.k8s.io/v1"; From 4b3987ab25f5a1ac8fe3e2230e750184e50c2f36 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:54 +0200 Subject: [PATCH 101/197] nixos/services.jenkins: remove `with lib;` --- .../jenkins/default.nix | 85 +++++++++---------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/nixos/modules/services/continuous-integration/jenkins/default.nix b/nixos/modules/services/continuous-integration/jenkins/default.nix index a23120739b7f..95372ec2bbf8 100644 --- a/nixos/modules/services/continuous-integration/jenkins/default.nix +++ b/nixos/modules/services/continuous-integration/jenkins/default.nix @@ -1,38 +1,37 @@ { config, lib, pkgs, ... }: -with lib; let cfg = config.services.jenkins; jenkinsUrl = "http://${cfg.listenAddress}:${toString cfg.port}${cfg.prefix}"; in { options = { services.jenkins = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable the jenkins continuous integration server. ''; }; - user = mkOption { + user = lib.mkOption { default = "jenkins"; - type = types.str; + type = lib.types.str; description = '' User the jenkins server should execute under. ''; }; - group = mkOption { + group = lib.mkOption { default = "jenkins"; - type = types.str; + type = lib.types.str; description = '' If the default user "jenkins" is configured then this is the primary group of that user. ''; }; - extraGroups = mkOption { - type = types.listOf types.str; + extraGroups = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ ]; example = [ "wheel" "dialout" ]; description = '' @@ -40,38 +39,38 @@ in { ''; }; - home = mkOption { + home = lib.mkOption { default = "/var/lib/jenkins"; - type = types.path; + type = lib.types.path; description = '' The path to use as JENKINS_HOME. If the default user "jenkins" is configured then this is the home of the "jenkins" user. ''; }; - listenAddress = mkOption { + listenAddress = lib.mkOption { default = "0.0.0.0"; example = "localhost"; - type = types.str; + type = lib.types.str; description = '' Specifies the bind address on which the jenkins HTTP interface listens. The default is the wildcard address. ''; }; - port = mkOption { + port = lib.mkOption { default = 8080; - type = types.port; + type = lib.types.port; description = '' Specifies port number on which the jenkins HTTP interface listens. The default is 8080. ''; }; - prefix = mkOption { + prefix = lib.mkOption { default = ""; example = "/jenkins"; - type = types.str; + type = lib.types.str; description = '' Specifies a urlPrefix to use with jenkins. If the example /jenkins is given, the jenkins server will be @@ -79,20 +78,20 @@ in { ''; }; - package = mkPackageOption pkgs "jenkins" { }; + package = lib.mkPackageOption pkgs "jenkins" { }; - packages = mkOption { + packages = lib.mkOption { default = [ pkgs.stdenv pkgs.git pkgs.jdk17 config.programs.ssh.package pkgs.nix ]; - defaultText = literalExpression "[ pkgs.stdenv pkgs.git pkgs.jdk17 config.programs.ssh.package pkgs.nix ]"; - type = types.listOf types.package; + defaultText = lib.literalExpression "[ pkgs.stdenv pkgs.git pkgs.jdk17 config.programs.ssh.package pkgs.nix ]"; + type = lib.types.listOf lib.types.package; description = '' Packages to add to PATH for the jenkins process. ''; }; - environment = mkOption { + environment = lib.mkOption { default = { }; - type = with types; attrsOf str; + type = with lib.types; attrsOf str; description = '' Additional environment variables to be passed to the jenkins process. As a base environment, jenkins receives NIX_PATH from @@ -104,9 +103,9 @@ in { ''; }; - plugins = mkOption { + plugins = lib.mkOption { default = null; - type = types.nullOr (types.attrsOf types.package); + type = lib.types.nullOr (lib.types.attrsOf lib.types.package); description = '' A set of plugins to activate. Note that this will completely remove and replace any previously installed plugins. If you @@ -115,13 +114,13 @@ in { `null`. You can generate this set with a tool such as `jenkinsPlugins2nix`. ''; - example = literalExpression '' + example = lib.literalExpression '' import path/to/jenkinsPlugins2nix-generated-plugins.nix { inherit (pkgs) fetchurl stdenv; } ''; }; - extraOptions = mkOption { - type = types.listOf types.str; + extraOptions = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ ]; example = [ "--debug=9" ]; description = '' @@ -129,8 +128,8 @@ in { ''; }; - extraJavaOptions = mkOption { - type = types.listOf types.str; + extraJavaOptions = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ ]; example = [ "-Xmx80m" ]; description = '' @@ -138,8 +137,8 @@ in { ''; }; - withCLI = mkOption { - type = types.bool; + withCLI = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to make the CLI available. @@ -152,25 +151,25 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment = { # server references the dejavu fonts systemPackages = [ pkgs.dejavu_fonts - ] ++ optional cfg.withCLI cfg.package; + ] ++ lib.optional cfg.withCLI cfg.package; variables = {} - // optionalAttrs cfg.withCLI { + // lib.optionalAttrs cfg.withCLI { # Make it more convenient to use the `jenkins-cli`. JENKINS_URL = jenkinsUrl; }; }; - users.groups = optionalAttrs (cfg.group == "jenkins") { + users.groups = lib.optionalAttrs (cfg.group == "jenkins") { jenkins.gid = config.ids.gids.jenkins; }; - users.users = optionalAttrs (cfg.user == "jenkins") { + users.users = lib.optionalAttrs (cfg.user == "jenkins") { jenkins = { description = "jenkins user"; createHome = true; @@ -205,14 +204,14 @@ in { preStart = let replacePlugins = - optionalString (cfg.plugins != null) ( - let pluginCmds = lib.attrsets.mapAttrsToList + lib.optionalString (cfg.plugins != null) ( + let pluginCmds = lib.attrsets.lib.mapAttrsToList (n: v: "cp ${v} ${cfg.home}/plugins/${n}.jpi") cfg.plugins; in '' rm -r ${cfg.home}/plugins || true mkdir -p ${cfg.home}/plugins - ${lib.strings.concatStringsSep "\n" pluginCmds} + ${lib.strings.lib.concatStringsSep "\n" pluginCmds} ''); in '' rm -rf ${cfg.home}/war @@ -221,11 +220,11 @@ in { # For reference: https://wiki.jenkins.io/display/JENKINS/JenkinsLinuxStartupScript script = '' - ${pkgs.jdk17}/bin/java ${concatStringsSep " " cfg.extraJavaOptions} -jar ${cfg.package}/webapps/jenkins.war --httpListenAddress=${cfg.listenAddress} \ + ${pkgs.jdk17}/bin/java ${lib.concatStringsSep " " cfg.extraJavaOptions} -jar ${cfg.package}/webapps/jenkins.war --httpListenAddress=${cfg.listenAddress} \ --httpPort=${toString cfg.port} \ --prefix=${cfg.prefix} \ -Djava.awt.headless=true \ - ${concatStringsSep " " cfg.extraOptions} + ${lib.concatStringsSep " " cfg.extraOptions} ''; postStart = '' @@ -236,7 +235,7 @@ in { serviceConfig = { User = cfg.user; - StateDirectory = mkIf (hasPrefix "/var/lib/jenkins" cfg.home) "jenkins"; + StateDirectory = lib.mkIf (lib.hasPrefix "/var/lib/jenkins" cfg.home) "jenkins"; # For (possible) socket use RuntimeDirectory = "jenkins"; }; From 5fb90466e8785cbaa006e309a472092eb11c71b1 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:55 +0200 Subject: [PATCH 102/197] nixos/services.jenkins.jobBuilder: remove `with lib;` --- .../jenkins/job-builder.nix | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/nixos/modules/services/continuous-integration/jenkins/job-builder.nix b/nixos/modules/services/continuous-integration/jenkins/job-builder.nix index 6400da13d3a8..ccad25cb92a7 100644 --- a/nixos/modules/services/continuous-integration/jenkins/job-builder.nix +++ b/nixos/modules/services/continuous-integration/jenkins/job-builder.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let jenkinsCfg = config.services.jenkins; cfg = config.services.jenkins.jobBuilder; @@ -9,7 +6,7 @@ let in { options = { services.jenkins.jobBuilder = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' the Jenkins Job Builder (JJB) service. It allows defining jobs for Jenkins in a declarative manner. @@ -24,17 +21,17 @@ in { ''; - accessUser = mkOption { + accessUser = lib.mkOption { default = "admin"; - type = types.str; + type = lib.types.str; description = '' User id in Jenkins used to reload config. ''; }; - accessToken = mkOption { + accessToken = lib.mkOption { default = ""; - type = types.str; + type = lib.types.str; description = '' User token in Jenkins used to reload config. WARNING: This token will be world readable in the Nix store. To keep @@ -42,10 +39,10 @@ in { ''; }; - accessTokenFile = mkOption { + accessTokenFile = lib.mkOption { default = "${config.services.jenkins.home}/secrets/initialAdminPassword"; - defaultText = literalExpression ''"''${config.services.jenkins.home}/secrets/initialAdminPassword"''; - type = types.str; + defaultText = lib.literalExpression ''"''${config.services.jenkins.home}/secrets/initialAdminPassword"''; + type = lib.types.str; example = "/run/keys/jenkins-job-builder-access-token"; description = '' File containing the API token for the {option}`accessUser` @@ -53,9 +50,9 @@ in { ''; }; - yamlJobs = mkOption { + yamlJobs = lib.mkOption { default = ""; - type = types.lines; + type = lib.types.lines; example = '' - job: name: jenkins-job-test-1 @@ -67,10 +64,10 @@ in { ''; }; - jsonJobs = mkOption { + jsonJobs = lib.mkOption { default = [ ]; - type = types.listOf types.str; - example = literalExpression '' + type = lib.types.listOf lib.types.str; + example = lib.literalExpression '' [ ''' [ { "job": @@ -87,10 +84,10 @@ in { ''; }; - nixJobs = mkOption { + nixJobs = lib.mkOption { default = [ ]; - type = types.listOf types.attrs; - example = literalExpression '' + type = lib.types.listOf lib.types.attrs; + example = lib.literalExpression '' [ { job = { name = "jenkins-job-test-3"; builders = [ @@ -110,7 +107,7 @@ in { }; }; - config = mkIf (jenkinsCfg.enable && cfg.enable) { + config = lib.mkIf (jenkinsCfg.enable && cfg.enable) { assertions = [ { assertion = if cfg.accessUser != "" @@ -213,7 +210,7 @@ in { # Create / update jobs mkdir -p ${jobBuilderOutputDir} - for inputFile in ${yamlJobsFile} ${concatStringsSep " " jsonJobsFiles}; do + for inputFile in ${yamlJobsFile} ${lib.concatStringsSep " " jsonJobsFiles}; do HOME="${jenkinsCfg.home}" "${pkgs.jenkins-job-builder}/bin/jenkins-jobs" --ignore-cache test --config-xml -o "${jobBuilderOutputDir}" "$inputFile" done @@ -237,7 +234,7 @@ in { jobdir="${jenkinsCfg.home}/$jenkinsjobname" rm -rf "$jobdir" done - '' + (optionalString (cfg.accessUser != "") reloadScript); + '' + (lib.optionalString (cfg.accessUser != "") reloadScript); serviceConfig = { Type = "oneshot"; User = jenkinsCfg.user; From 75d565a3b05711f9c0609106b612fc47346925b9 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:55 +0200 Subject: [PATCH 103/197] nixos/services.couchdb: remove `with lib;` --- nixos/modules/services/databases/couchdb.nix | 67 ++++++++++---------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/nixos/modules/services/databases/couchdb.nix b/nixos/modules/services/databases/couchdb.nix index e007bfce77ab..22c9cfd91823 100644 --- a/nixos/modules/services/databases/couchdb.nix +++ b/nixos/modules/services/databases/couchdb.nix @@ -1,7 +1,4 @@ { config, options, lib, pkgs, ... }: - -with lib; - let cfg = config.services.couchdb; opt = options.services.couchdb; @@ -11,7 +8,7 @@ let database_dir = ${cfg.databaseDir} uri_file = ${cfg.uriFile} view_index_dir = ${cfg.viewIndexDir} - '' + (optionalString (cfg.adminPass != null) '' + '' + (lib.optionalString (cfg.adminPass != null) '' [admins] ${cfg.adminUser} = ${cfg.adminPass} '' + '' @@ -34,12 +31,12 @@ in { services.couchdb = { - enable = mkEnableOption "CouchDB Server"; + enable = lib.mkEnableOption "CouchDB Server"; - package = mkPackageOption pkgs "couchdb3" { }; + package = lib.mkPackageOption pkgs "couchdb3" { }; - adminUser = mkOption { - type = types.str; + adminUser = lib.mkOption { + type = lib.types.str; default = "admin"; description = '' Couchdb (i.e. fauxton) account with permission for all dbs and @@ -47,8 +44,8 @@ in { ''; }; - adminPass = mkOption { - type = types.nullOr types.str; + adminPass = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Couchdb (i.e. fauxton) account with permission for all dbs and @@ -56,16 +53,16 @@ in { ''; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "couchdb"; description = '' User account under which couchdb runs. ''; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "couchdb"; description = '' Group account under which couchdb runs. @@ -74,8 +71,8 @@ in { # couchdb options: https://docs.couchdb.org/en/latest/config/index.html - databaseDir = mkOption { - type = types.path; + databaseDir = lib.mkOption { + type = lib.types.path; default = "/var/lib/couchdb"; description = '' Specifies location of CouchDB database files (*.couch named). This @@ -84,8 +81,8 @@ in { ''; }; - uriFile = mkOption { - type = types.path; + uriFile = lib.mkOption { + type = lib.types.path; default = "/run/couchdb/couchdb.uri"; description = '' This file contains the full URI that can be used to access this @@ -96,8 +93,8 @@ in { ''; }; - viewIndexDir = mkOption { - type = types.path; + viewIndexDir = lib.mkOption { + type = lib.types.path; default = "/var/lib/couchdb"; description = '' Specifies location of CouchDB view index files. This location should @@ -106,49 +103,49 @@ in { ''; }; - bindAddress = mkOption { - type = types.str; + bindAddress = lib.mkOption { + type = lib.types.str; default = "127.0.0.1"; description = '' Defines the IP address by which CouchDB will be accessible. ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 5984; description = '' Defined the port number to listen. ''; }; - logFile = mkOption { - type = types.path; + logFile = lib.mkOption { + type = lib.types.path; default = "/var/log/couchdb.log"; description = '' Specifies the location of file for logging output. ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = '' Extra configuration. Overrides any other configuration. ''; }; - argsFile = mkOption { - type = types.path; + argsFile = lib.mkOption { + type = lib.types.path; default = "${cfg.package}/etc/vm.args"; - defaultText = literalExpression ''"config.${opt.package}/etc/vm.args"''; + defaultText = lib.literalExpression ''"config.${opt.package}/etc/vm.args"''; description = '' vm.args configuration. Overrides Couchdb's Erlang VM parameters file. ''; }; - configFile = mkOption { - type = types.path; + configFile = lib.mkOption { + type = lib.types.path; description = '' Configuration file for persisting runtime changes. File needs to be readable and writable from couchdb user/group. @@ -161,11 +158,11 @@ in { ###### implementation - config = mkIf config.services.couchdb.enable { + config = lib.mkIf config.services.couchdb.enable { environment.systemPackages = [ cfg.package ]; - services.couchdb.configFile = mkDefault "/var/lib/couchdb/local.ini"; + services.couchdb.configFile = lib.mkDefault "/var/lib/couchdb/local.ini"; systemd.tmpfiles.rules = [ "d '${dirOf cfg.uriFile}' - ${cfg.user} ${cfg.group} - -" From 626c4c1a219297f974b81b890dfc62b36815473e Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:56 +0200 Subject: [PATCH 104/197] nixos/services.dgraph: remove `with lib;` --- nixos/modules/services/databases/dgraph.nix | 27 +++++++++------------ 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/nixos/modules/services/databases/dgraph.nix b/nixos/modules/services/databases/dgraph.nix index 00a11d6b686e..20bc56df85a4 100644 --- a/nixos/modules/services/databases/dgraph.nix +++ b/nixos/modules/services/databases/dgraph.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.dgraph; settingsFormat = pkgs.formats.json {}; @@ -53,11 +50,11 @@ in { options = { services.dgraph = { - enable = mkEnableOption "Dgraph native GraphQL database with a graph backend"; + enable = lib.mkEnableOption "Dgraph native GraphQL database with a graph backend"; package = lib.mkPackageOption pkgs "dgraph" { }; - settings = mkOption { + settings = lib.mkOption { type = settingsFormat.type; default = {}; description = '' @@ -66,15 +63,15 @@ in }; alpha = { - host = mkOption { - type = types.str; + host = lib.mkOption { + type = lib.types.str; default = "localhost"; description = '' The host which dgraph alpha will be run on. ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 7080; description = '' The port which to run dgraph alpha on. @@ -84,15 +81,15 @@ in }; zero = { - host = mkOption { - type = types.str; + host = lib.mkOption { + type = lib.types.str; default = "localhost"; description = '' The host which dgraph zero will be run on. ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 5080; description = '' The port which to run dgraph zero on. @@ -103,9 +100,9 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { services.dgraph.settings = { - badger.compression = mkDefault "zstd:3"; + badger.compression = lib.mkDefault "zstd:3"; }; systemd.services.dgraph-zero = { From f06f3a7973bd9196e4296afd08c19a99e23c9a76 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:56 +0200 Subject: [PATCH 105/197] nixos/services.dragonflydb: remove `with lib;` --- .../services/databases/dragonflydb.nix | 49 +++++++++---------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/nixos/modules/services/databases/dragonflydb.nix b/nixos/modules/services/databases/dragonflydb.nix index 220605c8b475..9024b584abc3 100644 --- a/nixos/modules/services/databases/dragonflydb.nix +++ b/nixos/modules/services/databases/dragonflydb.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.dragonflydb; dragonflydb = pkgs.dragonflydb; @@ -25,22 +22,22 @@ in options = { services.dragonflydb = { - enable = mkEnableOption "DragonflyDB"; + enable = lib.mkEnableOption "DragonflyDB"; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "dragonfly"; description = "The user to run DragonflyDB as"; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 6379; description = "The TCP port to accept connections."; }; - bind = mkOption { - type = with types; nullOr str; + bind = lib.mkOption { + type = with lib.types; nullOr str; default = "127.0.0.1"; description = '' The IP interface to bind to. @@ -48,15 +45,15 @@ in ''; }; - requirePass = mkOption { - type = with types; nullOr str; + requirePass = lib.mkOption { + type = with lib.types; nullOr str; default = null; description = "Password for database"; example = "letmein!"; }; - maxMemory = mkOption { - type = with types; nullOr ints.unsigned; + maxMemory = lib.mkOption { + type = with lib.types; nullOr ints.unsigned; default = null; description = '' The maximum amount of memory to use for storage (in bytes). @@ -64,8 +61,8 @@ in ''; }; - memcachePort = mkOption { - type = with types; nullOr port; + memcachePort = lib.mkOption { + type = with lib.types; nullOr port; default = null; description = '' To enable memcached compatible API on this port. @@ -73,8 +70,8 @@ in ''; }; - keysOutputLimit = mkOption { - type = types.ints.unsigned; + keysOutputLimit = lib.mkOption { + type = lib.types.ints.unsigned; default = 8192; description = '' Maximum number of returned keys in keys command. @@ -83,14 +80,14 @@ in ''; }; - dbNum = mkOption { - type = with types; nullOr ints.unsigned; + dbNum = lib.mkOption { + type = with lib.types; nullOr ints.unsigned; default = null; description = "Maximum number of supported databases for `select`"; }; - cacheMode = mkOption { - type = with types; nullOr bool; + cacheMode = lib.mkOption { + type = with lib.types; nullOr bool; default = null; description = '' Once this mode is on, Dragonfly will evict items least likely to be stumbled @@ -102,14 +99,14 @@ in ###### implementation - config = mkIf config.services.dragonflydb.enable { + config = lib.mkIf config.services.dragonflydb.enable { - users.users = optionalAttrs (cfg.user == "dragonfly") { + users.users = lib.optionalAttrs (cfg.user == "dragonfly") { dragonfly.description = "DragonflyDB server user"; dragonfly.isSystemUser = true; dragonfly.group = "dragonfly"; }; - users.groups = optionalAttrs (cfg.user == "dragonfly") { dragonfly = { }; }; + users.groups = lib.optionalAttrs (cfg.user == "dragonfly") { dragonfly = { }; }; environment.systemPackages = [ dragonflydb ]; @@ -120,7 +117,7 @@ in after = [ "network.target" ]; serviceConfig = { - ExecStart = "${dragonflydb}/bin/dragonfly --alsologtostderr ${builtins.concatStringsSep " " (attrsets.mapAttrsToList (n: v: "--${n} ${strings.escapeShellArg v}") settings)}"; + ExecStart = "${dragonflydb}/bin/dragonfly --alsologtostderr ${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "--${n} ${lib.escapeShellArg v}") settings)}"; User = cfg.user; From 17003eacc98b10cca0c3a01346c987b1d6d1da7d Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:57 +0200 Subject: [PATCH 106/197] nixos/services.ferretdb: remove `with lib;` --- nixos/modules/services/databases/ferretdb.nix | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/nixos/modules/services/databases/ferretdb.nix b/nixos/modules/services/databases/ferretdb.nix index ab55e22bf214..a7e3fa81c48f 100644 --- a/nixos/modules/services/databases/ferretdb.nix +++ b/nixos/modules/services/databases/ferretdb.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.ferretdb; in @@ -11,11 +8,11 @@ in options = { services.ferretdb = { - enable = mkEnableOption "FerretDB, an Open Source MongoDB alternative"; + enable = lib.mkEnableOption "FerretDB, an Open Source MongoDB alternative"; - package = mkOption { - type = types.package; - example = literalExpression "pkgs.ferretdb"; + package = lib.mkOption { + type = lib.types.package; + example = lib.literalExpression "pkgs.ferretdb"; default = pkgs.ferretdb; defaultText = "pkgs.ferretdb"; description = "FerretDB package to use."; @@ -37,7 +34,7 @@ in }; }; - config = mkIf cfg.enable + config = lib.mkIf cfg.enable { services.ferretdb.settings = { @@ -76,4 +73,3 @@ in }; }; } - From 567aa06ba26a6127bf41f846b847d02cfa527e4f Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:57 +0200 Subject: [PATCH 107/197] nixos/services.firebird: remove `with lib;` --- nixos/modules/services/databases/firebird.nix | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/nixos/modules/services/databases/firebird.nix b/nixos/modules/services/databases/firebird.nix index 17606218b633..4b2b34ae7b1d 100644 --- a/nixos/modules/services/databases/firebird.nix +++ b/nixos/modules/services/databases/firebird.nix @@ -18,9 +18,6 @@ # however there are no strong reasons to prefer this or the other one AFAIK # Eg superserver is said to be most efficiently using resources according to # https://www.firebirdsql.org/manual/qsg25-classic-or-super.html - -with lib; - let cfg = config.services.firebird; @@ -40,34 +37,34 @@ in services.firebird = { - enable = mkEnableOption "the Firebird super server"; + enable = lib.mkEnableOption "the Firebird super server"; - package = mkPackageOption pkgs "firebird" { + package = lib.mkPackageOption pkgs "firebird" { example = "firebird_3"; extraDescription = '' For SuperServer use override: `pkgs.firebird_3.override { superServer = true; };` ''; }; - port = mkOption { + port = lib.mkOption { default = 3050; - type = types.port; + type = lib.types.port; description = '' Port Firebird uses. ''; }; - user = mkOption { + user = lib.mkOption { default = "firebird"; - type = types.str; + type = lib.types.str; description = '' User account under which firebird runs. ''; }; - baseDir = mkOption { + baseDir = lib.mkOption { default = "/var/lib/firebird"; - type = types.str; + type = lib.types.str; description = '' Location containing data/ and system/ directories. data/ stores the databases, system/ stores the password database security2.fdb. @@ -81,7 +78,7 @@ in ###### implementation - config = mkIf config.services.firebird.enable { + config = lib.mkIf config.services.firebird.enable { environment.systemPackages = [cfg.package]; From 3db1445493cb3a3f31b0af3ca5b1e103d46fd442 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:58 +0200 Subject: [PATCH 108/197] nixos/services.hbase-standalone: remove `with lib;` --- .../services/databases/hbase-standalone.nix | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/nixos/modules/services/databases/hbase-standalone.nix b/nixos/modules/services/databases/hbase-standalone.nix index ac37e3932932..d3d2999eaeed 100644 --- a/nixos/modules/services/databases/hbase-standalone.nix +++ b/nixos/modules/services/databases/hbase-standalone.nix @@ -1,7 +1,4 @@ { config, options, lib, pkgs, ... }: - -with lib; - let cfg = config.services.hbase-standalone; opt = options.services.hbase-standalone; @@ -33,7 +30,7 @@ let in { imports = [ - (mkRenamedOptionModule [ "services" "hbase" ] [ "services" "hbase-standalone" ]) + (lib.mkRenamedOptionModule [ "services" "hbase" ] [ "services" "hbase-standalone" ]) ]; ###### interface @@ -41,31 +38,31 @@ in { options = { services.hbase-standalone = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' HBase master in standalone mode with embedded regionserver and zookeper. Do not use this configuration for production nor for evaluating HBase performance ''; - package = mkPackageOption pkgs "hbase" { }; + package = lib.mkPackageOption pkgs "hbase" { }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "hbase"; description = '' User account under which HBase runs. ''; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "hbase"; description = '' Group account under which HBase runs. ''; }; - dataDir = mkOption { - type = types.path; + dataDir = lib.mkOption { + type = lib.types.path; default = "/var/lib/hbase"; description = '' Specifies location of HBase database files. This location should be @@ -74,21 +71,21 @@ in { ''; }; - logDir = mkOption { - type = types.path; + logDir = lib.mkOption { + type = lib.types.path; default = "/var/log/hbase"; description = '' Specifies the location of HBase log files. ''; }; - settings = mkOption { + settings = lib.mkOption { type = with lib.types; attrsOf (oneOf [ str int bool ]); default = { "hbase.rootdir" = "file://${cfg.dataDir}/hbase"; "hbase.zookeeper.property.dataDir" = "${cfg.dataDir}/zookeeper"; }; - defaultText = literalExpression '' + defaultText = lib.literalExpression '' { "hbase.rootdir" = "file://''${config.${opt.dataDir}}/hbase"; "hbase.zookeeper.property.dataDir" = "''${config.${opt.dataDir}}/zookeeper"; @@ -104,7 +101,7 @@ in { ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.tmpfiles.rules = [ "d '${cfg.dataDir}' - ${cfg.user} ${cfg.group} - -" From 0dbb2e5fa1b309148d46edb83d84f3708b3b4642 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:58 +0200 Subject: [PATCH 109/197] nixos/services.influxdb: remove `with lib;` --- nixos/modules/services/databases/influxdb.nix | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/nixos/modules/services/databases/influxdb.nix b/nixos/modules/services/databases/influxdb.nix index 6dd4ca3b71cd..9bc0b935d08f 100644 --- a/nixos/modules/services/databases/influxdb.nix +++ b/nixos/modules/services/databases/influxdb.nix @@ -1,11 +1,8 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.influxdb; - configOptions = recursiveUpdate { + configOptions = lib.recursiveUpdate { meta = { bind-address = ":8088"; commit-timeout = "50ms"; @@ -110,36 +107,36 @@ in services.influxdb = { - enable = mkOption { + enable = lib.mkOption { default = false; description = "Whether to enable the influxdb server"; - type = types.bool; + type = lib.types.bool; }; - package = mkPackageOption pkgs "influxdb" { }; + package = lib.mkPackageOption pkgs "influxdb" { }; - user = mkOption { + user = lib.mkOption { default = "influxdb"; description = "User account under which influxdb runs"; - type = types.str; + type = lib.types.str; }; - group = mkOption { + group = lib.mkOption { default = "influxdb"; description = "Group under which influxdb runs"; - type = types.str; + type = lib.types.str; }; - dataDir = mkOption { + dataDir = lib.mkOption { default = "/var/db/influxdb"; description = "Data directory for influxd data files."; - type = types.path; + type = lib.types.path; }; - extraConfig = mkOption { + extraConfig = lib.mkOption { default = {}; description = "Extra configuration options for influxdb"; - type = types.attrs; + type = lib.types.attrs; }; }; }; @@ -147,7 +144,7 @@ in ###### implementation - config = mkIf config.services.influxdb.enable { + config = lib.mkIf config.services.influxdb.enable { systemd.tmpfiles.rules = [ "d '${cfg.dataDir}' 0770 ${cfg.user} ${cfg.group} - -" @@ -166,16 +163,16 @@ in postStart = let scheme = if configOptions.http.https-enabled then "-k https" else "http"; - bindAddr = (ba: if hasPrefix ":" ba then "127.0.0.1${ba}" else "${ba}")(toString configOptions.http.bind-address); + bindAddr = (ba: if lib.hasPrefix ":" ba then "127.0.0.1${ba}" else "${ba}")(toString configOptions.http.bind-address); in - mkBefore '' + lib.mkBefore '' until ${pkgs.curl.bin}/bin/curl -s -o /dev/null ${scheme}://${bindAddr}/ping; do sleep 1; done ''; }; - users.users = optionalAttrs (cfg.user == "influxdb") { + users.users = lib.optionalAttrs (cfg.user == "influxdb") { influxdb = { uid = config.ids.uids.influxdb; group = "influxdb"; @@ -183,7 +180,7 @@ in }; }; - users.groups = optionalAttrs (cfg.group == "influxdb") { + users.groups = lib.optionalAttrs (cfg.group == "influxdb") { influxdb.gid = config.ids.gids.influxdb; }; }; From 93fb328e44dc4a168e4551ea4bfe6f355d17f3de Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:42:59 +0200 Subject: [PATCH 110/197] nixos/services.openldap: remove `with lib;` --- nixos/modules/services/databases/openldap.nix | 72 +++++++++---------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/nixos/modules/services/databases/openldap.nix b/nixos/modules/services/databases/openldap.nix index feb974cdf6d3..20b1f03021f0 100644 --- a/nixos/modules/services/databases/openldap.nix +++ b/nixos/modules/services/databases/openldap.nix @@ -1,6 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; let cfg = config.services.openldap; openldap = cfg.package; @@ -23,22 +21,22 @@ let merge = lib.mergeEqualOption; }; # We don't coerce to lists of single values, as some values must be unique - in types.either singleLdapValueType (types.listOf singleLdapValueType); + in lib.types.either singleLdapValueType (lib.types.listOf singleLdapValueType); ldapAttrsType = let options = { - attrs = mkOption { - type = types.attrsOf ldapValueType; + attrs = lib.mkOption { + type = lib.types.attrsOf ldapValueType; default = {}; description = "Attributes of the parent entry."; }; - children = mkOption { + children = lib.mkOption { # Hide the child attributes, to avoid infinite recursion in e.g. documentation # Actual Nix evaluation is lazy, so this is not an issue there type = let hiddenOptions = lib.mapAttrs (name: attr: attr // { visible = false; }) options; - in types.attrsOf (types.submodule { options = hiddenOptions; }); + in lib.types.attrsOf (lib.types.submodule { options = hiddenOptions; }); default = {}; description = "Child entries of the current entry, with recursively the same structure."; example = lib.literalExpression '' @@ -56,15 +54,15 @@ let } ''; }; - includes = mkOption { - type = types.listOf types.path; + includes = lib.mkOption { + type = lib.types.listOf lib.types.path; default = []; description = '' LDIF files to include after the parent's attributes but before its children. ''; }; }; - in types.submodule { inherit options; }; + in lib.types.submodule { inherit options; }; valueToLdif = attr: values: let listValues = if lib.isList values then values else lib.singleton values; @@ -85,13 +83,13 @@ let in { options = { services.openldap = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = "Whether to enable the ldap server."; }; - package = mkPackageOption pkgs "openldap" { + package = lib.mkPackageOption pkgs "openldap" { extraDescription = '' This can be used to, for example, set an OpenLDAP package with custom overrides to enable modules or other @@ -99,26 +97,26 @@ in { ''; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "openldap"; description = "User account under which slapd runs."; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "openldap"; description = "Group account under which slapd runs."; }; - urlList = mkOption { - type = types.listOf types.str; + urlList = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ "ldap:///" ]; description = "URL list slapd should listen on."; example = [ "ldaps:///" ]; }; - settings = mkOption { + settings = lib.mkOption { type = ldapAttrsType; description = "Configuration for OpenLDAP, in OLC format"; example = lib.literalExpression '' @@ -165,8 +163,8 @@ in { }; # This option overrides settings - configDir = mkOption { - type = types.nullOr types.path; + configDir = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' Use this config directory instead of generating one from the @@ -175,8 +173,8 @@ in { example = "/var/lib/openldap/slapd.d"; }; - mutableConfig = mkOption { - type = types.bool; + mutableConfig = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to allow writable on-line configuration. If @@ -186,8 +184,8 @@ in { ''; }; - declarativeContents = mkOption { - type = with types; attrsOf lines; + declarativeContents = lib.mkOption { + type = with lib.types; attrsOf lines; default = {}; description = '' Declarative contents for the LDAP database, in LDIF format by suffix. @@ -225,8 +223,8 @@ in { meta.maintainers = with lib.maintainers; [ kwohlfahrt ]; config = let - dbSettings = mapAttrs' (name: { attrs, ... }: nameValuePair attrs.olcSuffix attrs) - (filterAttrs (name: { attrs, ... }: (hasPrefix "olcDatabase=" name) && attrs ? olcSuffix) cfg.settings.children); + dbSettings = lib.mapAttrs' (name: { attrs, ... }: lib.nameValuePair attrs.olcSuffix attrs) + (lib.filterAttrs (name: { attrs, ... }: (lib.hasPrefix "olcDatabase=" name) && attrs ? olcSuffix) cfg.settings.children); settingsFile = pkgs.writeText "config.ldif" (lib.concatStringsSep "\n" (attrsToLdif "cn=config" cfg.settings)); writeConfig = pkgs.writeShellScript "openldap-config" '' set -euo pipefail @@ -241,32 +239,32 @@ in { chmod -R ${if cfg.mutableConfig then "u+rw" else "u+r-w"} ${configDir} ''; - contentsFiles = mapAttrs (dn: ldif: pkgs.writeText "${dn}.ldif" ldif) cfg.declarativeContents; + contentsFiles = lib.mapAttrs (dn: ldif: pkgs.writeText "${dn}.ldif" ldif) cfg.declarativeContents; writeContents = pkgs.writeShellScript "openldap-load" '' set -euo pipefail rm -rf $2/* ${openldap}/bin/slapadd -F ${configDir} -b $1 -l $3 ''; - in mkIf cfg.enable { + in lib.mkIf cfg.enable { assertions = [{ assertion = (cfg.declarativeContents != {}) -> cfg.configDir == null; message = '' - Declarative DB contents (${attrNames cfg.declarativeContents}) are not + Declarative DB contents (${lib.attrNames cfg.declarativeContents}) are not supported with user-managed configuration. ''; }] ++ (map (dn: { - assertion = (getAttr dn dbSettings) ? "olcDbDirectory"; + assertion = (lib.getAttr dn dbSettings) ? "olcDbDirectory"; # olcDbDirectory is necessary to prepopulate database using `slapadd`. message = '' Declarative DB ${dn} does not exist in `services.openldap.settings`, or does not have `olcDbDirectory` configured. ''; - }) (attrNames cfg.declarativeContents)) ++ (mapAttrsToList (dn: { olcDbDirectory ? null, ... }: { + }) (lib.attrNames cfg.declarativeContents)) ++ (lib.mapAttrsToList (dn: { olcDbDirectory ? null, ... }: { # For forward compatibility with `DynamicUser`, and to avoid accidentally clobbering # directories with `declarativeContents`. assertion = (olcDbDirectory != null) -> - ((hasPrefix "/var/lib/openldap/" olcDbDirectory) && (olcDbDirectory != "/var/lib/openldap/")); + ((lib.hasPrefix "/var/lib/openldap/" olcDbDirectory) && (olcDbDirectory != "/var/lib/openldap/")); message = '' Database ${dn} has `olcDbDirectory` (${olcDbDirectory}) that is not a subdirectory of `/var/lib/openldap/`. @@ -303,8 +301,8 @@ in { "!${pkgs.coreutils}/bin/mkdir -p ${configDir}" "+${pkgs.coreutils}/bin/chown $USER ${configDir}" ] ++ (lib.optional (cfg.configDir == null) writeConfig) - ++ (mapAttrsToList (dn: content: lib.escapeShellArgs [ - writeContents dn (getAttr dn dbSettings).olcDbDirectory content + ++ (lib.mapAttrsToList (dn: content: lib.escapeShellArgs [ + writeContents dn (lib.getAttr dn dbSettings).olcDbDirectory content ]) contentsFiles) ++ [ "${openldap}/bin/slaptest -u -F ${configDir}" ]; ExecStart = lib.escapeShellArgs ([ @@ -317,7 +315,7 @@ in { NotifyAccess = "all"; RuntimeDirectory = "openldap"; StateDirectory = ["openldap"] - ++ (map ({olcDbDirectory, ... }: removePrefix "/var/lib/" olcDbDirectory) (attrValues dbSettings)); + ++ (map ({olcDbDirectory, ... }: lib.removePrefix "/var/lib/" olcDbDirectory) (lib.attrValues dbSettings)); StateDirectoryMode = "700"; AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; From 6bbc3df0dd093f170f0491c821dd3da22db47e12 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:00 +0200 Subject: [PATCH 111/197] nixos/services.opentsdb: remove `with lib;` --- nixos/modules/services/databases/opentsdb.nix | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/nixos/modules/services/databases/opentsdb.nix b/nixos/modules/services/databases/opentsdb.nix index e104c42f8b24..90268daec1d7 100644 --- a/nixos/modules/services/databases/opentsdb.nix +++ b/nixos/modules/services/databases/opentsdb.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.opentsdb; @@ -15,36 +12,36 @@ in { services.opentsdb = { - enable = mkEnableOption "OpenTSDB"; + enable = lib.mkEnableOption "OpenTSDB"; - package = mkPackageOption pkgs "opentsdb" { }; + package = lib.mkPackageOption pkgs "opentsdb" { }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "opentsdb"; description = '' User account under which OpenTSDB runs. ''; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "opentsdb"; description = '' Group account under which OpenTSDB runs. ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 4242; description = '' Which port OpenTSDB listens on. ''; }; - config = mkOption { - type = types.lines; + config = lib.mkOption { + type = lib.types.lines; default = '' tsd.core.auto_create_metrics = true tsd.http.request.enable_chunked = true @@ -60,7 +57,7 @@ in { ###### implementation - config = mkIf config.services.opentsdb.enable { + config = lib.mkIf config.services.opentsdb.enable { systemd.services.opentsdb = { description = "OpenTSDB Server"; From 18c0ca571450f006fdf3a8d20b485872705a27b4 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:01 +0200 Subject: [PATCH 112/197] nixos/services.pgmanage: remove `with lib;` --- nixos/modules/services/databases/pgmanage.nix | 67 +++++++++---------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/nixos/modules/services/databases/pgmanage.nix b/nixos/modules/services/databases/pgmanage.nix index c405162ed87e..fe3d1b5bfb9d 100644 --- a/nixos/modules/services/databases/pgmanage.nix +++ b/nixos/modules/services/databases/pgmanage.nix @@ -1,7 +1,4 @@ { lib, pkgs, config, ... } : - -with lib; - let cfg = config.services.pgmanage; @@ -16,7 +13,7 @@ let super_only = ${builtins.toJSON cfg.superOnly} - ${optionalString (cfg.loginGroup != null) "login_group = ${cfg.loginGroup}"} + ${lib.optionalString (cfg.loginGroup != null) "login_group = ${cfg.loginGroup}"} login_timeout = ${toString cfg.loginTimeout} @@ -24,7 +21,7 @@ let sql_root = ${cfg.sqlRoot} - ${optionalString (cfg.tls != null) '' + ${lib.optionalString (cfg.tls != null) '' tls_cert = ${cfg.tls.cert} tls_key = ${cfg.tls.key} ''} @@ -35,8 +32,8 @@ let pgmanageConnectionsFile = pkgs.writeTextFile { name = "pgmanage-connections.conf"; - text = concatStringsSep "\n" - (mapAttrsToList (name : conn : "${name}: ${conn}") cfg.connections); + text = lib.concatStringsSep "\n" + (lib.mapAttrsToList (name : conn : "${name}: ${conn}") cfg.connections); }; pgmanage = "pgmanage"; @@ -44,12 +41,12 @@ let in { options.services.pgmanage = { - enable = mkEnableOption "PostgreSQL Administration for the web"; + enable = lib.mkEnableOption "PostgreSQL Administration for the web"; - package = mkPackageOption pkgs "pgmanage" { }; + package = lib.mkPackageOption pkgs "pgmanage" { }; - connections = mkOption { - type = types.attrsOf types.str; + connections = lib.mkOption { + type = lib.types.attrsOf lib.types.str; default = {}; example = { nuc-server = "hostaddr=192.168.0.100 port=5432 dbname=postgres"; @@ -68,8 +65,8 @@ in { ''; }; - allowCustomConnections = mkOption { - type = types.bool; + allowCustomConnections = lib.mkOption { + type = lib.types.bool; default = false; description = '' This tells pgmanage whether or not to allow anyone to use a custom @@ -77,16 +74,16 @@ in { ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 8080; description = '' This tells pgmanage what port to listen on for browser requests. ''; }; - localOnly = mkOption { - type = types.bool; + localOnly = lib.mkOption { + type = lib.types.bool; default = true; description = '' This tells pgmanage whether or not to set the listening socket to local @@ -94,8 +91,8 @@ in { ''; }; - superOnly = mkOption { - type = types.bool; + superOnly = lib.mkOption { + type = lib.types.bool; default = true; description = '' This tells pgmanage whether or not to only allow super users to @@ -106,8 +103,8 @@ in { ''; }; - loginGroup = mkOption { - type = types.nullOr types.str; + loginGroup = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' This tells pgmanage to only allow users in a certain PostgreSQL group to @@ -116,8 +113,8 @@ in { ''; }; - loginTimeout = mkOption { - type = types.int; + loginTimeout = lib.mkOption { + type = lib.types.int; default = 3600; description = '' Number of seconds of inactivity before user is automatically logged @@ -125,8 +122,8 @@ in { ''; }; - sqlRoot = mkOption { - type = types.str; + sqlRoot = lib.mkOption { + type = lib.types.str; default = "/var/lib/pgmanage"; description = '' This tells pgmanage where to put the SQL file history. All tabs are saved @@ -135,15 +132,15 @@ in { ''; }; - tls = mkOption { - type = types.nullOr (types.submodule { + tls = lib.mkOption { + type = lib.types.nullOr (lib.types.submodule { options = { - cert = mkOption { - type = types.str; + cert = lib.mkOption { + type = lib.types.str; description = "TLS certificate"; }; - key = mkOption { - type = types.str; + key = lib.mkOption { + type = lib.types.str; description = "TLS key"; }; }; @@ -162,8 +159,8 @@ in { ''; }; - logLevel = mkOption { - type = types.enum ["error" "warn" "notice" "info"]; + logLevel = lib.mkOption { + type = lib.types.enum ["error" "warn" "notice" "info"]; default = "error"; description = '' Verbosity of logs @@ -171,7 +168,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.pgmanage = { description = "pgmanage - PostgreSQL Administration for the web"; wants = [ "postgresql.service" ]; @@ -181,7 +178,7 @@ in { User = pgmanage; Group = pgmanage; ExecStart = "${cfg.package}/sbin/pgmanage -c ${confFile}" + - optionalString cfg.localOnly " --local-only=true"; + lib.optionalString cfg.localOnly " --local-only=true"; }; }; users = { From edcd08a8ff4c8f112246650620bc93628934aae5 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:01 +0200 Subject: [PATCH 113/197] nixos/services.rethinkdb: remove `with lib;` --- .../modules/services/databases/rethinkdb.nix | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/nixos/modules/services/databases/rethinkdb.nix b/nixos/modules/services/databases/rethinkdb.nix index c764d6c21c6c..1b85fd1bb7bd 100644 --- a/nixos/modules/services/databases/rethinkdb.nix +++ b/nixos/modules/services/databases/rethinkdb.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.rethinkdb; rethinkdb = cfg.package; @@ -15,41 +12,41 @@ in services.rethinkdb = { - enable = mkEnableOption "RethinkDB server"; + enable = lib.mkEnableOption "RethinkDB server"; - #package = mkOption { + #package = lib.mkOption { # default = pkgs.rethinkdb; # description = "Which RethinkDB derivation to use."; #}; - user = mkOption { + user = lib.mkOption { default = "rethinkdb"; description = "User account under which RethinkDB runs."; }; - group = mkOption { + group = lib.mkOption { default = "rethinkdb"; description = "Group which rethinkdb user belongs to."; }; - dbpath = mkOption { + dbpath = lib.mkOption { default = "/var/db/rethinkdb"; description = "Location where RethinkDB stores its data, 1 data directory per instance."; }; - pidpath = mkOption { + pidpath = lib.mkOption { default = "/run/rethinkdb"; description = "Location where each instance's pid file is located."; }; - #cfgpath = mkOption { + #cfgpath = lib.mkOption { # default = "/etc/rethinkdb/instances.d"; # description = "Location where RethinkDB stores it config files, 1 config file per instance."; #}; # TODO: currently not used by our implementation. - #instances = mkOption { - # type = types.attrsOf types.str; + #instances = lib.mkOption { + # type = lib.types.attrsOf lib.types.str; # default = {}; # description = "List of named RethinkDB instances in our cluster."; #}; @@ -59,7 +56,7 @@ in }; ###### implementation - config = mkIf config.services.rethinkdb.enable { + config = lib.mkIf config.services.rethinkdb.enable { environment.systemPackages = [ rethinkdb ]; @@ -93,13 +90,13 @@ in ''; }; - users.users.rethinkdb = mkIf (cfg.user == "rethinkdb") + users.users.rethinkdb = lib.mkIf (cfg.user == "rethinkdb") { name = "rethinkdb"; description = "RethinkDB server user"; isSystemUser = true; }; - users.groups = optionalAttrs (cfg.group == "rethinkdb") (singleton + users.groups = lib.optionalAttrs (cfg.group == "rethinkdb") (lib.singleton { name = "rethinkdb"; }); From 24f82fc6b5d4feb059173c3f650890c1f473f951 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:01 +0200 Subject: [PATCH 114/197] nixos/services.surrealdb: remove `with lib;` --- .../modules/services/databases/surrealdb.nix | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/nixos/modules/services/databases/surrealdb.nix b/nixos/modules/services/databases/surrealdb.nix index 2118312d5a1b..b88129ebc6f4 100644 --- a/nixos/modules/services/databases/surrealdb.nix +++ b/nixos/modules/services/databases/surrealdb.nix @@ -1,6 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; let cfg = config.services.surrealdb; @@ -8,12 +6,12 @@ in { options = { services.surrealdb = { - enable = mkEnableOption "SurrealDB, a scalable, distributed, collaborative, document-graph database, for the realtime web"; + enable = lib.mkEnableOption "SurrealDB, a scalable, distributed, collaborative, document-graph database, for the realtime web"; - package = mkPackageOption pkgs "surrealdb" { }; + package = lib.mkPackageOption pkgs "surrealdb" { }; - dbPath = mkOption { - type = types.str; + dbPath = lib.mkOption { + type = lib.types.str; description = '' The path that surrealdb will write data to. Use null for in-memory. Can be one of "memory", "file://:path", "tikv://:addr". @@ -22,8 +20,8 @@ in { example = "memory"; }; - host = mkOption { - type = types.str; + host = lib.mkOption { + type = lib.types.str; description = '' The host that surrealdb will connect to. ''; @@ -31,8 +29,8 @@ in { example = "127.0.0.1"; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; description = '' The port that surrealdb will connect to. ''; @@ -40,8 +38,8 @@ in { example = 8000; }; - extraFlags = mkOption { - type = types.listOf types.str; + extraFlags = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; example = [ "--allow-all" "--auth" "--user root" "--pass root" ]; description = '' @@ -52,7 +50,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { # Used to connect to the running service environment.systemPackages = [ cfg.package ] ; @@ -63,7 +61,7 @@ in { after = [ "network.target" ]; serviceConfig = { - ExecStart = "${cfg.package}/bin/surreal start --bind ${cfg.host}:${toString cfg.port} ${escapeShellArgs cfg.extraFlags} -- ${cfg.dbPath}"; + ExecStart = "${cfg.package}/bin/surreal start --bind ${cfg.host}:${toString cfg.port} ${lib.escapeShellArgs cfg.extraFlags} -- ${cfg.dbPath}"; DynamicUser = true; Restart = "on-failure"; StateDirectory = "surrealdb"; From 38b5d41259eab8d373cd3525e9dec1b0dea602eb Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:02 +0200 Subject: [PATCH 115/197] nixos/services.blueman: remove `with lib;` --- nixos/modules/services/desktops/blueman.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/desktops/blueman.nix b/nixos/modules/services/desktops/blueman.nix index 28c2daa7191d..4f02d288e2df 100644 --- a/nixos/modules/services/desktops/blueman.nix +++ b/nixos/modules/services/desktops/blueman.nix @@ -1,20 +1,17 @@ # blueman service { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.blueman; in { ###### interface options = { services.blueman = { - enable = mkEnableOption "blueman, a bluetooth manager"; + enable = lib.mkEnableOption "blueman, a bluetooth manager"; }; }; ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.blueman ]; From f2e025b9a2d45701095bb485b672951f99f184c7 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:02 +0200 Subject: [PATCH 116/197] nixos/services.cpupower-gui: remove `with lib;` --- nixos/modules/services/desktops/cpupower-gui.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/desktops/cpupower-gui.nix b/nixos/modules/services/desktops/cpupower-gui.nix index f66afc0a3dc1..ceed84da840e 100644 --- a/nixos/modules/services/desktops/cpupower-gui.nix +++ b/nixos/modules/services/desktops/cpupower-gui.nix @@ -1,13 +1,10 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.cpupower-gui; in { options = { services.cpupower-gui = { - enable = mkOption { + enable = lib.mkOption { type = lib.types.bool; default = false; example = true; @@ -20,7 +17,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.cpupower-gui ]; services.dbus.packages = [ pkgs.cpupower-gui ]; systemd.user = { From 5fd49dc5fc77c7f577a4033ac3baea919d8142bc Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:03 +0200 Subject: [PATCH 117/197] nixos/services.deepin.app-services: remove `with lib;` --- nixos/modules/services/desktops/deepin/app-services.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/desktops/deepin/app-services.nix b/nixos/modules/services/desktops/deepin/app-services.nix index 4702274df374..7d99bd11802f 100644 --- a/nixos/modules/services/desktops/deepin/app-services.nix +++ b/nixos/modules/services/desktops/deepin/app-services.nix @@ -1,11 +1,8 @@ { config, pkgs, lib, ... }: - -with lib; - { meta = { - maintainers = teams.deepin.members; + maintainers = lib.teams.deepin.members; }; ###### interface @@ -14,7 +11,7 @@ with lib; services.deepin.app-services = { - enable = mkEnableOption "service collection of DDE applications, including dconfig-center"; + enable = lib.mkEnableOption "service collection of DDE applications, including dconfig-center"; }; @@ -23,7 +20,7 @@ with lib; ###### implementation - config = mkIf config.services.deepin.app-services.enable { + config = lib.mkIf config.services.deepin.app-services.enable { users.groups.dde-dconfig-daemon = { }; users.users.dde-dconfig-daemon = { From 345c0fc9ae66cf3520ff0ab01101c462ffeb554b Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:03 +0200 Subject: [PATCH 118/197] nixos/services.deepin.dde-api.enable: remove `with lib;` --- nixos/modules/services/desktops/deepin/dde-api.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/desktops/deepin/dde-api.nix b/nixos/modules/services/desktops/deepin/dde-api.nix index 36f9881fc766..89889b3530c9 100644 --- a/nixos/modules/services/desktops/deepin/dde-api.nix +++ b/nixos/modules/services/desktops/deepin/dde-api.nix @@ -1,11 +1,8 @@ { config, pkgs, lib, ... }: - -with lib; - { meta = { - maintainers = teams.deepin.members; + maintainers = lib.teams.deepin.members; }; ###### interface @@ -14,7 +11,7 @@ with lib; services.deepin.dde-api = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' the DDE API, which provides some dbus interfaces that is used for screen zone detecting, thumbnail generating, and sound playing in Deepin Desktop Environment ''; @@ -26,7 +23,7 @@ with lib; ###### implementation - config = mkIf config.services.deepin.dde-api.enable { + config = lib.mkIf config.services.deepin.dde-api.enable { environment.systemPackages = [ pkgs.deepin.dde-api ]; From 8de58d85420da107cea486de5b22b1f18a0fe87c Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:03 +0200 Subject: [PATCH 119/197] nixos/services.dleyna-renderer: remove `with lib;` --- nixos/modules/services/desktops/dleyna-renderer.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/desktops/dleyna-renderer.nix b/nixos/modules/services/desktops/dleyna-renderer.nix index 7f88605f627c..f36f1fbb1a4e 100644 --- a/nixos/modules/services/desktops/dleyna-renderer.nix +++ b/nixos/modules/services/desktops/dleyna-renderer.nix @@ -1,14 +1,11 @@ # dleyna-renderer service. { config, lib, pkgs, ... }: - -with lib; - { ###### interface options = { services.dleyna-renderer = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable dleyna-renderer service, a DBus service @@ -20,7 +17,7 @@ with lib; ###### implementation - config = mkIf config.services.dleyna-renderer.enable { + config = lib.mkIf config.services.dleyna-renderer.enable { environment.systemPackages = [ pkgs.dleyna-renderer ]; services.dbus.packages = [ pkgs.dleyna-renderer ]; From fe453fb99f4bdc492cc3e743cbd9eccfc7e7ad1f Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:04 +0200 Subject: [PATCH 120/197] nixos/services.dleyna-server: remove `with lib;` --- nixos/modules/services/desktops/dleyna-server.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/desktops/dleyna-server.nix b/nixos/modules/services/desktops/dleyna-server.nix index 9a131a5e700f..812110281ae4 100644 --- a/nixos/modules/services/desktops/dleyna-server.nix +++ b/nixos/modules/services/desktops/dleyna-server.nix @@ -1,14 +1,11 @@ # dleyna-server service. { config, lib, pkgs, ... }: - -with lib; - { ###### interface options = { services.dleyna-server = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable dleyna-server service, a DBus service @@ -20,7 +17,7 @@ with lib; ###### implementation - config = mkIf config.services.dleyna-server.enable { + config = lib.mkIf config.services.dleyna-server.enable { environment.systemPackages = [ pkgs.dleyna-server ]; services.dbus.packages = [ pkgs.dleyna-server ]; From b7a963841c4c7ffb03fc442d9e57ce41ccbe2d87 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:04 +0200 Subject: [PATCH 121/197] nixos/services.flatpak: remove `with lib;` --- nixos/modules/services/desktops/flatpak.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/desktops/flatpak.nix b/nixos/modules/services/desktops/flatpak.nix index b386bafcfe6f..da07f602b3a0 100644 --- a/nixos/modules/services/desktops/flatpak.nix +++ b/nixos/modules/services/desktops/flatpak.nix @@ -1,8 +1,5 @@ # flatpak service. { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.flatpak; in { @@ -14,15 +11,15 @@ in { ###### interface options = { services.flatpak = { - enable = mkEnableOption "flatpak"; + enable = lib.mkEnableOption "flatpak"; - package = mkPackageOption pkgs "flatpak" { }; + package = lib.mkPackageOption pkgs "flatpak" { }; }; }; ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { assertions = [ { assertion = (config.xdg.portal.enable == true); From 42f3c52358874c8f2c1dfcd0cb9e19c6724f8a9c Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:04 +0200 Subject: [PATCH 122/197] nixos/services.gsignond: remove `with lib;` --- nixos/modules/services/desktops/gsignond.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/nixos/modules/services/desktops/gsignond.nix b/nixos/modules/services/desktops/gsignond.nix index 465acd73fa64..c21d3f0aafd8 100644 --- a/nixos/modules/services/desktops/gsignond.nix +++ b/nixos/modules/services/desktops/gsignond.nix @@ -1,15 +1,11 @@ # Accounts-SSO gSignOn daemon - { config, lib, pkgs, ... }: - -with lib; - let package = pkgs.gsignond.override { plugins = config.services.gsignond.plugins; }; in { - meta.maintainers = teams.pantheon.members; + meta.maintainers = lib.teams.pantheon.members; ###### interface @@ -17,8 +13,8 @@ in services.gsignond = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable gSignOn daemon, a DBus service @@ -26,8 +22,8 @@ in ''; }; - plugins = mkOption { - type = types.listOf types.package; + plugins = lib.mkOption { + type = lib.types.listOf lib.types.package; default = []; description = '' What plugins to use with the gSignOn daemon. @@ -37,7 +33,7 @@ in }; ###### implementation - config = mkIf config.services.gsignond.enable { + config = lib.mkIf config.services.gsignond.enable { environment.etc."gsignond.conf".source = "${package}/etc/gsignond.conf"; services.dbus.packages = [ package ]; }; From 6c702884e9b7e9944f5111038183d17fe90b51b3 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:05 +0200 Subject: [PATCH 123/197] nixos/services.neard: remove `with lib;` --- nixos/modules/services/desktops/neard.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/desktops/neard.nix b/nixos/modules/services/desktops/neard.nix index 5459d2e5a1e5..5d67adc09870 100644 --- a/nixos/modules/services/desktops/neard.nix +++ b/nixos/modules/services/desktops/neard.nix @@ -1,19 +1,16 @@ # neard service. { config, lib, pkgs, ... }: - -with lib; - { ###### interface options = { services.neard = { - enable = mkEnableOption "neard, an NFC daemon"; + enable = lib.mkEnableOption "neard, an NFC daemon"; }; }; ###### implementation - config = mkIf config.services.neard.enable { + config = lib.mkIf config.services.neard.enable { environment.systemPackages = [ pkgs.neard ]; services.dbus.packages = [ pkgs.neard ]; From 5ee287118fc9c9a1e92d9f7831f2b14833b4a70a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:05 +0200 Subject: [PATCH 124/197] nixos/services.psd: remove `with lib;` --- .../modules/services/desktops/profile-sync-daemon.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/desktops/profile-sync-daemon.nix b/nixos/modules/services/desktops/profile-sync-daemon.nix index 6206295272fc..48b29a59135c 100644 --- a/nixos/modules/services/desktops/profile-sync-daemon.nix +++ b/nixos/modules/services/desktops/profile-sync-daemon.nix @@ -1,19 +1,16 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.psd; in { - options.services.psd = with types; { - enable = mkOption { + options.services.psd = with lib.types; { + enable = lib.mkOption { type = bool; default = false; description = '' Whether to enable the Profile Sync daemon. ''; }; - resyncTimer = mkOption { + resyncTimer = lib.mkOption { type = str; default = "1h"; example = "1h 30min"; @@ -27,7 +24,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd = { user = { services = { From 63f72067f85286db833d534f5de02719c38a31aa Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:06 +0200 Subject: [PATCH 125/197] nixos/services.system-config-printer: remove `with lib;` --- nixos/modules/services/desktops/system-config-printer.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/desktops/system-config-printer.nix b/nixos/modules/services/desktops/system-config-printer.nix index 55f27b0e6534..6a8ff8dd19c6 100644 --- a/nixos/modules/services/desktops/system-config-printer.nix +++ b/nixos/modules/services/desktops/system-config-printer.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - { ###### interface @@ -10,7 +7,7 @@ with lib; services.system-config-printer = { - enable = mkEnableOption "system-config-printer, a service for CUPS administration used by printing interfaces"; + enable = lib.mkEnableOption "system-config-printer, a service for CUPS administration used by printing interfaces"; }; @@ -19,7 +16,7 @@ with lib; ###### implementation - config = mkIf config.services.system-config-printer.enable { + config = lib.mkIf config.services.system-config-printer.enable { services.dbus.packages = [ pkgs.system-config-printer From 506e98b3066d0df23e36988567df78ba1f926219 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:06 +0200 Subject: [PATCH 126/197] nixos/services.telepathy: remove `with lib;` --- nixos/modules/services/desktops/telepathy.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/desktops/telepathy.nix b/nixos/modules/services/desktops/telepathy.nix index b5f6a5fcbcfd..8f8adf7f4f83 100644 --- a/nixos/modules/services/desktops/telepathy.nix +++ b/nixos/modules/services/desktops/telepathy.nix @@ -1,13 +1,9 @@ # Telepathy daemon. - { config, lib, pkgs, ... }: - -with lib; - { meta = { - maintainers = teams.gnome.members; + maintainers = lib.teams.gnome.members; }; ###### interface @@ -16,8 +12,8 @@ with lib; services.telepathy = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable Telepathy service, a communications framework @@ -32,7 +28,7 @@ with lib; ###### implementation - config = mkIf config.services.telepathy.enable { + config = lib.mkIf config.services.telepathy.enable { environment.systemPackages = [ pkgs.telepathy-mission-control ]; From dee0a9173011dc3184a659653d03acd81175c84a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:06 +0200 Subject: [PATCH 127/197] nixos/services.tumbler: remove `with lib;` --- nixos/modules/services/desktops/tumbler.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/desktops/tumbler.nix b/nixos/modules/services/desktops/tumbler.nix index f5341df2f7a4..a52767301949 100644 --- a/nixos/modules/services/desktops/tumbler.nix +++ b/nixos/modules/services/desktops/tumbler.nix @@ -1,9 +1,5 @@ # Tumbler - { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.tumbler; @@ -13,13 +9,13 @@ in { imports = [ - (mkRemovedOptionModule + (lib.mkRemovedOptionModule [ "services" "tumbler" "package" ] "") ]; meta = with lib; { - maintainers = with maintainers; [ ] ++ teams.pantheon.members; + maintainers = with lib.maintainers; [ ] ++ lib.teams.pantheon.members; }; ###### interface @@ -28,7 +24,7 @@ in services.tumbler = { - enable = mkEnableOption "Tumbler, A D-Bus thumbnailer service"; + enable = lib.mkEnableOption "Tumbler, A D-Bus thumbnailer service"; }; @@ -37,7 +33,7 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = with pkgs.xfce; [ tumbler From 8ddfb1375fb4300abc94ef961de8981bbc65927a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:07 +0200 Subject: [PATCH 128/197] nixos/services.distccd: remove `with lib;` --- .../modules/services/development/distccd.nix | 69 +++++++++---------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/nixos/modules/services/development/distccd.nix b/nixos/modules/services/development/distccd.nix index 916c0905034c..7eb9789b5c38 100644 --- a/nixos/modules/services/development/distccd.nix +++ b/nixos/modules/services/development/distccd.nix @@ -1,17 +1,14 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.distccd; in { options = { services.distccd = { - enable = mkEnableOption "distccd, a distributed C/C++ compiler"; + enable = lib.mkEnableOption "distccd, a distributed C/C++ compiler"; - allowedClients = mkOption { - type = types.listOf types.str; + allowedClients = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ "127.0.0.1" ]; example = [ "127.0.0.1" "192.168.0.0/24" "10.0.0.0/24" ]; description = '' @@ -23,16 +20,16 @@ in ''; }; - jobTimeout = mkOption { - type = types.nullOr types.int; + jobTimeout = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' Maximum duration, in seconds, of a single compilation request. ''; }; - logLevel = mkOption { - type = types.nullOr (types.enum [ "critical" "error" "warning" "notice" "info" "debug" ]); + logLevel = lib.mkOption { + type = lib.types.nullOr (lib.types.enum [ "critical" "error" "warning" "notice" "info" "debug" ]); default = "warning"; description = '' Set the minimum severity of error that will be included in the log @@ -41,35 +38,35 @@ in ''; }; - maxJobs = mkOption { - type = types.nullOr types.int; + maxJobs = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' - Maximum number of tasks distccd should execute at any time. + Maximum number of tasks distccd should execute at lib.any time. ''; }; - nice = mkOption { - type = types.nullOr types.int; + nice = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' Niceness of the compilation tasks. ''; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = '' Opens the specified TCP port for distcc. ''; }; - package = mkPackageOption pkgs "distcc" { }; + package = lib.mkPackageOption pkgs "distcc" { }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 3632; description = '' The TCP port which distccd will listen on. @@ -77,9 +74,9 @@ in }; stats = { - enable = mkEnableOption "statistics reporting via HTTP server"; - port = mkOption { - type = types.port; + enable = lib.mkEnableOption "statistics reporting via HTTP server"; + port = lib.mkOption { + type = lib.types.port; default = 3633; description = '' The TCP port which the distccd statistics HTTP server will listen @@ -88,8 +85,8 @@ in }; }; - zeroconf = mkOption { - type = types.bool; + zeroconf = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to register via mDNS/DNS-SD @@ -98,10 +95,10 @@ in }; }; - config = mkIf cfg.enable { - networking.firewall = mkIf cfg.openFirewall { + config = lib.mkIf cfg.enable { + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.port ] - ++ optionals cfg.stats.enable [ cfg.stats.port ]; + ++ lib.optionals cfg.stats.enable [ cfg.stats.port ]; }; systemd.services.distccd = { @@ -124,14 +121,14 @@ in --daemon \ --enable-tcp-insecure \ --port ${toString cfg.port} \ - ${optionalString (cfg.jobTimeout != null) "--job-lifetime ${toString cfg.jobTimeout}"} \ - ${optionalString (cfg.logLevel != null) "--log-level ${cfg.logLevel}"} \ - ${optionalString (cfg.maxJobs != null) "--jobs ${toString cfg.maxJobs}"} \ - ${optionalString (cfg.nice != null) "--nice ${toString cfg.nice}"} \ - ${optionalString cfg.stats.enable "--stats"} \ - ${optionalString cfg.stats.enable "--stats-port ${toString cfg.stats.port}"} \ - ${optionalString cfg.zeroconf "--zeroconf"} \ - ${concatMapStrings (c: "--allow ${c} ") cfg.allowedClients} + ${lib.optionalString (cfg.jobTimeout != null) "--job-lifetime ${toString cfg.jobTimeout}"} \ + ${lib.optionalString (cfg.logLevel != null) "--log-level ${cfg.logLevel}"} \ + ${lib.optionalString (cfg.maxJobs != null) "--jobs ${toString cfg.maxJobs}"} \ + ${lib.optionalString (cfg.nice != null) "--nice ${toString cfg.nice}"} \ + ${lib.optionalString cfg.stats.enable "--stats"} \ + ${lib.optionalString cfg.stats.enable "--stats-port ${toString cfg.stats.port}"} \ + ${lib.optionalString cfg.zeroconf "--zeroconf"} \ + ${lib.concatMapStrings (c: "--allow ${c} ") cfg.allowedClients} ''; }; }; From 25ddce8617d3a7ea8fa10171f2aa90135dfc1eba Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:07 +0200 Subject: [PATCH 129/197] nixos/services.hoogle: remove `with lib;` --- nixos/modules/services/development/hoogle.nix | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/nixos/modules/services/development/hoogle.nix b/nixos/modules/services/development/hoogle.nix index 1747ef391290..0a09a339e2be 100644 --- a/nixos/modules/services/development/hoogle.nix +++ b/nixos/modules/services/development/hoogle.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.hoogle; @@ -14,21 +11,21 @@ let in { options.services.hoogle = { - enable = mkEnableOption "Haskell documentation server"; + enable = lib.mkEnableOption "Haskell documentation server"; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 8080; description = '' Port number Hoogle will be listening to. ''; }; - packages = mkOption { - type = types.functionTo (types.listOf types.package); + packages = lib.mkOption { + type = lib.types.functionTo (lib.types.listOf lib.types.package); default = hp: []; - defaultText = literalExpression "hp: []"; - example = literalExpression "hp: with hp; [ text lens ]"; + defaultText = lib.literalExpression "hp: []"; + example = lib.literalExpression "hp: with hp; [ text lens ]"; description = '' The Haskell packages to generate documentation for. @@ -38,27 +35,27 @@ in { ''; }; - haskellPackages = mkOption { + haskellPackages = lib.mkOption { description = "Which haskell package set to use."; - type = types.attrs; + type = lib.types.attrs; default = pkgs.haskellPackages; - defaultText = literalExpression "pkgs.haskellPackages"; + defaultText = lib.literalExpression "pkgs.haskellPackages"; }; - home = mkOption { - type = types.str; + home = lib.mkOption { + type = lib.types.str; description = "Url for hoogle logo"; default = "https://hoogle.haskell.org"; }; - host = mkOption { - type = types.str; + host = lib.mkOption { + type = lib.types.str; description = "Set the host to bind on."; default = "127.0.0.1"; }; - extraOptions = mkOption { - type = types.listOf types.str; + extraOptions = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; example = [ "--no-security-headers" ]; description = '' @@ -68,7 +65,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.hoogle = { description = "Haskell documentation server"; @@ -78,7 +75,7 @@ in { Restart = "always"; ExecStart = '' ${hoogleEnv}/bin/hoogle server --local --port ${toString cfg.port} --home ${cfg.home} --host ${cfg.host} \ - ${concatStringsSep " " cfg.extraOptions} + ${lib.concatStringsSep " " cfg.extraOptions} ''; DynamicUser = true; From 5134f4b55cb2305dde6b35b06d4c59a9efa54554 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:08 +0200 Subject: [PATCH 130/197] nixos/services.jupyter: remove `with lib;` --- .../services/development/jupyter/default.nix | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/nixos/modules/services/development/jupyter/default.nix b/nixos/modules/services/development/jupyter/default.nix index 561ea86ea18b..b3991fa4c268 100644 --- a/nixos/modules/services/development/jupyter/default.nix +++ b/nixos/modules/services/development/jupyter/default.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.jupyter; @@ -21,13 +18,13 @@ let ''; in { - meta.maintainers = with maintainers; [ aborsu ]; + meta.maintainers = with lib.maintainers; [ aborsu ]; options.services.jupyter = { - enable = mkEnableOption "Jupyter development server"; + enable = lib.mkEnableOption "Jupyter development server"; - ip = mkOption { - type = types.str; + ip = lib.mkOption { + type = lib.types.str; default = "localhost"; description = '' IP address Jupyter will be listening on. @@ -37,10 +34,10 @@ in { # NOTE: We don't use top-level jupyter because we don't # want to pass in JUPYTER_PATH but use .environment instead, # saving a rebuild. - package = mkPackageOption pkgs [ "python3" "pkgs" "notebook" ] { }; + package = lib.mkPackageOption pkgs [ "python3" "pkgs" "notebook" ] { }; - command = mkOption { - type = types.str; + command = lib.mkOption { + type = lib.types.str; default = "jupyter-notebook"; example = "jupyter-lab"; description = '' @@ -49,24 +46,24 @@ in { ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 8888; description = '' Port number Jupyter will be listening on. ''; }; - notebookDir = mkOption { - type = types.str; + notebookDir = lib.mkOption { + type = lib.types.str; default = "~/"; description = '' Root directory for notebooks. ''; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "jupyter"; description = '' Name of the user used to run the jupyter service. @@ -76,8 +73,8 @@ in { example = "aborsu"; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "jupyter"; description = '' Name of the group used to run the jupyter service. @@ -86,8 +83,8 @@ in { example = "users"; }; - password = mkOption { - type = types.str; + password = lib.mkOption { + type = lib.types.str; description = '' Password to use with notebook. Can be generated using: @@ -102,21 +99,21 @@ in { example = "'sha1:1b961dc713fb:88483270a63e57d18d43cf337e629539de1436ba'"; }; - notebookConfig = mkOption { - type = types.lines; + notebookConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = '' Raw jupyter config. ''; }; - kernels = mkOption { - type = types.nullOr (types.attrsOf(types.submodule (import ./kernel-options.nix { + kernels = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf(lib.types.submodule (import ./kernel-options.nix { inherit lib pkgs; }))); default = null; - example = literalExpression '' + example = lib.literalExpression '' { python3 = let env = (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [ @@ -153,8 +150,8 @@ in { }; }; - config = mkMerge [ - (mkIf cfg.enable { + config = lib.mkMerge [ + (lib.mkIf cfg.enable { systemd.services.jupyter = { description = "Jupyter development server"; @@ -183,10 +180,10 @@ in { }; }; }) - (mkIf (cfg.enable && (cfg.group == "jupyter")) { + (lib.mkIf (cfg.enable && (cfg.group == "jupyter")) { users.groups.jupyter = {}; }) - (mkIf (cfg.enable && (cfg.user == "jupyter")) { + (lib.mkIf (cfg.enable && (cfg.user == "jupyter")) { users.extraUsers.jupyter = { extraGroups = [ cfg.group ]; home = "/var/lib/jupyter"; From a986e3c10a263569ea4dfb909cb45648fc807a23 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:08 +0200 Subject: [PATCH 131/197] nixos/services.jupyter.kernels: remove `with lib;` --- .../development/jupyter/kernel-options.nix | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/nixos/modules/services/development/jupyter/kernel-options.nix b/nixos/modules/services/development/jupyter/kernel-options.nix index 8a91125e6cce..421e1a0cf51d 100644 --- a/nixos/modules/services/development/jupyter/kernel-options.nix +++ b/nixos/modules/services/development/jupyter/kernel-options.nix @@ -1,17 +1,14 @@ # Options that can be used for creating a jupyter kernel. { lib, pkgs }: - -with lib; - { freeformType = (pkgs.formats.json { }).type; options = { - displayName = mkOption { - type = types.str; + displayName = lib.mkOption { + type = lib.types.str; default = ""; - example = literalExpression '' + example = lib.literalExpression '' "Python 3" "Python 3 for Data Science" ''; @@ -20,8 +17,8 @@ with lib; ''; }; - argv = mkOption { - type = types.listOf types.str; + argv = lib.mkOption { + type = lib.types.listOf lib.types.str; example = [ "{customEnv.interpreter}" "-m" @@ -34,16 +31,16 @@ with lib; ''; }; - language = mkOption { - type = types.str; + language = lib.mkOption { + type = lib.types.str; example = "python"; description = '' Language of the environment. Typically the name of the binary. ''; }; - env = mkOption { - type = types.attrsOf types.str; + env = lib.mkOption { + type = lib.types.attrsOf lib.types.str; default = { }; example = { OMP_NUM_THREADS = "1"; }; description = '' @@ -51,27 +48,27 @@ with lib; ''; }; - logo32 = mkOption { - type = types.nullOr types.path; + logo32 = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; - example = literalExpression ''"''${env.sitePackages}/ipykernel/resources/logo-32x32.png"''; + example = lib.literalExpression ''"''${env.sitePackages}/ipykernel/resources/logo-32x32.png"''; description = '' Path to 32x32 logo png. ''; }; - logo64 = mkOption { - type = types.nullOr types.path; + logo64 = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; - example = literalExpression ''"''${env.sitePackages}/ipykernel/resources/logo-64x64.png"''; + example = lib.literalExpression ''"''${env.sitePackages}/ipykernel/resources/logo-64x64.png"''; description = '' Path to 64x64 logo png. ''; }; - extraPaths = mkOption { - type = types.attrsOf types.path; + extraPaths = lib.mkOption { + type = lib.types.attrsOf lib.types.path; default = { }; - example = literalExpression ''"{ examples = ''${env.sitePack}/IRkernel/kernelspec/kernel.js"; }''; + example = lib.literalExpression ''"{ examples = ''${env.sitePack}/IRkernel/kernelspec/kernel.js"; }''; description = '' Extra paths to link in kernel directory ''; From df4401eac86fcc7528f02f143aa802997ab9a562 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:09 +0200 Subject: [PATCH 132/197] nixos/services.jupyterhub: remove `with lib;` --- .../development/jupyterhub/default.nix | 53 +++++++++---------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/nixos/modules/services/development/jupyterhub/default.nix b/nixos/modules/services/development/jupyterhub/default.nix index d9a37ad915d4..196d4aafabd4 100644 --- a/nixos/modules/services/development/jupyterhub/default.nix +++ b/nixos/modules/services/development/jupyterhub/default.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.jupyterhub; @@ -27,13 +24,13 @@ let ${cfg.extraConfig} ''; in { - meta.maintainers = with maintainers; [ costrouc ]; + meta.maintainers = with lib.maintainers; [ costrouc ]; options.services.jupyterhub = { - enable = mkEnableOption "Jupyterhub development server"; + enable = lib.mkEnableOption "Jupyterhub development server"; - authentication = mkOption { - type = types.str; + authentication = lib.mkOption { + type = lib.types.str; default = "jupyterhub.auth.PAMAuthenticator"; description = '' Jupyterhub authentication to use @@ -43,8 +40,8 @@ in { ''; }; - spawner = mkOption { - type = types.str; + spawner = lib.mkOption { + type = lib.types.str; default = "systemdspawner.SystemdSpawner"; description = '' Jupyterhub spawner to use @@ -54,8 +51,8 @@ in { ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = '' Extra contents appended to the jupyterhub configuration @@ -72,13 +69,13 @@ in { ''; }; - jupyterhubEnv = mkOption { - type = types.package; + jupyterhubEnv = lib.mkOption { + type = lib.types.package; default = pkgs.python3.withPackages (p: with p; [ jupyterhub jupyterhub-systemdspawner ]); - defaultText = literalExpression '' + defaultText = lib.literalExpression '' pkgs.python3.withPackages (p: with p; [ jupyterhub jupyterhub-systemdspawner @@ -94,13 +91,13 @@ in { ''; }; - jupyterlabEnv = mkOption { - type = types.package; + jupyterlabEnv = lib.mkOption { + type = lib.types.package; default = pkgs.python3.withPackages (p: with p; [ jupyterhub jupyterlab ]); - defaultText = literalExpression '' + defaultText = lib.literalExpression '' pkgs.python3.withPackages (p: with p; [ jupyterhub jupyterlab @@ -117,13 +114,13 @@ in { ''; }; - kernels = mkOption { - type = types.nullOr (types.attrsOf(types.submodule (import ../jupyter/kernel-options.nix { + kernels = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf(lib.types.submodule (import ../jupyter/kernel-options.nix { inherit lib pkgs; }))); default = null; - example = literalExpression '' + example = lib.literalExpression '' { python3 = let env = (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [ @@ -156,24 +153,24 @@ in { ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 8000; description = '' Port number Jupyterhub will be listening on ''; }; - host = mkOption { - type = types.str; + host = lib.mkOption { + type = lib.types.str; default = "0.0.0.0"; description = '' Bind IP JupyterHub will be listening on ''; }; - stateDirectory = mkOption { - type = types.str; + stateDirectory = lib.mkOption { + type = lib.types.str; default = "jupyterhub"; description = '' Directory for jupyterhub state (token + database) @@ -181,8 +178,8 @@ in { }; }; - config = mkMerge [ - (mkIf cfg.enable { + config = lib.mkMerge [ + (lib.mkIf cfg.enable { systemd.services.jupyterhub = { description = "Jupyterhub development server"; From f65c35866a57a1860318bd6cef3681b07e68c7c2 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:09 +0200 Subject: [PATCH 133/197] nixos/services.livebook: remove `with lib;` --- .../modules/services/development/livebook.nix | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/nixos/modules/services/development/livebook.nix b/nixos/modules/services/development/livebook.nix index 859083635201..3861d18e4ab5 100644 --- a/nixos/modules/services/development/livebook.nix +++ b/nixos/modules/services/development/livebook.nix @@ -1,6 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; let cfg = config.services.livebook; in @@ -10,12 +8,12 @@ in # either has access to all the data or none at all), the decision # was made to run this as a user service. If that changes in the # future, this can be changed to a system service. - enableUserService = mkEnableOption "a user service for Livebook"; + enableUserService = lib.mkEnableOption "a user service for Livebook"; - package = mkPackageOption pkgs "livebook" { }; + package = lib.mkPackageOption pkgs "livebook" { }; - environment = mkOption { - type = with types; attrsOf (nullOr (oneOf [ bool int str ])); + environment = lib.mkOption { + type = with lib.types; attrsOf (nullOr (oneOf [ bool int str ])); default = { }; description = '' Environment variables to set. @@ -37,15 +35,15 @@ in variables specified in this option. ''; - example = literalExpression '' + example = lib.literalExpression '' { LIVEBOOK_PORT = 8080; } ''; }; - environmentFile = mkOption { - type = with types; nullOr types.path; + environmentFile = lib.mkOption { + type = with lib.types; nullOr lib.types.path; default = null; description = '' Additional dnvironment file as defined in {manpage}`systemd.exec(5)`. @@ -72,17 +70,17 @@ in example = "/var/lib/livebook.env"; }; - extraPackages = mkOption { - type = with types; listOf package; + extraPackages = lib.mkOption { + type = with lib.types; listOf package; default = [ ]; description = '' Extra packages to make available to the Livebook service. ''; - example = literalExpression "with pkgs; [ gcc gnumake ]"; + example = lib.literalExpression "with pkgs; [ gcc gnumake ]"; }; }; - config = mkIf cfg.enableUserService { + config = lib.mkIf cfg.enableUserService { systemd.user.services.livebook = { serviceConfig = { Restart = "always"; @@ -97,8 +95,8 @@ in # stuck running a `cat /dev/urandom | tr | fold` pipeline. IgnoreSIGPIPE = false; }; - environment = mapAttrs (name: value: - if isBool value then boolToString value else toString value) + environment = lib.mapAttrs (name: value: + if lib.isBool value then lib.boolToString value else toString value) cfg.environment; path = [ pkgs.bash ] ++ cfg.extraPackages; wantedBy = [ "default.target" ]; From 45bc5974dd41d4fcfcea29e8f575cfb7ea77a671 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:09 +0200 Subject: [PATCH 134/197] nixos/services.rstudio-server: remove `with lib;` --- .../development/rstudio-server/default.nix | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/nixos/modules/services/development/rstudio-server/default.nix b/nixos/modules/services/development/rstudio-server/default.nix index 0126e105b3d3..70f665b09e31 100644 --- a/nixos/modules/services/development/rstudio-server/default.nix +++ b/nixos/modules/services/development/rstudio-server/default.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.rstudio-server; @@ -18,41 +15,41 @@ let in { - meta.maintainers = with maintainers; [ jbedo cfhammill ]; + meta.maintainers = with lib.maintainers; [ jbedo cfhammill ]; options.services.rstudio-server = { - enable = mkEnableOption "RStudio server"; + enable = lib.mkEnableOption "RStudio server"; - serverWorkingDir = mkOption { - type = types.str; + serverWorkingDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/rstudio-server"; description = '' Default working directory for server (server-working-dir in rserver.conf). ''; }; - listenAddr = mkOption { - type = types.str; + listenAddr = lib.mkOption { + type = lib.types.str; default = "127.0.0.1"; description = '' Address to listen on (www-address in rserver.conf). ''; }; - package = mkPackageOption pkgs "rstudio-server" { + package = lib.mkPackageOption pkgs "rstudio-server" { example = "rstudioServerWrapper.override { packages = [ pkgs.rPackages.ggplot2 ]; }"; }; - rserverExtraConfig = mkOption { - type = types.str; + rserverExtraConfig = lib.mkOption { + type = lib.types.str; default = ""; description = '' Extra contents for rserver.conf. ''; }; - rsessionExtraConfig = mkOption { - type = types.str; + rsessionExtraConfig = lib.mkOption { + type = lib.types.str; default = ""; description = '' Extra contents for resssion.conf. @@ -61,7 +58,7 @@ in }; - config = mkIf cfg.enable + config = lib.mkIf cfg.enable { systemd.services.rstudio-server = { description = "Rstudio server"; From 260654677f1e4c502bfe01c73b7795c9e1c4b2d4 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:10 +0200 Subject: [PATCH 135/197] nixos/services.greetd: remove `with lib;` --- .../services/display-managers/greetd.nix | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/nixos/modules/services/display-managers/greetd.nix b/nixos/modules/services/display-managers/greetd.nix index 118a3e1df378..9774b6a4d12e 100644 --- a/nixos/modules/services/display-managers/greetd.nix +++ b/nixos/modules/services/display-managers/greetd.nix @@ -1,6 +1,4 @@ { config, lib, pkgs, ... }: -with lib; - let cfg = config.services.greetd; tty = "tty${toString cfg.vt}"; @@ -8,13 +6,13 @@ let in { options.services.greetd = { - enable = mkEnableOption "greetd, a minimal and flexible login manager daemon"; + enable = lib.mkEnableOption "greetd, a minimal and flexible login manager daemon"; - package = mkPackageOption pkgs [ "greetd" "greetd" ] { }; + package = lib.mkPackageOption pkgs [ "greetd" "greetd" ] { }; - settings = mkOption { + settings = lib.mkOption { type = settingsFormat.type; - example = literalExpression '' + example = lib.literalExpression '' { default_session = { command = "''${pkgs.greetd.greetd}/bin/agreety --cmd sway"; @@ -27,8 +25,8 @@ in ''; }; - greeterManagesPlymouth = mkOption { - type = types.bool; + greeterManagesPlymouth = lib.mkOption { + type = lib.types.bool; internal = true; default = false; description = '' @@ -38,18 +36,18 @@ in ''; }; - vt = mkOption { - type = types.int; + vt = lib.mkOption { + type = lib.types.int; default = 1; description = '' The virtual console (tty) that greetd should use. This option also disables getty on that tty. ''; }; - restart = mkOption { - type = types.bool; + restart = lib.mkOption { + type = lib.types.bool; default = !(cfg.settings ? initial_session); - defaultText = literalExpression "!(config.services.greetd.settings ? initial_session)"; + defaultText = lib.literalExpression "!(config.services.greetd.settings ? initial_session)"; description = '' Whether to restart greetd when it terminates (e.g. on failure). This is usually desirable so a user can always log in, but should be disabled when using 'settings.initial_session' (autologin), @@ -57,15 +55,15 @@ in ''; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { - services.greetd.settings.terminal.vt = mkDefault cfg.vt; - services.greetd.settings.default_session.user = mkDefault "greeter"; + services.greetd.settings.terminal.vt = lib.mkDefault cfg.vt; + services.greetd.settings.default_session.user = lib.mkDefault "greeter"; security.pam.services.greetd = { allowNullPassword = true; startSession = true; - enableGnomeKeyring = mkDefault config.services.gnome.gnome-keyring.enable; + enableGnomeKeyring = lib.mkDefault config.services.gnome.gnome-keyring.enable; }; # This prevents nixos-rebuild from killing greetd by activating getty again @@ -95,7 +93,7 @@ in serviceConfig = { ExecStart = "${pkgs.greetd.greetd}/bin/greetd --config ${settingsFormat.generate "greetd.toml" cfg.settings}"; - Restart = mkIf cfg.restart "on-success"; + Restart = lib.mkIf cfg.restart "on-success"; # Defaults from greetd upstream configuration IgnoreSIGPIPE = false; @@ -128,5 +126,5 @@ in users.groups.greeter = { }; }; - meta.maintainers = with maintainers; [ queezle ]; + meta.maintainers = with lib.maintainers; [ queezle ]; } From facc95c0ce7a4d1bfbaffd5bdda7cbf003f90436 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:10 +0200 Subject: [PATCH 136/197] nixos/services.emacs: remove `with lib;` --- nixos/modules/services/editors/emacs.nix | 31 +++++++++++------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/nixos/modules/services/editors/emacs.nix b/nixos/modules/services/editors/emacs.nix index 98d8506e6727..ee1951e26222 100644 --- a/nixos/modules/services/editors/emacs.nix +++ b/nixos/modules/services/editors/emacs.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.emacs; @@ -18,8 +15,8 @@ in { options.services.emacs = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable a user service for the Emacs daemon. Use `emacsclient` to connect to the @@ -28,8 +25,8 @@ in ''; }; - install = mkOption { - type = types.bool; + install = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to install a user service for the Emacs daemon. Once @@ -43,10 +40,10 @@ in }; - package = mkPackageOption pkgs "emacs" { }; + package = lib.mkPackageOption pkgs "emacs" { }; - defaultEditor = mkOption { - type = types.bool; + defaultEditor = lib.mkOption { + type = lib.types.bool; default = false; description = '' When enabled, configures emacsclient to be the default editor @@ -54,17 +51,17 @@ in ''; }; - startWithGraphical = mkOption { - type = types.bool; + startWithGraphical = lib.mkOption { + type = lib.types.bool; default = config.services.xserver.enable; - defaultText = literalExpression "config.services.xserver.enable"; + defaultText = lib.literalExpression "config.services.xserver.enable"; description = '' Start emacs with the graphical session instead of any session. Without this, emacs clients will not be able to create frames in the graphical session. ''; }; }; - config = mkIf (cfg.enable || cfg.install) { + config = lib.mkIf (cfg.enable || cfg.install) { systemd.user.services.emacs = { description = "Emacs: the extensible, self-documenting text editor"; @@ -75,16 +72,16 @@ in Restart = "always"; }; - unitConfig = optionalAttrs cfg.startWithGraphical { + unitConfig = lib.optionalAttrs cfg.startWithGraphical { After = "graphical-session.target"; }; - } // optionalAttrs cfg.enable { + } // lib.optionalAttrs cfg.enable { wantedBy = if cfg.startWithGraphical then [ "graphical-session.target" ] else [ "default.target" ]; }; environment.systemPackages = [ cfg.package editorScript ]; - environment.variables.EDITOR = mkIf cfg.defaultEditor (mkOverride 900 "emacseditor"); + environment.variables.EDITOR = lib.mkIf cfg.defaultEditor (lib.mkOverride 900 "emacseditor"); }; meta.doc = ./emacs.md; From 11e4758bd31909a7eb6ba453d1c5fe0e258b20d6 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:11 +0200 Subject: [PATCH 137/197] nixos/services.haste: remove `with lib;` --- nixos/modules/services/editors/haste.nix | 37 +++++++++++------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/nixos/modules/services/editors/haste.nix b/nixos/modules/services/editors/haste.nix index f2a40e62e718..cf5bde6a5865 100644 --- a/nixos/modules/services/editors/haste.nix +++ b/nixos/modules/services/editors/haste.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let pkg = pkgs.haste-server; cfg = config.services.haste-server; @@ -10,10 +7,10 @@ let in { options.services.haste-server = { - enable = mkEnableOption "haste-server"; - openFirewall = mkEnableOption "firewall passthrough for haste-server"; + enable = lib.mkEnableOption "haste-server"; + openFirewall = lib.mkEnableOption "firewall passthrough for haste-server"; - settings = mkOption { + settings = lib.mkOption { description = '' Configuration for haste-server. For documentation see [project readme](https://github.com/toptal/haste-server#settings) @@ -22,21 +19,21 @@ in }; }; - config = mkIf (cfg.enable) { - networking.firewall.allowedTCPPorts = mkIf (cfg.openFirewall) [ cfg.settings.port ]; + config = lib.mkIf (cfg.enable) { + networking.firewall.allowedTCPPorts = lib.mkIf (cfg.openFirewall) [ cfg.settings.port ]; services.haste-server = { settings = { - host = mkDefault "::"; - port = mkDefault 7777; + host = lib.mkDefault "::"; + port = lib.mkDefault 7777; - keyLength = mkDefault 10; - maxLength = mkDefault 400000; + keyLength = lib.mkDefault 10; + maxLength = lib.mkDefault 400000; - staticMaxAge = mkDefault 86400; - recompressStaticAssets = mkDefault false; + staticMaxAge = lib.mkDefault 86400; + recompressStaticAssets = lib.mkDefault false; - logging = mkDefault [ + logging = lib.mkDefault [ { level = "verbose"; type = "Console"; @@ -44,25 +41,25 @@ in } ]; - keyGenerator = mkDefault { + keyGenerator = lib.mkDefault { type = "phonetic"; }; rateLimits = { categories = { normal = { - totalRequests = mkDefault 500; - every = mkDefault 60000; + totalRequests = lib.mkDefault 500; + every = lib.mkDefault 60000; }; }; }; - storage = mkDefault { + storage = lib.mkDefault { type = "file"; }; documents = { - about = mkDefault "${pkg}/share/haste-server/about.md"; + about = lib.mkDefault "${pkg}/share/haste-server/about.md"; }; }; }; From fe2d014a096812a673c64226c9fa8d05fbbcc6fc Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:11 +0200 Subject: [PATCH 138/197] nixos/services.infinoted: remove `with lib;` --- nixos/modules/services/editors/infinoted.nix | 67 ++++++++++---------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/nixos/modules/services/editors/infinoted.nix b/nixos/modules/services/editors/infinoted.nix index 2a7f1d45c2d8..b6e353b637e8 100644 --- a/nixos/modules/services/editors/infinoted.nix +++ b/nixos/modules/services/editors/infinoted.nix @@ -1,33 +1,30 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.infinoted; in { options.services.infinoted = { - enable = mkEnableOption "infinoted"; + enable = lib.mkEnableOption "infinoted"; - package = mkPackageOption pkgs "libinfinity" { }; + package = lib.mkPackageOption pkgs "libinfinity" { }; - keyFile = mkOption { - type = types.nullOr types.path; + keyFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' Private key to use for TLS ''; }; - certificateFile = mkOption { - type = types.nullOr types.path; + certificateFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' Server certificate to use for TLS ''; }; - certificateChain = mkOption { - type = types.nullOr types.path; + certificateChain = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' Chain of CA-certificates to which our `certificateFile` is relative. @@ -35,48 +32,48 @@ in { ''; }; - securityPolicy = mkOption { - type = types.enum ["no-tls" "allow-tls" "require-tls"]; + securityPolicy = lib.mkOption { + type = lib.types.enum ["no-tls" "allow-tls" "require-tls"]; default = "require-tls"; description = '' How strictly to enforce clients connection with TLS. ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 6523; description = '' Port to listen on ''; }; - rootDirectory = mkOption { - type = types.path; + rootDirectory = lib.mkOption { + type = lib.types.path; default = "/var/lib/infinoted/documents/"; description = '' Root of the directory structure to serve ''; }; - plugins = mkOption { - type = types.listOf types.str; + plugins = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ "note-text" "note-chat" "logging" "autosave" ]; description = '' Plugins to enable ''; }; - passwordFile = mkOption { - type = types.nullOr types.path; + passwordFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' File to read server-wide password from ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = '' [autosave] interval=10 @@ -86,16 +83,16 @@ in { ''; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "infinoted"; description = '' What to call the dedicated user under which infinoted is run ''; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "infinoted"; description = '' What to call the primary group of the dedicated user under which infinoted is run @@ -103,15 +100,15 @@ in { }; }; - config = mkIf (cfg.enable) { - users.users = optionalAttrs (cfg.user == "infinoted") + config = lib.mkIf (cfg.enable) { + users.users = lib.optionalAttrs (cfg.user == "infinoted") { infinoted = { description = "Infinoted user"; group = cfg.group; isSystemUser = true; }; }; - users.groups = optionalAttrs (cfg.group == "infinoted") + users.groups = lib.optionalAttrs (cfg.group == "infinoted") { infinoted = { }; }; @@ -134,14 +131,14 @@ in { install -o ${cfg.user} -g ${cfg.group} -m 0600 /dev/null /var/lib/infinoted/infinoted.conf cat >>/var/lib/infinoted/infinoted.conf < Date: Tue, 27 Aug 2024 20:43:11 +0200 Subject: [PATCH 139/197] nixos/services.odoo: remove `with lib;` --- nixos/modules/services/finance/odoo.nix | 37 ++++++++++++------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/nixos/modules/services/finance/odoo.nix b/nixos/modules/services/finance/odoo.nix index 074617d35e3d..1414500389d6 100644 --- a/nixos/modules/services/finance/odoo.nix +++ b/nixos/modules/services/finance/odoo.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.odoo; format = pkgs.formats.ini {}; @@ -9,35 +6,35 @@ in { options = { services.odoo = { - enable = mkEnableOption "odoo, an open source ERP and CRM system"; + enable = lib.mkEnableOption "odoo, an open source ERP and CRM system"; - package = mkPackageOption pkgs "odoo" { }; + package = lib.mkPackageOption pkgs "odoo" { }; - addons = mkOption { - type = with types; listOf package; + addons = lib.mkOption { + type = with lib.types; listOf package; default = []; - example = literalExpression "[ pkgs.odoo_enterprise ]"; + example = lib.literalExpression "[ pkgs.odoo_enterprise ]"; description = "Odoo addons."; }; - autoInit = mkEnableOption "automatically initialize the DB"; + autoInit = lib.mkEnableOption "automatically initialize the DB"; - autoInitExtraFlags = mkOption { - type = with types; listOf str; + autoInitExtraFlags = lib.mkOption { + type = with lib.types; listOf str; default = [ ]; - example = literalExpression /*nix*/ '' + example = lib.literalExpression /*nix*/ '' [ "--without-demo=all" ] ''; description = "Extra flags passed to odoo when run for the first time by autoInit"; }; - settings = mkOption { + settings = lib.mkOption { type = format.type; default = {}; description = '' Odoo configuration settings. For more details see ''; - example = literalExpression '' + example = lib.literalExpression '' options = { db_user = "odoo"; db_password="odoo"; @@ -45,18 +42,18 @@ in ''; }; - domain = mkOption { - type = with types; nullOr str; + domain = lib.mkOption { + type = with lib.types; nullOr str; description = "Domain to host Odoo with nginx"; default = null; }; }; }; - config = mkIf (cfg.enable) (let + config = lib.mkIf (cfg.enable) (let cfgFile = format.generate "odoo.cfg" cfg.settings; in { - services.nginx = mkIf (cfg.domain != null) { + services.nginx = lib.mkIf (cfg.domain != null) { upstreams = { odoo.servers = { "127.0.0.1:8069" = {}; @@ -98,7 +95,7 @@ in data_dir = "/var/lib/private/odoo/data"; proxy_mode = cfg.domain != null; } // (lib.optionalAttrs (cfg.addons != []) { - addons_path = concatMapStringsSep "," escapeShellArg cfg.addons; + addons_path = lib.concatMapStringsSep "," lib.escapeShellArg cfg.addons; }); users.users.odoo = { @@ -137,7 +134,7 @@ in echo "pre-start: auto-init" INITIALIZED="${cfg.settings.options.data_dir}/.odoo.initialized" if [ ! -e "$INITIALIZED" ]; then - ${cfg.package}/bin/odoo --init=INIT --database=odoo --db_user=odoo --stop-after-init ${concatStringsSep " " cfg.autoInitExtraFlags} + ${cfg.package}/bin/odoo --init=INIT --database=odoo --db_user=odoo --stop-after-init ${lib.concatStringsSep " " cfg.autoInitExtraFlags} touch "$INITIALIZED" fi '') From eb3a044360edb46dce95ab76ef7525df7abe26bf Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:11 +0200 Subject: [PATCH 140/197] nixos/services.crossfire-server: remove `with lib;` --- .../services/games/crossfire-server.nix | 47 +++++++++---------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/nixos/modules/services/games/crossfire-server.nix b/nixos/modules/services/games/crossfire-server.nix index 314b4bad9a29..91a684873c2a 100644 --- a/nixos/modules/services/games/crossfire-server.nix +++ b/nixos/modules/services/games/crossfire-server.nix @@ -1,21 +1,18 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.crossfire-server; serverPort = 13327; in { options.services.crossfire-server = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' If enabled, the Crossfire game server will be started at boot. ''; }; - package = mkPackageOption pkgs "crossfire-server" { + package = lib.mkPackageOption pkgs "crossfire-server" { extraDescription = '' ::: {.note} This will also be used for map/arch data, if you don't change {option}`dataDir` @@ -23,10 +20,10 @@ in { ''; }; - dataDir = mkOption { - type = types.str; + dataDir = lib.mkOption { + type = lib.types.str; default = "${cfg.package}/share/crossfire"; - defaultText = literalExpression ''"''${config.services.crossfire.package}/share/crossfire"''; + defaultText = lib.literalExpression ''"''${config.services.crossfire.package}/share/crossfire"''; description = '' Where to load readonly data from -- maps, archetypes, treasure tables, and the like. If you plan to edit the data on the live server (rather @@ -36,8 +33,8 @@ in { ''; }; - stateDir = mkOption { - type = types.str; + stateDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/crossfire"; description = '' Where to store runtime data (save files, persistent items, etc). @@ -49,16 +46,16 @@ in { ''; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to open ports in the firewall for the server. ''; }; - configFiles = mkOption { - type = types.attrsOf types.str; + configFiles = lib.mkOption { + type = lib.types.attrsOf lib.types.str; description = '' Text to append to the corresponding configuration files. Note that the files given in the example are *not* the complete set of files available @@ -70,7 +67,7 @@ in { overwrite the example files that come with the server, rather than being appended to them as the other configuration files are. ''; - example = literalExpression '' + example = lib.literalExpression '' { dm_file = ''' admin:secret_password:localhost @@ -101,7 +98,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { users.users.crossfire = { description = "Crossfire server daemon user"; home = cfg.stateDir; @@ -120,8 +117,8 @@ in { (name: value: lib.attrsets.nameValuePair "crossfire/${name}" { mode = "0644"; text = - (optionalString (!elem name ["motd" "news" "rules"]) - (fileContents "${cfg.package}/etc/crossfire/${name}")) + (lib.optionalString (!lib.elem name ["motd" "news" "rules"]) + (lib.fileContents "${cfg.package}/etc/crossfire/${name}")) + "\n${value}"; }) ({ ban_file = ""; @@ -129,9 +126,9 @@ in { exp_table = ""; forbid = ""; metaserver2 = ""; - motd = fileContents "${cfg.package}/etc/crossfire/motd"; - news = fileContents "${cfg.package}/etc/crossfire/news"; - rules = fileContents "${cfg.package}/etc/crossfire/rules"; + motd = lib.fileContents "${cfg.package}/etc/crossfire/motd"; + news = lib.fileContents "${cfg.package}/etc/crossfire/news"; + rules = lib.fileContents "${cfg.package}/etc/crossfire/rules"; settings = ""; stat_bonus = ""; } // cfg.configFiles); @@ -141,7 +138,7 @@ in { wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - serviceConfig = mkMerge [ + serviceConfig = lib.mkMerge [ { ExecStart = "${cfg.package}/bin/crossfire-server -conf /etc/crossfire -local '${cfg.stateDir}' -data '${cfg.dataDir}'"; Restart = "always"; @@ -149,7 +146,7 @@ in { Group = "crossfire"; WorkingDirectory = cfg.stateDir; } - (mkIf (cfg.stateDir == "/var/lib/crossfire") { + (lib.mkIf (cfg.stateDir == "/var/lib/crossfire") { StateDirectory = "crossfire"; }) ]; @@ -170,7 +167,7 @@ in { ''; }; - networking.firewall = mkIf cfg.openFirewall { + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ serverPort ]; }; }; From 07d3ecf363d5f2dd35d3771dc5718f6497567a6d Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:12 +0200 Subject: [PATCH 141/197] nixos/services.deliantra-server: remove `with lib;` --- .../services/games/deliantra-server.nix | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/nixos/modules/services/games/deliantra-server.nix b/nixos/modules/services/games/deliantra-server.nix index 401a453ba932..0bb9cea92c7e 100644 --- a/nixos/modules/services/games/deliantra-server.nix +++ b/nixos/modules/services/games/deliantra-server.nix @@ -1,21 +1,18 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.deliantra-server; serverPort = 13327; in { options.services.deliantra-server = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' If enabled, the Deliantra game server will be started at boot. ''; }; - package = mkPackageOption pkgs "deliantra-server" { + package = lib.mkPackageOption pkgs "deliantra-server" { extraDescription = '' ::: {.note} This will also be used for map/arch data, if you don't change {option}`dataDir` @@ -23,10 +20,10 @@ in { ''; }; - dataDir = mkOption { - type = types.str; + dataDir = lib.mkOption { + type = lib.types.str; default = "${pkgs.deliantra-data}"; - defaultText = literalExpression ''"''${pkgs.deliantra-data}"''; + defaultText = lib.literalExpression ''"''${pkgs.deliantra-data}"''; description = '' Where to store readonly data (maps, archetypes, sprites, etc). Note that if you plan to use the live map editor (rather than editing @@ -36,8 +33,8 @@ in { ''; }; - stateDir = mkOption { - type = types.str; + stateDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/deliantra"; description = '' Where to store runtime data (save files, persistent items, etc). @@ -49,16 +46,16 @@ in { ''; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to open ports in the firewall for the server. ''; }; - configFiles = mkOption { - type = types.attrsOf types.str; + configFiles = lib.mkOption { + type = lib.types.attrsOf lib.types.str; description = '' Contents of the server configuration files. These will be appended to the example configurations the server comes with and overwrite any @@ -67,7 +64,7 @@ in { The example here is not comprehensive. See the files in /etc/deliantra-server after enabling this module for full documentation. ''; - example = literalExpression '' + example = lib.literalExpression '' { dm_file = ''' admin:secret_password:localhost @@ -92,7 +89,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { users.users.deliantra = { description = "Deliantra server daemon user"; home = cfg.stateDir; @@ -113,8 +110,8 @@ in { text = # Deliantra doesn't come with a motd file, but respects it if present # in /etc. - (optionalString (name != "motd") - (fileContents "${cfg.package}/etc/deliantra-server/${name}")) + (lib.optionalString (name != "motd") + (lib.fileContents "${cfg.package}/etc/deliantra-server/${name}")) + "\n${value}"; }) ({ motd = ""; @@ -134,7 +131,7 @@ in { DELIANTRA_CONFDIR="/etc/deliantra-server"; }; - serviceConfig = mkMerge [ + serviceConfig = lib.mkMerge [ { ExecStart = "${cfg.package}/bin/deliantra-server"; Restart = "always"; @@ -142,7 +139,7 @@ in { Group = "deliantra"; WorkingDirectory = cfg.stateDir; } - (mkIf (cfg.stateDir == "/var/lib/deliantra") { + (lib.mkIf (cfg.stateDir == "/var/lib/deliantra") { StateDirectory = "deliantra"; }) ]; @@ -163,7 +160,7 @@ in { ''; }; - networking.firewall = mkIf cfg.openFirewall { + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ serverPort ]; }; }; From d74605503f4fbf4f44661f26d2a02d98624cdb87 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:12 +0200 Subject: [PATCH 142/197] nixos/services.freeciv: remove `with lib;` --- nixos/modules/services/games/freeciv.nix | 61 ++++++++++++------------ 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/nixos/modules/services/games/freeciv.nix b/nixos/modules/services/games/freeciv.nix index e4c05af3caba..fc73824e6920 100644 --- a/nixos/modules/services/games/freeciv.nix +++ b/nixos/modules/services/games/freeciv.nix @@ -1,5 +1,4 @@ { config, lib, pkgs, ... }: -with lib; let cfg = config.services.freeciv; inherit (config.users) groups; @@ -16,31 +15,31 @@ let generate = name: value: let mkParam = k: v: if v == null then [] - else if isBool v then optional v ("--"+k) + else if lib.isBool v then lib.optional v ("--"+k) else [("--"+k) v]; - mkParams = k: v: map (mkParam k) (if isList v then v else [v]); - in escapeShellArgs (concatLists (concatLists (mapAttrsToList mkParams value))); + mkParams = k: v: map (mkParam k) (if lib.isList v then v else [v]); + in lib.escapeShellArgs (lib.concatLists (lib.concatLists (lib.mapAttrsToList mkParams value))); }; in { options = { services.freeciv = { - enable = mkEnableOption ''freeciv''; - settings = mkOption { + enable = lib.mkEnableOption ''freeciv''; + settings = lib.mkOption { description = '' Parameters of freeciv-server. ''; default = {}; - type = types.submodule { + type = lib.types.submodule { freeformType = argsFormat.type; - options.Announce = mkOption { - type = types.enum ["IPv4" "IPv6" "none"]; + options.Announce = lib.mkOption { + type = lib.types.enum ["IPv4" "IPv6" "none"]; default = "none"; description = "Announce game in LAN using given protocol."; }; - options.auth = mkEnableOption "server authentication"; - options.Database = mkOption { - type = types.nullOr types.str; + options.auth = lib.mkEnableOption "server authentication"; + options.Database = lib.mkOption { + type = lib.types.nullOr lib.types.str; apply = pkgs.writeText "auth.conf"; default = '' [fcdb] @@ -49,34 +48,34 @@ in ''; description = "Enable database connection with given configuration."; }; - options.debug = mkOption { - type = types.ints.between 0 3; + options.debug = lib.mkOption { + type = lib.types.ints.between 0 3; default = 0; description = "Set debug log level."; }; - options.exit-on-end = mkEnableOption "exit instead of restarting when a game ends"; - options.Guests = mkEnableOption "guests to login if auth is enabled"; - options.Newusers = mkEnableOption "new users to login if auth is enabled"; - options.port = mkOption { - type = types.port; + options.exit-on-end = lib.mkEnableOption "exit instead of restarting when a game ends"; + options.Guests = lib.mkEnableOption "guests to login if auth is enabled"; + options.Newusers = lib.mkEnableOption "new users to login if auth is enabled"; + options.port = lib.mkOption { + type = lib.types.port; default = 5556; description = "Listen for clients on given port"; }; - options.quitidle = mkOption { - type = types.nullOr types.int; + options.quitidle = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = "Quit if no players for given time in seconds."; }; - options.read = mkOption { - type = types.lines; + options.read = lib.mkOption { + type = lib.types.lines; apply = v: pkgs.writeTextDir "read.serv" v + "/read"; default = '' /fcdb lua sqlite_createdb() ''; description = "Startup script."; }; - options.saves = mkOption { - type = types.nullOr types.str; + options.saves = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = "/var/lib/freeciv/saves/"; description = '' Save games to given directory, @@ -86,10 +85,10 @@ in }; }; }; - openFirewall = mkEnableOption "opening the firewall for the port listening for clients"; + openFirewall = lib.mkEnableOption "opening the firewall for the port listening for clients"; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { users.groups.freeciv = {}; # Use with: # journalctl -u freeciv.service -f -o cat & @@ -119,8 +118,8 @@ in set -eux savedir=$(date +%Y-%m-%d_%H-%M-%S) '' + "${pkgs.freeciv}/bin/freeciv-server" - + " " + optionalString (cfg.settings.saves != null) - (concatStringsSep " " [ "--saves" "${escapeShellArg cfg.settings.saves}/$savedir" ]) + + " " + lib.optionalString (cfg.settings.saves != null) + (lib.concatStringsSep " " [ "--saves" "${lib.escapeShellArg cfg.settings.saves}/$savedir" ]) + " " + argsFormat.generate "freeciv-server" (cfg.settings // { saves = null; })); DynamicUser = true; # Create rootDir in the host's mount namespace. @@ -152,7 +151,7 @@ in NoNewPrivileges = true; PrivateDevices = true; PrivateMounts = true; - PrivateNetwork = mkDefault false; + PrivateNetwork = lib.mkDefault false; PrivateTmp = true; PrivateUsers = true; ProtectClock = true; @@ -180,7 +179,7 @@ in SystemCallErrorNumber = "EPERM"; }; }; - networking.firewall = mkIf cfg.openFirewall + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.settings.port ]; }; }; meta.maintainers = with lib.maintainers; [ julm ]; From d93ebcfd04bddefebadd8c2248c0cc54fcac38bc Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:13 +0200 Subject: [PATCH 143/197] nixos/services.minecraft-server: remove `with lib;` --- .../services/games/minecraft-server.nix | 57 +++++++++---------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/nixos/modules/services/games/minecraft-server.nix b/nixos/modules/services/games/minecraft-server.nix index 00af8dce6603..bc56feffb748 100644 --- a/nixos/modules/services/games/minecraft-server.nix +++ b/nixos/modules/services/games/minecraft-server.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.minecraft-server; @@ -13,13 +10,13 @@ let whitelistFile = pkgs.writeText "whitelist.json" (builtins.toJSON - (mapAttrsToList (n: v: { name = n; uuid = v; }) cfg.whitelist)); + (lib.mapAttrsToList (n: v: { name = n; uuid = v; }) cfg.whitelist)); - cfgToString = v: if builtins.isBool v then boolToString v else toString v; + cfgToString = v: if builtins.isBool v then lib.boolToString v else toString v; serverPropertiesFile = pkgs.writeText "server.properties" ('' # server.properties managed by NixOS configuration - '' + concatStringsSep "\n" (mapAttrsToList + '' + lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: "${n}=${cfgToString v}") cfg.serverProperties)); stopScript = pkgs.writeShellScript "minecraft-server-stop" '' @@ -51,8 +48,8 @@ in { options = { services.minecraft-server = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' If enabled, start a Minecraft Server. The server @@ -61,8 +58,8 @@ in { ''; }; - declarative = mkOption { - type = types.bool; + declarative = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to use a declarative Minecraft server configuration. @@ -73,8 +70,8 @@ in { ''; }; - eula = mkOption { - type = types.bool; + eula = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether you agree to @@ -84,29 +81,29 @@ in { ''; }; - dataDir = mkOption { - type = types.path; + dataDir = lib.mkOption { + type = lib.types.path; default = "/var/lib/minecraft"; description = '' Directory to store Minecraft database and other state/data files. ''; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to open ports in the firewall for the server. ''; }; - whitelist = mkOption { + whitelist = lib.mkOption { type = let - minecraftUUID = types.strMatching + minecraftUUID = lib.types.strMatching "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" // { description = "Minecraft UUID"; }; - in types.attrsOf minecraftUUID; + in lib.types.attrsOf minecraftUUID; default = {}; description = '' Whitelisted players, only has an effect when @@ -118,7 +115,7 @@ in { You can use to get a Minecraft UUID for a username. ''; - example = literalExpression '' + example = lib.literalExpression '' { username1 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; username2 = "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"; @@ -126,10 +123,10 @@ in { ''; }; - serverProperties = mkOption { - type = with types; attrsOf (oneOf [ bool int str ]); + serverProperties = lib.mkOption { + type = with lib.types; attrsOf (oneOf [ bool int str ]); default = {}; - example = literalExpression '' + example = lib.literalExpression '' { server-port = 43000; difficulty = 3; @@ -150,12 +147,12 @@ in { ''; }; - package = mkPackageOption pkgs "minecraft-server" { + package = lib.mkPackageOption pkgs "minecraft-server" { example = "minecraft-server_1_12_2"; }; - jvmOpts = mkOption { - type = types.separatedString " "; + jvmOpts = lib.mkOption { + type = lib.types.separatedString " "; default = "-Xmx2048M -Xms2048M"; # Example options from https://minecraft.gamepedia.com/Tutorials/Server_startup_script example = "-Xms4092M -Xmx4092M -XX:+UseG1GC -XX:+CMSIncrementalPacing " @@ -166,7 +163,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { users.users.minecraft = { description = "Minecraft server service user"; @@ -259,11 +256,11 @@ in { ''); }; - networking.firewall = mkIf cfg.openFirewall (if cfg.declarative then { + networking.firewall = lib.mkIf cfg.openFirewall (if cfg.declarative then { allowedUDPPorts = [ serverPort ]; allowedTCPPorts = [ serverPort ] - ++ optional (queryPort != null) queryPort - ++ optional (rconPort != null) rconPort; + ++ lib.optional (queryPort != null) queryPort + ++ lib.optional (rconPort != null) rconPort; } else { allowedUDPPorts = [ defaultServerPort ]; allowedTCPPorts = [ defaultServerPort ]; From 3e001960ebd39c873b0950fb7f58670928af6995 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:13 +0200 Subject: [PATCH 144/197] nixos/services.minetest-server: remove `with lib;` --- .../services/games/minetest-server.nix | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/nixos/modules/services/games/minetest-server.nix b/nixos/modules/services/games/minetest-server.nix index 7fa687d2c7ed..98613e4391ef 100644 --- a/nixos/modules/services/games/minetest-server.nix +++ b/nixos/modules/services/games/minetest-server.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let CONTAINS_NEWLINE_RE = ".*\n.*"; # The following values are reserved as complete option values: @@ -53,14 +50,14 @@ in { options = { services.minetest-server = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = "If enabled, starts a Minetest Server."; }; - gameId = mkOption { - type = types.nullOr types.str; + gameId = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Id of the game to use. To list available games run @@ -70,8 +67,8 @@ in ''; }; - world = mkOption { - type = types.nullOr types.path; + world = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' Name of the world to use. To list available worlds run @@ -81,8 +78,8 @@ in ''; }; - configPath = mkOption { - type = types.nullOr types.path; + configPath = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' Path to the config to use. @@ -92,8 +89,8 @@ in ''; }; - config = mkOption { - type = types.attrsOf types.anything; + config = lib.mkOption { + type = lib.types.attrsOf lib.types.anything; default = {}; description = '' Settings to add to the minetest config file. @@ -102,8 +99,8 @@ in ''; }; - logPath = mkOption { - type = types.nullOr types.path; + logPath = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' Path to logfile for logging. @@ -113,8 +110,8 @@ in ''; }; - port = mkOption { - type = types.nullOr types.int; + port = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' Port number to bind to. @@ -123,8 +120,8 @@ in ''; }; - extraArgs = mkOption { - type = types.listOf types.str; + extraArgs = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; description = '' Additional command line flags to pass to the minetest executable. @@ -133,7 +130,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { users.users.minetest = { description = "Minetest Server Service user"; home = "/var/lib/minetest"; From e79224ab545627c87eeb4cdb2f0eab29a960246e Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:14 +0200 Subject: [PATCH 145/197] nixos/services.terraria: remove `with lib;` --- nixos/modules/services/games/terraria.nix | 61 +++++++++++------------ 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/nixos/modules/services/games/terraria.nix b/nixos/modules/services/games/terraria.nix index 4c32cc92a1b9..144186dc7701 100644 --- a/nixos/modules/services/games/terraria.nix +++ b/nixos/modules/services/games/terraria.nix @@ -1,13 +1,10 @@ { config, lib, options, pkgs, ... }: - -with lib; - let cfg = config.services.terraria; opt = options.services.terraria; worldSizeMap = { small = 1; medium = 2; large = 3; }; - valFlag = name: val: optionalString (val != null) "-${name} \"${escape ["\\" "\""] (toString val)}\""; - boolFlag = name: val: optionalString val "-${name}"; + valFlag = name: val: lib.optionalString (val != null) "-${name} \"${lib.escape ["\\" "\""] (toString val)}\""; + boolFlag = name: val: lib.optionalString val "-${name}"; flags = [ (valFlag "port" cfg.port) (valFlag "maxPlayers" cfg.maxPlayers) @@ -46,8 +43,8 @@ in { options = { services.terraria = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' If enabled, starts a Terraria server. The server can be connected to via `tmux -S ''${config.${opt.dataDir}}/terraria.sock attach` @@ -55,40 +52,40 @@ in ''; }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 7777; description = '' Specifies the port to listen on. ''; }; - maxPlayers = mkOption { - type = types.ints.u8; + maxPlayers = lib.mkOption { + type = lib.types.ints.u8; default = 255; description = '' Sets the max number of players (between 1 and 255). ''; }; - password = mkOption { - type = types.nullOr types.str; + password = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Sets the server password. Leave `null` for no password. ''; }; - messageOfTheDay = mkOption { - type = types.nullOr types.str; + messageOfTheDay = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Set the server message of the day text. ''; }; - worldPath = mkOption { - type = types.nullOr types.path; + worldPath = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' The path to the world file (`.wld`) which should be loaded. @@ -97,8 +94,8 @@ in ''; }; - autoCreatedWorldSize = mkOption { - type = types.enum [ "small" "medium" "large" ]; + autoCreatedWorldSize = lib.mkOption { + type = lib.types.enum [ "small" "medium" "large" ]; default = "medium"; description = '' Specifies the size of the auto-created world if `worldPath` does not @@ -106,34 +103,34 @@ in ''; }; - banListPath = mkOption { - type = types.nullOr types.path; + banListPath = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' The path to the ban list. ''; }; - secure = mkOption { - type = types.bool; + secure = lib.mkOption { + type = lib.types.bool; default = false; description = "Adds additional cheat protection to the server."; }; - noUPnP = mkOption { - type = types.bool; + noUPnP = lib.mkOption { + type = lib.types.bool; default = false; description = "Disables automatic Universal Plug and Play."; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = "Whether to open ports in the firewall"; }; - dataDir = mkOption { - type = types.str; + dataDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/terraria"; example = "/srv/terraria"; description = "Path to variable state data directory for terraria."; @@ -141,7 +138,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { users.users.terraria = { description = "Terraria server service user"; group = "terraria"; @@ -165,12 +162,12 @@ in Type = "forking"; GuessMainPID = true; UMask = 007; - ExecStart = "${tmuxCmd} new -d ${pkgs.terraria-server}/bin/TerrariaServer ${concatStringsSep " " flags}"; + ExecStart = "${tmuxCmd} new -d ${pkgs.terraria-server}/bin/TerrariaServer ${lib.concatStringsSep " " flags}"; ExecStop = "${stopScript} $MAINPID"; }; }; - networking.firewall = mkIf cfg.openFirewall { + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.port ]; allowedUDPPorts = [ cfg.port ]; }; From f8305b629b8a9e602dd7a63a31d669a8f47a6ec0 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:14 +0200 Subject: [PATCH 146/197] nixos/services.acpid: remove `with lib;` --- nixos/modules/services/hardware/acpid.nix | 43 +++++++++++------------ 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/nixos/modules/services/hardware/acpid.nix b/nixos/modules/services/hardware/acpid.nix index 581b6cb40136..357f692801b4 100644 --- a/nixos/modules/services/hardware/acpid.nix +++ b/nixos/modules/services/hardware/acpid.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.acpid; @@ -34,7 +31,7 @@ let echo "event=${handler.event}" > $fn echo "action=${pkgs.writeShellScriptBin "${name}.sh" handler.action }/bin/${name}.sh '%e'" >> $fn ''; - in concatStringsSep "\n" (mapAttrsToList f (canonicalHandlers // cfg.handlers)) + in lib.concatStringsSep "\n" (lib.mapAttrsToList f (canonicalHandlers // cfg.handlers)) } ''; @@ -48,25 +45,25 @@ in services.acpid = { - enable = mkEnableOption "the ACPI daemon"; + enable = lib.mkEnableOption "the ACPI daemon"; - logEvents = mkOption { - type = types.bool; + logEvents = lib.mkOption { + type = lib.types.bool; default = false; description = "Log all event activity."; }; - handlers = mkOption { - type = types.attrsOf (types.submodule { + handlers = lib.mkOption { + type = lib.types.attrsOf (lib.types.submodule { options = { - event = mkOption { - type = types.str; - example = literalExpression ''"button/power.*" "button/lid.*" "ac_adapter.*" "button/mute.*" "button/volumedown.*" "cd/play.*" "cd/next.*"''; + event = lib.mkOption { + type = lib.types.str; + example = lib.literalExpression ''"button/power.*" "button/lid.*" "ac_adapter.*" "button/mute.*" "button/volumedown.*" "cd/play.*" "cd/next.*"''; description = "Event type."; }; - action = mkOption { - type = types.lines; + action = lib.mkOption { + type = lib.types.lines; description = "Shell commands to execute when the event is triggered."; }; }; @@ -101,20 +98,20 @@ in }; }; - powerEventCommands = mkOption { - type = types.lines; + powerEventCommands = lib.mkOption { + type = lib.types.lines; default = ""; description = "Shell commands to execute on a button/power.* event."; }; - lidEventCommands = mkOption { - type = types.lines; + lidEventCommands = lib.mkOption { + type = lib.types.lines; default = ""; description = "Shell commands to execute on a button/lid.* event."; }; - acEventCommands = mkOption { - type = types.lines; + acEventCommands = lib.mkOption { + type = lib.types.lines; default = ""; description = "Shell commands to execute on an ac_adapter.* event."; }; @@ -126,7 +123,7 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.acpid = { description = "ACPI Daemon"; @@ -135,12 +132,12 @@ in wantedBy = [ "multi-user.target" ]; serviceConfig = { - ExecStart = escapeShellArgs + ExecStart = lib.escapeShellArgs ([ "${pkgs.acpid}/bin/acpid" "--foreground" "--netlink" "--confdir" "${acpiConfDir}" - ] ++ optional cfg.logEvents "--logevents" + ] ++ lib.optional cfg.logEvents "--logevents" ); }; unitConfig = { From efcfb7ec52b250a2c6451d4d8e22d095cc783a4e Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:14 +0200 Subject: [PATCH 147/197] nixos/services.auto-cpufreq: remove `with lib;` --- nixos/modules/services/hardware/auto-cpufreq.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/hardware/auto-cpufreq.nix b/nixos/modules/services/hardware/auto-cpufreq.nix index f61fa38be175..ed24c656c543 100644 --- a/nixos/modules/services/hardware/auto-cpufreq.nix +++ b/nixos/modules/services/hardware/auto-cpufreq.nix @@ -1,5 +1,4 @@ { config, lib, pkgs, ... }: -with lib; let cfg = config.services.auto-cpufreq; cfgFilename = "auto-cpufreq.conf"; @@ -9,9 +8,9 @@ let in { options = { services.auto-cpufreq = { - enable = mkEnableOption "auto-cpufreq daemon"; + enable = lib.mkEnableOption "auto-cpufreq daemon"; - settings = mkOption { + settings = lib.mkOption { description = '' Configuration for `auto-cpufreq`. @@ -19,12 +18,12 @@ in { ''; default = {}; - type = types.submodule { freeformType = format.type; }; + type = lib.types.submodule { freeformType = format.type; }; }; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.auto-cpufreq ]; systemd = { From 555402cee58ec55418fa76de284e8072c7ecba31 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:15 +0200 Subject: [PATCH 148/197] nixos/services.bolt: remove `with lib;` --- nixos/modules/services/hardware/bolt.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/hardware/bolt.nix b/nixos/modules/services/hardware/bolt.nix index 729273f94f12..f005d24e0883 100644 --- a/nixos/modules/services/hardware/bolt.nix +++ b/nixos/modules/services/hardware/bolt.nix @@ -1,15 +1,12 @@ { config, lib, pkgs, ...}: - -with lib; - let cfg = config.services.hardware.bolt; in { options = { services.hardware.bolt = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable Bolt, a userspace daemon to enable @@ -19,11 +16,11 @@ in ''; }; - package = mkPackageOption pkgs "bolt" { }; + package = lib.mkPackageOption pkgs "bolt" { }; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; services.udev.packages = [ cfg.package ]; systemd.packages = [ cfg.package ]; From 3822e798f8bdd01f37dff74c852a34a146b4ac00 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:15 +0200 Subject: [PATCH 149/197] nixos/services.brltty: remove `with lib;` --- nixos/modules/services/hardware/brltty.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/hardware/brltty.nix b/nixos/modules/services/hardware/brltty.nix index bdec5d79be96..c4ded927345d 100644 --- a/nixos/modules/services/hardware/brltty.nix +++ b/nixos/modules/services/hardware/brltty.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.brltty; @@ -22,15 +19,15 @@ in { options = { - services.brltty.enable = mkOption { - type = types.bool; + services.brltty.enable = lib.mkOption { + type = lib.types.bool; default = false; description = "Whether to enable the BRLTTY daemon."; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { users.users.brltty = { description = "BRLTTY daemon user"; group = "brltty"; From 29536d4a4df5da981194087a8b2eb9eb23e9afbe Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:16 +0200 Subject: [PATCH 150/197] nixos/services.fancontrol: remove `with lib;` --- nixos/modules/services/hardware/fancontrol.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/hardware/fancontrol.nix b/nixos/modules/services/hardware/fancontrol.nix index f9fc8593f852..06c217b4d3c9 100644 --- a/nixos/modules/services/hardware/fancontrol.nix +++ b/nixos/modules/services/hardware/fancontrol.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.fancontrol; configFile = pkgs.writeText "fancontrol.conf" cfg.config; @@ -9,10 +6,10 @@ let in { options.hardware.fancontrol = { - enable = mkEnableOption "software fan control (requires fancontrol.config)"; + enable = lib.mkEnableOption "software fan control (requires fancontrol.config)"; - config = mkOption { - type = types.lines; + config = lib.mkOption { + type = lib.types.lines; description = "Required fancontrol configuration file content. See {manpage}`pwmconfig(8)` from the lm_sensors package."; example = '' # Configuration file generated by pwmconfig @@ -29,7 +26,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.fancontrol = { documentation = [ "man:fancontrol(8)" ]; @@ -51,5 +48,5 @@ in }; - meta.maintainers = [ maintainers.evils ]; + meta.maintainers = [ lib.maintainers.evils ]; } From 6c707fe30f92e9df679de813ca3548d6ddcb05b3 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:17 +0200 Subject: [PATCH 151/197] nixos/services.freefall: remove `with lib;` --- nixos/modules/services/hardware/freefall.nix | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/nixos/modules/services/hardware/freefall.nix b/nixos/modules/services/hardware/freefall.nix index 4ac7c54d4d8a..fe017bb17f7e 100644 --- a/nixos/modules/services/hardware/freefall.nix +++ b/nixos/modules/services/hardware/freefall.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, utils, ... }: - -with lib; - let cfg = config.services.freefall; @@ -10,18 +7,18 @@ in { options.services.freefall = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to protect HP/Dell laptop hard drives (not SSDs) in free fall. ''; }; - package = mkPackageOption pkgs "freefall" { }; + package = lib.mkPackageOption pkgs "freefall" { }; - devices = mkOption { - type = types.listOf types.str; + devices = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ "/dev/sda" ]; description = '' Device paths to all internal spinning hard drives. @@ -35,7 +32,7 @@ in { mkService = dev: assert dev != ""; let dev' = utils.escapeSystemdPath dev; in - nameValuePair "freefall-${dev'}" { + lib.nameValuePair "freefall-${dev'}" { description = "Free-fall protection for ${dev}"; after = [ "${dev'}.device" ]; wantedBy = [ "${dev'}.device" ]; @@ -46,7 +43,7 @@ in { }; }; - in mkIf cfg.enable { + in lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; From 8ebc06069db9eb561e01a4107e32b47075b2be48 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:17 +0200 Subject: [PATCH 152/197] nixos/services.fwupd: remove `with lib;` --- nixos/modules/services/hardware/fwupd.nix | 70 +++++++++++------------ 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/nixos/modules/services/hardware/fwupd.nix b/nixos/modules/services/hardware/fwupd.nix index bdbd0ac2440b..09a55ad28052 100644 --- a/nixos/modules/services/hardware/fwupd.nix +++ b/nixos/modules/services/hardware/fwupd.nix @@ -1,15 +1,11 @@ # fwupd daemon. - { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.fwupd; format = pkgs.formats.ini { - listToValue = l: lib.concatStringsSep ";" (map (s: generators.mkValueStringDefault {} s) l); - mkKeyValue = generators.mkKeyValueDefault {} "="; + listToValue = l: lib.concatStringsSep ";" (map (s: lib.generators.mkValueStringDefault {} s) l); + mkKeyValue = lib.generators.mkKeyValueDefault {} "="; }; customEtc = { @@ -26,13 +22,13 @@ let originalEtc = let - mkEtcFile = n: nameValuePair n { source = "${cfg.package}/etc/${n}"; }; - in listToAttrs (map mkEtcFile cfg.package.filesInstalledToEtc); + mkEtcFile = n: lib.nameValuePair n { source = "${cfg.package}/etc/${n}"; }; + in lib.listToAttrs (map mkEtcFile cfg.package.filesInstalledToEtc); extraTrustedKeys = let mkName = p: "pki/fwupd/${baseNameOf (toString p)}"; - mkEtcFile = p: nameValuePair (mkName p) { source = p; }; - in listToAttrs (map mkEtcFile cfg.extraTrustedKeys); + mkEtcFile = p: lib.nameValuePair (mkName p) { source = p; }; + in lib.listToAttrs (map mkEtcFile cfg.extraTrustedKeys); enableRemote = base: remote: { "fwupd/remotes.d/${remote}.conf" = { @@ -42,7 +38,7 @@ let ''; }; }; - remotes = (foldl' + remotes = (lib.foldl' (configFiles: remote: configFiles // (enableRemote cfg.package remote)) {} cfg.extraRemotes @@ -61,8 +57,8 @@ in { ###### interface options = { services.fwupd = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable fwupd, a DBus service that allows @@ -70,17 +66,17 @@ in { ''; }; - extraTrustedKeys = mkOption { - type = types.listOf types.path; + extraTrustedKeys = lib.mkOption { + type = lib.types.listOf lib.types.path; default = []; - example = literalExpression "[ /etc/nixos/fwupd/myfirmware.pem ]"; + example = lib.literalExpression "[ /etc/nixos/fwupd/myfirmware.pem ]"; description = '' Installing a public key allows firmware signed with a matching private key to be recognized as trusted, which may require less authentication to install than for untrusted files. By default trusted firmware can be upgraded (but not downgraded) without the user or administrator password. Only very few keys are installed by default. ''; }; - extraRemotes = mkOption { - type = with types; listOf str; + extraRemotes = lib.mkOption { + type = with lib.types; listOf str; default = []; example = [ "lvfs-testing" ]; description = '' @@ -88,14 +84,14 @@ in { ''; }; - package = mkPackageOption pkgs "fwupd" { }; + package = lib.mkPackageOption pkgs "fwupd" { }; - daemonSettings = mkOption { - type = types.submodule { + daemonSettings = lib.mkOption { + type = lib.types.submodule { freeformType = format.type.nestedTypes.elemType; options = { - DisabledDevices = mkOption { - type = types.listOf types.str; + DisabledDevices = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; example = [ "2082b5e0-7a64-478a-b1b2-e3404fab6dad" ]; description = '' @@ -103,8 +99,8 @@ in { ''; }; - DisabledPlugins = mkOption { - type = types.listOf types.str; + DisabledPlugins = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; example = [ "udev" ]; description = '' @@ -112,8 +108,8 @@ in { ''; }; - EspLocation = mkOption { - type = types.path; + EspLocation = lib.mkOption { + type = lib.types.path; default = config.boot.loader.efi.efiSysMountPoint; defaultText = lib.literalExpression "config.boot.loader.efi.efiSysMountPoint"; description = '' @@ -122,9 +118,9 @@ in { ''; }; - TestDevices = mkOption { + TestDevices = lib.mkOption { internal = true; - type = types.bool; + type = lib.types.bool; default = false; description = '' Create virtual test devices and remote for validating daemon flows. @@ -139,8 +135,8 @@ in { ''; }; - uefiCapsuleSettings = mkOption { - type = types.submodule { + uefiCapsuleSettings = lib.mkOption { + type = lib.types.submodule { freeformType = format.type.nestedTypes.elemType; }; default = {}; @@ -152,15 +148,15 @@ in { }; imports = [ - (mkRenamedOptionModule [ "services" "fwupd" "blacklistDevices"] [ "services" "fwupd" "daemonSettings" "DisabledDevices" ]) - (mkRenamedOptionModule [ "services" "fwupd" "blacklistPlugins"] [ "services" "fwupd" "daemonSettings" "DisabledPlugins" ]) - (mkRenamedOptionModule [ "services" "fwupd" "disabledDevices" ] [ "services" "fwupd" "daemonSettings" "DisabledDevices" ]) - (mkRenamedOptionModule [ "services" "fwupd" "disabledPlugins" ] [ "services" "fwupd" "daemonSettings" "DisabledPlugins" ]) - (mkRemovedOptionModule [ "services" "fwupd" "enableTestRemote" ] "This option was removed after being removed upstream. It only provided a method for testing fwupd functionality, and should not have been exposed for use outside of nix tests.") + (lib.mkRenamedOptionModule [ "services" "fwupd" "blacklistDevices"] [ "services" "fwupd" "daemonSettings" "DisabledDevices" ]) + (lib.mkRenamedOptionModule [ "services" "fwupd" "blacklistPlugins"] [ "services" "fwupd" "daemonSettings" "DisabledPlugins" ]) + (lib.mkRenamedOptionModule [ "services" "fwupd" "disabledDevices" ] [ "services" "fwupd" "daemonSettings" "DisabledDevices" ]) + (lib.mkRenamedOptionModule [ "services" "fwupd" "disabledPlugins" ] [ "services" "fwupd" "daemonSettings" "DisabledPlugins" ]) + (lib.mkRemovedOptionModule [ "services" "fwupd" "enableTestRemote" ] "This option was removed after being removed upstream. It only provided a method for testing fwupd functionality, and should not have been exposed for use outside of nix tests.") ]; ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { # Disable test related plug-ins implicitly so that users do not have to care about them. services.fwupd.daemonSettings = { EspLocation = config.boot.loader.efi.efiSysMountPoint; From d3a4a69eda1d98f22c46eea4fd8f733edd09dc80 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:17 +0200 Subject: [PATCH 153/197] nixos/services.illum: remove `with lib;` --- nixos/modules/services/hardware/illum.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/hardware/illum.nix b/nixos/modules/services/hardware/illum.nix index 7f7a85000234..61ab24a5de7c 100644 --- a/nixos/modules/services/hardware/illum.nix +++ b/nixos/modules/services/hardware/illum.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.illum; in { @@ -10,9 +7,9 @@ in { services.illum = { - enable = mkOption { + enable = lib.mkOption { default = false; - type = types.bool; + type = lib.types.bool; description = '' Enable illum, a daemon for controlling screen brightness with brightness buttons. ''; @@ -22,7 +19,7 @@ in { }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.illum = { description = "Backlight Adjustment Service"; From 650db2b016b2ba50f9204c573d9774c25b9c30ae Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:18 +0200 Subject: [PATCH 154/197] nixos/services.interception-tools: remove `with lib;` --- .../services/hardware/interception-tools.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nixos/modules/services/hardware/interception-tools.nix b/nixos/modules/services/hardware/interception-tools.nix index e69c05841ee0..d60e7ca59547 100644 --- a/nixos/modules/services/hardware/interception-tools.nix +++ b/nixos/modules/services/hardware/interception-tools.nix @@ -1,29 +1,26 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.interception-tools; in { options.services.interception-tools = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = "Whether to enable the interception tools service."; }; - plugins = mkOption { - type = types.listOf types.package; + plugins = lib.mkOption { + type = lib.types.listOf lib.types.package; default = [ pkgs.interception-tools-plugins.caps2esc ]; - defaultText = literalExpression "[ pkgs.interception-tools-plugins.caps2esc ]"; + defaultText = lib.literalExpression "[ pkgs.interception-tools-plugins.caps2esc ]"; description = '' A list of interception tools plugins that will be made available to use inside the udevmon configuration. ''; }; - udevmonConfig = mkOption { - type = types.either types.str types.path; + udevmonConfig = lib.mkOption { + type = lib.types.either lib.types.str lib.types.path; default = '' - JOB: "intercept -g $DEVNODE | caps2esc | uinput -d $DEVNODE" DEVICE: @@ -43,7 +40,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.interception-tools = { description = "Interception tools"; path = [ pkgs.bash pkgs.interception-tools ] ++ cfg.plugins; From d71be6eda5e2a95d9ce93bbba8ee5f8c3c2b835e Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:18 +0200 Subject: [PATCH 155/197] nixos/services.irqbalance: remove `with lib;` --- nixos/modules/services/hardware/irqbalance.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/hardware/irqbalance.nix b/nixos/modules/services/hardware/irqbalance.nix index c79e0eb83ece..42878725cca3 100644 --- a/nixos/modules/services/hardware/irqbalance.nix +++ b/nixos/modules/services/hardware/irqbalance.nix @@ -1,17 +1,14 @@ # { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.irqbalance; in { - options.services.irqbalance.enable = mkEnableOption "irqbalance daemon"; + options.services.irqbalance.enable = lib.mkEnableOption "irqbalance daemon"; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.irqbalance ]; From f5c96d88c1d87fa801c831abde2113a1217af993 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:19 +0200 Subject: [PATCH 156/197] nixos/services.joycond: remove `with lib;` --- nixos/modules/services/hardware/joycond.nix | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/hardware/joycond.nix b/nixos/modules/services/hardware/joycond.nix index 106c19243c49..b6d2b8328af7 100644 --- a/nixos/modules/services/hardware/joycond.nix +++ b/nixos/modules/services/hardware/joycond.nix @@ -1,19 +1,15 @@ { config, lib, pkgs, ... }: - let cfg = config.services.joycond; in - -with lib; - { options.services.joycond = { - enable = mkEnableOption "support for Nintendo Pro Controllers and Joycons"; + enable = lib.mkEnableOption "support for Nintendo Pro Controllers and Joycons"; - package = mkPackageOption pkgs "joycond" { }; + package = lib.mkPackageOption pkgs "joycond" { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; services.udev.packages = [ cfg.package ]; From 3b7622d31b50e332a54955d2ef10621ce39ec0e9 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:19 +0200 Subject: [PATCH 157/197] nixos/services.kanata: remove `with lib;` --- nixos/modules/services/hardware/kanata.nix | 69 +++++++++++----------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/nixos/modules/services/hardware/kanata.nix b/nixos/modules/services/hardware/kanata.nix index 60fb33881f25..67bcac6fe443 100644 --- a/nixos/modules/services/hardware/kanata.nix +++ b/nixos/modules/services/hardware/kanata.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, utils, ... }: - -with lib; - let cfg = config.services.kanata; @@ -9,8 +6,8 @@ let keyboard = { name, config, ... }: { options = { - devices = mkOption { - type = types.listOf types.str; + devices = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ ]; example = [ "/dev/input/by-id/usb-0000_0000-event-kbd" ]; description = '' @@ -20,8 +17,8 @@ let input devices are keyboards and intercept them all. ''; }; - config = mkOption { - type = types.lines; + config = lib.mkOption { + type = lib.types.lines; example = '' (defsrc caps) @@ -36,8 +33,8 @@ let ${upstreamDoc} ''; }; - extraDefCfg = mkOption { - type = types.lines; + extraDefCfg = lib.mkOption { + type = lib.types.lines; default = ""; example = "danger-enable-cmd yes"; description = '' @@ -48,8 +45,8 @@ let ${upstreamDoc} ''; }; - configFile = mkOption { - type = types.path; + configFile = lib.mkOption { + type = lib.types.path; default = mkConfig name config; defaultText = "A config file generated by values from other kanata module options."; @@ -63,13 +60,13 @@ let overrides all other kanata module options. ${upstreamDoc} ''; }; - extraArgs = mkOption { - type = types.listOf types.str; + extraArgs = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ ]; description = "Extra command line arguments passed to kanata."; }; - port = mkOption { - type = types.nullOr types.port; + port = lib.mkOption { + type = lib.types.nullOr lib.types.port; default = null; example = 6666; description = '' @@ -83,12 +80,12 @@ let mkDevices = devices: let - devicesString = pipe devices [ + devicesString = lib.pipe devices [ (map (device: "\"" + device + "\"")) - (concatStringsSep " ") + (lib.concatStringsSep " ") ]; in - optionalString ((length devices) > 0) "linux-dev (${devicesString})"; + lib.optionalString ((lib.length devices) > 0) "linux-dev (${devicesString})"; mkConfig = name: keyboard: pkgs.writeTextFile { name = "${mkName name}-config.kdb"; @@ -105,20 +102,20 @@ let # at build time. I think this is a good balance between module # complexity and functionality. checkPhase = '' - ${getExe cfg.package} --cfg "$target" --check --debug + ${lib.getExe cfg.package} --cfg "$target" --check --debug ''; }; - mkService = name: keyboard: nameValuePair (mkName name) { + mkService = name: keyboard: lib.nameValuePair (mkName name) { wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "notify"; ExecStart = '' - ${getExe cfg.package} \ + ${lib.getExe cfg.package} \ --cfg ${keyboard.configFile} \ --symlink-path ''${RUNTIME_DIRECTORY}/${name} \ - ${optionalString (keyboard.port != null) "--port ${toString keyboard.port}"} \ - ${utils.escapeSystemdExecArgs keyboard.extraArgs} + ${lib.optionalString (keyboard.port != null) "--port ${toString keyboard.port}"} \ + ${utils.lib.escapeSystemdExecArgs keyboard.extraArgs} ''; DynamicUser = true; @@ -135,7 +132,7 @@ let ]; CapabilityBoundingSet = [ "" ]; DevicePolicy = "closed"; - IPAddressAllow = optional (keyboard.port != null) "localhost"; + IPAddressAllow = lib.optional (keyboard.port != null) "localhost"; IPAddressDeny = [ "any" ]; LockPersonality = true; MemoryDenyWriteExecute = true; @@ -150,7 +147,7 @@ let ProtectKernelModules = true; ProtectKernelTunables = true; ProtectProc = "invisible"; - RestrictAddressFamilies = [ "AF_UNIX" ] ++ optional (keyboard.port != null) "AF_INET"; + RestrictAddressFamilies = [ "AF_UNIX" ] ++ lib.optional (keyboard.port != null) "AF_INET"; RestrictNamespaces = true; RestrictRealtime = true; SystemCallArchitectures = [ "native" ]; @@ -165,8 +162,8 @@ let in { options.services.kanata = { - enable = mkEnableOption "kanata, a tool to improve keyboard comfort and usability with advanced customization"; - package = mkPackageOption pkgs "kanata" { + enable = lib.mkEnableOption "kanata, a tool to improve keyboard comfort and usability with advanced customization"; + package = lib.mkPackageOption pkgs "kanata" { example = [ "kanata-with-cmd" ]; extraDescription = '' ::: {.note} @@ -175,26 +172,26 @@ in ::: ''; }; - keyboards = mkOption { - type = types.attrsOf (types.submodule keyboard); + keyboards = lib.mkOption { + type = lib.types.attrsOf (lib.types.submodule keyboard); default = { }; description = "Keyboard configurations."; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { warnings = let - keyboardsWithEmptyDevices = filterAttrs (name: keyboard: keyboard.devices == [ ]) cfg.keyboards; - existEmptyDevices = length (attrNames keyboardsWithEmptyDevices) > 0; - moreThanOneKeyboard = length (attrNames cfg.keyboards) > 1; + keyboardsWithEmptyDevices = lib.filterAttrs (name: keyboard: keyboard.devices == [ ]) cfg.keyboards; + existEmptyDevices = lib.length (lib.attrNames keyboardsWithEmptyDevices) > 0; + moreThanOneKeyboard = lib.length (lib.attrNames cfg.keyboards) > 1; in - optional (existEmptyDevices && moreThanOneKeyboard) "One device can only be intercepted by one kanata instance. Setting services.kanata.keyboards.${head (attrNames keyboardsWithEmptyDevices)}.devices = [ ] and using more than one services.kanata.keyboards may cause a race condition."; + lib.optional (existEmptyDevices && moreThanOneKeyboard) "One device can only be intercepted by one kanata instance. Setting services.kanata.keyboards.${lib.head (lib.attrNames keyboardsWithEmptyDevices)}.devices = [ ] and using more than one services.kanata.keyboards may cause a race condition."; hardware.uinput.enable = true; - systemd.services = mapAttrs' mkService cfg.keyboards; + systemd.services = lib.mapAttrs' mkService cfg.keyboards; }; - meta.maintainers = with maintainers; [ linj ]; + meta.maintainers = with lib.maintainers; [ linj ]; } From 827d9dfac960289d59af147c6aca85009cb1e65f Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:20 +0200 Subject: [PATCH 158/197] nixos/services.keyd: remove `with lib;` --- nixos/modules/services/hardware/keyd.nix | 35 ++++++++++++------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/nixos/modules/services/hardware/keyd.nix b/nixos/modules/services/hardware/keyd.nix index 2aee7817c6f3..92b62fe2e977 100644 --- a/nixos/modules/services/hardware/keyd.nix +++ b/nixos/modules/services/hardware/keyd.nix @@ -1,12 +1,11 @@ { config, lib, pkgs, ... }: -with lib; let cfg = config.services.keyd; keyboardOptions = { ... }: { options = { - ids = mkOption { - type = types.listOf types.str; + ids = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ "*" ]; example = [ "*" "-0123:0456" ]; description = '' @@ -14,7 +13,7 @@ let ''; }; - settings = mkOption { + settings = lib.mkOption { type = (pkgs.formats.ini { }).type; default = { }; example = { @@ -37,8 +36,8 @@ let ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; example = '' [control+shift] @@ -55,19 +54,19 @@ let in { imports = [ - (mkRemovedOptionModule [ "services" "keyd" "ids" ] + (lib.mkRemovedOptionModule [ "services" "keyd" "ids" ] ''Use keyboards..ids instead. If you don't need a multi-file configuration, just add keyboards.default before the ids. See https://github.com/NixOS/nixpkgs/pull/243271.'') - (mkRemovedOptionModule [ "services" "keyd" "settings" ] + (lib.mkRemovedOptionModule [ "services" "keyd" "settings" ] ''Use keyboards..settings instead. If you don't need a multi-file configuration, just add keyboards.default before the settings. See https://github.com/NixOS/nixpkgs/pull/243271.'') ]; options.services.keyd = { - enable = mkEnableOption "keyd, a key remapping daemon"; + enable = lib.mkEnableOption "keyd, a key remapping daemon"; - keyboards = mkOption { - type = types.attrsOf (types.submodule keyboardOptions); + keyboards = lib.mkOption { + type = lib.types.attrsOf (lib.types.submodule keyboardOptions); default = { }; - example = literalExpression '' + example = lib.literalExpression '' { default = { ids = [ "*" ]; @@ -93,16 +92,16 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { # Creates separate files in the `/etc/keyd/` directory for each key in the dictionary - environment.etc = mapAttrs' + environment.etc = lib.mapAttrs' (name: options: - nameValuePair "keyd/${name}.conf" { + lib.nameValuePair "keyd/${name}.conf" { text = '' [ids] - ${concatStringsSep "\n" options.ids} + ${lib.concatStringsSep "\n" options.ids} - ${generators.toINI {} options.settings} + ${lib.generators.toINI {} options.settings} ${options.extraConfig} ''; }) @@ -116,7 +115,7 @@ in wantedBy = [ "multi-user.target" ]; - restartTriggers = mapAttrsToList + restartTriggers = lib.mapAttrsToList (name: options: config.environment.etc."keyd/${name}.conf".source ) From 78b24bea0f41ccacc66aea0230b803172e02c70a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:20 +0200 Subject: [PATCH 159/197] nixos/services.lirc: remove `with lib;` --- nixos/modules/services/hardware/lirc.nix | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/nixos/modules/services/hardware/lirc.nix b/nixos/modules/services/hardware/lirc.nix index 8103dbeb2d48..9942b9a97513 100644 --- a/nixos/modules/services/hardware/lirc.nix +++ b/nixos/modules/services/hardware/lirc.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.lirc; in { @@ -11,10 +8,10 @@ in { options = { services.lirc = { - enable = mkEnableOption "the LIRC daemon, to receive and send infrared signals"; + enable = lib.mkEnableOption "the LIRC daemon, to receive and send infrared signals"; - options = mkOption { - type = types.lines; + options = lib.mkOption { + type = lib.types.lines; example = '' [lircd] nodaemon = False @@ -22,13 +19,13 @@ in { description = "LIRC default options described in man:lircd(8) ({file}`lirc_options.conf`)"; }; - configs = mkOption { - type = types.listOf types.lines; + configs = lib.mkOption { + type = lib.types.listOf lib.types.lines; description = "Configurations for lircd to load, see man:lircd.conf(5) for details ({file}`lircd.conf`)"; }; - extraArguments = mkOption { - type = types.listOf types.str; + extraArguments = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; description = "Extra arguments to lircd."; }; @@ -37,7 +34,7 @@ in { ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { # Note: LIRC executables raises a warning, if lirc_options.conf do not exists environment.etc."lirc/lirc_options.conf".text = cfg.options; @@ -82,7 +79,7 @@ in { ExecStart = '' ${pkgs.lirc}/bin/lircd --nodaemon \ - ${escapeShellArgs cfg.extraArguments} \ + ${lib.escapeShellArgs cfg.extraArguments} \ ${configFile} ''; User = "lirc"; From b2d74343f12cdc0194e71cb05f14fc84ec3d3a70 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:21 +0200 Subject: [PATCH 160/197] nixos/services.openrgb: remove `with lib;` --- nixos/modules/services/hardware/openrgb.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nixos/modules/services/hardware/openrgb.nix b/nixos/modules/services/hardware/openrgb.nix index 4dc521aa9780..0e06f9720ac1 100644 --- a/nixos/modules/services/hardware/openrgb.nix +++ b/nixos/modules/services/hardware/openrgb.nix @@ -1,21 +1,18 @@ { pkgs, lib, config, ... }: - -with lib; - let cfg = config.services.hardware.openrgb; in { options.services.hardware.openrgb = { - enable = mkEnableOption "OpenRGB server, for RGB lighting control"; + enable = lib.mkEnableOption "OpenRGB server, for RGB lighting control"; - package = mkPackageOption pkgs "openrgb" { }; + package = lib.mkPackageOption pkgs "openrgb" { }; - motherboard = mkOption { - type = types.nullOr (types.enum [ "amd" "intel" ]); + motherboard = lib.mkOption { + type = lib.types.nullOr (lib.types.enum [ "amd" "intel" ]); default = if config.hardware.cpu.intel.updateMicrocode then "intel" else if config.hardware.cpu.amd.updateMicrocode then "amd" else null; - defaultText = literalMD '' + defaultText = lib.literalMD '' if config.hardware.cpu.intel.updateMicrocode then "intel" else if config.hardware.cpu.amd.updateMicrocode then "amd" else null; @@ -23,15 +20,15 @@ in { description = "CPU family of motherboard. Allows for addition motherboard i2c support."; }; - server.port = mkOption { - type = types.port; + server.port = lib.mkOption { + type = lib.types.port; default = 6742; description = "Set server port of openrgb."; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; services.udev.packages = [ cfg.package ]; From 2f256fd905823fb16ea844c2c031154124965423 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:21 +0200 Subject: [PATCH 161/197] nixos/services.pcscd: remove `with lib;` --- nixos/modules/services/hardware/pcscd.nix | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/nixos/modules/services/hardware/pcscd.nix b/nixos/modules/services/hardware/pcscd.nix index 17bab2c5bf20..df98c1fd208d 100644 --- a/nixos/modules/services/hardware/pcscd.nix +++ b/nixos/modules/services/hardware/pcscd.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.pcscd; cfgFile = pkgs.writeText "reader.conf" config.services.pcscd.readerConfig; @@ -18,17 +15,17 @@ let in { options.services.pcscd = { - enable = mkEnableOption "PCSC-Lite daemon, to access smart cards using SCard API (PC/SC)"; + enable = lib.mkEnableOption "PCSC-Lite daemon, to access smart cards using SCard API (PC/SC)"; - plugins = mkOption { - type = types.listOf types.package; - defaultText = literalExpression "[ pkgs.ccid ]"; - example = literalExpression "[ pkgs.pcsc-cyberjack ]"; + plugins = lib.mkOption { + type = lib.types.listOf lib.types.package; + defaultText = lib.literalExpression "[ pkgs.ccid ]"; + example = lib.literalExpression "[ pkgs.pcsc-cyberjack ]"; description = "Plugin packages to be used for PCSC-Lite."; }; - readerConfig = mkOption { - type = types.lines; + readerConfig = lib.mkOption { + type = lib.types.lines; default = ""; example = '' FRIENDLYNAME "Some serial reader" @@ -43,14 +40,14 @@ in ''; }; - extraArgs = mkOption { - type = types.listOf types.str; + extraArgs = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ ]; description = "Extra command line arguments to be passed to the PCSC daemon."; }; }; - config = mkIf config.services.pcscd.enable { + config = lib.mkIf config.services.pcscd.enable { environment.etc."reader.conf".source = cfgFile; environment.systemPackages = [ package ]; From 08ec49ef4174a6266dd2222eec76beefe205260f Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:21 +0200 Subject: [PATCH 162/197] nixos/services.pommed: remove `with lib;` --- nixos/modules/services/hardware/pommed.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/hardware/pommed.nix b/nixos/modules/services/hardware/pommed.nix index 9cdb2d4d1af8..c5efb76d6eec 100644 --- a/nixos/modules/services/hardware/pommed.nix +++ b/nixos/modules/services/hardware/pommed.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.hardware.pommed; defaultConf = "${pkgs.pommed_light}/etc/pommed.conf.mactel"; in { @@ -10,8 +7,8 @@ in { services.hardware.pommed = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to use the pommed tool to handle Apple laptop @@ -19,8 +16,8 @@ in { ''; }; - configFile = mkOption { - type = types.nullOr types.path; + configFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' The path to the {file}`pommed.conf` file. Leave @@ -35,7 +32,7 @@ in { }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.polkit pkgs.pommed_light ]; environment.etc."pommed.conf".source = From 439cb745b0d8eb3f881c77c7d8bccecba3782a75 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:22 +0200 Subject: [PATCH 163/197] nixos/hardware.rasdaemon: remove `with lib;` --- nixos/modules/services/hardware/rasdaemon.nix | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/nixos/modules/services/hardware/rasdaemon.nix b/nixos/modules/services/hardware/rasdaemon.nix index 3fe75984b3fb..ac3c675a7fbe 100644 --- a/nixos/modules/services/hardware/rasdaemon.nix +++ b/nixos/modules/services/hardware/rasdaemon.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.rasdaemon; @@ -10,16 +7,16 @@ in { options.hardware.rasdaemon = { - enable = mkEnableOption "RAS logging daemon"; + enable = lib.mkEnableOption "RAS logging daemon"; - record = mkOption { - type = types.bool; + record = lib.mkOption { + type = lib.types.bool; default = true; description = "record events via sqlite3, required for ras-mc-ctl"; }; - mainboard = mkOption { - type = types.lines; + mainboard = lib.mkOption { + type = lib.types.lines; default = ""; description = "Custom mainboard description, see {manpage}`ras-mc-ctl(8)` for more details."; example = '' @@ -37,8 +34,8 @@ in # TODO, accept `rasdaemon.labels = " ";` or `rasdaemon.labels = { dell = " "; asrock = " "; };' - labels = mkOption { - type = types.lines; + labels = lib.mkOption { + type = lib.types.lines; default = ""; description = "Additional memory module label descriptions to be placed in /etc/ras/dimm_labels.d/labels"; example = '' @@ -54,8 +51,8 @@ in ''; }; - config = mkOption { - type = types.lines; + config = lib.mkOption { + type = lib.types.lines; default = ""; description = '' rasdaemon configuration, currently only used for CE PFA @@ -69,17 +66,17 @@ in ''; }; - extraModules = mkOption { - type = types.listOf types.str; + extraModules = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; description = "extra kernel modules to load"; example = [ "i7core_edac" ]; }; - testing = mkEnableOption "error injection infrastructure"; + testing = lib.mkEnableOption "error injection infrastructure"; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.etc = { "ras/mainboard" = { @@ -97,14 +94,14 @@ in }; }; environment.systemPackages = [ pkgs.rasdaemon ] - ++ optionals (cfg.testing) (with pkgs.error-inject; [ + ++ lib.optionals (cfg.testing) (with pkgs.error-inject; [ edac-inject mce-inject aer-inject ]); boot.initrd.kernelModules = cfg.extraModules - ++ optionals (cfg.testing) [ + ++ lib.optionals (cfg.testing) [ # edac_core and amd64_edac should get loaded automatically # i7core_edac may not be, and may not be required, but should load successfully "edac_core" @@ -114,7 +111,7 @@ in "aer-inject" ]; - boot.kernelPatches = optionals (cfg.testing) [{ + boot.kernelPatches = lib.optionals (cfg.testing) [{ name = "rasdaemon-tests"; patch = null; extraConfig = '' @@ -139,10 +136,10 @@ in wantedBy = [ "multi-user.target" ]; serviceConfig = { - StateDirectory = optionalString (cfg.record) "rasdaemon"; + StateDirectory = lib.optionalString (cfg.record) "rasdaemon"; ExecStart = "${pkgs.rasdaemon}/bin/rasdaemon --foreground" - + optionalString (cfg.record) " --record"; + + lib.optionalString (cfg.record) " --record"; ExecStop = "${pkgs.rasdaemon}/bin/rasdaemon --disable"; Restart = "on-abort"; @@ -152,7 +149,7 @@ in # and everything seems to be enabled without this... }; }; - ras-mc-ctl = mkIf (cfg.labels != "") { + ras-mc-ctl = lib.mkIf (cfg.labels != "") { description = "register DIMM labels on startup"; documentation = [ "man:ras-mc-ctl(8)" ]; wantedBy = [ "multi-user.target" ]; @@ -165,6 +162,6 @@ in }; }; - meta.maintainers = [ maintainers.evils ]; + meta.maintainers = [ lib.maintainers.evils ]; } From e2a4b6715f4ca2dfffe9b393f021215504dc236e Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:22 +0200 Subject: [PATCH 164/197] nixos/services.ratbagd: remove `with lib;` --- nixos/modules/services/hardware/ratbagd.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/hardware/ratbagd.nix b/nixos/modules/services/hardware/ratbagd.nix index 4398e8d582ea..c7a6e9093b47 100644 --- a/nixos/modules/services/hardware/ratbagd.nix +++ b/nixos/modules/services/hardware/ratbagd.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.ratbagd; in @@ -10,15 +7,15 @@ in options = { services.ratbagd = { - enable = mkEnableOption "ratbagd for configuring gaming mice"; + enable = lib.mkEnableOption "ratbagd for configuring gaming mice"; - package = mkPackageOption pkgs "libratbag" { }; + package = lib.mkPackageOption pkgs "libratbag" { }; }; }; ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { # Give users access to the "ratbagctl" tool environment.systemPackages = [ cfg.package ]; From 131116e4f04b4d7649df700768537bb8af942fa6 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:22 +0200 Subject: [PATCH 165/197] nixos/services.saned: remove `with lib;` --- nixos/modules/services/hardware/sane.nix | 69 ++++++++++++------------ 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/nixos/modules/services/hardware/sane.nix b/nixos/modules/services/hardware/sane.nix index b6b36b6b60f4..98207ada78c3 100644 --- a/nixos/modules/services/hardware/sane.nix +++ b/nixos/modules/services/hardware/sane.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let pkg = config.hardware.sane.backends-package.override { @@ -32,7 +29,7 @@ let LD_LIBRARY_PATH = [ "/etc/sane-libs" ]; }; - backends = [ pkg netConf ] ++ optional config.services.saned.enable sanedConf ++ config.hardware.sane.extraBackends; + backends = [ pkg netConf ] ++ lib.optional config.services.saned.enable sanedConf ++ config.hardware.sane.extraBackends; saneConfig = pkgs.mkSaneConfig { paths = backends; inherit (config.hardware.sane) disabledDefaultBackends; }; enabled = config.hardware.sane.enable || config.services.saned.enable; @@ -45,8 +42,8 @@ in options = { - hardware.sane.enable = mkOption { - type = types.bool; + hardware.sane.enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Enable support for SANE scanners. @@ -57,21 +54,21 @@ in ''; }; - hardware.sane.backends-package = mkOption { - type = types.package; + hardware.sane.backends-package = lib.mkOption { + type = lib.types.package; default = pkgs.sane-backends; - defaultText = literalExpression "pkgs.sane-backends"; + defaultText = lib.literalExpression "pkgs.sane-backends"; description = "Backends driver package to use."; }; - hardware.sane.snapshot = mkOption { - type = types.bool; + hardware.sane.snapshot = lib.mkOption { + type = lib.types.bool; default = false; description = "Use a development snapshot of SANE scanner drivers."; }; - hardware.sane.extraBackends = mkOption { - type = types.listOf types.path; + hardware.sane.extraBackends = lib.mkOption { + type = lib.types.listOf lib.types.path; default = []; description = '' Packages providing extra SANE backends to enable. @@ -82,11 +79,11 @@ in vendors/devices). ::: ''; - example = literalExpression "[ pkgs.hplipWithPlugin pkgs.sane-airscan ]"; + example = lib.literalExpression "[ pkgs.hplipWithPlugin pkgs.sane-airscan ]"; }; - hardware.sane.disabledDefaultBackends = mkOption { - type = types.listOf types.str; + hardware.sane.disabledDefaultBackends = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; example = [ "v4l" ]; description = '' @@ -95,14 +92,14 @@ in ''; }; - hardware.sane.configDir = mkOption { - type = types.str; + hardware.sane.configDir = lib.mkOption { + type = lib.types.str; internal = true; description = "The value of SANE_CONFIG_DIR."; }; - hardware.sane.netConf = mkOption { - type = types.lines; + hardware.sane.netConf = lib.mkOption { + type = lib.types.lines; default = ""; example = "192.168.0.16"; description = '' @@ -110,8 +107,8 @@ in ''; }; - hardware.sane.drivers.scanSnap.enable = mkOption { - type = types.bool; + hardware.sane.drivers.scanSnap.enable = lib.mkOption { + type = lib.types.bool; default = false; example = true; description = '' @@ -121,7 +118,7 @@ in ''; }; - hardware.sane.drivers.scanSnap.package = mkPackageOption pkgs [ "sane-drivers" "epjitsu" ] { + hardware.sane.drivers.scanSnap.package = lib.mkPackageOption pkgs [ "sane-drivers" "epjitsu" ] { extraDescription = '' Useful if you want to extract the driver files yourself. @@ -130,8 +127,8 @@ in ''; }; - hardware.sane.openFirewall = mkOption { - type = types.bool; + hardware.sane.openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = '' Open ports needed for discovery of scanners on the local network, e.g. @@ -139,8 +136,8 @@ in ''; }; - services.saned.enable = mkOption { - type = types.bool; + services.saned.enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Enable saned network daemon for remote connection to scanners. @@ -151,8 +148,8 @@ in ''; }; - services.saned.extraConfig = mkOption { - type = types.lines; + services.saned.extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; example = "192.168.0.0/24"; description = '' @@ -165,9 +162,9 @@ in ###### implementation - config = mkMerge [ - (mkIf enabled { - hardware.sane.configDir = mkDefault "${saneConfig}/etc/sane.d"; + config = lib.mkMerge [ + (lib.mkIf enabled { + hardware.sane.configDir = lib.mkDefault "${saneConfig}/etc/sane.d"; environment.systemPackages = backends; environment.sessionVariables = env; @@ -176,19 +173,19 @@ in services.udev.packages = backends; users.groups.scanner.gid = config.ids.gids.scanner; - networking.firewall.allowedUDPPorts = mkIf config.hardware.sane.openFirewall [ 8612 ]; + networking.firewall.allowedUDPPorts = lib.mkIf config.hardware.sane.openFirewall [ 8612 ]; systemd.tmpfiles.rules = [ "d /var/lock/sane 0770 root scanner - -" ]; }) - (mkIf config.services.saned.enable { + (lib.mkIf config.services.saned.enable { networking.firewall.connectionTrackingModules = [ "sane" ]; systemd.services."saned@" = { description = "Scanner Service"; - environment = mapAttrs (name: val: toString val) env; + environment = lib.mapAttrs (name: val: toString val) env; serviceConfig = { User = "scanner"; Group = "scanner"; @@ -211,7 +208,7 @@ in users.users.scanner = { uid = config.ids.uids.scanner; group = "scanner"; - extraGroups = [ "lp" ] ++ optionals config.services.avahi.enable [ "avahi" ]; + extraGroups = [ "lp" ] ++ lib.optionals config.services.avahi.enable [ "avahi" ]; }; }) ]; From d59ce5878ba5164f42bff7159aef50bb652b727f Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:23 +0200 Subject: [PATCH 166/197] nixos/hardware.spacenavd: remove `with lib;` --- nixos/modules/services/hardware/spacenavd.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/hardware/spacenavd.nix b/nixos/modules/services/hardware/spacenavd.nix index 69ca6f102efe..c09439356998 100644 --- a/nixos/modules/services/hardware/spacenavd.nix +++ b/nixos/modules/services/hardware/spacenavd.nix @@ -1,18 +1,15 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.spacenavd; in { options = { hardware.spacenavd = { - enable = mkEnableOption "spacenavd to support 3DConnexion devices"; + enable = lib.mkEnableOption "spacenavd to support 3DConnexion devices"; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.user.services.spacenavd = { description = "Daemon for the Spacenavigator 6DOF mice by 3Dconnexion"; wantedBy = [ "graphical.target" ]; From b80de00ac610295a6a0cace49f50d015bbf97395 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:23 +0200 Subject: [PATCH 167/197] nixos/services.tcsd: remove `with lib;` --- nixos/modules/services/hardware/tcsd.nix | 51 +++++++++++------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/nixos/modules/services/hardware/tcsd.nix b/nixos/modules/services/hardware/tcsd.nix index e414b9647c9b..24bb20b0146d 100644 --- a/nixos/modules/services/hardware/tcsd.nix +++ b/nixos/modules/services/hardware/tcsd.nix @@ -1,8 +1,5 @@ # tcsd daemon. - { config, options, pkgs, lib, ... }: - -with lib; let cfg = config.services.tcsd; @@ -37,9 +34,9 @@ in services.tcsd = { - enable = mkOption { + enable = lib.mkOption { default = false; - type = types.bool; + type = lib.types.bool; description = '' Whether to enable tcsd, a Trusted Computing management service that provides TCG Software Stack (TSS). The tcsd daemon is @@ -48,21 +45,21 @@ in ''; }; - user = mkOption { + user = lib.mkOption { default = "tss"; - type = types.str; + type = lib.types.str; description = "User account under which tcsd runs."; }; - group = mkOption { + group = lib.mkOption { default = "tss"; - type = types.str; + type = lib.types.str; description = "Group account under which tcsd runs."; }; - stateDir = mkOption { + stateDir = lib.mkOption { default = "/var/lib/tpm"; - type = types.path; + type = lib.types.path; description = '' The location of the system persistent storage file. The system persistent storage file holds keys and data across @@ -70,22 +67,22 @@ in ''; }; - firmwarePCRs = mkOption { + firmwarePCRs = lib.mkOption { default = "0,1,2,3,4,5,6,7"; - type = types.str; + type = lib.types.str; description = "PCR indices used in the TPM for firmware measurements."; }; - kernelPCRs = mkOption { + kernelPCRs = lib.mkOption { default = "8,9,10,11,12"; - type = types.str; + type = lib.types.str; description = "PCR indices used in the TPM for kernel measurements."; }; - platformCred = mkOption { + platformCred = lib.mkOption { default = "${cfg.stateDir}/platform.cert"; - defaultText = literalExpression ''"''${config.${opt.stateDir}}/platform.cert"''; - type = types.path; + defaultText = lib.literalExpression ''"''${config.${opt.stateDir}}/platform.cert"''; + type = lib.types.path; description = '' Path to the platform credential for your TPM. Your TPM manufacturer may have provided you with a set of credentials @@ -96,19 +93,19 @@ in on this process. ''; }; - conformanceCred = mkOption { + conformanceCred = lib.mkOption { default = "${cfg.stateDir}/conformance.cert"; - defaultText = literalExpression ''"''${config.${opt.stateDir}}/conformance.cert"''; - type = types.path; + defaultText = lib.literalExpression ''"''${config.${opt.stateDir}}/conformance.cert"''; + type = lib.types.path; description = '' Path to the conformance credential for your TPM. See also the platformCred option''; }; - endorsementCred = mkOption { + endorsementCred = lib.mkOption { default = "${cfg.stateDir}/endorsement.cert"; - defaultText = literalExpression ''"''${config.${opt.stateDir}}/endorsement.cert"''; - type = types.path; + defaultText = lib.literalExpression ''"''${config.${opt.stateDir}}/endorsement.cert"''; + type = lib.types.path; description = '' Path to the endorsement credential for your TPM. See also the platformCred option''; @@ -119,7 +116,7 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.trousers ]; @@ -150,13 +147,13 @@ in }; }; - users.users = optionalAttrs (cfg.user == "tss") { + users.users = lib.optionalAttrs (cfg.user == "tss") { tss = { group = "tss"; isSystemUser = true; }; }; - users.groups = optionalAttrs (cfg.group == "tss") { tss = {}; }; + users.groups = lib.optionalAttrs (cfg.group == "tss") { tss = {}; }; }; } From f4fdd33746e458a6e119085bf26bec17c74a2c82 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:23 +0200 Subject: [PATCH 168/197] nixos/services.thermald: remove `with lib;` --- nixos/modules/services/hardware/thermald.nix | 25 +++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/nixos/modules/services/hardware/thermald.nix b/nixos/modules/services/hardware/thermald.nix index fb7cf3735a7e..d7f706f1ef05 100644 --- a/nixos/modules/services/hardware/thermald.nix +++ b/nixos/modules/services/hardware/thermald.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.thermald; in @@ -9,24 +6,24 @@ in ###### interface options = { services.thermald = { - enable = mkEnableOption "thermald, the temperature management daemon"; + enable = lib.mkEnableOption "thermald, the temperature management daemon"; - debug = mkOption { - type = types.bool; + debug = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable debug logging. ''; }; - ignoreCpuidCheck = mkOption { - type = types.bool; + ignoreCpuidCheck = lib.mkOption { + type = lib.types.bool; default = false; description = "Whether to ignore the cpuid check to allow running on unsupported platforms"; }; - configFile = mkOption { - type = types.nullOr types.path; + configFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; default = null; description = '' The thermald manual configuration file. @@ -37,12 +34,12 @@ in ''; }; - package = mkPackageOption pkgs "thermald" { }; + package = lib.mkPackageOption pkgs "thermald" { }; }; }; ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { services.dbus.packages = [ cfg.package ]; systemd.services.thermald = { @@ -53,8 +50,8 @@ in ExecStart = '' ${cfg.package}/sbin/thermald \ --no-daemon \ - ${optionalString cfg.debug "--loglevel=debug"} \ - ${optionalString cfg.ignoreCpuidCheck "--ignore-cpuid-check"} \ + ${lib.optionalString cfg.debug "--loglevel=debug"} \ + ${lib.optionalString cfg.ignoreCpuidCheck "--ignore-cpuid-check"} \ ${if cfg.configFile != null then "--config-file ${cfg.configFile}" else "--adaptive"} \ --dbus-enable ''; From d9dc50dc1193ad14f8534611f7280fac4a3543d0 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:24 +0200 Subject: [PATCH 169/197] nixos/services.thinkfan: remove `with lib;` --- nixos/modules/services/hardware/thinkfan.nix | 69 ++++++++++---------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/nixos/modules/services/hardware/thinkfan.nix b/nixos/modules/services/hardware/thinkfan.nix index 37c9fef03d78..9dd4c5434211 100644 --- a/nixos/modules/services/hardware/thinkfan.nix +++ b/nixos/modules/services/hardware/thinkfan.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.thinkfan; @@ -10,13 +7,13 @@ let thinkfan = pkgs.thinkfan.override { inherit (cfg) smartSupport; }; # fan-speed and temperature levels - levelType = with types; + levelType = with lib.types; let - tuple = ts: mkOptionType { + tuple = ts: lib.mkOptionType { name = "tuple"; - merge = mergeOneOption; + merge = lib.mergeOneOption; check = xs: all id (zipListsWith (t: x: t.check x) ts xs); - description = "tuple of" + concatMapStrings (t: " (${t.description})") ts; + description = "tuple of" + lib.concatMapStrings (t: " (${t.description})") ts; }; level = ints.unsigned; special = enum [ "level auto" "level full-speed" "level disengaged" ]; @@ -24,11 +21,11 @@ let tuple [ (either level special) level level ]; # sensor or fan config - sensorType = name: types.submodule { - freeformType = types.attrsOf settingsFormat.type; + sensorType = name: lib.types.submodule { + freeformType = lib.types.attrsOf settingsFormat.type; options = { - type = mkOption { - type = types.enum [ "hwmon" "atasmart" "tpacpi" "nvml" ]; + type = lib.mkOption { + type = lib.types.enum [ "hwmon" "atasmart" "tpacpi" "nvml" ]; description = '' The ${name} type, can be `hwmon` for standard ${name}s, @@ -41,8 +38,8 @@ let `nvml` for the (proprietary) nVidia driver. ''; }; - query = mkOption { - type = types.str; + query = lib.mkOption { + type = lib.types.str; description = '' The query string used to match one or more ${name}s: can be a fullpath to the temperature file (single ${name}) or a fullpath @@ -54,8 +51,8 @@ let ::: ''; }; - indices = mkOption { - type = with types; nullOr (listOf ints.unsigned); + indices = lib.mkOption { + type = with lib.types; nullOr (listOf ints.unsigned); default = null; description = '' A list of ${name}s to pick in case multiple ${name}s match the query. @@ -65,9 +62,9 @@ let ::: ''; }; - } // optionalAttrs (name == "sensor") { - correction = mkOption { - type = with types; nullOr (listOf int); + } // lib.optionalAttrs (name == "sensor") { + correction = lib.mkOption { + type = with lib.types; nullOr (listOf int); default = null; description = '' A list of values to be added to the temperature of each sensor, @@ -79,7 +76,7 @@ let # removes NixOS special and unused attributes sensorToConf = { type, query, ... }@args: - (filterAttrs (k: v: v != null && !(elem k ["type" "query"])) args) + (lib.filterAttrs (k: v: v != null && !(lib.elem k ["type" "query"])) args) // { "${type}" = query; }; syntaxNote = name: '' @@ -103,8 +100,8 @@ in { services.thinkfan = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable thinkfan, a fan control program. @@ -117,8 +114,8 @@ in { relatedPackages = [ "thinkfan" ]; }; - smartSupport = mkOption { - type = types.bool; + smartSupport = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to build thinkfan with S.M.A.R.T. support to read temperatures @@ -126,8 +123,8 @@ in { ''; }; - sensors = mkOption { - type = types.listOf (sensorType "sensor"); + sensors = lib.mkOption { + type = lib.types.listOf (sensorType "sensor"); default = [ { type = "tpacpi"; query = "/proc/acpi/ibm/thermal"; @@ -140,8 +137,8 @@ in { ''; }; - fans = mkOption { - type = types.listOf (sensorType "fan"); + fans = lib.mkOption { + type = lib.types.listOf (sensorType "fan"); default = [ { type = "tpacpi"; query = "/proc/acpi/ibm/fan"; @@ -154,8 +151,8 @@ in { ''; }; - levels = mkOption { - type = types.listOf levelType; + levels = lib.mkOption { + type = lib.types.listOf levelType; default = [ [0 0 55] [1 48 60] @@ -177,8 +174,8 @@ in { ''; }; - extraArgs = mkOption { - type = types.listOf types.str; + extraArgs = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ ]; example = [ "-b" "0" ]; description = '' @@ -187,8 +184,8 @@ in { ''; }; - settings = mkOption { - type = types.attrsOf settingsFormat.type; + settings = lib.mkOption { + type = lib.types.attrsOf settingsFormat.type; default = { }; description = '' Thinkfan settings. Use this option to configure thinkfan @@ -203,11 +200,11 @@ in { }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ thinkfan ]; - services.thinkfan.settings = mapAttrs (k: v: mkDefault v) { + services.thinkfan.settings = lib.mapAttrs (k: v: lib.mkDefault v) { sensors = map sensorToConf cfg.sensors; fans = map sensorToConf cfg.fans; levels = cfg.levels; @@ -216,7 +213,7 @@ in { systemd.packages = [ thinkfan ]; systemd.services = { - thinkfan.environment.THINKFAN_ARGS = escapeShellArgs ([ "-c" configFile ] ++ cfg.extraArgs); + thinkfan.environment.THINKFAN_ARGS = lib.escapeShellArgs ([ "-c" configFile ] ++ cfg.extraArgs); thinkfan.serviceConfig = { Restart = "on-failure"; RestartSec = "30s"; From 00052ae198632574d8e788807bd9fed2bbefbe96 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:24 +0200 Subject: [PATCH 170/197] nixos/services.throttled: remove `with lib;` --- nixos/modules/services/hardware/throttled.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/hardware/throttled.nix b/nixos/modules/services/hardware/throttled.nix index 143dc83a1d8b..30f10b3361a6 100644 --- a/nixos/modules/services/hardware/throttled.nix +++ b/nixos/modules/services/hardware/throttled.nix @@ -1,23 +1,20 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.throttled; in { options = { services.throttled = { - enable = mkEnableOption "fix for Intel CPU throttling"; + enable = lib.mkEnableOption "fix for Intel CPU throttling"; - extraConfig = mkOption { - type = types.str; + extraConfig = lib.mkOption { + type = lib.types.str; default = ""; description = "Alternative configuration"; }; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.packages = [ pkgs.throttled ]; # The upstream package has this in Install, but that's not enough, see the NixOS manual systemd.services.throttled.wantedBy = [ "multi-user.target" ]; @@ -31,6 +28,6 @@ in { # Kernel 5.9 spams warnings whenever userspace writes to CPU MSRs. # See https://github.com/erpalma/throttled/issues/215 hardware.cpu.x86.msr.settings.allow-writes = - mkIf (versionAtLeast config.boot.kernelPackages.kernel.version "5.9") "on"; + lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "5.9") "on"; }; } From cb1696c7287c33223b403707eea0858798083739 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:24 +0200 Subject: [PATCH 171/197] nixos/services.tlp: remove `with lib;` --- nixos/modules/services/hardware/tlp.nix | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/nixos/modules/services/hardware/tlp.nix b/nixos/modules/services/hardware/tlp.nix index 148a88e2030f..53e232a32912 100644 --- a/nixos/modules/services/hardware/tlp.nix +++ b/nixos/modules/services/hardware/tlp.nix @@ -1,14 +1,13 @@ { config, lib, pkgs, ... }: -with lib; let cfg = config.services.tlp; enableRDW = config.networking.networkmanager.enable; tlp = pkgs.tlp.override { inherit enableRDW; }; # TODO: Use this for having proper parameters in the future - mkTlpConfig = tlpConfig: generators.toKeyValue { - mkKeyValue = generators.mkKeyValueDefault { + mkTlpConfig = tlpConfig: lib.generators.toKeyValue { + mkKeyValue = lib.generators.mkKeyValueDefault { mkValueString = val: - if isList val then "\"" + (toString val) + "\"" + if lib.isList val then "\"" + (toString val) + "\"" else toString val; } "="; } tlpConfig; @@ -17,13 +16,13 @@ in ###### interface options = { services.tlp = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = "Whether to enable the TLP power management daemon."; }; - settings = mkOption {type = with types; attrsOf (oneOf [bool int float str (listOf str)]); + settings = lib.mkOption {type = with lib.types; attrsOf (oneOf [bool int float str (listOf str)]); default = {}; example = { SATA_LINKPWR_ON_BAT = "med_power_with_dipm"; @@ -34,8 +33,8 @@ in ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = '' Verbatim additional configuration variables for TLP. @@ -46,10 +45,10 @@ in }; ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { hardware.cpu.x86.msr.enable = true; - warnings = optional (cfg.extraConfig != "") '' + warnings = lib.optional (cfg.extraConfig != "") '' Using config.services.tlp.extraConfig is deprecated and will become unsupported in a future release. Use config.services.tlp.settings instead. ''; @@ -63,7 +62,7 @@ in environment.etc = { "tlp.conf".text = (mkTlpConfig cfg.settings) + cfg.extraConfig; - } // optionalAttrs enableRDW { + } // lib.optionalAttrs enableRDW { "NetworkManager/dispatcher.d/99tlp-rdw-nm".source = "${tlp}/usr/lib/NetworkManager/dispatcher.d/99tlp-rdw-nm"; }; From 624ea29c2737814383efecc93d0098aea284dfe2 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:25 +0200 Subject: [PATCH 172/197] nixos/services.triggerhappy: remove `with lib;` --- .../services/hardware/triggerhappy.nix | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/nixos/modules/services/hardware/triggerhappy.nix b/nixos/modules/services/hardware/triggerhappy.nix index 89f8754c0e68..d2137971b3a7 100644 --- a/nixos/modules/services/hardware/triggerhappy.nix +++ b/nixos/modules/services/hardware/triggerhappy.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.triggerhappy; @@ -9,9 +6,9 @@ let socket = "/run/thd.socket"; configFile = pkgs.writeText "triggerhappy.conf" '' - ${concatMapStringsSep "\n" + ${lib.concatMapStringsSep "\n" ({ keys, event, cmd, ... }: - ''${concatMapStringsSep "+" (x: "KEY_" + x) keys} ${toString { press = 1; hold = 2; release = 0; }.${event}} ${cmd}'' + ''${lib.concatMapStringsSep "+" (x: "KEY_" + x) keys} ${toString { press = 1; hold = 2; release = 0; }.${event}} ${cmd}'' ) cfg.bindings} ${cfg.extraConfig} @@ -20,19 +17,19 @@ let bindingCfg = { ... }: { options = { - keys = mkOption { - type = types.listOf types.str; + keys = lib.mkOption { + type = lib.types.listOf lib.types.str; description = "List of keys to match. Key names as defined in linux/input-event-codes.h"; }; - event = mkOption { - type = types.enum ["press" "hold" "release"]; + event = lib.mkOption { + type = lib.types.enum ["press" "hold" "release"]; default = "press"; description = "Event to match."; }; - cmd = mkOption { - type = types.str; + cmd = lib.mkOption { + type = lib.types.str; description = "What to run."; }; @@ -49,16 +46,16 @@ in services.triggerhappy = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable the {command}`triggerhappy` hotkey daemon. ''; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "nobody"; example = "root"; description = '' @@ -66,8 +63,8 @@ in ''; }; - bindings = mkOption { - type = types.listOf (types.submodule bindingCfg); + bindings = lib.mkOption { + type = lib.types.listOf (lib.types.submodule bindingCfg); default = []; example = lib.literalExpression '' [ { keys = ["PLAYPAUSE"]; cmd = "''${pkgs.mpc-cli}/bin/mpc -q toggle"; } ] @@ -77,8 +74,8 @@ in ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = '' Literal contents to append to the end of {command}`triggerhappy` configuration file. @@ -92,7 +89,7 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.sockets.triggerhappy = { description = "Triggerhappy Socket"; @@ -104,7 +101,7 @@ in wantedBy = [ "multi-user.target" ]; description = "Global hotkey daemon"; serviceConfig = { - ExecStart = "${pkgs.triggerhappy}/bin/thd ${optionalString (cfg.user != "root") "--user ${cfg.user}"} --socket ${socket} --triggers ${configFile} --deviceglob /dev/input/event*"; + ExecStart = "${pkgs.triggerhappy}/bin/thd ${lib.optionalString (cfg.user != "root") "--user ${cfg.user}"} --socket ${socket} --triggers ${configFile} --deviceglob /dev/input/event*"; }; }; From 48633eb323f600b9226e27f2e3aba8aacc5d1535 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:25 +0200 Subject: [PATCH 173/197] nixos/hardware.tuxedo-rs: remove `with lib;` --- nixos/modules/services/hardware/tuxedo-rs.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/hardware/tuxedo-rs.nix b/nixos/modules/services/hardware/tuxedo-rs.nix index 506454c1cadf..cfdc1c64d118 100644 --- a/nixos/modules/services/hardware/tuxedo-rs.nix +++ b/nixos/modules/services/hardware/tuxedo-rs.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.tuxedo-rs; @@ -9,13 +6,13 @@ in { options = { hardware.tuxedo-rs = { - enable = mkEnableOption "Rust utilities for interacting with hardware from TUXEDO Computers"; + enable = lib.mkEnableOption "Rust utilities for interacting with hardware from TUXEDO Computers"; - tailor-gui.enable = mkEnableOption "tailor-gui, an alternative to TUXEDO Control Center, written in Rust"; + tailor-gui.enable = lib.mkEnableOption "tailor-gui, an alternative to TUXEDO Control Center, written in Rust"; }; }; - config = mkIf cfg.enable (mkMerge [ + config = lib.mkIf cfg.enable (lib.mkMerge [ { hardware.tuxedo-keyboard.enable = true; @@ -40,10 +37,10 @@ in environment.systemPackages = [ pkgs.tuxedo-rs ]; } - (mkIf cfg.tailor-gui.enable { + (lib.mkIf cfg.tailor-gui.enable { environment.systemPackages = [ pkgs.tailor-gui ]; }) ]); - meta.maintainers = with maintainers; [ mrcjkb ]; + meta.maintainers = with lib.maintainers; [ mrcjkb ]; } From b00fba5c637cf602eb6854ff8a5d87a1c3557912 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:25 +0200 Subject: [PATCH 174/197] nixos/services.udev: remove `with lib;` --- nixos/modules/services/hardware/udev.nix | 69 ++++++++++++------------ 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index 67956fdd6c76..e3f356ade678 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let udev = config.systemd.package; @@ -42,7 +39,7 @@ let udevRulesFor = { name, udevPackages, udevPath, udev, systemd, binPackages, initrdBin ? null }: pkgs.runCommand name { preferLocalBuild = true; allowSubstitutes = false; - packages = unique (map toString udevPackages); + packages = lib.unique (map toString udevPackages); } '' mkdir -p $out @@ -70,8 +67,8 @@ let --replace \"/bin/mount \"${pkgs.util-linux}/bin/mount \ --replace /usr/bin/readlink ${pkgs.coreutils}/bin/readlink \ --replace /usr/bin/basename ${pkgs.coreutils}/bin/basename 2>/dev/null - ${optionalString (initrdBin != null) '' - substituteInPlace $i --replace '/run/current-system/systemd' "${removeSuffix "/bin" initrdBin}" + ${lib.optionalString (initrdBin != null) '' + substituteInPlace $i --replace '/run/current-system/systemd' "${lib.removeSuffix "/bin" initrdBin}" ''} done @@ -137,7 +134,7 @@ let # If auto-configuration is disabled, then remove # udev's 80-drivers.rules file, which contains rules for # automatically calling modprobe. - ${optionalString (!config.boot.hardwareScan) '' + ${lib.optionalString (!config.boot.hardwareScan) '' ln -s /dev/null $out/80-drivers.rules ''} ''; @@ -145,7 +142,7 @@ let hwdbBin = pkgs.runCommand "hwdb.bin" { preferLocalBuild = true; allowSubstitutes = false; - packages = unique (map toString ([udev] ++ cfg.packages)); + packages = lib.unique (map toString ([udev] ++ cfg.packages)); } '' mkdir -p etc/udev/hwdb.d @@ -191,8 +188,8 @@ in ###### interface options = { - boot.hardwareScan = mkOption { - type = types.bool; + boot.hardwareScan = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether to try to load kernel modules for all detected hardware. @@ -203,12 +200,12 @@ in }; services.udev = { - enable = mkEnableOption "udev, a device manager for the Linux kernel" // { + enable = lib.mkEnableOption "udev, a device manager for the Linux kernel" // { default = true; }; - packages = mkOption { - type = types.listOf types.path; + packages = lib.mkOption { + type = lib.types.listOf lib.types.path; default = []; description = '' List of packages containing {command}`udev` rules. @@ -217,11 +214,11 @@ in {file}`«pkg»/lib/udev/rules.d` will be included. ''; - apply = map getBin; + apply = map lib.getBin; }; - path = mkOption { - type = types.listOf types.path; + path = lib.mkOption { + type = lib.types.listOf lib.types.path; default = []; description = '' Packages added to the {env}`PATH` environment variable when @@ -232,12 +229,12 @@ in ''; }; - extraRules = mkOption { + extraRules = lib.mkOption { default = ""; example = '' ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="0825", ENV{PULSE_IGNORE}="1" ''; - type = types.lines; + type = lib.types.lines; description = '' Additional {command}`udev` rules. They'll be written into file {file}`99-local.rules`. Thus they are @@ -245,14 +242,14 @@ in ''; }; - extraHwdb = mkOption { + extraHwdb = lib.mkOption { default = ""; example = '' evdev:input:b0003v05AFp8277* KEYBOARD_KEY_70039=leftalt KEYBOARD_KEY_700e2=leftctrl ''; - type = types.lines; + type = lib.types.lines; description = '' Additional {command}`hwdb` files. They'll be written into file {file}`99-local.hwdb`. Thus they are @@ -262,8 +259,8 @@ in }; - hardware.firmware = mkOption { - type = types.listOf types.package; + hardware.firmware = lib.mkOption { + type = lib.types.listOf lib.types.package; default = []; description = '' List of packages containing firmware files. Such files @@ -282,9 +279,9 @@ in }; }; - networking.usePredictableInterfaceNames = mkOption { + networking.usePredictableInterfaceNames = lib.mkOption { default = true; - type = types.bool; + type = lib.types.bool; description = '' Whether to assign [predictable names to network interfaces](https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/). If enabled, interfaces @@ -300,8 +297,8 @@ in boot.initrd.services.udev = { - packages = mkOption { - type = types.listOf types.path; + packages = lib.mkOption { + type = lib.types.listOf lib.types.path; default = []; description = '' *This will only be used when systemd is used in stage 1.* @@ -314,8 +311,8 @@ in ''; }; - binPackages = mkOption { - type = types.listOf types.path; + binPackages = lib.mkOption { + type = lib.types.listOf lib.types.path; default = []; description = '' *This will only be used when systemd is used in stage 1.* @@ -323,15 +320,15 @@ in Packages to search for binaries that are referenced by the udev rules in stage 1. This list always contains /bin of the initrd. ''; - apply = map getBin; + apply = map lib.getBin; }; - rules = mkOption { + rules = lib.mkOption { default = ""; example = '' SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1D:60:B9:6D:4F", KERNEL=="eth*", NAME="my_fast_network_card" ''; - type = types.lines; + type = lib.types.lines; description = '' {command}`udev` rules to include in the initrd *only*. They'll be written into file @@ -347,7 +344,7 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { services.udev.extraRules = nixosRules; @@ -355,9 +352,9 @@ in services.udev.path = [ pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.util-linux udev ]; - boot.kernelParams = mkIf (!config.networking.usePredictableInterfaceNames) [ "net.ifnames=0" ]; + boot.kernelParams = lib.mkIf (!config.networking.usePredictableInterfaceNames) [ "net.ifnames=0" ]; - boot.initrd.extraUdevRulesCommands = mkIf (!config.boot.initrd.systemd.enable && config.boot.initrd.services.udev.rules != "") + boot.initrd.extraUdevRulesCommands = lib.mkIf (!config.boot.initrd.systemd.enable && config.boot.initrd.services.udev.rules != "") '' cat <<'EOF' > $out/99-local.rules ${config.boot.initrd.services.udev.rules} @@ -397,7 +394,7 @@ in # Insert initrd rules boot.initrd.services.udev.packages = [ initrdUdevRules - (mkIf (config.boot.initrd.services.udev.rules != "") (pkgs.writeTextFile { + (lib.mkIf (config.boot.initrd.services.udev.rules != "") (pkgs.writeTextFile { name = "initrd-udev-rules"; destination = "/etc/udev/rules.d/99-local.rules"; text = config.boot.initrd.services.udev.rules; @@ -443,6 +440,6 @@ in }; imports = [ - (mkRenamedOptionModule [ "services" "udev" "initrdRules" ] [ "boot" "initrd" "services" "udev" "rules" ]) + (lib.mkRenamedOptionModule [ "services" "udev" "initrdRules" ] [ "boot" "initrd" "services" "udev" "rules" ]) ]; } From 0de89d26ea59907d0bdf84dc6216c480880bf2a3 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:26 +0200 Subject: [PATCH 175/197] nixos/services.udisks2: remove `with lib;` --- nixos/modules/services/hardware/udisks2.nix | 30 ++++++++++----------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/nixos/modules/services/hardware/udisks2.nix b/nixos/modules/services/hardware/udisks2.nix index 46a72b961501..e52aa5a58df2 100644 --- a/nixos/modules/services/hardware/udisks2.nix +++ b/nixos/modules/services/hardware/udisks2.nix @@ -1,13 +1,11 @@ # Udisks daemon. { config, lib, pkgs, ... }: -with lib; - let cfg = config.services.udisks2; settingsFormat = pkgs.formats.ini { - listToValue = concatMapStringsSep "," (generators.mkValueStringDefault {}); + listToValue = lib.concatMapStringsSep "," (lib.generators.mkValueStringDefault {}); }; - configFiles = mapAttrs (name: value: (settingsFormat.generate name value)) (mapAttrs' (name: value: nameValuePair name value ) config.services.udisks2.settings); + configFiles = lib.mapAttrs (name: value: (settingsFormat.generate name value)) (lib.mapAttrs' (name: value: lib.nameValuePair name value ) config.services.udisks2.settings); in { @@ -18,10 +16,10 @@ in services.udisks2 = { - enable = mkEnableOption "udisks2, a DBus service that allows applications to query and manipulate storage devices"; + enable = lib.mkEnableOption "udisks2, a DBus service that allows applications to query and manipulate storage devices"; - mountOnMedia = mkOption { - type = types.bool; + mountOnMedia = lib.mkOption { + type = lib.types.bool; default = false; description = '' When enabled, instructs udisks2 to mount removable drives under `/media/` directory, instead of the @@ -30,9 +28,9 @@ in ''; }; - settings = mkOption rec { - type = types.attrsOf settingsFormat.type; - apply = recursiveUpdate default; + settings = lib.mkOption rec { + type = lib.types.attrsOf settingsFormat.type; + apply = lib.recursiveUpdate default; default = { "udisks2.conf" = { udisks2 = { @@ -44,7 +42,7 @@ in }; }; }; - example = literalExpression '' + example = lib.literalExpression '' { "WDC-WD10EZEX-60M2NA0-WD-WCC3F3SJ0698.conf" = { ATA = { @@ -67,14 +65,14 @@ in ###### implementation - config = mkIf config.services.udisks2.enable { + config = lib.mkIf config.services.udisks2.enable { environment.systemPackages = [ pkgs.udisks2 ]; - environment.etc = (mapAttrs' (name: value: nameValuePair "udisks2/${name}" { source = value; } ) configFiles) // ( + environment.etc = (lib.mapAttrs' (name: value: lib.nameValuePair "udisks2/${name}" { source = value; } ) configFiles) // ( let libblockdev = pkgs.udisks2.libblockdev; - majorVer = versions.major libblockdev.version; + majorVer = lib.versions.major libblockdev.version; in { # We need to make sure /etc/libblockdev/@major_ver@/conf.d is populated to avoid # warnings @@ -87,11 +85,11 @@ in services.dbus.packages = [ pkgs.udisks2 ]; systemd.tmpfiles.rules = [ "d /var/lib/udisks2 0755 root root -" ] - ++ optional cfg.mountOnMedia "D! /media 0755 root root -"; + ++ lib.optional cfg.mountOnMedia "D! /media 0755 root root -"; services.udev.packages = [ pkgs.udisks2 ]; - services.udev.extraRules = optionalString cfg.mountOnMedia '' + services.udev.extraRules = lib.optionalString cfg.mountOnMedia '' ENV{ID_FS_USAGE}=="filesystem", ENV{UDISKS_FILESYSTEM_SHARED}="1" ''; From c1573bb3efbaa0c5ca796922ffc431bf8bd471d7 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:26 +0200 Subject: [PATCH 176/197] nixos/services.undervolt: remove `with lib;` --- nixos/modules/services/hardware/undervolt.nix | 68 +++++++++---------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/nixos/modules/services/hardware/undervolt.nix b/nixos/modules/services/hardware/undervolt.nix index 23bc848b2398..1fce225db366 100644 --- a/nixos/modules/services/hardware/undervolt.nix +++ b/nixos/modules/services/hardware/undervolt.nix @@ -1,12 +1,10 @@ { config, pkgs, lib, ... }: - -with lib; let cfg = config.services.undervolt; mkPLimit = limit: window: if (limit == null && window == null) then null - else assert asserts.assertMsg (limit != null && window != null) "Both power limit and window must be set"; + else assert lib.asserts.assertMsg (limit != null && window != null) "Both power limit and window must be set"; "${toString limit} ${toString window}"; cliArgs = lib.cli.toGNUCommandLine {} { inherit (cfg) @@ -34,96 +32,96 @@ let in { options.services.undervolt = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' Undervolting service for Intel CPUs. Warning: This service is not endorsed by Intel and may permanently damage your hardware. Use at your own risk ''; - verbose = mkOption { - type = types.bool; + verbose = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable verbose logging. ''; }; - package = mkPackageOption pkgs "undervolt" { }; + package = lib.mkPackageOption pkgs "undervolt" { }; - coreOffset = mkOption { - type = types.nullOr types.int; + coreOffset = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' The amount of voltage in mV to offset the CPU cores by. ''; }; - gpuOffset = mkOption { - type = types.nullOr types.int; + gpuOffset = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' The amount of voltage in mV to offset the GPU by. ''; }; - uncoreOffset = mkOption { - type = types.nullOr types.int; + uncoreOffset = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' The amount of voltage in mV to offset uncore by. ''; }; - analogioOffset = mkOption { - type = types.nullOr types.int; + analogioOffset = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' The amount of voltage in mV to offset analogio by. ''; }; - temp = mkOption { - type = types.nullOr types.int; + temp = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' The temperature target in Celsius degrees. ''; }; - tempAc = mkOption { - type = types.nullOr types.int; + tempAc = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' The temperature target on AC power in Celsius degrees. ''; }; - tempBat = mkOption { - type = types.nullOr types.int; + tempBat = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' The temperature target on battery power in Celsius degrees. ''; }; - turbo = mkOption { - type = types.nullOr types.int; + turbo = lib.mkOption { + type = lib.types.nullOr lib.types.int; default = null; description = '' Changes the Intel Turbo feature status (1 is disabled and 0 is enabled). ''; }; - p1.limit = mkOption { - type = with types; nullOr int; + p1.limit = lib.mkOption { + type = with lib.types; nullOr int; default = null; description = '' The P1 Power Limit in Watts. Both limit and window must be set. ''; }; - p1.window = mkOption { - type = with types; nullOr (oneOf [ float int ]); + p1.window = lib.mkOption { + type = with lib.types; nullOr (oneOf [ float int ]); default = null; description = '' The P1 Time Window in seconds. @@ -131,16 +129,16 @@ in ''; }; - p2.limit = mkOption { - type = with types; nullOr int; + p2.limit = lib.mkOption { + type = with lib.types; nullOr int; default = null; description = '' The P2 Power Limit in Watts. Both limit and window must be set. ''; }; - p2.window = mkOption { - type = with types; nullOr (oneOf [ float int ]); + p2.window = lib.mkOption { + type = with lib.types; nullOr (oneOf [ float int ]); default = null; description = '' The P2 Time Window in seconds. @@ -148,8 +146,8 @@ in ''; }; - useTimer = mkOption { - type = types.bool; + useTimer = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to set a timer that applies the undervolt settings every 30s. @@ -160,7 +158,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { hardware.cpu.x86.msr.enable = true; environment.systemPackages = [ cfg.package ]; @@ -179,7 +177,7 @@ in }; }; - systemd.timers.undervolt = mkIf cfg.useTimer { + systemd.timers.undervolt = lib.mkIf cfg.useTimer { description = "Undervolt timer to ensure voltage settings are always applied"; partOf = [ "undervolt.service" ]; wantedBy = [ "multi-user.target" ]; From ab7b22c311f40fd8cfd9b5097de0bca06646f4c7 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:26 +0200 Subject: [PATCH 177/197] nixos/services.upower: remove `with lib;` --- nixos/modules/services/hardware/upower.nix | 58 ++++++++++------------ 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/nixos/modules/services/hardware/upower.nix b/nixos/modules/services/hardware/upower.nix index 3d0edb0467ea..bcc768cc05d3 100644 --- a/nixos/modules/services/hardware/upower.nix +++ b/nixos/modules/services/hardware/upower.nix @@ -1,9 +1,5 @@ # Upower daemon. - { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.upower; @@ -18,8 +14,8 @@ in services.upower = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable Upower, a DBus service that provides power @@ -27,10 +23,10 @@ in ''; }; - package = mkPackageOption pkgs "upower" { }; + package = lib.mkPackageOption pkgs "upower" { }; - enableWattsUpPro = mkOption { - type = types.bool; + enableWattsUpPro = lib.mkOption { + type = lib.types.bool; default = false; description = '' Enable the Watts Up Pro device. @@ -47,8 +43,8 @@ in ''; }; - noPollBatteries = mkOption { - type = types.bool; + noPollBatteries = lib.mkOption { + type = lib.types.bool; default = false; description = '' Don't poll the kernel for battery level changes. @@ -59,8 +55,8 @@ in ''; }; - ignoreLid = mkOption { - type = types.bool; + ignoreLid = lib.mkOption { + type = lib.types.bool; default = false; description = '' Do we ignore the lid state @@ -73,8 +69,8 @@ in ''; }; - usePercentageForPolicy = mkOption { - type = types.bool; + usePercentageForPolicy = lib.mkOption { + type = lib.types.bool; default = true; description = '' Policy for warnings and action based on battery levels @@ -87,8 +83,8 @@ in ''; }; - percentageLow = mkOption { - type = types.ints.unsigned; + percentageLow = lib.mkOption { + type = lib.types.ints.unsigned; default = 10; description = '' When `usePercentageForPolicy` is @@ -105,8 +101,8 @@ in ''; }; - percentageCritical = mkOption { - type = types.ints.unsigned; + percentageCritical = lib.mkOption { + type = lib.types.ints.unsigned; default = 3; description = '' When `usePercentageForPolicy` is @@ -123,8 +119,8 @@ in ''; }; - percentageAction = mkOption { - type = types.ints.unsigned; + percentageAction = lib.mkOption { + type = lib.types.ints.unsigned; default = 2; description = '' When `usePercentageForPolicy` is @@ -141,8 +137,8 @@ in ''; }; - timeLow = mkOption { - type = types.ints.unsigned; + timeLow = lib.mkOption { + type = lib.types.ints.unsigned; default = 1200; description = '' When `usePercentageForPolicy` is @@ -155,8 +151,8 @@ in ''; }; - timeCritical = mkOption { - type = types.ints.unsigned; + timeCritical = lib.mkOption { + type = lib.types.ints.unsigned; default = 300; description = '' When `usePercentageForPolicy` is @@ -169,8 +165,8 @@ in ''; }; - timeAction = mkOption { - type = types.ints.unsigned; + timeAction = lib.mkOption { + type = lib.types.ints.unsigned; default = 120; description = '' When `usePercentageForPolicy` is @@ -183,8 +179,8 @@ in ''; }; - criticalPowerAction = mkOption { - type = types.enum [ "PowerOff" "Hibernate" "HybridSleep" ]; + criticalPowerAction = lib.mkOption { + type = lib.types.enum [ "PowerOff" "Hibernate" "HybridSleep" ]; default = "HybridSleep"; description = '' The action to take when `timeAction` or @@ -200,7 +196,7 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; @@ -210,7 +206,7 @@ in systemd.packages = [ cfg.package ]; - environment.etc."UPower/UPower.conf".text = generators.toINI {} { + environment.etc."UPower/UPower.conf".text = lib.generators.toINI {} { UPower = { EnableWattsUpPro = cfg.enableWattsUpPro; NoPollBatteries = cfg.noPollBatteries; From a79aa024ca88447857f43a4b0f11626565e9066b Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:27 +0200 Subject: [PATCH 178/197] nixos/services.usbmuxd: remove `with lib;` --- nixos/modules/services/hardware/usbmuxd.nix | 27 +++++++++------------ 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/nixos/modules/services/hardware/usbmuxd.nix b/nixos/modules/services/hardware/usbmuxd.nix index 891619934eb6..c1b76ddce3b7 100644 --- a/nixos/modules/services/hardware/usbmuxd.nix +++ b/nixos/modules/services/hardware/usbmuxd.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let defaultUserGroup = "usbmux"; @@ -14,8 +11,8 @@ in { options.services.usbmuxd = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Enable the usbmuxd ("USB multiplexing daemon") service. This daemon is @@ -25,35 +22,35 @@ in ''; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = defaultUserGroup; description = '' The user usbmuxd should use to run after startup. ''; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = defaultUserGroup; description = '' The group usbmuxd should use to run after startup. ''; }; - package = mkOption { - type = types.package; + package = lib.mkOption { + type = lib.types.package; default = pkgs.usbmuxd; - defaultText = literalExpression "pkgs.usbmuxd"; + defaultText = lib.literalExpression "pkgs.usbmuxd"; description = "Which package to use for the usbmuxd daemon."; relatedPackages = [ "usbmuxd" "usbmuxd2" ]; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { - users.users = optionalAttrs (cfg.user == defaultUserGroup) { + users.users = lib.optionalAttrs (cfg.user == defaultUserGroup) { ${cfg.user} = { description = "usbmuxd user"; group = cfg.group; @@ -61,7 +58,7 @@ in }; }; - users.groups = optionalAttrs (cfg.group == defaultUserGroup) { + users.groups = lib.optionalAttrs (cfg.group == defaultUserGroup) { ${cfg.group} = { }; }; From e5f14949de8dcbdc265d89676c7adbf6813be029 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:27 +0200 Subject: [PATCH 179/197] nixos/services.matter-server: remove `with lib;` --- .../home-automation/matter-server.nix | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/nixos/modules/services/home-automation/matter-server.nix b/nixos/modules/services/home-automation/matter-server.nix index 08a68db71386..8a59815eec66 100644 --- a/nixos/modules/services/home-automation/matter-server.nix +++ b/nixos/modules/services/home-automation/matter-server.nix @@ -3,9 +3,6 @@ , config , ... }: - -with lib; - let cfg = config.services.matter-server; storageDir = "matter-server"; @@ -16,24 +13,24 @@ in { meta.maintainers = with lib.maintainers; [ leonm1 ]; - options.services.matter-server = with types; { - enable = mkEnableOption "Matter-server"; + options.services.matter-server = with lib.types; { + enable = lib.mkEnableOption "Matter-server"; - package = mkPackageOption pkgs "python-matter-server" { }; + package = lib.mkPackageOption pkgs "python-matter-server" { }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 5580; description = "Port to expose the matter-server service on."; }; - logLevel = mkOption { - type = types.enum [ "critical" "error" "warning" "info" "debug" ]; + logLevel = lib.mkOption { + type = lib.types.enum [ "critical" "error" "warning" "info" "debug" ]; default = "info"; description = "Verbosity of logs from the matter-server"; }; - extraArgs = mkOption { + extraArgs = lib.mkOption { type = listOf str; default = []; description = '' @@ -43,7 +40,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.matter-server = { after = [ "network-online.target" ]; before = [ "home-assistant.service" ]; @@ -52,13 +49,13 @@ in description = "Matter Server"; environment.HOME = storagePath; serviceConfig = { - ExecStart = (concatStringsSep " " [ + ExecStart = (lib.concatStringsSep " " [ "${cfg.package}/bin/matter-server" "--port" (toString cfg.port) "--vendorid" vendorId "--storage-path" storagePath "--log-level" "${cfg.logLevel}" - "${escapeShellArgs cfg.extraArgs}" + "${lib.escapeShellArgs cfg.extraArgs}" ]); # Start with a clean root filesystem, and allowlist what the container # is permitted to access. @@ -103,7 +100,7 @@ in RestrictNamespaces = true; RestrictRealtime = true; RestrictSUIDSGID = true; - SystemCallFilter = concatStringsSep " " [ + SystemCallFilter = lib.concatStringsSep " " [ "~" # Blocklist "@clock" "@cpu-emulation" From 5645a33f6ae6c89f51fb93a2d01c63045a42ffba Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:27 +0200 Subject: [PATCH 180/197] nixos/services.zigbee2mqtt: remove `with lib;` --- .../services/home-automation/zigbee2mqtt.nix | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/nixos/modules/services/home-automation/zigbee2mqtt.nix b/nixos/modules/services/home-automation/zigbee2mqtt.nix index f1d150487379..5a9fb0eaebc1 100644 --- a/nixos/modules/services/home-automation/zigbee2mqtt.nix +++ b/nixos/modules/services/home-automation/zigbee2mqtt.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.zigbee2mqtt; @@ -10,28 +7,28 @@ let in { - meta.maintainers = with maintainers; [ sweber hexa ]; + meta.maintainers = with lib.maintainers; [ sweber hexa ]; imports = [ # Remove warning before the 21.11 release - (mkRenamedOptionModule [ "services" "zigbee2mqtt" "config" ] [ "services" "zigbee2mqtt" "settings" ]) + (lib.mkRenamedOptionModule [ "services" "zigbee2mqtt" "config" ] [ "services" "zigbee2mqtt" "settings" ]) ]; options.services.zigbee2mqtt = { - enable = mkEnableOption "zigbee2mqtt service"; + enable = lib.mkEnableOption "zigbee2mqtt service"; - package = mkPackageOption pkgs "zigbee2mqtt" { }; + package = lib.mkPackageOption pkgs "zigbee2mqtt" { }; - dataDir = mkOption { + dataDir = lib.mkOption { description = "Zigbee2mqtt data directory"; default = "/var/lib/zigbee2mqtt"; - type = types.path; + type = lib.types.path; }; - settings = mkOption { + settings = lib.mkOption { type = format.type; default = { }; - example = literalExpression '' + example = lib.literalExpression '' { homeassistant = config.services.home-assistant.enable; permit_join = true; @@ -48,21 +45,21 @@ in }; }; - config = mkIf (cfg.enable) { + config = lib.mkIf (cfg.enable) { # preset config values services.zigbee2mqtt.settings = { - homeassistant = mkDefault config.services.home-assistant.enable; - permit_join = mkDefault false; + homeassistant = lib.mkDefault config.services.home-assistant.enable; + permit_join = lib.mkDefault false; mqtt = { - base_topic = mkDefault "zigbee2mqtt"; - server = mkDefault "mqtt://localhost:1883"; + base_topic = lib.mkDefault "zigbee2mqtt"; + server = lib.mkDefault "mqtt://localhost:1883"; }; - serial.port = mkDefault "/dev/ttyACM0"; + serial.port = lib.mkDefault "/dev/ttyACM0"; # reference device/group configuration, that is kept in a separate file # to prevent it being overwritten in the units ExecStartPre script - devices = mkDefault "devices.yaml"; - groups = mkDefault "groups.yaml"; + devices = lib.mkDefault "devices.yaml"; + groups = lib.mkDefault "groups.yaml"; }; systemd.services.zigbee2mqtt = { From 5eba86d6f2771675b7f61db8bc553d2c85a3b45a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:28 +0200 Subject: [PATCH 181/197] nixos/services.zwave-js: remove `with lib;` --- .../services/home-automation/zwave-js.nix | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/nixos/modules/services/home-automation/zwave-js.nix b/nixos/modules/services/home-automation/zwave-js.nix index 2138719ec6fa..4ce792624269 100644 --- a/nixos/modules/services/home-automation/zwave-js.nix +++ b/nixos/modules/services/home-automation/zwave-js.nix @@ -1,35 +1,32 @@ {config, pkgs, lib, ...}: - -with lib; - let cfg = config.services.zwave-js; mergedConfigFile = "/run/zwave-js/config.json"; settingsFormat = pkgs.formats.json {}; in { options.services.zwave-js = { - enable = mkEnableOption "the zwave-js server on boot"; + enable = lib.mkEnableOption "the zwave-js server on boot"; - package = mkPackageOption pkgs "zwave-js-server" { }; + package = lib.mkPackageOption pkgs "zwave-js-server" { }; - port = mkOption { - type = types.port; + port = lib.mkOption { + type = lib.types.port; default = 3000; description = '' Port for the server to listen on. ''; }; - serialPort = mkOption { - type = types.path; + serialPort = lib.mkOption { + type = lib.types.path; description = '' Serial port device path for Z-Wave controller. ''; example = "/dev/ttyUSB0"; }; - secretsConfigFile = mkOption { - type = types.path; + secretsConfigFile = lib.mkOption { + type = lib.types.path; description = '' JSON file containing secret keys. A dummy example: @@ -62,14 +59,14 @@ in { example = "/secrets/zwave-js-keys.json"; }; - settings = mkOption { + settings = lib.mkOption { type = lib.types.submodule { freeformType = settingsFormat.type; options = { storage = { - cacheDir = mkOption { - type = types.path; + cacheDir = lib.mkOption { + type = lib.types.path; default = "/var/cache/zwave-js"; readOnly = true; description = "Cache directory"; @@ -94,7 +91,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.zwave-js = let configFile = settingsFormat.generate "zwave-js-config.json" cfg.settings; in { @@ -110,7 +107,7 @@ in { "--config ${mergedConfigFile}" "--port ${toString cfg.port}" cfg.serialPort - (escapeShellArgs cfg.extraFlags) + (lib.escapeShellArgs cfg.extraFlags) ]; Restart = "on-failure"; User = "zwave-js"; From d9a644373a92b4e763d2c6aaa69ca9bcdc4253e3 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:28 +0200 Subject: [PATCH 182/197] nixos/services.SystemdJournal2Gelf: remove `with lib;` --- .../services/logging/SystemdJournal2Gelf.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nixos/modules/services/logging/SystemdJournal2Gelf.nix b/nixos/modules/services/logging/SystemdJournal2Gelf.nix index 7c50e9e2c42f..5b2f05f8c0f1 100644 --- a/nixos/modules/services/logging/SystemdJournal2Gelf.nix +++ b/nixos/modules/services/logging/SystemdJournal2Gelf.nix @@ -1,22 +1,19 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.SystemdJournal2Gelf; in { options = { services.SystemdJournal2Gelf = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable SystemdJournal2Gelf. ''; }; - graylogServer = mkOption { - type = types.str; + graylogServer = lib.mkOption { + type = lib.types.str; example = "graylog2.example.com:11201"; description = '' Host and port of your graylog2 input. This should be a GELF @@ -24,8 +21,8 @@ in ''; }; - extraOptions = mkOption { - type = types.separatedString " "; + extraOptions = lib.mkOption { + type = lib.types.separatedString " "; default = ""; description = '' Any extra flags to pass to SystemdJournal2Gelf. Note that @@ -33,12 +30,12 @@ in ''; }; - package = mkPackageOption pkgs "systemd-journal2gelf" { }; + package = lib.mkPackageOption pkgs "systemd-journal2gelf" { }; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.SystemdJournal2Gelf = { description = "SystemdJournal2Gelf"; after = [ "network.target" ]; From e2a2735d4d4ffdaca26229d56c7ce8c8bea026da Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:28 +0200 Subject: [PATCH 183/197] nixos/services.awstats: remove `with lib;` --- nixos/modules/services/logging/awstats.nix | 83 +++++++++++----------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/nixos/modules/services/logging/awstats.nix b/nixos/modules/services/logging/awstats.nix index a5b0e6347b2b..d6d1fd64bd52 100644 --- a/nixos/modules/services/logging/awstats.nix +++ b/nixos/modules/services/logging/awstats.nix @@ -1,29 +1,26 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.awstats; package = pkgs.awstats; configOpts = {name, config, ...}: { options = { - type = mkOption{ - type = types.enum [ "mail" "web" ]; + type = lib.mkOption{ + type = lib.types.enum [ "mail" "web" ]; default = "web"; example = "mail"; description = '' The type of log being collected. ''; }; - domain = mkOption { - type = types.str; + domain = lib.mkOption { + type = lib.types.str; default = name; description = "The domain name to collect stats for."; example = "example.com"; }; - logFile = mkOption { - type = types.str; + logFile = lib.mkOption { + type = lib.types.str; example = "/var/log/nginx/access.log"; description = '' The log file to be scanned. @@ -35,8 +32,8 @@ let ''; }; - logFormat = mkOption { - type = types.str; + logFormat = lib.mkOption { + type = lib.types.str; default = "1"; description = '' The log format being used. @@ -48,8 +45,8 @@ let ''; }; - hostAliases = mkOption { - type = types.listOf types.str; + hostAliases = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; example = [ "www.example.org" ]; description = '' @@ -57,10 +54,10 @@ let ''; }; - extraConfig = mkOption { - type = types.attrsOf types.str; + extraConfig = lib.mkOption { + type = lib.types.attrsOf lib.types.str; default = {}; - example = literalExpression '' + example = lib.literalExpression '' { "ValidHTTPCodes" = "404"; } @@ -69,44 +66,44 @@ let }; webService = { - enable = mkEnableOption "awstats web service"; + enable = lib.mkEnableOption "awstats web service"; - hostname = mkOption { - type = types.str; + hostname = lib.mkOption { + type = lib.types.str; default = config.domain; description = "The hostname the web service appears under."; }; - urlPrefix = mkOption { - type = types.str; + urlPrefix = lib.mkOption { + type = lib.types.str; default = "/awstats"; description = "The URL prefix under which the awstats pages appear."; }; }; }; }; - webServices = filterAttrs (name: value: value.webService.enable) cfg.configs; + webServices = lib.filterAttrs (name: value: value.webService.enable) cfg.configs; in { imports = [ - (mkRemovedOptionModule [ "services" "awstats" "service" "enable" ] "Please enable per domain with `services.awstats.configs..webService.enable`") - (mkRemovedOptionModule [ "services" "awstats" "service" "urlPrefix" ] "Please set per domain with `services.awstats.configs..webService.urlPrefix`") - (mkRenamedOptionModule [ "services" "awstats" "vardir" ] [ "services" "awstats" "dataDir" ]) + (lib.mkRemovedOptionModule [ "services" "awstats" "service" "enable" ] "Please enable per domain with `services.awstats.configs..webService.enable`") + (lib.mkRemovedOptionModule [ "services" "awstats" "service" "urlPrefix" ] "Please set per domain with `services.awstats.configs..webService.urlPrefix`") + (lib.mkRenamedOptionModule [ "services" "awstats" "vardir" ] [ "services" "awstats" "dataDir" ]) ]; options.services.awstats = { - enable = mkEnableOption "awstats, a real-time logfile analyzer"; + enable = lib.mkEnableOption "awstats, a real-time logfile analyzer"; - dataDir = mkOption { - type = types.path; + dataDir = lib.mkOption { + type = lib.types.path; default = "/var/lib/awstats"; description = "The directory where awstats data will be stored."; }; - configs = mkOption { - type = types.attrsOf (types.submodule configOpts); + configs = lib.mkOption { + type = lib.types.attrsOf (lib.types.submodule configOpts); default = {}; - example = literalExpression '' + example = lib.literalExpression '' { "mysite" = { domain = "example.com"; @@ -117,8 +114,8 @@ in description = "Attribute set of domains to collect stats for."; }; - updateAt = mkOption { - type = types.nullOr types.str; + updateAt = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; example = "hourly"; description = '' @@ -129,18 +126,18 @@ in }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ package.bin ]; - environment.etc = mapAttrs' (name: opts: - nameValuePair "awstats/awstats.${name}.conf" { + environment.etc = lib.mapAttrs' (name: opts: + lib.nameValuePair "awstats/awstats.${name}.conf" { source = pkgs.runCommand "awstats.${name}.conf" { preferLocalBuild = true; } ('' sed \ '' # set up mail stats - + optionalString (opts.type == "mail") + + lib.optionalString (opts.type == "mail") '' -e 's|^\(LogType\)=.*$|\1=M|' \ -e 's|^\(LevelForBrowsersDetection\)=.*$|\1=0|' \ @@ -187,7 +184,7 @@ in '' + # extra config - concatStringsSep "\n" (mapAttrsToList (n: v: '' + lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: '' -e 's|^\(${n}\)=.*$|\1="${v}"|' \ '') opts.extraConfig) + @@ -199,11 +196,11 @@ in # create data directory with the correct permissions systemd.tmpfiles.rules = [ "d '${cfg.dataDir}' 755 root root - -" ] ++ - mapAttrsToList (name: opts: "d '${cfg.dataDir}/${name}' 755 root root - -") cfg.configs ++ + lib.mapAttrsToList (name: opts: "d '${cfg.dataDir}/${name}' 755 root root - -") cfg.configs ++ [ "Z '${cfg.dataDir}' 755 root root - -" ]; # nginx options - services.nginx.virtualHosts = mapAttrs'(name: opts: { + services.nginx.virtualHosts = lib.mapAttrs'(name: opts: { name = opts.webService.hostname; value = { locations = { @@ -224,10 +221,10 @@ in }) webServices; # update awstats - systemd.services = mkIf (cfg.updateAt != null) (mapAttrs' (name: opts: - nameValuePair "awstats-${name}-update" { + systemd.services = lib.mkIf (cfg.updateAt != null) (lib.mapAttrs' (name: opts: + lib.nameValuePair "awstats-${name}-update" { description = "update awstats for ${name}"; - script = optionalString (opts.type == "mail") + script = lib.optionalString (opts.type == "mail") '' if [[ -f "${cfg.dataDir}/${name}-cursor" ]]; then CURSOR="$(cat "${cfg.dataDir}/${name}-cursor" | tr -d '\n')" From 4e0ba37569670184e48e6bb5d5ebf345176dbf96 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:29 +0200 Subject: [PATCH 184/197] nixos/services.fluentd: remove `with lib;` --- nixos/modules/services/logging/fluentd.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nixos/modules/services/logging/fluentd.nix b/nixos/modules/services/logging/fluentd.nix index bbf905eca06b..fed5cacac37e 100644 --- a/nixos/modules/services/logging/fluentd.nix +++ b/nixos/modules/services/logging/fluentd.nix @@ -1,29 +1,26 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.fluentd; - pluginArgs = concatStringsSep " " (map (x: "-p ${x}") cfg.plugins); + pluginArgs = lib.concatStringsSep " " (map (x: "-p ${x}") cfg.plugins); in { ###### interface options = { services.fluentd = { - enable = mkEnableOption "fluentd, a data/log collector"; + enable = lib.mkEnableOption "fluentd, a data/log collector"; - config = mkOption { - type = types.lines; + config = lib.mkOption { + type = lib.types.lines; default = ""; description = "Fluentd config."; }; - package = mkPackageOption pkgs "fluentd" { }; + package = lib.mkPackageOption pkgs "fluentd" { }; - plugins = mkOption { - type = types.listOf types.path; + plugins = lib.mkOption { + type = lib.types.listOf lib.types.path; default = []; description = '' A list of plugin paths to pass into fluentd. It will make plugins defined in ruby files @@ -36,7 +33,7 @@ in { ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.fluentd = with pkgs; { description = "Fluentd Daemon"; wantedBy = [ "multi-user.target" ]; From 83ed6b4d3bda16f629f71d58b368bb8937ce94d7 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:29 +0200 Subject: [PATCH 185/197] nixos/services.graylog: remove `with lib;` --- nixos/modules/services/logging/graylog.nix | 73 +++++++++++----------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/nixos/modules/services/logging/graylog.nix b/nixos/modules/services/logging/graylog.nix index caeac16815f4..ff1860e99a75 100644 --- a/nixos/modules/services/logging/graylog.nix +++ b/nixos/modules/services/logging/graylog.nix @@ -1,17 +1,14 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.graylog; confFile = pkgs.writeText "graylog.conf" '' - is_master = ${boolToString cfg.isMaster} + is_master = ${lib.boolToString cfg.isMaster} node_id_file = ${cfg.nodeIdFile} password_secret = ${cfg.passwordSecret} root_username = ${cfg.rootUsername} root_password_sha2 = ${cfg.rootPasswordSha2} - elasticsearch_hosts = ${concatStringsSep "," cfg.elasticsearchHosts} + elasticsearch_hosts = ${lib.concatStringsSep "," cfg.elasticsearchHosts} message_journal_dir = ${cfg.messageJournalDir} mongodb_uri = ${cfg.mongodbUri} plugin_dir = /var/lib/graylog/plugins @@ -34,49 +31,49 @@ in services.graylog = { - enable = mkEnableOption "Graylog, a log management solution"; + enable = lib.mkEnableOption "Graylog, a log management solution"; - package = mkOption { - type = types.package; - default = if versionOlder config.system.stateVersion "23.05" then pkgs.graylog-3_3 else pkgs.graylog-5_1; - defaultText = literalExpression (if versionOlder config.system.stateVersion "23.05" then "pkgs.graylog-3_3" else "pkgs.graylog-5_1"); + package = lib.mkOption { + type = lib.types.package; + default = if lib.versionOlder config.system.stateVersion "23.05" then pkgs.graylog-3_3 else pkgs.graylog-5_1; + defaultText = lib.literalExpression (if lib.versionOlder config.system.stateVersion "23.05" then "pkgs.graylog-3_3" else "pkgs.graylog-5_1"); description = "Graylog package to use."; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "graylog"; description = "User account under which graylog runs"; }; - isMaster = mkOption { - type = types.bool; + isMaster = lib.mkOption { + type = lib.types.bool; default = true; description = "Whether this is the master instance of your Graylog cluster"; }; - nodeIdFile = mkOption { - type = types.str; + nodeIdFile = lib.mkOption { + type = lib.types.str; default = "/var/lib/graylog/server/node-id"; description = "Path of the file containing the graylog node-id"; }; - passwordSecret = mkOption { - type = types.str; + passwordSecret = lib.mkOption { + type = lib.types.str; description = '' You MUST set a secret to secure/pepper the stored user passwords here. Use at least 64 characters. Generate one by using for example: pwgen -N 1 -s 96 ''; }; - rootUsername = mkOption { - type = types.str; + rootUsername = lib.mkOption { + type = lib.types.str; default = "admin"; description = "Name of the default administrator user"; }; - rootPasswordSha2 = mkOption { - type = types.str; + rootPasswordSha2 = lib.mkOption { + type = lib.types.str; example = "e3c652f0ba0b4801205814f8b6bc49672c4c74e25b497770bb89b22cdeb4e952"; description = '' You MUST specify a hash password for the root user (which you only need to initially set up the @@ -88,40 +85,40 @@ in ''; }; - elasticsearchHosts = mkOption { - type = types.listOf types.str; - example = literalExpression ''[ "http://node1:9200" "http://user:password@node2:19200" ]''; + elasticsearchHosts = lib.mkOption { + type = lib.types.listOf lib.types.str; + example = lib.literalExpression ''[ "http://node1:9200" "http://user:password@node2:19200" ]''; description = "List of valid URIs of the http ports of your elastic nodes. If one or more of your elasticsearch hosts require authentication, include the credentials in each node URI that requires authentication"; }; - dataDir = mkOption { - type = types.str; + dataDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/graylog/data"; description = "Directory used to store Graylog server state."; }; - messageJournalDir = mkOption { - type = types.str; + messageJournalDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/graylog/data/journal"; description = "The directory which will be used to store the message journal. The directory must be exclusively used by Graylog and must not contain any other files than the ones created by Graylog itself"; }; - mongodbUri = mkOption { - type = types.str; + mongodbUri = lib.mkOption { + type = lib.types.str; default = "mongodb://localhost/graylog"; description = "MongoDB connection string. See http://docs.mongodb.org/manual/reference/connection-string/ for details"; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = "Any other configuration options you might want to add"; }; - plugins = mkOption { + plugins = lib.mkOption { description = "Extra graylog plugins"; default = [ ]; - type = types.listOf types.package; + type = lib.types.listOf lib.types.package; }; }; @@ -130,16 +127,16 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { - users.users = mkIf (cfg.user == "graylog") { + users.users = lib.mkIf (cfg.user == "graylog") { graylog = { isSystemUser = true; group = "graylog"; description = "Graylog server daemon user"; }; }; - users.groups = mkIf (cfg.user == "graylog") { graylog = {}; }; + users.groups = lib.mkIf (cfg.user == "graylog") { graylog = {}; }; systemd.tmpfiles.rules = [ "d '${cfg.messageJournalDir}' - ${cfg.user} - - -" From d0885b12f263b1e135a72873d1720d59d1c42d8a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:29 +0200 Subject: [PATCH 186/197] nixos/services.heartbeat: remove `with lib;` --- nixos/modules/services/logging/heartbeat.nix | 25 +++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/nixos/modules/services/logging/heartbeat.nix b/nixos/modules/services/logging/heartbeat.nix index 1a264cebf6a2..a9fa644d550d 100644 --- a/nixos/modules/services/logging/heartbeat.nix +++ b/nixos/modules/services/logging/heartbeat.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.heartbeat; @@ -18,32 +15,32 @@ in services.heartbeat = { - enable = mkEnableOption "heartbeat, uptime monitoring"; + enable = lib.mkEnableOption "heartbeat, uptime monitoring"; - package = mkPackageOption pkgs "heartbeat" { + package = lib.mkPackageOption pkgs "heartbeat" { example = "heartbeat7"; }; - name = mkOption { - type = types.str; + name = lib.mkOption { + type = lib.types.str; default = "heartbeat"; description = "Name of the beat"; }; - tags = mkOption { - type = types.listOf types.str; + tags = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; description = "Tags to place on the shipped log messages"; }; - stateDir = mkOption { - type = types.str; + stateDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/heartbeat"; description = "The state directory. heartbeat's own logs and other data are stored here."; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = '' heartbeat.monitors: - type: http @@ -56,7 +53,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.tmpfiles.rules = [ "d '${cfg.stateDir}' - nobody nogroup - -" From 0470d7f52fbb5740ca129c60a338cd5f36f95b3c Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:30 +0200 Subject: [PATCH 187/197] nixos/services.journalbeat: remove `with lib;` --- .../modules/services/logging/journalbeat.nix | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/nixos/modules/services/logging/journalbeat.nix b/nixos/modules/services/logging/journalbeat.nix index e7d726ab1f61..5c35e84f88e0 100644 --- a/nixos/modules/services/logging/journalbeat.nix +++ b/nixos/modules/services/logging/journalbeat.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.journalbeat; @@ -18,24 +15,24 @@ in services.journalbeat = { - enable = mkEnableOption "journalbeat"; + enable = lib.mkEnableOption "journalbeat"; - package = mkPackageOption pkgs "journalbeat" { }; + package = lib.mkPackageOption pkgs "journalbeat" { }; - name = mkOption { - type = types.str; + name = lib.mkOption { + type = lib.types.str; default = "journalbeat"; description = "Name of the beat"; }; - tags = mkOption { - type = types.listOf types.str; + tags = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; description = "Tags to place on the shipped log messages"; }; - stateDir = mkOption { - type = types.str; + stateDir = lib.mkOption { + type = lib.types.str; default = "journalbeat"; description = '' Directory below `/var/lib/` to store journalbeat's @@ -44,8 +41,8 @@ in ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = "Any other configuration options you want to add"; }; @@ -53,11 +50,11 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { assertions = [ { - assertion = !hasPrefix "/" cfg.stateDir; + assertion = !lib.hasPrefix "/" cfg.stateDir; message = "The option services.journalbeat.stateDir shouldn't be an absolute directory." + " It should be a directory relative to /var/lib/."; From 5bc3fb494999ff0bf6a443271a76093b0b0b6399 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:30 +0200 Subject: [PATCH 188/197] nixos/services.journalwatch: remove `with lib;` --- .../modules/services/logging/journalwatch.nix | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/nixos/modules/services/logging/journalwatch.nix b/nixos/modules/services/logging/journalwatch.nix index 48fd992ffb65..ab75ed656c19 100644 --- a/nixos/modules/services/logging/journalwatch.nix +++ b/nixos/modules/services/logging/journalwatch.nix @@ -1,6 +1,4 @@ { config, lib, pkgs, ... }: -with lib; - let cfg = config.services.journalwatch; user = "journalwatch"; @@ -15,7 +13,7 @@ let priority = ${toString cfg.priority} mail_from = ${cfg.mailFrom} '' - + optionalString (cfg.mailTo != null) '' + + lib.optionalString (cfg.mailTo != null) '' mail_to = ${cfg.mailTo} '' + cfg.extraConfig); @@ -27,7 +25,7 @@ let ''; # empty line at the end needed to to separate the blocks - mkPatterns = filterBlocks: concatStringsSep "\n" (map (block: '' + mkPatterns = filterBlocks: lib.concatStringsSep "\n" (map (block: '' ${block.match} ${block.filters} @@ -48,18 +46,18 @@ let in { options = { services.journalwatch = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' If enabled, periodically check the journal with journalwatch and report the results by mail. ''; }; - package = mkPackageOption pkgs "journalwatch" { }; + package = lib.mkPackageOption pkgs "journalwatch" { }; - priority = mkOption { - type = types.int; + priority = lib.mkOption { + type = lib.types.int; default = 6; description = '' Lowest priority of message to be considered. @@ -73,33 +71,33 @@ in { # HACK: this is a workaround for journalwatch's usage of socket.getfqdn() which always returns localhost if # there's an alias for the localhost on a separate line in /etc/hosts, or take for ages if it's not present and # then return something right-ish in the direction of /etc/hostname. Just bypass it completely. - mailFrom = mkOption { - type = types.str; + mailFrom = lib.mkOption { + type = lib.types.str; default = "journalwatch@${config.networking.hostName}"; - defaultText = literalExpression ''"journalwatch@''${config.networking.hostName}"''; + defaultText = lib.literalExpression ''"journalwatch@''${config.networking.hostName}"''; description = '' Mail address to send journalwatch reports from. ''; }; - mailTo = mkOption { - type = types.nullOr types.str; + mailTo = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' Mail address to send journalwatch reports to. ''; }; - mailBinary = mkOption { - type = types.path; + mailBinary = lib.mkOption { + type = lib.types.path; default = "/run/wrappers/bin/sendmail"; description = '' Sendmail-compatible binary to be used to send the messages. ''; }; - extraConfig = mkOption { - type = types.str; + extraConfig = lib.mkOption { + type = lib.types.str; default = ""; description = '' Extra lines to be added verbatim to the journalwatch/config configuration file. @@ -108,11 +106,11 @@ in { ''; }; - filterBlocks = mkOption { - type = types.listOf (types.submodule { + filterBlocks = lib.mkOption { + type = lib.types.listOf (lib.types.submodule { options = { - match = mkOption { - type = types.str; + match = lib.mkOption { + type = lib.types.str; example = "SYSLOG_IDENTIFIER = systemd"; description = '' Syntax: `field = value` @@ -125,8 +123,8 @@ in { ''; }; - filters = mkOption { - type = types.str; + filters = lib.mkOption { + type = lib.types.str; example = '' (Stopped|Stopping|Starting|Started) .* (Reached target|Stopped target) .* @@ -190,8 +188,8 @@ in { ''; }; - interval = mkOption { - type = types.str; + interval = lib.mkOption { + type = lib.types.str; default = "hourly"; description = '' How often to run journalwatch. @@ -199,8 +197,8 @@ in { The format is described in systemd.time(7). ''; }; - accuracy = mkOption { - type = types.str; + accuracy = lib.mkOption { + type = lib.types.str; default = "10min"; description = '' The time window around the interval in which the journalwatch run will be scheduled. @@ -211,7 +209,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { users.users.${user} = { isSystemUser = true; @@ -242,7 +240,7 @@ in { # requires a relative directory name to create beneath /var/lib StateDirectory = user; StateDirectoryMode = "0750"; - ExecStart = "${getExe cfg.package} mail"; + ExecStart = "${lib.getExe cfg.package} mail"; # lowest CPU and IO priority, but both still in best-effort class to prevent starvation Nice=19; IOSchedulingPriority=7; From e3a59fb4ac5aafe335afe7087ee06bfb298bfa29 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:30 +0200 Subject: [PATCH 189/197] nixos/services.logcheck: remove `with lib;` --- nixos/modules/services/logging/logcheck.nix | 81 ++++++++++----------- 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/nixos/modules/services/logging/logcheck.nix b/nixos/modules/services/logging/logcheck.nix index bda7f9a607e1..d937a523c866 100644 --- a/nixos/modules/services/logging/logcheck.nix +++ b/nixos/modules/services/logging/logcheck.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.logcheck; @@ -22,7 +19,7 @@ let flags = "-r ${rulesDir} -c ${configFile} -L ${logFiles} -${levelFlag} -m ${cfg.mailTo}"; - levelFlag = getAttrFromPath [cfg.level] + levelFlag = lib.getAttrFromPath [cfg.level] { paranoid = "p"; server = "s"; workstation = "w"; @@ -43,7 +40,7 @@ let }; writeIgnoreCronRule = name: {level, user, regex, cmdline, ...}: - let escapeRegex = escape (stringToCharacters "\\[]{}()^$?*+|."); + let escapeRegex = lib.escape (lib.stringToCharacters "\\[]{}()^$?*+|."); cmdline_ = builtins.unsafeDiscardStringContext cmdline; re = if regex != "" then regex else if cmdline_ == "" then ".*" else escapeRegex cmdline_; in writeIgnoreRule "cron-${name}" { @@ -53,9 +50,9 @@ let ''; }; - levelOption = mkOption { + levelOption = lib.mkOption { default = "server"; - type = types.enum [ "workstation" "server" "paranoid" ]; + type = lib.types.enum [ "workstation" "server" "paranoid" ]; description = '' Set the logcheck level. ''; @@ -65,9 +62,9 @@ let options = { level = levelOption; - regex = mkOption { + regex = lib.mkOption { default = ""; - type = types.str; + type = lib.types.str; description = '' Regex specifying which log lines to ignore. ''; @@ -77,25 +74,25 @@ let ignoreCronOptions = { options = { - user = mkOption { + user = lib.mkOption { default = "root"; - type = types.str; + type = lib.types.str; description = '' User that runs the cronjob. ''; }; - cmdline = mkOption { + cmdline = lib.mkOption { default = ""; - type = types.str; + type = lib.types.str; description = '' Command line for the cron job. Will be turned into a regex for the logcheck ignore rule. ''; }; - timeArgs = mkOption { + timeArgs = lib.mkOption { default = null; - type = types.nullOr (types.str); + type = lib.types.nullOr (lib.types.str); example = "02 06 * * *"; description = '' "min hr dom mon dow" crontab time args, to auto-create a cronjob too. @@ -109,20 +106,20 @@ in { options = { services.logcheck = { - enable = mkEnableOption "logcheck cron job, to mail anomalies in the system logfiles to the administrator"; + enable = lib.mkEnableOption "logcheck cron job, to mail anomalies in the system logfiles to the administrator"; - user = mkOption { + user = lib.mkOption { default = "logcheck"; - type = types.str; + type = lib.types.str; description = '' Username for the logcheck user. ''; }; - timeOfDay = mkOption { + timeOfDay = lib.mkOption { default = "*"; example = "6"; - type = types.str; + type = lib.types.str; description = '' Time of day to run logcheck. A logcheck will be scheduled at xx:02 each day. Leave default (*) to run every hour. Of course when nothing special was logged, @@ -130,68 +127,68 @@ in ''; }; - mailTo = mkOption { + mailTo = lib.mkOption { default = "root"; example = "you@domain.com"; - type = types.str; + type = lib.types.str; description = '' Email address to send reports to. ''; }; - level = mkOption { + level = lib.mkOption { default = "server"; - type = types.str; + type = lib.types.str; description = '' Set the logcheck level. Either "workstation", "server", or "paranoid". ''; }; - config = mkOption { + config = lib.mkOption { default = "FQDN=1"; - type = types.lines; + type = lib.types.lines; description = '' Config options that you would like in logcheck.conf. ''; }; - files = mkOption { + files = lib.mkOption { default = [ "/var/log/messages" ]; - type = types.listOf types.path; + type = lib.types.listOf lib.types.path; example = [ "/var/log/messages" "/var/log/mail" ]; description = '' Which log files to check. ''; }; - extraRulesDirs = mkOption { + extraRulesDirs = lib.mkOption { default = []; example = [ "/etc/logcheck" ]; - type = types.listOf types.path; + type = lib.types.listOf lib.types.path; description = '' Directories with extra rules. ''; }; - ignore = mkOption { + ignore = lib.mkOption { default = {}; description = '' This option defines extra ignore rules. ''; - type = with types; attrsOf (submodule ignoreOptions); + type = with lib.types; attrsOf (submodule ignoreOptions); }; - ignoreCron = mkOption { + ignoreCron = lib.mkOption { default = {}; description = '' This option defines extra ignore rules for cronjobs. ''; - type = with types; attrsOf (submodule ignoreCronOptions); + type = with lib.types; attrsOf (submodule ignoreCronOptions); }; - extraGroups = mkOption { + extraGroups = lib.mkOption { default = []; - type = types.listOf types.str; + type = lib.types.listOf lib.types.str; example = [ "postdrop" "mongodb" ]; description = '' Extra groups for the logcheck user, for example to be able to use sendmail, @@ -202,12 +199,12 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { services.logcheck.extraRulesDirs = - mapAttrsToList writeIgnoreRule cfg.ignore - ++ mapAttrsToList writeIgnoreCronRule cfg.ignoreCron; + lib.mapAttrsToList writeIgnoreRule cfg.ignore + ++ lib.mapAttrsToList writeIgnoreCronRule cfg.ignoreCron; - users.users = optionalAttrs (cfg.user == "logcheck") { + users.users = lib.optionalAttrs (cfg.user == "logcheck") { logcheck = { group = "logcheck"; isSystemUser = true; @@ -216,7 +213,7 @@ in extraGroups = cfg.extraGroups; }; }; - users.groups = optionalAttrs (cfg.user == "logcheck") { + users.groups = lib.optionalAttrs (cfg.user == "logcheck") { logcheck = {}; }; @@ -236,7 +233,7 @@ in mkCron = name: {user, cmdline, timeArgs, ...}: '' ${timeArgs} ${user} ${cmdline} ''; - in mapAttrsToList mkCron (filterAttrs withTime cfg.ignoreCron) + in lib.mapAttrsToList mkCron (lib.filterAttrs withTime cfg.ignoreCron) ++ [ cronJob ]; }; } From 5ba36926e63540cc63ff786e6ae85bd7dfbc115d Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:31 +0200 Subject: [PATCH 190/197] nixos/services.logrotate: remove `with lib;` --- nixos/modules/services/logging/logrotate.nix | 71 ++++++++++---------- 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/nixos/modules/services/logging/logrotate.nix b/nixos/modules/services/logging/logrotate.nix index 9344277fc1e0..6db1b108cc6c 100644 --- a/nixos/modules/services/logging/logrotate.nix +++ b/nixos/modules/services/logging/logrotate.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, utils, ... }: - -with lib; - let cfg = config.services.logrotate; @@ -10,24 +7,24 @@ let else if builtins.elem n [ "frequency" ] then "${v}\n" else if builtins.elem n [ "firstaction" "lastaction" "prerotate" "postrotate" "preremove" ] then "${n}\n ${v}\n endscript\n" - else if isInt v then "${n} ${toString v}\n" + else if lib.isInt v then "${n} ${toString v}\n" else if v == true then "${n}\n" else if v == false then "no${n}\n" else "${n} ${v}\n"; - generateSection = indent: settings: concatStringsSep (fixedWidthString indent " " "") ( - filter (x: x != null) (mapAttrsToList generateLine settings) + generateSection = indent: settings: lib.concatStringsSep (lib.fixedWidthString indent " " "") ( + lib.filter (x: x != null) (lib.mapAttrsToList generateLine settings) ); # generateSection includes a final newline hence weird closing brace mkConf = settings: if settings.global or false then generateSection 0 settings else '' - ${concatMapStringsSep "\n" (files: ''"${files}"'') (toList settings.files)} { + ${lib.concatMapStringsSep "\n" (files: ''"${files}"'') (lib.toList settings.files)} { ${generateSection 2 settings}} ''; - settings = sortProperties (attrValues (filterAttrs (_: settings: settings.enable) ( - foldAttrs recursiveUpdate { } [ + settings = lib.sortProperties (lib.attrValues (lib.filterAttrs (_: settings: settings.enable) ( + lib.foldAttrs lib.recursiveUpdate { } [ { header = { enable = true; @@ -43,10 +40,10 @@ let ))); configFile = pkgs.writeTextFile { name = "logrotate.conf"; - text = concatStringsSep "\n" ( + text = lib.concatStringsSep "\n" ( map mkConf settings ); - checkPhase = optionalString cfg.checkConfig '' + checkPhase = lib.optionalString cfg.checkConfig '' # logrotate --debug also checks that users specified in config # file exist, but we only have sandboxed users here so brown these # out. according to man page that means su, create and createolddir. @@ -83,24 +80,24 @@ let }; mailOption = - optionalString (foldr (n: a: a || (n.mail or false) != false) false (attrValues cfg.settings)) + lib.optionalString (lib.foldr (n: a: a || (n.mail or false) != false) false (lib.attrValues cfg.settings)) "--mail=${pkgs.mailutils}/bin/mail"; in { imports = [ - (mkRemovedOptionModule [ "services" "logrotate" "config" ] "Modify services.logrotate.settings.header instead") - (mkRemovedOptionModule [ "services" "logrotate" "extraConfig" ] "Modify services.logrotate.settings.header instead") - (mkRemovedOptionModule [ "services" "logrotate" "paths" ] "Add attributes to services.logrotate.settings instead") + (lib.mkRemovedOptionModule [ "services" "logrotate" "config" ] "Modify services.logrotate.settings.header instead") + (lib.mkRemovedOptionModule [ "services" "logrotate" "extraConfig" ] "Modify services.logrotate.settings.header instead") + (lib.mkRemovedOptionModule [ "services" "logrotate" "paths" ] "Add attributes to services.logrotate.settings instead") ]; options = { services.logrotate = { - enable = mkEnableOption "the logrotate systemd service" // { - default = foldr (n: a: a || n.enable) false (attrValues cfg.settings); - defaultText = literalExpression "cfg.settings != {}"; + enable = lib.mkEnableOption "the logrotate systemd service" // { + default = lib.foldr (n: a: a || n.enable) false (lib.attrValues cfg.settings); + defaultText = lib.literalExpression "cfg.settings != {}"; }; - settings = mkOption { + settings = lib.mkOption { default = { }; description = '' logrotate freeform settings: each attribute here will define its own section, @@ -111,7 +108,7 @@ in as logrotate config directives, refer to for details. ''; - example = literalExpression '' + example = lib.literalExpression '' { # global options header = { @@ -138,24 +135,24 @@ in }; }; ''; - type = types.attrsOf (types.submodule ({ name, ... }: { - freeformType = with types; attrsOf (nullOr (oneOf [ int bool str ])); + type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: { + freeformType = with lib.types; attrsOf (nullOr (oneOf [ int bool str ])); options = { - enable = mkEnableOption "setting individual kill switch" // { + enable = lib.mkEnableOption "setting individual kill switch" // { default = true; }; - global = mkOption { - type = types.bool; + global = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether this setting is a global option or not: set to have these settings apply to all files settings with a higher priority. ''; }; - files = mkOption { - type = with types; either str (listOf str); + files = lib.mkOption { + type = with lib.types; either str (listOf str); default = name; defaultText = '' The attrset name if not specified @@ -168,8 +165,8 @@ in ''; }; - frequency = mkOption { - type = types.nullOr types.str; + frequency = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' How often to rotate the logs. Defaults to previously set global setting, @@ -177,8 +174,8 @@ in ''; }; - priority = mkOption { - type = types.int; + priority = lib.mkOption { + type = lib.types.int; default = 1000; description = '' Order of this logrotate block in relation to the others. The semantics are @@ -190,8 +187,8 @@ in })); }; - configFile = mkOption { - type = types.path; + configFile = lib.mkOption { + type = lib.types.path; default = configFile; defaultText = '' A configuration file automatically generated by NixOS. @@ -200,7 +197,7 @@ in Override the configuration file used by logrotate. By default, NixOS generates one automatically from [](#opt-services.logrotate.settings). ''; - example = literalExpression '' + example = lib.literalExpression '' pkgs.writeText "logrotate.conf" ''' missingok "/var/log/*.log" { @@ -211,8 +208,8 @@ in ''; }; - checkConfig = mkOption { - type = types.bool; + checkConfig = lib.mkOption { + type = lib.types.bool; default = true; description = '' Whether the config should be checked at build time. @@ -240,7 +237,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.logrotate = { description = "Logrotate Service"; startAt = "hourly"; From 5b61b700823c3d5af23eb966c617a1ea86ba4017 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:31 +0200 Subject: [PATCH 191/197] nixos/services.logstash: remove `with lib;` --- nixos/modules/services/logging/logstash.nix | 67 ++++++++++----------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/nixos/modules/services/logging/logstash.nix b/nixos/modules/services/logging/logstash.nix index 53e2e91d6212..31f0eef77c46 100644 --- a/nixos/modules/services/logging/logstash.nix +++ b/nixos/modules/services/logging/logstash.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.logstash; ops = lib.optionalString; @@ -38,8 +35,8 @@ in { imports = [ - (mkRenamedOptionModule [ "services" "logstash" "address" ] [ "services" "logstash" "listenAddress" ]) - (mkRemovedOptionModule [ "services" "logstash" "enableWeb" ] "The web interface was removed from logstash") + (lib.mkRenamedOptionModule [ "services" "logstash" "address" ] [ "services" "logstash" "listenAddress" ]) + (lib.mkRemovedOptionModule [ "services" "logstash" "enableWeb" ] "The web interface was removed from logstash") ]; ###### interface @@ -48,23 +45,23 @@ in services.logstash = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = "Enable logstash."; }; - package = mkPackageOption pkgs "logstash" { }; + package = lib.mkPackageOption pkgs "logstash" { }; - plugins = mkOption { - type = types.listOf types.path; + plugins = lib.mkOption { + type = lib.types.listOf lib.types.path; default = [ ]; - example = literalExpression "[ pkgs.logstash-contrib ]"; + example = lib.literalExpression "[ pkgs.logstash-contrib ]"; description = "The paths to find other logstash plugins in."; }; - dataDir = mkOption { - type = types.str; + dataDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/logstash"; description = '' A path to directory writable by logstash that it uses to store data. @@ -72,35 +69,35 @@ in ''; }; - logLevel = mkOption { - type = types.enum [ "debug" "info" "warn" "error" "fatal" ]; + logLevel = lib.mkOption { + type = lib.types.enum [ "debug" "info" "warn" "error" "fatal" ]; default = "warn"; description = "Logging verbosity level."; }; - filterWorkers = mkOption { - type = types.int; + filterWorkers = lib.mkOption { + type = lib.types.int; default = 1; description = "The quantity of filter workers to run."; }; - listenAddress = mkOption { - type = types.str; + listenAddress = lib.mkOption { + type = lib.types.str; default = "127.0.0.1"; description = "Address on which to start webserver."; }; - port = mkOption { - type = types.str; + port = lib.mkOption { + type = lib.types.str; default = "9292"; description = "Port on which to start webserver."; }; - inputConfig = mkOption { - type = types.lines; + inputConfig = lib.mkOption { + type = lib.types.lines; default = "generator { }"; description = "Logstash input configuration."; - example = literalExpression '' + example = lib.literalExpression '' ''' # Read from journal pipe { @@ -111,8 +108,8 @@ in ''; }; - filterConfig = mkOption { - type = types.lines; + filterConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = "logstash filter configuration."; example = '' @@ -129,8 +126,8 @@ in ''; }; - outputConfig = mkOption { - type = types.lines; + outputConfig = lib.mkOption { + type = lib.types.lines; default = "stdout { codec => rubydebug }"; description = "Logstash output configuration."; example = '' @@ -139,8 +136,8 @@ in ''; }; - extraSettings = mkOption { - type = types.lines; + extraSettings = lib.mkOption { + type = lib.types.lines; default = ""; description = "Extra Logstash settings in YAML format."; example = '' @@ -151,8 +148,8 @@ in ''; }; - extraJvmOptions = mkOption { - type = types.lines; + extraJvmOptions = lib.mkOption { + type = lib.types.lines; default = ""; description = "Extra JVM options, one per line (jvm.options format)."; example = '' @@ -167,17 +164,17 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.logstash = { description = "Logstash Daemon"; wantedBy = [ "multi-user.target" ]; path = [ pkgs.bash ]; serviceConfig = { ExecStartPre = ''${pkgs.coreutils}/bin/mkdir -p "${cfg.dataDir}" ; ${pkgs.coreutils}/bin/chmod 700 "${cfg.dataDir}"''; - ExecStart = concatStringsSep " " (filter (s: stringLength s != 0) [ + ExecStart = lib.concatStringsSep " " (lib.filter (s: lib.stringLength s != 0) [ "${cfg.package}/bin/logstash" "-w ${toString cfg.filterWorkers}" - (concatMapStringsSep " " (x: "--path.plugins ${x}") cfg.plugins) + (lib.concatMapStringsSep " " (x: "--path.plugins ${x}") cfg.plugins) "${verbosityFlag}" "-f ${logstashConf}" "--path.settings ${logstashSettingsDir}" From bb1483bbc63e9cb2e4b27a115627dcbc65afc111 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:31 +0200 Subject: [PATCH 192/197] nixos/services.rsyslogd: remove `with lib;` --- nixos/modules/services/logging/rsyslogd.nix | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/nixos/modules/services/logging/rsyslogd.nix b/nixos/modules/services/logging/rsyslogd.nix index 25b6eec5056c..88a8ff840682 100644 --- a/nixos/modules/services/logging/rsyslogd.nix +++ b/nixos/modules/services/logging/rsyslogd.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.rsyslogd; @@ -36,8 +33,8 @@ in services.rsyslogd = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable syslogd. Note that systemd also logs @@ -45,8 +42,8 @@ in ''; }; - defaultConfig = mkOption { - type = types.lines; + defaultConfig = lib.mkOption { + type = lib.types.lines; default = defaultConf; description = '' The default {file}`syslog.conf` file configures a @@ -55,8 +52,8 @@ in ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; example = "news.* -/var/log/news"; description = '' @@ -65,8 +62,8 @@ in ''; }; - extraParams = mkOption { - type = types.listOf types.str; + extraParams = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ ]; example = [ "-m 0" ]; description = '' @@ -81,7 +78,7 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.rsyslog ]; From b14d3ec28f8e27ed8280d8b5932122c814b5ea1a Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:32 +0200 Subject: [PATCH 193/197] nixos/services.syslog-ng: remove `with lib;` --- nixos/modules/services/logging/syslog-ng.nix | 31 +++++++++----------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/nixos/modules/services/logging/syslog-ng.nix b/nixos/modules/services/logging/syslog-ng.nix index 14e18d3f0eef..d9d4b0cdb94a 100644 --- a/nixos/modules/services/logging/syslog-ng.nix +++ b/nixos/modules/services/logging/syslog-ng.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.syslog-ng; @@ -17,7 +14,7 @@ let syslogngOptions = [ "--foreground" - "--module-path=${concatStringsSep ":" (["${cfg.package}/lib/syslog-ng"] ++ cfg.extraModulePaths)}" + "--module-path=${lib.concatStringsSep ":" (["${cfg.package}/lib/syslog-ng"] ++ cfg.extraModulePaths)}" "--cfgfile=${syslogngConfig}" "--control=${ctrlSocket}" "--persist-file=${persistFile}" @@ -26,23 +23,23 @@ let in { imports = [ - (mkRemovedOptionModule [ "services" "syslog-ng" "serviceName" ] "") - (mkRemovedOptionModule [ "services" "syslog-ng" "listenToJournal" ] "") + (lib.mkRemovedOptionModule [ "services" "syslog-ng" "serviceName" ] "") + (lib.mkRemovedOptionModule [ "services" "syslog-ng" "listenToJournal" ] "") ]; options = { services.syslog-ng = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable the syslog-ng daemon. ''; }; - package = mkPackageOption pkgs "syslogng" { }; - extraModulePaths = mkOption { - type = types.listOf types.str; + package = lib.mkPackageOption pkgs "syslogng" { }; + extraModulePaths = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; description = '' A list of paths that should be included in syslog-ng's @@ -50,15 +47,15 @@ in { end in `/lib/syslog-ng` ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; description = '' Configuration added to the end of `syslog-ng.conf`. ''; }; - configHeader = mkOption { - type = types.lines; + configHeader = lib.mkOption { + type = lib.types.lines; default = '' @version: 4.4 @include "scl.conf" @@ -71,7 +68,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.syslog-ng = { description = "syslog-ng daemon"; preStart = "mkdir -p /{var,run}/syslog-ng"; @@ -82,7 +79,7 @@ in { PIDFile = pidFile; StandardOutput = "null"; Restart = "on-failure"; - ExecStart = "${cfg.package}/sbin/syslog-ng ${concatStringsSep " " syslogngOptions}"; + ExecStart = "${cfg.package}/sbin/syslog-ng ${lib.concatStringsSep " " syslogngOptions}"; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; }; }; From 12cf354b8384ac6bc7f24bc8fbf85e135a941d72 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:32 +0200 Subject: [PATCH 194/197] nixos/services.syslogd: remove `with lib;` --- nixos/modules/services/logging/syslogd.nix | 33 ++++++++++------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/nixos/modules/services/logging/syslogd.nix b/nixos/modules/services/logging/syslogd.nix index 8674fad69658..ad2d09b5a8de 100644 --- a/nixos/modules/services/logging/syslogd.nix +++ b/nixos/modules/services/logging/syslogd.nix @@ -1,13 +1,10 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.syslogd; syslogConf = pkgs.writeText "syslog.conf" '' - ${optionalString (cfg.tty != "") "kern.warning;*.err;authpriv.none /dev/${cfg.tty}"} + ${lib.optionalString (cfg.tty != "") "kern.warning;*.err;authpriv.none /dev/${cfg.tty}"} ${cfg.defaultConfig} ${cfg.extraConfig} ''; @@ -36,8 +33,8 @@ in services.syslogd = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to enable syslogd. Note that systemd also logs @@ -45,8 +42,8 @@ in ''; }; - tty = mkOption { - type = types.str; + tty = lib.mkOption { + type = lib.types.str; default = "tty10"; description = '' The tty device on which syslogd will print important log @@ -54,8 +51,8 @@ in ''; }; - defaultConfig = mkOption { - type = types.lines; + defaultConfig = lib.mkOption { + type = lib.types.lines; default = defaultConf; description = '' The default {file}`syslog.conf` file configures a @@ -64,16 +61,16 @@ in ''; }; - enableNetworkInput = mkOption { - type = types.bool; + enableNetworkInput = lib.mkOption { + type = lib.types.bool; default = false; description = '' Accept logging through UDP. Option -r of syslogd(8). ''; }; - extraConfig = mkOption { - type = types.lines; + extraConfig = lib.mkOption { + type = lib.types.lines; default = ""; example = "news.* -/var/log/news"; description = '' @@ -82,8 +79,8 @@ in ''; }; - extraParams = mkOption { - type = types.listOf types.str; + extraParams = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ ]; example = [ "-m 0" ]; description = '' @@ -98,7 +95,7 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { assertions = [ { assertion = !config.services.rsyslogd.enable; @@ -108,7 +105,7 @@ in environment.systemPackages = [ pkgs.sysklogd ]; - services.syslogd.extraParams = optional cfg.enableNetworkInput "-r"; + services.syslogd.extraParams = lib.optional cfg.enableNetworkInput "-r"; # FIXME: restarting syslog seems to break journal logging. systemd.services.syslog = From 640892113aa0a2ff0f2090fd49d0cc7ed8f608ca Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:32 +0200 Subject: [PATCH 195/197] nixos/services.ulogd: remove `with lib;` --- nixos/modules/services/logging/ulogd.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/logging/ulogd.nix b/nixos/modules/services/logging/ulogd.nix index 5bd51ef88fe5..9d1d8e61231d 100644 --- a/nixos/modules/services/logging/ulogd.nix +++ b/nixos/modules/services/logging/ulogd.nix @@ -1,6 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; let cfg = config.services.ulogd; settingsFormat = pkgs.formats.ini { listsAsDuplicateKeys = true; }; @@ -8,9 +6,9 @@ let in { options = { services.ulogd = { - enable = mkEnableOption "ulogd, a userspace logging daemon for netfilter/iptables related logging"; + enable = lib.mkEnableOption "ulogd, a userspace logging daemon for netfilter/iptables related logging"; - settings = mkOption { + settings = lib.mkOption { example = { global.stack = [ "log1:NFLOG,base1:BASE,ifi1:IFINDEX,ip2str1:IP2STR,print1:PRINTPKT,emu1:LOGEMU" @@ -35,8 +33,8 @@ in { "Configuration for ulogd. See {file}`/share/doc/ulogd/` in `pkgs.ulogd.doc`."; }; - logLevel = mkOption { - type = types.enum [ 1 3 5 7 8 ]; + logLevel = lib.mkOption { + type = lib.types.enum [ 1 3 5 7 8 ]; default = 5; description = "Log level (1 = debug, 3 = info, 5 = notice, 7 = error, 8 = fatal)"; @@ -44,7 +42,7 @@ in { }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.services.ulogd = { description = "Ulogd Daemon"; wantedBy = [ "multi-user.target" ]; From 28072b63dde295735a30087e0b293c37531cc256 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:33 +0200 Subject: [PATCH 196/197] nixos/services.vector: remove `with lib;` --- nixos/modules/services/logging/vector.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/nixos/modules/services/logging/vector.nix b/nixos/modules/services/logging/vector.nix index 129a38b1d20f..c68d546bb96c 100644 --- a/nixos/modules/services/logging/vector.nix +++ b/nixos/modules/services/logging/vector.nix @@ -1,24 +1,22 @@ { config, lib, pkgs, ... }: - -with lib; let cfg = config.services.vector; in { options.services.vector = { - enable = mkEnableOption "Vector, a high-performance observability data pipeline"; + enable = lib.mkEnableOption "Vector, a high-performance observability data pipeline"; - package = mkPackageOption pkgs "vector" { }; + package = lib.mkPackageOption pkgs "vector" { }; - journaldAccess = mkOption { - type = types.bool; + journaldAccess = lib.mkOption { + type = lib.types.bool; default = false; description = '' Enable Vector to access journald. ''; }; - settings = mkOption { + settings = lib.mkOption { type = (pkgs.formats.json { }).type; default = { }; description = '' @@ -27,7 +25,7 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { # for cli usage environment.systemPackages = [ pkgs.vector ]; @@ -49,14 +47,14 @@ in ''; in { - ExecStart = "${getExe cfg.package} --config ${validateConfig conf}"; + ExecStart = "${lib.getExe cfg.package} --config ${validateConfig conf}"; DynamicUser = true; Restart = "always"; StateDirectory = "vector"; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; AmbientCapabilities = "CAP_NET_BIND_SERVICE"; # This group is required for accessing journald. - SupplementaryGroups = mkIf cfg.journaldAccess "systemd-journal"; + SupplementaryGroups = lib.mkIf cfg.journaldAccess "systemd-journal"; }; unitConfig = { StartLimitIntervalSec = 10; From 14dad27e70df3eb4ecb4cdc1af80ac09e34e7de4 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 27 Aug 2024 20:43:33 +0200 Subject: [PATCH 197/197] nixos/services.prometheus.exporters: remove `with lib;` --- .../monitoring/prometheus/exporters.md | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/nixos/modules/services/monitoring/prometheus/exporters.md b/nixos/modules/services/monitoring/prometheus/exporters.md index d291020d3673..23464b9d315e 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters.md +++ b/nixos/modules/services/monitoring/prometheus/exporters.md @@ -83,9 +83,6 @@ example: ```nix # nixpkgs/nixos/modules/services/prometheus/exporters/postfix.nix { config, lib, pkgs, options }: - - with lib; - let # for convenience we define cfg here cfg = config.services.prometheus.exporters.postfix; @@ -97,15 +94,15 @@ example: # (and optional overrides for default options). # Note that this attribute is optional. extraOpts = { - telemetryPath = mkOption { - type = types.str; + telemetryPath = lib.mkOption { + type = lib.types.str; default = "/metrics"; description = '' Path under which to expose metrics. ''; }; - logfilePath = mkOption { - type = types.path; + logfilePath = lib.mkOption { + type = lib.types.path; default = /var/log/postfix_exporter_input.log; example = /var/log/mail.log; description = '' @@ -113,8 +110,8 @@ example: This file will be truncated by this exporter! ''; }; - showqPath = mkOption { - type = types.path; + showqPath = lib.mkOption { + type = lib.types.path; default = /var/spool/postfix/public/showq; example = /var/lib/postfix/queue/public/showq; description = '' @@ -136,7 +133,7 @@ example: ${pkgs.prometheus-postfix-exporter}/bin/postfix_exporter \ --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \ --web.telemetry-path ${cfg.telemetryPath} \ - ${concatStringsSep " \\\n " cfg.extraFlags} + ${lib.concatStringsSep " \\\n " cfg.extraFlags} ''; }; }; @@ -156,8 +153,6 @@ information about the change to the exporter definition similar to ```nix { config, lib, pkgs, options }: -with lib; - let cfg = config.services.prometheus.exporters.nginx; in @@ -173,10 +168,10 @@ in }; imports = [ # 'services.prometheus.exporters.nginx.telemetryEndpoint' -> 'services.prometheus.exporters.nginx.telemetryPath' - (mkRenamedOptionModule [ "telemetryEndpoint" ] [ "telemetryPath" ]) + (lib.mkRenamedOptionModule [ "telemetryEndpoint" ] [ "telemetryPath" ]) # removed option 'services.prometheus.exporters.nginx.insecure' - (mkRemovedOptionModule [ "insecure" ] '' + (lib.mkRemovedOptionModule [ "insecure" ] '' This option was replaced by 'prometheus.exporters.nginx.sslVerify' which defaults to true. '') ({ options.warnings = options.warnings; })