I have problems sharing a flake publicly and I'm not sure if I misunderstood the concept or if it's a bug.
I have a public flake like nixos-and-darwin-shared-homes that defines in the flake nix an additional input:
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
And a module that sets it up my-nix-index:
{ inputs, ... }: {
imports = [
inputs.nix-index-database.hmModules.nix-index
];
# more config here
}
When pulling this public flake into my private flake:
my-public-flake = {
url = "git+file:///home/user/my-public-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
and pulling it into one of my configurations:
{ inputs, ... }: {
import = [
inputs.my-public-flake.homeModules.my-nix-index
]
}
a nix flake check on this private repo will fail with:
error: attribute 'nix-index-database' missing
at /nix/store/yxndvw7rnr3l7vbchrvlv0fblch05b42-source/modules/home/my-nix-index/default.nix:5:15:
4| {
5| imports = [ inputs.nix-index-database.hmModules.nix-index ];
How do I import a flake in my public flake so that is usable in a private one?
I have problems sharing a flake publicly and I'm not sure if I misunderstood the concept or if it's a bug.
I have a public flake like nixos-and-darwin-shared-homes that defines in the flake nix an additional input:
And a module that sets it up
my-nix-index:When pulling this public flake into my private flake:
and pulling it into one of my configurations:
a nix flake check on this private repo will fail with:
How do I import a flake in my public flake so that is usable in a private one?