1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-28 17:38:33 +02:00
Commit Graph

11 Commits

Author SHA1 Message Date
h7x4
fce9dbfeb4
lib: add generator for KDL
Added a generator for the KDL document language.
This is in order for home-manager to natively generate
the new config format for zellij, as described in nix-community#3364.

There is not a one to one mapping between KDL and nix types,
but attrset translation is heavily based on KDLs JSON-IN-KDL microsyntax.
The exception here is the `_args` and `_props` arguments, which lets you
specify arguments and properties as described in the spec.

See more here:
- https://kdl.dev/
- https://github.com/kdl-org/kdl/blob/main/SPEC.md

The generator also conforms to the interface from the nixpkgs manual:
https://nixos.org/manual/nixpkgs/stable/#sec-generators

Co-authored-by: Gaetan Lepage <gaetan@glepage.com>
2023-03-10 16:48:10 +01:00
rcerc
4a724cb84c
lib: improve DAG library
Specifically,

- directly export `modules/lib/dag.nix` instead of renaming
  attributes,

- run through utilities to reuse code where possible,

- expose `lib.hm.dag.isEntry` and reuse it in
  `modules/lib/types-dag.nix`,

- reuse utilities through `lib` set instead of passing imports to
  functions, and

- eta reduction of `map`, `entryAnywhere`, `entryAfter` and
  `entryBefore`.
2022-07-18 15:32:48 +02:00
Sumner Evans
f911ebbec9
lib.booleans: add yesNo function (#2818)
Closes #2772
2022-04-07 22:36:13 -06:00
Robert Helgesson
5f433eb164
Move platform check into modules
Before, loading a module would be guarded by an optional platform
condition. This made it possible to avoid loading and evaluating a
module if it did not support the host platform.

Unfortunately, this made it impossible to share a single configuration
between GNU/Linux and Darwin hosts, which some wish to do.

This removes the conditional load and instead inserts host platform
assertions in the modules that are platform specific.

Fixes #1906
2021-07-18 20:43:22 +02:00
Robert Helgesson
866d7d5152
lib: add maintainers attribute set
This attribute set is for users who are Home Manager maintainers but
not Nixpkgs maintainers.
2020-05-02 16:30:55 +02:00
Robert Helgesson
ac9e44a831
lib: add GVariant datatype and functions 2020-03-21 00:28:50 +01:00
Robert Helgesson
6e4b9af080
Switch to extended Nixpkg's lib
This change makes use of the `extend` function inside `lib` to inject
a new `hm` field containing the Home Manager library functions. This
simplifies use of the Home Manager library in the modules and reduces
the risk of accidental infinite recursion.

PR #994
2020-01-21 20:47:04 +01:00
Robert Helgesson
7c04351a57
files: allow a wider range of source file names
In particular support source files whose name start with `.` or
contain characters not allowed in the nix store, such as spaces.

Also add some test cases for `home.file`.
2019-01-19 12:44:58 +01:00
Marcial Gaißert
62eb7ebeba
lib.zsh: add module
Added utilities to generate export statements and definitions for zsh scripts.

Currently, there is only lib.shell which generates export statements in bash
syntax. However, this does not allow to generate export statements for zsh
arrays (syntax: NAME=(elem1 elem2 ...) ), which would be the natural
representation of lists in the nix language.
2019-01-11 10:26:12 +01:00
Robert Helgesson
58a629b02e
lib/shell: add library of convenience functions
This library holds a few convenience functions for generating shell
code.
2018-01-07 16:59:22 +01:00
Robert Helgesson
f0d207f380
Add dag library to config.lib
Also replace all imports of `dag.nix` by the entry in `config.lib`.
2017-12-26 17:27:21 +01:00