Created
February 13, 2023 17:15
-
-
Save pigam/095b15016cb8a30b4b28e317375e7d4b to your computer and use it in GitHub Desktop.
Use a local flake as input in devenv.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { pkgs, inputs, ... }: | |
| let | |
| extra = inputs.local.devShell."${pkgs.system}".buildInputs; | |
| in | |
| { | |
| packages = [ pkgs.git ] ++ extra; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| inputs: | |
| nixpkgs: | |
| url: github:NixOS/nixpkgs/nixpkgs-unstable | |
| local: | |
| url: /home/gamba/Documents/code/hello | |
| # does not work | |
| # url: . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| description = "A very basic flake"; | |
| inputs = { | |
| nixpkgs.url = "github:NixOS/nixpkgs"; | |
| flake-utils.url = "github:numtide/flake-utils"; | |
| }; | |
| outputs = { self, nixpkgs, flake-utils }: | |
| flake-utils.lib.eachDefaultSystem (system: | |
| let | |
| pkgs = nixpkgs.legacyPackages.${system}; | |
| hello = pkgs.hello; | |
| in { | |
| packages.default = hello; | |
| packages.hello = hello; | |
| devShell = pkgs.mkShell { | |
| buildInputs = [hello]; | |
| }; | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that while
url: .does not work since it leads to an infinite recursion, something likeurl: path:./flakeworks, then put yourflake.nixandflake.lockunder./flake/and you're good.Downside is that the flake has to be in a subdirectory.