Skip to content

Commit

Permalink
refactor(nix): don't instantiate nixpkgs
Browse files Browse the repository at this point in the history
See https://zimbatm.com/notes/1000-instances-of-nixpkgs

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
  • Loading branch information
Scrumplex committed Aug 28, 2023
1 parent e4e4c4a commit 70fb3d8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 37 deletions.
14 changes: 13 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,17 @@
outputs = inputs:
inputs.flake-parts.lib.mkFlake
{inherit inputs;}
{imports = [./nix];};
{
imports = [
./nix/dev.nix
./nix/distribution.nix
];

systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
};
}
31 changes: 0 additions & 31 deletions nix/default.nix

This file was deleted.

File renamed without changes.
13 changes: 8 additions & 5 deletions nix/distribution.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
{
inputs,
self,
version,
...
}: {
perSystem = {pkgs, ...}: {
packages = {
inherit (pkgs) prismlauncher-qt5-unwrapped prismlauncher-qt5 prismlauncher-unwrapped prismlauncher;
default = pkgs.prismlauncher;
packages = let
ourPackages = self.overlays.default pkgs pkgs;
in {
inherit (ourPackages) prismlauncher-qt5-unwrapped prismlauncher-qt5 prismlauncher-unwrapped prismlauncher;
default = ourPackages.prismlauncher;
};
};

flake = {
overlays.default = final: prev: let
version = builtins.substring 0 8 self.lastModifiedDate;

# Helper function to build prism against different versions of Qt.
mkPrism = qt:
qt.callPackage ./package.nix {
qt.callPackage ./derivation.nix {
inherit (inputs) libnbtplusplus;
inherit (prev.darwin.apple_sdk.frameworks) Cocoa;
inherit self version;
Expand Down

0 comments on commit 70fb3d8

Please sign in to comment.