flake: make packages more modular

This commit is contained in:
NullBite 2024-03-07 06:59:45 +00:00
parent 2a0e3098d4
commit 3db530e26b
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
4 changed files with 19 additions and 5 deletions

View File

@ -194,7 +194,8 @@
# (extraS|s)pecialArgs to pass variables
nixosModules = (import ./modules/nixos) moduleInputs;
homeManagerModules = (import ./modules/home-manager) moduleInputs;
packages = eachSystem (system: import ./pkgs { inherit nixpkgs system; });
packages = eachSystem (system: let pkgs = import nixpkgs { inherit system; };
in import ./pkgs { inherit pkgs; });
apps = eachSystem (system: import ./pkgs/apps.nix
{ inherit (self.outputs) packages; inherit system; });

View File

@ -1,11 +1,14 @@
{ nixpkgs, system, ... }:
{ pkgs, ... }:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) callPackage;
inherit (pkgs) callPackage callPackages;
mopidyPackages = callPackages ./mopidy {
python = pkgs.python3;
};
in
{
inherit (mopidyPackages) mopidy-autoplay ;
google-fonts = callPackage ./google-fonts { };
wm-helpers = callPackage ./wm-helpers { };
atool = callPackage ./atool-wrapped { };
mopidy-autoplay = callPackage ./mopidy-autoplay { };
}

10
pkgs/mopidy/default.nix Normal file
View File

@ -0,0 +1,10 @@
{ lib, newScope, python }:
# i have no idea what this is but there's some conflict if i don't do this
# based on https://github.com/NixOS/nixpkgs/blob/77f0d2095a8271fdb6e0d08c90a7d93631fd2748/pkgs/applications/audio/mopidy/default.nix
lib.makeScope newScope (self: with self; {
inherit python;
pythonPackages = python.pkgs;
mopidy-autoplay = callPackage ./autoplay.nix { };
})