From 4abe0770290bba0bf2cf800f467b3bc076d13870 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Sun, 19 Jan 2025 18:21:44 -0600 Subject: [PATCH] add attic packages to oizys packages --- lib/default.nix | 28 +++------------------------- lib/extended.nix | 11 +++++++++++ pkgs/default.nix | 19 ++++++++++++++++++- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 7027101..f275507 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,7 +1,6 @@ inputs@{ nixpkgs, treefmt-nix, - lix-attic, self, ... }: @@ -11,7 +10,6 @@ let inherit (builtins) mapAttrs readDir listToAttrs; inherit (lib) genAttrs - pkgFromSystem loadOverlays listify enableAttrs @@ -34,15 +32,6 @@ let ) ); - inheritFlakePkgs = - pkgs: flakes: - listToAttrs ( - map (name: { - inherit name; - value = pkgFromSystem pkgs.system name; - }) flakes - ); - evalTreeFmt = pkgs: (treefmt-nix.lib.evalModule pkgs ( @@ -60,12 +49,6 @@ let } )); - lixAtticPackages = pkgs: - { attic-client = lix-attic.packages.${pkgs.system}.attic-client; - attic-server = lix-attic.packages.${pkgs.system}.attic-server; -}; - - oizysFlake = { templates = { dev = { @@ -82,15 +65,10 @@ let default = oizys; oizys = pkgs.callPackage ../pkgs/oizys { }; iso = mkIso.config.system.build.isoImage; - lix = pkgFromSystem pkgs.system "lix-module"; + + # nimlangserver = pkgs.callPackage ../pkgs/nim/nimlangserver { }; } - // (inheritFlakePkgs pkgs [ - "pixi" - "f1multiviewer" - "tsm" - ]) - // (import ../pkgs { inherit pkgs; }) - // (lixAtticPackages pkgs) + // (import ../pkgs { inherit pkgs lib; }) ); devShells = forAllSystems (pkgs: { diff --git a/lib/extended.nix b/lib/extended.nix index c55586b..4665c4f 100644 --- a/lib/extended.nix +++ b/lib/extended.nix @@ -104,6 +104,16 @@ let # listNixFilesRecursive = dir: filterNotDefaultNixFile (listFilesRecursive dir); listNixFilesRecursive = dir: dir |> listFilesRecursive |> filterNotDefaultNixFile; + ## convert a list of flakes to { name = packageAttr; } + flakesToPackagesAttrs = + system: flakes: + listToAttrs ( + map (name: { + inherit name; + value = pkgFromSystem system name; + }) flakes + ); + # defaultLinuxPackage = flake: flake.packages.x86_64-linux.default; # defaultPackageGeneric = system: flake: "${flake}.packages.${system}.default"; pkgsFromSystem = system: flake: inputs."${flake}".packages."${system}"; @@ -199,5 +209,6 @@ in hostFiles oizysSettings tryPkgsFromFile + flakesToPackagesAttrs ; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 420dc9c..fcb794c 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,12 @@ -{ pkgs, ... }: +{ + pkgs, + lib, + ... +}: +let + inherit (lib) flakesToPackageAttrs flakeFromSystem; + flake = flakeFromSystem pkgs.system; +in { nimlangserver = pkgs.callPackage ./nim/nimlangserver { }; procs = pkgs.callPackage ./nim/procs { }; @@ -7,4 +15,13 @@ distrobox = pkgs.callPackage ./distrobox { }; llm-with-plugins = pkgs.callPackage ./llm/llm-with-plugins { }; + + attic-client = (flake.pkgs "lix-attic").attic-client; + attic-server = (flake.pkgs "lix-attic").attic-server; + lix = (flake.pkgs "lix-module").default; } +# // (flakesToPackageAttrs [ +# "pixi" +# "f1multiviewer" +# "tsm" +# ])