Ability to use unstable packages

This commit is contained in:
Geoffrey Preud'homme 2024-03-26 17:04:16 +01:00
parent fe468eebd7
commit 25c00be8fd
No known key found for this signature in database
GPG key ID: A8F1DA9A7F67BECA

View file

@ -3,6 +3,7 @@
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11"; nixpkgs.url = "nixpkgs/nixos-23.11";
unixpkgs.url = "nixpkgs";
# OS # OS
disko = { disko = {
url = "disko"; url = "disko";
@ -33,7 +34,7 @@
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
}; };
outputs = { self, nixpkgs, disko, nix-on-droid, stylix, ... }@attrs: outputs = { self, nixpkgs, unixpkgs, disko, nix-on-droid, stylix, ... }@attrs:
let let
nixpkgsConfig = { nixpkgsConfig = {
config = { config = {
@ -43,6 +44,15 @@
"nix-2.15.3" "nix-2.15.3"
]; ];
}; };
overlays = [
(final: prev: { unstable = unixpkgs.legacyPackages.${prev.system}.pkgs; })
];
# Only allows importing packages, not NixOS modules. If that is needed, see:
# https://discourse.nixos.org/t/how-to-use-unstable-nixpkgs-in-imports-with-flake/17414/7
};
homeManagerConfig = {
sharedModules = [ self.homeManagerModules.dotfiles ];
extraSpecialArgs = attrs;
}; };
lib = { lib = {
nixosSystem = { system, modules ? [ ] }: nixpkgs.lib.nixosSystem { nixosSystem = { system, modules ? [ ] }: nixpkgs.lib.nixosSystem {
@ -52,10 +62,7 @@
self.nixosModules.dotfiles self.nixosModules.dotfiles
{ {
nixpkgs = nixpkgsConfig; nixpkgs = nixpkgsConfig;
home-manager = { home-manager = homeManagerConfig;
sharedModules = [ self.homeManagerModules.dotfiles ];
extraSpecialArgs = attrs;
};
} }
]; ];
}; };
@ -66,7 +73,7 @@
modules = modules ++ [ modules = modules ++ [
self.nixOnDroidModules.dotfiles self.nixOnDroidModules.dotfiles
{ {
home-manager.sharedModules = [ self.homeManagerModules.dotfiles ]; home-manager = homeManagerConfig;
} }
]; ];
}; };