flake(pkgs): move old package definitions to legacy-module.nix

This commit is contained in:
NullBite 2025-02-20 01:32:22 -05:00
parent f9f39bf70d
commit 45eebbb1ce
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
2 changed files with 56 additions and 46 deletions

51
pkgs/legacy-module.nix Normal file
View File

@ -0,0 +1,51 @@
{
inputs,
self,
config,
lib,
options,
...
}: let
cfg = config.nixfiles.outputs.packages;
inherit (lib) mapAttrs mkEnableOption mkIf;
in {
options.nixfiles.outputs.packages = {
enable =
mkEnableOption ""
// {
description = ''
Whether to generate the packages output.
'';
default = true;
};
};
config = mkIf cfg.enable {
perSystem = {
system,
inputs',
self',
pkgs,
...
}: {
packages = let
inherit (pkgs) callPackage callPackages;
# i forget how this works so i'm not messing with it.
mopidyPackages = callPackages ./mopidy {
python = pkgs.python3;
};
in
(mapAttrs (_: v: callPackage v {}) {
google-fonts = ./google-fonts;
wm-helpers = ./wm-helpers;
atool = ./atool-wrapped;
nixfiles-assets = ./nixfiles-assets;
redlib = ./redlib;
cross-seed = ./cross-seed;
})
// {
inherit (mopidyPackages) mopidy-autoplay;
};
};
};
}

View File

@ -1,51 +1,10 @@
{ config, lib, ... }:
{
inputs,
self,
config,
lib,
options,
...
}: let
cfg = config.nixfiles.outputs.packages;
inherit (lib) mapAttrs mkEnableOption mkIf;
in {
options.nixfiles.outputs.packages = {
enable =
mkEnableOption ""
// {
description = ''
Whether to generate the packages output.
'';
default = true;
imports = [ ./legacy-module.nix ];
config = {
perSystem = { system, inputs', self', pkgs, ...}: {
packages = {
};
};
config = mkIf cfg.enable {
perSystem = {
system,
inputs',
self',
pkgs,
...
}: {
packages = let
inherit (pkgs) callPackage callPackages;
# i forget how this works so i'm not messing with it.
mopidyPackages = callPackages ./mopidy {
python = pkgs.python3;
};
in
(mapAttrs (_: v: callPackage v {}) {
google-fonts = ./google-fonts;
wm-helpers = ./wm-helpers;
atool = ./atool-wrapped;
nixfiles-assets = ./nixfiles-assets;
redlib = ./redlib;
cross-seed = ./cross-seed;
})
// {
inherit (mopidyPackages) mopidy-autoplay;
};
};
};
}