Skip to content

Commit

Permalink
nix: Add om init template params (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
srid authored Sep 19, 2024
1 parent 96aad3a commit 31d7f05
Showing 1 changed file with 69 additions and 55 deletions.
124 changes: 69 additions & 55 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
description = "A `flake-parts` module for Haskell development";
outputs = _: {
outputs = inputs: {
flakeModule = ./nix/modules;

templates.default = {
Expand All @@ -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;
};
};
};
};
};
};
}

0 comments on commit 31d7f05

Please sign in to comment.