Questions tagged [nix-flake]

https://nixos.wiki/wiki/Flakes

https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html

Differences between channels and flakes: https://www.reddit.com/r/Nix/comments/u1psl5/comment/i4ehod0/?utm_source=share&utm_medium=web2x&context=3

24 questions
4
votes
1 answer

Nix Flake: how to accept the Android SDK License

I'm trying to use nix flakes for android development. This is my flake.nix: { description = "test"; outputs = { self, nixpkgs }: { packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello; devShell.x86_64-linux =…
Baju
  • 2,616
  • 1
  • 19
  • 29
3
votes
1 answer

What's the mechanism behind `(import nixpkgs) { ... }` in Nix flakes?

I'm working to understand as much as I can about Nix flakes. I'm puzzled by the fact that a nixpkgs input is usually imported, and the imported value is called as a function. How does the result of import nixpkgs map to code in the nixpkgs flake? It…
Jesse Hallett
  • 1,857
  • 17
  • 26
3
votes
1 answer

Using an external flake in home-manager/darwin nix config

I'm trying to use an external (as in not present in nixpkgs) flake in my home-manager (using nix-darwin) config. The flake has a default output which is the binary produced by…
Paulo Casaretto
  • 967
  • 10
  • 33
3
votes
1 answer

why does `nix flake show` builds ghc?

If I look at the outputs provided by the haskell.nix flake from a M1 computer, it starts building ghc-8.8.4 etc.. ❯ nix flake show…
nicolas
  • 9,549
  • 3
  • 39
  • 83
2
votes
1 answer

How to create a nix project with the python package streamlit

{ description = "virtual environment with python and streamlit"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.flake-utils.url = "github:numtide/flake-utils"; outputs = { self, nixpkgs, flake-utils }: …
2
votes
1 answer

How to create with nix an environment where Rstudio can be launched

{ description = "virtual environment with Rstudio, R, Shiny"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.flake-utils.url = "github:numtide/flake-utils"; outputs = { self, nixpkgs, flake-utils }: …
2
votes
2 answers

Composer is reading the incorrect version of PHP when installed via Nix flake

I am creating a WordPress plugin but need to connect to Xero's API. Xero suggest using the composer plugin xero-php-oauth2 so I setup my WP plugin to use composer, which works. And I have successfully installed and used phpdotenv as a…
dxj197i6
  • 53
  • 6
1
vote
0 answers

Is there a better way to create an executable of a R project with dependencies with nix

In a file. I have some R files and I have a subdirectory with a "sub application" that calls the R files of the parent directory. project : fileR_n.R subapp_directory file.R If file.R were alone this flake.nix would be enough. { …
1
vote
1 answer

How to make the creation of "python executable" by nix flake independent of the shell location

{ description = "virtual environment with python and streamlit"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.flake-utils.url = "github:numtide/flake-utils"; outputs = { self, nixpkgs, flake-utils }: …
1
vote
1 answer

nix buildPhase fails, "fatal: not a git repository", the .git dir isn't being copied into the build dir?

I'm trying to create a flake for the peer to peer web browser, agregore ( https://github.com/AgregoreWeb/agregore-browser ). It's my first flake and I'm having major difficulties. Here's the full flake, which I have placed in a clone of the above…
mako
  • 1,201
  • 14
  • 30
1
vote
0 answers

nix flakes: what is the difference between `nix build git+file:.` and `nix build path:.`

this is a continuation of https://discourse.nixos.org/t/can-i-use-flakes-within-a-git-repo-without-committing-flake-nix/18196/37?u=srghma IF I enable nix flakes AND I am in the in the git repo I found the following behavior IF I do nix build . THEN…
srghma
  • 4,770
  • 2
  • 38
  • 54
1
vote
1 answer

In a flake.nix how can I run a script from it and use the output in the same flake.nix

This is the sequel of this question. I've a bash list of command that generated a file nix directory when these commands are executed. mkdir nix rm -fr node_module node2nix -16 --development --input package.json --lock package-lock.json --node-env…
1
vote
0 answers

why a flake.nix file prevent to nixos-rebuild

I'm trying to do this tutorial. I've added these lines in /etc/nixos/configuration.nix services.nginx.enable = true; services.nginx.virtualHosts."test.local.cetacean.club" = { root = "/srv/http/test.local.cetacean.club"; }; I've made these…
1
vote
0 answers

Merlin is not picking up dependencies in a nix flake shell

I have a flake containing a dev shell pinning all the dependencies required to develop a given OCaml program, including an actual OCaml compiler, merlin, findlib and the OCaml libraries. For instance, if the project only depended on Graphics, it…
jthulhu
  • 7,223
  • 2
  • 16
  • 33
1
vote
0 answers

Nix flake equivalent for `nix build` on older non flake projects?

Previously I could nix build a project / derivation with a default.nix file. However after upgrading to Nixos 22.05, and hence Nix 2.8+ running nix build results in: path '/example/lib' does not contain a 'flake.nix', searching up error: path…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
1
2