Add pkgs parameter to perSystem

This commit is contained in:
Robert Hensing 2022-05-18 11:03:42 +02:00
parent cb99722a25
commit 1bd171ef6b
5 changed files with 33 additions and 5 deletions

View file

@ -19,12 +19,13 @@
];
systems = [ "x86_64-linux" "aarch64-darwin" ];
perSystem = system: { config, self', inputs', ... }: {
perSystem = system: { config, self', inputs', pkgs, ... }: {
# Per-system attributes can be defined here. The self' and inputs'
# module parameters provide easy access to attributes of the same
# system.
packages.hello = inputs'.nixpkgs.legacyPackages.hello;
# Equivalent to inputs'.nixpkgs.legacyPackages.hello;
packages.hello = pkgs.hello;
};
flake = {
# The usual flake attributes can be defined here, including system-

View file

@ -1,10 +1,10 @@
# Definitions can be imported from a separate file like this one
{ self, ... }: {
perSystem = system: { config, self', inputs', ... }: {
perSystem = system: { config, self', inputs', pkgs, ... }: {
# Definitions like this are entirely equivalent to the ones
# you may have directly in flake.nix.
packages.hello = inputs'.nixpkgs.legacyPackages.hello;
packages.hello = pkgs.hello;
};
flake = {
nixosModules.hello = { pkgs, ... }: {