Hi there,
I’m trying to add an overlay to install a version of a package that is not already merged into nixpkgs unstable (this pull request). This is the first time I’m attempting this and being new to this I might be doing something stupid. I have a NixOs installation with Flake and Home-Manager.
flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
devenv.url = "github:cachix/devenv/latest";
impermanence.url = "github:nix-community/impermanence/master";
};
outputs = { self, nixpkgs, unstable, home-manager, nixos-hardware, devenv, impermanence }:
let
system = "x86_64-linux";
in {
nixosConfigurations.mymachine = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
unstablePkgs = unstable.legacyPackages.${system};
};
modules = [
nixos-hardware.nixosModules.lenovo-thinkpad-t480
impermanence.nixosModules.impermanence
./hosts/mymachine/nixos/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.martin = import ./hosts/mymachine/home/home.nix;
extraSpecialArgs = {
unfreePkgs = import unstable {
config.allowUnfree = true;
inherit system;
overlays = [
(final: prev: {
anytype = prev.anytype.overrideAttrs (
_: {
version = "0.36.0";
name = "Anytype-0.36.0";
src = prev.fetchurl {
url = "https://github.com/anyproto/anytype-ts/releases/download/v0.36.0/AnyType-0.36.0.AppImage";
name = "Anytype-0.36.0.AppImage";
sha256 = "sha256-Efoqy/izULDgd2Dc3ktVZNj9/U0vCtENm0NLr5VKQpQ=";
};
});
})
];
};
devenvPkgs = devenv.packages.${system};
};
};
}
];
};
};
}
Extract of home.nix
{ pkgs, agenixPkgs, devenvPkgs, unfreePkgs, ...}:
{
home.packages = [
unfreePkgs.anytype
];
}
Problem is that I don’t get the correct version of Anytype but the one already in the unstable repository although I do see the download of the newer version happening in the trace.
What am I doing wrong/not understanding ?
I do have a second question regarding this which is: is there a way to do this overlaying inside home-manager instead of the flake.nix file ? I’ve see that home-manager has a nixpkgs.overlays
option but in my case it’s the unfreePkgs
that I would like to overlay.
Thanks in advance !