summary refs log tree commit diff
path: root/nixos/lib/utils.nix
Commit message (Collapse)AuthorAge
* Fix broken genJqSecretsReplacementSnippet for jq 1.7 (#257932)Reno Reckling2023-09-30
| | | | | jq 1.7 updated it's behaviour and now throws an error if the first argument is an empty string. It now needs "." to pass the input through.
* nixos/networkd: refactormutantmell2023-07-01
| | | | Reduces size of networkd module by moving unit file generation code into a util.
* lib.replaceChars: warn about being a deprecated aliasArtturin2022-12-15
| | | | | | | | replaceStrings has been in nix since 2015(nix 1.10) so it is safe to remove the fallback https://github.com/nixos/nix/commit/d6d5885c1567454754a0d260521bafa0bd5e7fdb
* Revert "nixos/lib: add /home to pathsNeededForBoot"Artturi2022-12-03
|
* nixos/lib: add /home to pathsNeededForBootLin Jian2022-12-01
| | | | | | | | | | | | | | | Before this patch, if we: 1. add a new user in the config, 2. mount /home seperately, 3. not set neededForBoot for /home, 4. and run `nixos-rebuild boot`, the newly added user's home will not be created after a reboot. This is because when nixos/modules/config/update-users-groups.pl is running in stage 2 to setup users, /home is not mounted. This patch fixes this issue.
* nixos/lib.escapeSystemdPath: Implement the correct algorithm for escaping ↵Daniel Olsen2022-10-20
| | | | | | names in systemd units Co-authored-by: ajs124 <git@ajs124.de>
* genJqSecretsReplacementSnippet: Allow dots in attribute names...talyz2022-10-09
| | | | ...and escape quotation marks and backslashes.
* nixos: Fix up systemd shutdown ramfsWill Fancher2022-04-28
|
* nixos/utils: move removePackagesByName to here from gnomeSandro Jäckel2022-04-11
|
* nixos: systemd: Split unit types into separate moduleWill Fancher2022-03-21
|
* Merge pull request #154113 from pennae/systemd-escapingpennae2022-03-13
|\ | | | | nixos: add functions and documentation for escaping systemd Exec* directives
| * nixos: add functions and documentation for escaping systemd Exec* directivespennae2022-03-12
| | | | | | | | | | | | | | it's really easy to accidentally write the wrong systemd Exec* directive, ones that works most of the time but fails when users include systemd metacharacters in arguments that are interpolated into an Exec* directive. add a few functions analogous to escapeShellArg{,s} and some documentation on how and when to use them.
* | genJqSecretsReplacementSnippet: Fix error handlingtalyz2022-02-23
| | | | | | | | | | | | | | | | | | | | With the previous change that enabled error propagation through `inherit_errexit`, the script would fail if `errexit` was set, but `inherit_errexit` was not. This is due to `shopt -p` exiting with an error if the option is disabled. To work around this, use the exit code instead of the text value returned by `shopt -p`. Fixes #160869.
* | genJqSecretsReplacementSnippet: Propagate secret file read errorstalyz2022-01-31
|/ | | | | | | | | | If an error occurs while trying to read a secret file, we want that error to propagate to the main shell context. That means we have to set the `inherit_errexit` option, which allows errors from subshells to propagate to the outer shell. Also, the subshell cannot run as part of another command, such as `export`, since that will simply ignore the subshell exit status and only respect `export`s exit status; first assigning the value to a variable and then exporting it solves issue.
* Move systemd-lib.nix and systemd-unit-options.nix into utilsWill Fancher2021-11-20
|
* nixos/lib: add /usr to pathsNeededForBootArtturin2021-11-15
| | | | | if /usr is split from root then it has to be mounted at boot See https://github.com/NixOS/nixpkgs/issues/146115
* Merge pull request #112823 from deviant/nixos-boot-pathsKim Lindberger2021-10-07
|\ | | | | nixos/boot: add /var/lib/nixos to pathsNeededForBoot
| * nixos/boot: add /var/lib/nixos to pathsNeededForBootV2021-02-11
| | | | | | | | | | | | | | | | | | /var/lib/nixos is used by update-users-groups.pl in the activation script for storing uid/gid mappings. If this has its own mountpoint (as is the case in some setups with fine-grained bind mounts pointing into persistent storage), the mappings are written to /var/lib, /var, or /. These may be backed by a tmpfs or (otherwise ephemeral storage), resulting in the mappings not persisting between reboots.
* | treewide: runCommandNoCC -> runCommandRobert Hensing2021-08-15
| | | | | | | | This has been synonymous for ~5y.
* | nixos/lib: Handle null `device` correctlyjakobrs2021-06-18
| |
* | nixos/lib, nixos/filesystems: Make fsBefore more stable, and add `depends` ↵jakobrs2021-06-08
|/ | | | option
* nixos/{containers,cri-o,podman}: move copyFile to nixos/lib/utilszowoq2020-09-24
|
* nixos/boot: some documentation improvementsKeshav Kini2020-07-29
| | | | | | | | - Give a more accurate description of how fileSystems.<name/>.neededForBoot works - Give a more detailed description of how fileSystems.<name/>.encrypted.keyFile works
* nixos/lib: use removePrefix in escapeSystemdPathflorianjacob2020-03-14
|
* nixos/lib/utils: Make the set recursive again, unbreak evalSarah Brofeldt2019-09-08
|
* Merge pull request #66274 from talyz/gitlabFlorian Klink2019-09-07
|\ | | | | nixos/gitlab: Add support for secure secrets and more
| * nixos/utils: Handle arbitrary secrets in JSON output filestalyz2019-09-06
| | | | | | | | | | | | Introduce new functions which allows modules to define options where, if the input is an attrset and the output is JSON, the user can define arbitrary secrets.
* | treewide: remove redundant recvolth2019-08-28
|/
* fix infinite recursion caused by the unnecessary inspection of options + fix ↵msteen2018-12-24
| | | | is parent of mount point check (#51541)
* nixos: generalize copy-paste from stage-1 and zfs to utilsJan Malakhovski2016-08-23
|
* nixos: apply toposort to fileSystems to support bind and move mountsJan Malakhovski2016-08-23
| | | | And use new `config.system.build.fileSystems` property everywhere.
* nixos: throw an error on invalid shell packagezimbatm2016-07-04
| | | | All shell packages must export the shellPath passthru
* Use shell packages to select the user's shellzimbatm2016-06-12
| | | | The string type is still available for backward-compatiblity.
* nixos/utils: Don't remove first character if not a /William A. Kennington III2014-09-03
|
* Move all of NixOS to nixos/ in preparation of the repository mergeEelco Dolstra2013-10-10