diff --git a/flake.nix b/flake.nix index a5090ee..e9d731f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { description = "A `flake-parts` module for Haskell development"; - outputs = _: { + outputs = inputs: { flakeModule = ./nix/modules; templates.default = { @@ -12,73 +12,87 @@ path = builtins.path { path = ./example; }; }; - # CI spec - # https://github.com/juspay/omnix - om.ci.default = - let - exampleLock = builtins.fromJSON (builtins.readFile ./example/flake.lock); - nixpkgs = "github:nixos/nixpkgs/" + exampleLock.nodes.nixpkgs.locked.rev; - flake-parts = "github:hercules-ci/flake-parts/" + exampleLock.nodes.flake-parts.locked.rev; - haskell-flake = ./.; - haskell-parsers = ./nix/haskell-parsers; - haskell-template = "github:srid/haskell-template/554b7c565396cf2d49a248e7e1dc0e0b46883b10"; - in - { - dev = { - dir = "dev"; - overrideInputs = { inherit haskell-flake; }; - }; + om = { + # https://omnix.page/om/init.html#spec + templates.haskell-flake = { + template = inputs.self.templates.example; + params = [ + { + name = "package-name"; + description = "Name of the Haskell package"; + placeholder = "example"; + } + ]; + }; - doc = { - dir = "doc"; - overrideInputs = { inherit haskell-flake; }; - }; + # CI spec + # https://omnix.page/om/ci.html + ci.default = + let + exampleLock = builtins.fromJSON (builtins.readFile ./example/flake.lock); + nixpkgs = "github:nixos/nixpkgs/" + exampleLock.nodes.nixpkgs.locked.rev; + flake-parts = "github:hercules-ci/flake-parts/" + exampleLock.nodes.flake-parts.locked.rev; + haskell-flake = ./.; + haskell-parsers = ./nix/haskell-parsers; + haskell-template = "github:srid/haskell-template/554b7c565396cf2d49a248e7e1dc0e0b46883b10"; + in + { + dev = { + dir = "dev"; + overrideInputs = { inherit haskell-flake; }; + }; - example = { - dir = "example"; - overrideInputs = { inherit haskell-flake; }; - }; + doc = { + dir = "doc"; + overrideInputs = { inherit haskell-flake; }; + }; - # Tests - haskell-parsers-test = { - dir = "./nix/haskell-parsers/test"; - overrideInputs = { inherit haskell-parsers; }; - }; + example = { + dir = "example"; + overrideInputs = { inherit haskell-flake; }; + }; - test-simple = { - dir = "test/simple"; - overrideInputs = { - inherit nixpkgs flake-parts haskell-flake; + # Tests + haskell-parsers-test = { + dir = "./nix/haskell-parsers/test"; + overrideInputs = { inherit haskell-parsers; }; }; - }; - test-with-subdir = { - dir = "test/with-subdir"; - overrideInputs = { - inherit nixpkgs flake-parts haskell-flake; + test-simple = { + dir = "test/simple"; + overrideInputs = { + inherit nixpkgs flake-parts haskell-flake; + }; }; - }; - test-project-module = { - dir = "test/project-module"; - overrideInputs = { - inherit nixpkgs flake-parts haskell-flake; + test-with-subdir = { + dir = "test/with-subdir"; + overrideInputs = { + inherit nixpkgs flake-parts haskell-flake; + }; }; - }; - test-settings-defaults = { - dir = "test/settings-defaults"; - overrideInputs = { - inherit nixpkgs flake-parts haskell-flake haskell-template; + test-project-module = { + dir = "test/project-module"; + overrideInputs = { + inherit nixpkgs flake-parts haskell-flake; + }; }; - }; - test-otherOverlays = { - dir = "test/otherOverlays"; - overrideInputs = { - inherit nixpkgs flake-parts haskell-flake; + test-settings-defaults = { + dir = "test/settings-defaults"; + overrideInputs = { + inherit nixpkgs flake-parts haskell-flake haskell-template; + }; + }; + + test-otherOverlays = { + dir = "test/otherOverlays"; + overrideInputs = { + inherit nixpkgs flake-parts haskell-flake; + }; }; }; - }; + }; }; }