Comments (7)
I've got some ideas for making the bootstrap process simpler and more automatic and this could definitely be a part of it. It'll take some time, but I'll have a new branch up soon(ish) and I'll see if this can work.
from digga.
When running
nix edit nixpkgs#hello
, there is a heuristic to find the package declaration which essentially goes like this:
$ nix repl
Welcome to Nix version 3.0pre20200829_f156513. Type :? for help.
nix-repl> pkgs = import <nixpkgs> {}
nix-repl> builtins.unsafeGetAttrPos "description" pkgs.hello.meta
{ column = 5; file = "/home/zimbatm/go/src/github.com/NixOS/nixpkgs/pkgs/applications/misc/hello/default.nix"; line = 15; }
Once the file and line have been found, call
$EDITOR $file +$line
.
Here is what happens when an attribute cannot be found:
nix-repl> builtins.unsafeGetAttrPos "broken" pkgs.hello.meta
null
It wouldn’t be too hard to write a tool that relies on this information and then combines it with an AST patcher. We have a number of those in the community.
Quote from zimbatm from a private conversation.
from digga.
I've decided not to opt for external tools, but instead I created a bare branch which should suffice if you're wanting the benefits of this template without any of the predefined profiles. I've also wired up the template output, so creating a new iteration of a bare template is as simple as:
nix flake new -t "github:nrdxp/nixflk/bare" flk
from digga.
I'm reopening this, as we might be able to use cookiecutter during the building of the system generation to easily solve some current introspective problems, such as knowing available users to assign user properties to each, without causing infinite recursion.
Not to mention, cookiecutter or similar tools could help with #179 in general.
from digga.
I'd have thought ideally nix templates would offer us something, here.
Instead of a template, we might use annotations, so that an unprocessed template is still a valid project.
{
name = "hey"; # setter: name
}
And I think nix even provides something to manipulate values on the fly over the cli.
from digga.
With suites, we have a cheap way of introspecting the global composing components for a host by name and coukd write those into a host template via substitute --replace '@suites@' "${suiteNames}"
.
That could go into flk up
which already partly addresses this use case.
from digga.
This template has evolved quite a bit, and also flk
gained a boostrapping command. I don't think there is a need to improve the templating experience further.
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.