Closed ArtemChandragupta closed 2 months ago
I have the same issue here
$ ls /nix/store/0ikl83z4h69imxkwsly3hcm424f7wi7j-wayland-scanner-1.23.0-dev/
lib nix-support share
$ ls "/nix/store/0ikl83z4h69imxkwsly3hcm424f7wi7j-wayland-scanner-1.23.0-dev/include": No such file or directory (os error 2)
me too. Any work around?
This PR fixed it for me https://github.com/NixOS/nixpkgs/pull/338836
@fufexan ?
Not yet working for me, I'm on unstable but maybe not going through the right process. I am using flakes with home-manager. Am I not on up to date with the current head of nixpkgs?
Not yet working for me, I'm on unstable but maybe not going through the right process. I am using flakes with home-manager. Am I not on up to date with the current head of nixpkgs?
The linked PR was merged into master earlier today. It takes a while until it lands in unstable, you can use this tool to track the progress. If you want to use it right now, you can add an input for nixos-unstable-small
to your flake.nix
and use an overlay:
{
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
nixos-unstable-small = {
url = "github:NixOS/nixpkgs/nixos-unstable-small";
};
flake-utils = {
url = "github:numtide/flake-utils";
};
};
outputs = { ... } @ inputs:
inputs.flake-utils.lib.eachDefaultSystem (
system: let
unstable-small-pkgs = import inputs.nixos-unstable-small {inherit system;};
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
(final: prev: {
inherit (unstable-small-pkgs) xdg-desktop-portal-hyprland;
})
];
};
in {
# your configuration
}
);
}
@clemenscodes
Thanks for explaining this, I will just be waiting until it has merged into unstable
@clemenscodes
how can i adapt my flake to your code?
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixvim.url = "github:nix-community/nixvim";
nixvim.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs:
let
system = "x86_64-linux";
in
{
nixosConfigurations = {
nixos = inputs.nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
inputs.nixvim.nixosModules.nixvim
];
};
};
homeConfigurations.hoffmano = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.${system};
modules = [ ./home.nix ];
};
};
}
@Hoffmano you could either pass the modified pkgs
to specialArgs
to your configuration or add the overlay to the option nixpkgs.overlays
.
I personally prefer the first option, for your configuration it could look like this:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixos-unstable-small.url = "github:NixOS/nixpkgs/nixos-unstable-small";
nixvim.url = "github:nix-community/nixvim";
nixvim.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs: let
system = "x86_64-linux";
unstable-small-pkgs = import inputs.nixos-unstable-small {inherit system;};
xdphOverlay = final: prev: {
inherit (unstable-small-pkgs) xdg-desktop-portal-hyprland;
};
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [xdphOverlay];
};
in {
nixosConfigurations = {
nixos = inputs.nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit inputs pkgs;};
modules = [
./configuration.nix
inputs.nixvim.nixosModules.nixvim
];
};
};
homeConfigurations.hoffmano = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.${system};
modules = [./home.nix];
};
};
}
For me doing an overlay like this (my config is very similar to example above) results into unfree software error, while I definitely allowed it as a module (not in flake) before for original nixpkgs unstable.
@ArtemChandragupta I am getting the same error, not sure why either.
Passing pkgs
to specialArgs
sets that pkgs
as a global argument to all NixOS modules, which allows you to reuse that instance in every module and it makes other modules use that as well. This is essentially the same as setting the option nixpkgs.pkgs
. This instance contains its own configration and the nixpkgs.config
option will be ignored. See documentation here. The solution is to instantiate pkgs
with that config instead:
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [xdphOverlay];
config = {
permittedInsecurePackages = [];
allowUnfree = true;
};
};
Thank you very much, dear @clemenscodes. With your help I created my first overlay (and probably three other people too), which will move me a step further on a Nix path.
Nixos-unstable-small version fixes the problem, so issue is closed.
I use NixOS unstable + flakes
Log: