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 = {
nixpkgs.url = "nixpkgs/nixos-23.11";
unixpkgs.url = "nixpkgs";
# OS
disko = {
url = "disko";
@ -33,7 +34,7 @@
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
nixpkgsConfig = {
config = {
@ -43,6 +44,15 @@
"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 = {
nixosSystem = { system, modules ? [ ] }: nixpkgs.lib.nixosSystem {
@ -52,10 +62,7 @@
self.nixosModules.dotfiles
{
nixpkgs = nixpkgsConfig;
home-manager = {
sharedModules = [ self.homeManagerModules.dotfiles ];
extraSpecialArgs = attrs;
};
home-manager = homeManagerConfig;
}
];
};
@ -66,7 +73,7 @@
modules = modules ++ [
self.nixOnDroidModules.dotfiles
{
home-manager.sharedModules = [ self.homeManagerModules.dotfiles ];
home-manager = homeManagerConfig;
}
];
};