commits
Really important typo fix, probably the most important typo fix ever,
all of my friends say so, so it must be true.
This PR fixes a typo in an option description.
This allows the aspect to be included in other aspects and compose all
unfree packages that are defined.
:warning: I just have tested the code for nixos and home-manager (as
module) definitions.
### Context:
I want to use `<den/unfree>` in multiple aspects and have their defined
packages to combined to one large `allowUnfreePredicate`.
That allows to define the unfree packages in the aspects near their
usage and not on the respective class definition (e.G. the host).
Here an example on my tryout repo where i am currently exploring how to
build my configs with den.
This defines an unfree predicate for vscode and the respective addons:
https://github.com/Shawn8901/dend_test/blob/main/modules/aspects/cfg/desktop/coding.nix
This defines my printer
https://github.com/Shawn8901/dend_test/blob/main/modules/aspects/cfg/printer.nix#L6
Both are later on then used in the host pointalpha together, whilst the
printer aspect is not used on my zenbook.
### Possible workarounds
* Gather unfree packages by hand and define them once on a class
* use `nixpkgs.config.allowUnfree = true`
### Other resources
Discussion on zulip
https://oeiuwq.zulipchat.com/#narrow/channel/548534-den/topic/feat-idea.20composable.20unfree.20batteries/with/564892231
Actual "root issue" why predicates are not combine/composable by default
https://github.com/NixOS/nixpkgs/issues/197325
### Possible Todos
~One issue i found is, that it does not play well with setting~
```nix
nixos.home-manager.useGlobalPkgs = true;
```
~as its setting a `nixpkgs.config.allowUnfreePredicate` even tho its not
allowed when using `useGlobalPkgs` in homeManager class.~
~This should just be done if `useGlobalPkgs` is set to false, tho i am
not yet fully confident how to set that condition correctly with den.~
Might have found a reasonable solution for that, see
https://github.com/vic/den/pull/128#discussion_r2656546800
See [#den > Set user unspecific home-manager
options](https://oeiuwq.zulipchat.com/#narrow/channel/548534-den/topic/Set.20user.20unspecific.20home-manager.20options/with/563739770)
This changeset introduces a new Den core context: `{ HM-OS-HOST }`
invoked on host aspects. This context is used by our home-manager
integration but can also be used by any other host aspect to detect when
HM is enabled, for example to set `useGlobalPkgs`.
This context is produced by `hm-os-host.nix` when it detects any host
that has an OS supported by home-manager AND has at least one user with
`homeManager` class.
The aspect from `hm-os-host.nix` is internal, always included in
`den.default`.
When `den._.home-manager` integration is enabled, it reacts to the
`host-aspect { HM-OS-HOST }` context and setups home-manager
integration. For each user it calls `user-aspect { HM-OS-USER }` for
hm-dependencies.nix to include the correct dependencies.
home-manager related code has been moved to ./provides/home-manager/.
Closes #121
Nicely done, Heitor. Thanks :)
Allows users to have a base module for home/host/user definitions:
```nix
den.base.host = {
# applies to all den.hosts.<system>.<name>
# use it to define options all hosts might have.
};
den.base.user = { ... } # included in all den.hosts.<system>.<name>.users.<user>
den.base.home = { ... } # included in all den.homes.<system>.<name>
den.base.conf = { ... } # included in ANY host / user / home config.
```
improve docs of #117
Adds `inputs'` and `self'` aspects
flake-file's dendritic module no longer includes den nor flake-aspects. We now provide our own flakeModules.dendritic that does so.
Fixes #59
See https://github.com/vic/den/discussions/99#discussion-9150825
Fixes #99
This introduces `parametric.withOwn` that is just a `parametric.atLeast`
that also includes the aspect owned configs.
See discussion:
https://github.com/vic/den/discussions/91#discussioncomment-14985716
Calling `parametric x` itself is an alias for `parametric.withOwn x`.
So that both syntax do the same:
```
den.aspects.foo = {
__functor = den.lib.parametric;
nixos.foo = 1;
includes = [ bar ];
};
```
and also, **this is the preferred* syntax that will be documented, since
it is more intuitive and does not surfaces `__functor`:
```
den.aspects.foo = den.lib.parametric {
nixos.foo = 1;
includes = [ bar ];
};
```
Still have to update documentation about this combinator.
Fixes #97.
See https://github.com/vic/den/discussions/91 for context.
See
[failure](https://github.com/vic/bugs-den/actions/runs/19377336327/job/55448108522)
for
[reproduction](https://github.com/vic/bugs-den/commit/f81dca61403c7a08e5381b61bcb2fedc1994efb4)
Support for top-level contextual aspects was added at
https://github.com/vic/flake-aspects/pull/14.
Closes #92.
Fixes #87
Edit `modules/vm.nix`
Closes #82
to be more precise about it providing a fixed context to all its
included functions.
Fixes #84.
This PR removes the directional contexts `fromHost` and `fromUser`. Now
people can include funcitons like:
```nix
den.default.includes = [
({ user, ...}: { nixos.some-array = [ user.name ]; })
];
```
And values are not duplicated now. Added test based on report from #84.
This also simplified a lot the number of contexts we have. Still have to
update documentation about contexts.
This also removes outdated `_profile` directory. Closes #78. Instead our
default template now includes an `eg/routes.nix` example router and
exercises namespaces and angle-brackets, ensuring via tests that they
work.
split into several files, more dendritic.
This helps people find aspect implementation, aspect usage and test in one file.
Closes #73
This allows the aspect to be included in other aspects and compose all
unfree packages that are defined.
:warning: I just have tested the code for nixos and home-manager (as
module) definitions.
### Context:
I want to use `<den/unfree>` in multiple aspects and have their defined
packages to combined to one large `allowUnfreePredicate`.
That allows to define the unfree packages in the aspects near their
usage and not on the respective class definition (e.G. the host).
Here an example on my tryout repo where i am currently exploring how to
build my configs with den.
This defines an unfree predicate for vscode and the respective addons:
https://github.com/Shawn8901/dend_test/blob/main/modules/aspects/cfg/desktop/coding.nix
This defines my printer
https://github.com/Shawn8901/dend_test/blob/main/modules/aspects/cfg/printer.nix#L6
Both are later on then used in the host pointalpha together, whilst the
printer aspect is not used on my zenbook.
### Possible workarounds
* Gather unfree packages by hand and define them once on a class
* use `nixpkgs.config.allowUnfree = true`
### Other resources
Discussion on zulip
https://oeiuwq.zulipchat.com/#narrow/channel/548534-den/topic/feat-idea.20composable.20unfree.20batteries/with/564892231
Actual "root issue" why predicates are not combine/composable by default
https://github.com/NixOS/nixpkgs/issues/197325
### Possible Todos
~One issue i found is, that it does not play well with setting~
```nix
nixos.home-manager.useGlobalPkgs = true;
```
~as its setting a `nixpkgs.config.allowUnfreePredicate` even tho its not
allowed when using `useGlobalPkgs` in homeManager class.~
~This should just be done if `useGlobalPkgs` is set to false, tho i am
not yet fully confident how to set that condition correctly with den.~
Might have found a reasonable solution for that, see
https://github.com/vic/den/pull/128#discussion_r2656546800
See [#den > Set user unspecific home-manager
options](https://oeiuwq.zulipchat.com/#narrow/channel/548534-den/topic/Set.20user.20unspecific.20home-manager.20options/with/563739770)
This changeset introduces a new Den core context: `{ HM-OS-HOST }`
invoked on host aspects. This context is used by our home-manager
integration but can also be used by any other host aspect to detect when
HM is enabled, for example to set `useGlobalPkgs`.
This context is produced by `hm-os-host.nix` when it detects any host
that has an OS supported by home-manager AND has at least one user with
`homeManager` class.
The aspect from `hm-os-host.nix` is internal, always included in
`den.default`.
When `den._.home-manager` integration is enabled, it reacts to the
`host-aspect { HM-OS-HOST }` context and setups home-manager
integration. For each user it calls `user-aspect { HM-OS-USER }` for
hm-dependencies.nix to include the correct dependencies.
home-manager related code has been moved to ./provides/home-manager/.
Allows users to have a base module for home/host/user definitions:
```nix
den.base.host = {
# applies to all den.hosts.<system>.<name>
# use it to define options all hosts might have.
};
den.base.user = { ... } # included in all den.hosts.<system>.<name>.users.<user>
den.base.home = { ... } # included in all den.homes.<system>.<name>
den.base.conf = { ... } # included in ANY host / user / home config.
```
This introduces `parametric.withOwn` that is just a `parametric.atLeast`
that also includes the aspect owned configs.
See discussion:
https://github.com/vic/den/discussions/91#discussioncomment-14985716
Calling `parametric x` itself is an alias for `parametric.withOwn x`.
So that both syntax do the same:
```
den.aspects.foo = {
__functor = den.lib.parametric;
nixos.foo = 1;
includes = [ bar ];
};
```
and also, **this is the preferred* syntax that will be documented, since
it is more intuitive and does not surfaces `__functor`:
```
den.aspects.foo = den.lib.parametric {
nixos.foo = 1;
includes = [ bar ];
};
```
Still have to update documentation about this combinator.
Fixes #97.
See https://github.com/vic/den/discussions/91 for context.
See
[failure](https://github.com/vic/bugs-den/actions/runs/19377336327/job/55448108522)
for
[reproduction](https://github.com/vic/bugs-den/commit/f81dca61403c7a08e5381b61bcb2fedc1994efb4)
Support for top-level contextual aspects was added at
https://github.com/vic/flake-aspects/pull/14.
Closes #92.
Fixes #84.
This PR removes the directional contexts `fromHost` and `fromUser`. Now
people can include funcitons like:
```nix
den.default.includes = [
({ user, ...}: { nixos.some-array = [ user.name ]; })
];
```
And values are not duplicated now. Added test based on report from #84.
This also simplified a lot the number of contexts we have. Still have to
update documentation about contexts.