From 4967396702ad723d86a8d6792052cfdcad090ccf Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 24 Jan 2024 01:56:28 -0500 Subject: tree-wide: better support legacy nix --- flake.nix | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 9cd5074..a66c833 100644 --- a/flake.nix +++ b/flake.nix @@ -31,8 +31,6 @@ system, ... }: let - overlay = lib.fix (final: self.overlays.default final pkgs); - /* this filters out packages that may be broken or not supported on the current system. packages that have no `broken` or `platforms` @@ -41,30 +39,18 @@ isValid = _: v: lib.elem pkgs.system (v.meta.platforms or [pkgs.system]) && !(v.meta.broken or false); - pkgs' = lib.filterAttrs isValid overlay; + pkgs' = lib.filterAttrs isValid (import ./. { + nixpkgs = pkgs; + inherit system; + }); in pkgs' // {default = pkgs'.treefetch;} ); formatter = forAllSystems (pkgs: pkgs.alejandra); - overlays.default = final: prev: (import ./pkgs final prev); - - templates = let - # string -> string -> {} - toTemplate = name: description: { - path = builtins.path { - path = ./templates/${name}; - name = "${name}-template"; - }; + overlays.default = final: prev: import ./overlay.nix final prev; - inherit description; - }; - in - builtins.mapAttrs toTemplate { - basic = "minimal boilerplate for my flakes"; - full = "big template for complex flakes (using flake-parts)"; - nixos = "minimal boilerplate for flake-based nixos configuration"; - }; + templates = import ./templates; }; } -- cgit v1.2.3