Conversation
This comes from reading through a tutorial.
|
@koibtw The Nix is happening |
|
WOW 😮 |
|
I'm thinking I'll have both |
|
well...... thats not really how that works. flakes are experimental but like literally 90% of nix users use flakes |
|
Alright, thanks! Will check out flakes, then. |
2699246 to
84892d8
Compare
|
I followed examples in Nix docs and ended up writing something pretty different from your example. It's a mix of me being a beginner to Nix tooling and wanting to keep things simple. It works (builds to |
| description = "Displays file structure as a tree with Nerd Font icons, git statuses, etc."; | ||
|
|
||
| inputs = { | ||
| nixpkgs.url = "github:NixOS/nixpkgs"; |
There was a problem hiding this comment.
| nixpkgs.url = "github:NixOS/nixpkgs"; | |
| nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
you should NOT be using master
There was a problem hiding this comment.
Any difference between this and github:NixOS/nixpkgs?ref=nixos-unstable?
There was a problem hiding this comment.
OK, cool. I'll just go with that since that's what nix flake init defaulted to.
Co-authored-by: koi <me@koi.rip>
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable | ||
| - name: Build Nix Package (classic) | ||
| run: nix-build |
There was a problem hiding this comment.
| run: nix-build |
nix-build -E "with import <nixpkgs> { }; callPackage ./nix/package.nix { }"you should use it like this but you dont need it anyway since its the same package
There was a problem hiding this comment.
you dont need a default.nix at all
There was a problem hiding this comment.
Not for flake.nix, but I think I need it so that users can build it the "old" way with nix-build instead of nix build, right? Since the docs noted some controversies with Flakes I figured I would let users also use the old way if they wanted. I guess nix-build -E "with import <nixpkgs> { }; callPackage ./nix/package.nix { }" would let me get rid of it but it's kind of nice to just call nix-build I guess 🤷
What do you think?
There was a problem hiding this comment.
i mean i wouldnt do that personally but if you have to, then instead of doing it that way, just put this in default.nix
with import <nixpkgs> { }; callPackage ./nix/package.nix { }| ### With `nix-build` | ||
|
|
||
| ```shell | ||
| nix-build | ||
| ``` | ||
|
|
||
| ### As a Nix flake | ||
|
|
||
| ```shell | ||
| nix --experimental-features nix-command --extra-experimental-features flakes build | ||
| ``` |
There was a problem hiding this comment.
one With Nix with nix build is probably fine
Co-authored-by: koi <me@koi.rip>
|
@koibtw Thanks for helping so much with getting Nix builds set up ❤️ |
There was a problem hiding this comment.
i mean i wouldnt do that personally but if you have to, then instead of doing it that way, just put this in default.nix
with import <nixpkgs> { }; callPackage ./nix/package.nix { }
This adds configuration to build the package with Nix tooling.
It also adds instructions to build from source to
INSTALL.md.See https://nix.dev/manual/nix/2.28/command-ref/new-cli/nix3-flake.html
Closes #26