diff --git a/flake.lock b/flake.lock index b332500..687deef 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,44 @@ { "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "ndg": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713798153, + "narHash": "sha256-SVzN8+hQd9eCEtVDpUtWDEjPygjFAoJm8lnf7ZZ+cn0=", + "owner": "feel-co", + "repo": "ndg", + "rev": "5d4b1be08a401f11cbd3503e244c84695f456b81", + "type": "github" + }, + "original": { + "owner": "feel-co", + "repo": "ndg", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1702151865, @@ -16,8 +55,27 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1711703276, + "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { + "ndg": "ndg", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 716b8fd..f6278d4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,86 +1,65 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + ndg = { + url = "github:feel-co/ndg"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; }; outputs = { self, nixpkgs, + ndg, }: let forAllSystems = function: - nixpkgs.lib.genAttrs [ + nixpkgs.lib.genAttrs + [ "x86_64-linux" "aarch64-linux" - ] (system: - function - # Import nixpkgs to try google-chrome wrapper - # this pkgs is not used by the consumer, only .lib - (import nixpkgs { - inherit system; - config.allowUnfree = true; - })); - - doc = forAllSystems (pkgs: - import ./doc { - inherit pkgs; - optionsCommonMark = self.legacyPackages.${pkgs.system}.optionsCommonMark; - }); + ] + ( + system: + function + # Import nixpkgs to try google-chrome wrapper + # this pkgs is not used by the consumer, only .lib + ( + import nixpkgs { + inherit system; + config.allowUnfree = true; + } + ) + ); in - ( - import ./default.nix { - inherit (nixpkgs) lib; - } - ) + (import ./default.nix {inherit (nixpkgs) lib;}) // { formatter = forAllSystems (pkgs: pkgs.alejandra); - checks = forAllSystems (pkgs: - (self.lib { - inherit pkgs; - modules = [./tests/test-module.nix]; - specialArgs = { - some-special-arg = "foo"; - }; - }) - .config - .build - .packages); - - packages = forAllSystems (pkgs: doc.${pkgs.system}.packages); - - devShells = forAllSystems (pkgs: doc.${pkgs.system}.devShells); - - legacyPackages = forAllSystems ( + checks = forAllSystems ( pkgs: - pkgs.nixosOptionsDoc { - options = - (self.lib { - inherit pkgs; - modules = [ - { - options._module.args = pkgs.lib.mkOption {internal = true;}; - } - ]; - }) - .options; - transformOptions = opt: - opt - // { - declarations = with pkgs.lib; - map - (decl: - if hasPrefix (toString ./.) (toString decl) - then let - rev = self.rev or "master"; - subpath = removePrefix "/" (removePrefix (toString ./.) (toString decl)); - in { - url = "https://github.com/viperML/wrapper-manager/blob/${rev}/${subpath}"; - name = subpath; - } - else decl) - opt.declarations; - }; - } + (self.lib { + inherit pkgs; + modules = [./tests/test-module.nix]; + specialArgs = { + some-special-arg = "foo"; + }; + }) + .config + .build + .packages + ); + + packages = forAllSystems ( + pkgs: { + doc = ndg.packages.${pkgs.system}.ndg-builder.override { + evaluatedModules = self.lib { + inherit pkgs; + modules = []; + }; + }; + } ); }; }