Comments (8)
I was just looking at the core branch and thought about this, it would be good if extern has a specialArgs attribute. It would also be useful for mobile-nixos usage, which will be getting flakes support soon.
from digga.
for one thing, specialArgs only affects the nixos configurations and not home-manager. So you would have to do the import in your user profile:
{ hm-modules, ... }:
{ home-manager.users.me.imports = hm-modules; }
Then you can use the modulle in any user profile.
But I have no idea how you got an infinite recursion error, I would have thought the error would be from the file not being called with hmModule.
from digga.
you could try using builtins.getFlake
inside your user profile as a better workaround. We could probably solve this by adding another specialArg to all modules.
from digga.
I followed your builtins.getFlake
advice. It's a better workaround.
Only downside is that I need to specify the commit hash I want to fetch (as far as I can tell).
Which makes it harder to update. But it's not a big deal.
Thanks 🙌
from digga.
Just inherit the modules into the empty attribute set...
from digga.
Hi, is there a good example on the proper usage? I'm trying to import nix-doom-emacs as described in the docs but I'm having some issues.
extern/default.nix:
{ inputs }: with inputs;
let
hmModules = {
inherit (nix-doom-emacs.hmModule) hmModule; # I've tried without .hmModule to the same effect
};
in
{
modules = [
home.nixosModules.home-manager
ci-agent.nixosModules.agent-profile
];
overlays = [
nur.overlay
devshell.overlay
emacs.overlay
(final: prev: {
deploy-rs = deploy.packages.${prev.system}.deploy-rs;
})
];
# passed to all nixos modules
specialArgs = {
inherit hmModules; # sidenote - I think this needs changing as it's "hm-modules" still in the current core branch
overrideModulesPath = "${override}/nixos/modules";
hardware = nixos-hardware.nixosModules;
};
}
users/profiles/emacs/default.nix:
{ config, lib, pkgs, hmModules, ... }:
{
imports = [ hmModules.hmModule ];
programs.doom-emacs = {
enable = true;
package = pkgs.emacsPgtkGcc;
doomPrivateDir = ./doom.d;
};
services.emacs = {
enable = true;
#package = programs.doom-emacs.package;
};
}
The error I get:
$ flk home e7240 figgyc switch --show-trace
error: --- EvalError ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- nix
at: (303:28) in file: /nix/store/pz44872rmpd7ygqfmdcwh4ac6hk1hy4s-source/lib/modules.nix
302| value = builtins.addErrorContext (context name)
303| (args.${name} or config._module.args.${name});
| ^
304| }) requiredArgs);
infinite recursion encountered
(use '--show-trace' to show detailed location information)
from digga.
I fixed the typo in lastest core, also put a bit of documentation up last night, I'll expand with this example later. But for now, get it working. Also made it available by default from the community branch.
from digga.
Yeah that works perfectly. Thanks!
from digga.
Related Issues (20)
- ci: workflow to build example hosts
- Onboarding documentation incomplete HOT 1
- [Documentation] Relationship between digga API and raw flake API/output
- How do I use the examples?
- `emacs-overlay` cause errors HOT 11
- Question - How do you make platform aware modules HOT 2
- Support customTestFor with multiple (different) nodes HOT 1
- bug report template: add example command to provide environment metadata HOT 1
- `groupByConfig`@`main` fails check due to insecure `python3.9-poetry-1.1.12` HOT 1
- use `.overlays.*` instead of `.overlay` HOT 2
- Inconsistent behaviour when accessing `self.lib` in different places
- Changes to user profiles are not applied upon rebuilding HOT 1
- Comparison to `divnix/std` & `divnix/hive` HOT 18
- Cannot login account when switch to devos config HOT 2
- nix-shell after following the quickstart guide returns an error
- digga tries to do something clever by loading all inputs' overlays, but fails HOT 9
- Clean Installation gives out error HOT 1
- Devos digga input needs update
- Infinite recursion encountered when using Stylix HOT 1
- Ending digga HOT 21
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from digga.