-
-
Save con-f-use/e2fa9b7d866dcf4befb46b7bfd24d1bc to your computer and use it in GitHub Desktop.
Somewhat minimal example for Python Libraries as overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
description = "Minimal example for Python Libraries as overlay"; | |
outputs = { self, nixpkgs }: # implicitly get `nixpkgs` from flake registry | |
let | |
system = "x86_64-linux"; | |
myPyLibOverlay = final: prev: { | |
myPyLib = final.callPackage ./packages/myPyLib.nix { }; | |
}; | |
overlayed-nixpkgs = import nixpkgs { | |
inherit system; | |
overlays = [ self.overlays.customPyLibs ]; | |
}; | |
in | |
{ | |
overlays = { | |
customPyLibs = final: prev: { | |
# pythonPackagesExtensions (PR #91850) merged Aug 6, 2022 | |
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ | |
myPyLibOverlay | |
# ... more Python library overlays ... | |
]; | |
}; | |
}; | |
packages."${system}" = { | |
somePackage = overlayed-nixpkgs.callPackage ./packages/uses_myPyLib.nix {}; | |
}; | |
apps."${system}" = { | |
someApp = { | |
type = "app"; | |
program = "${self.packages."${system}".somePackage}/bin/some_executable"; | |
}; | |
}; | |
nixosConfigurations = { | |
someMachine = overlayed-nixpkgs.lib.nixosSystem { | |
inherit system; | |
modules = [ ./machines/some/configuration.nix ]; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment