Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not home.file.<name>.text? #11

Open
nalzok opened this issue Dec 27, 2024 · 0 comments
Open

Why not home.file.<name>.text? #11

nalzok opened this issue Dec 27, 2024 · 0 comments

Comments

@nalzok
Copy link

nalzok commented Dec 27, 2024

In Chapter 6, you noted that

Before we start, I want to make something clear: in the long run, you actually
probably won't use this very often. You'll want to prefer using specific
configuration options that will generate config files, or using other
functionality to build shell scripts, etc. However, it's very easy to get
started with this, and it can be useful for sketching out some ideas or just
getting a file somewhere that you want it. Mostly it's a great excuse to show
you some more new syntax.

and

_Again, this is NOT actually the long term solution you want for writing your
own utility scripts. The long term solution you want is probably
[`writeShellApplication`](https://ryantm.github.io/nixpkgs/builders/trivial-builders/#trivial-builder-writeShellApplication)
in nixpkgs, which is available in `pkgs.writeShellApplication`. This requires
some significant extra work and understanding, so bookmark this later and return
to it once you're more comfortable with Nix generally. If you want a taste of
what this might look like, [here's what I do to generate a bunch of helpful
wrapper scripts in my own setup](https://github.com/Evertras/nix-systems/blob/main/home/modules/shell/funcs/default.nix)._

But why? Sure, using modules like https://github.com/nix-community/nixvim is more "elegant" than copying and pasting ~/.config/nvim/init.lua from an existing system, but the latter is at least as expressive as the former, and requires essentially zero effort. Is there any practical advantage besides aesthetics?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant