From 5d2ab82409ad35709927c8e54ded1f530faa2e0a Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 23 May 2024 18:28:30 +0200 Subject: refactor(flake/packages): Export the new pkgs set --- flake/packages/default.nix | 54 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 12 deletions(-) (limited to 'flake/packages') diff --git a/flake/packages/default.nix b/flake/packages/default.nix index 1b14be6a..7a8aacc2 100644 --- a/flake/packages/default.nix +++ b/flake/packages/default.nix @@ -1,9 +1,8 @@ { self, nixos-generators, - defaultSpecialArgs, - defaultModules, pkgs, + myPkgs, sysLib, nixVim, system, @@ -13,15 +12,17 @@ inherit (pkgs) lib; inherit (import ./merge.nix {inherit lib;}) merge; output = import ../../bootstrap {inherit pkgs sysLib;}; + args = { inherit pkgs; inherit (pkgs) lib; }; + nvim = builtins.mapAttrs ( name: value: let nvim_config = - import ../../hm/soispha/conf/nvim/default.nix + import ../../modules/home/conf/nvim/default.nix args; build_args = args @@ -54,18 +55,46 @@ ) ) self.nixosConfigurations; + output_neovim = lib.attrsets.mapAttrs' (name: value: lib.attrsets.nameValuePair "nvim_${name}" value) nvim; - firefox = (import ../../hm/soispha/conf/firefox/scripts) {inherit pkgs sysLib;}; + + myPkgsFlat = + builtins.listToAttrs + # Filter out the `override` and `overrideDerivation` functions + (builtins.filter ({ + name, + value, + }: + lib.attrsets.isDerivation value) (lib.lists.flatten + ( + lib.attrsets.mapAttrsToList (name: value: + if lib.attrsets.isDerivation value + then [ + { + inherit name value; + } + ] + else + lib.attrsets.mapAttrsToList (name: value: { + inherit name value; + }) + value) + myPkgs + ))); + + firefox = (import ../../modules/home/conf/firefox/scripts) {inherit pkgs sysLib;}; in { - install-iso = nixos-generators.nixosGenerate { - system = "x86_64-linux"; - specialArgs = defaultSpecialArgs; - modules = [ - ../../hosts/marduk - ]; - format = "install-iso"; - }; + # install-iso = nixos-generators.nixosGenerate { + # system = "x86_64-linux"; + # specialArgs = defaultSpecialArgs; + # modules = [ + # ../../hosts/marduk + # ]; + # format = "install-iso"; + # }; + + inherit myPkgs; update_shell_lib = shell_library.packages."${system}".update_shell_library; @@ -84,3 +113,4 @@ in // output // output_neovim // firefox + // myPkgsFlat -- cgit 1.4.1