Hi, I am trying to move to Flake with some overlays and unstable packages. I want to make overlay that will expose unstable packages into the pkgs set through the attribute unstable.
flake.nix:
{
inputs = rec {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-community = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
overlays = {
emacs-community = inputs.emacs-community.overlay;
nixpkgs-unstable = final: prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
};
};
};
nixosConfigurations.alaptop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
];
};
};
}
Part of configuration.nix:
nixpkgs.config = {
allowUnfree = true;
overlays = [
outputs.overlays.emacs-community
outputs.overlays.nixpkgs-unstable
];
};
Errors:
warning: Git tree '/etc/nixos' is dirty
building the system configuration...
warning: Git tree '/etc/nixos' is dirty
error:
… while calling the 'head' builtin
at /nix/store/lzhqf5y9dcgfkg5f7f96jjc814pgrsqy-source/lib/attrsets.nix:1575:11:
1574| || pred here (elemAt values 1) (head values) then
1575| head values
| ^
1576| else
… while evaluating the attribute 'value'
at /nix/store/lzhqf5y9dcgfkg5f7f96jjc814pgrsqy-source/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: attribute 'unstable' missing
at /nix/store/k23ldgmy7b3izfivrjk5jxixf2g8i293-source/03-DesktopEnvironment/screenshots.nix:18:128:
17| keybindings = {
18| "Print" = "exec '${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -d)\" - | ${pkgs.unstable.swappy}/bin/swappy -f - -o - | ${pkgs.wl-clipboard}/bin/wl-copy --type image/png'";
| ^
19| "Shift+Print" = "exec '${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -d)\" - | ${pkgs.wl-clipboard}/bin/wl-copy --type image/png'";
Did you mean notable?