Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions projects/jaq/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
lib,
pkgs,
sources,
}@args:

{
metadata = {
summary = "Jaq is a data wrangling tool focusing on correctness, speed, and simplicity";
subgrants = [
"jaq"
"Polyglot-jaq"
];
};

nixos.modules.programs = {
jaq = {
name = "jaq";
module = ./programs/jaq/module.nix;
examples.basic = {
module = ./programs/jaq/examples/basic.nix;
description = "Enable the jaq program";
tests.basic = import ./programs/jaq/tests/basic.nix args;
};
};
};

# no service module as this is strictly a program
}
5 changes: 5 additions & 0 deletions projects/jaq/programs/jaq/examples/basic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ ... }:

{
programs.jaq.enable = true;
}
21 changes: 21 additions & 0 deletions projects/jaq/programs/jaq/module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.jaq;
in
{
options.programs.jaq = {
enable = lib.mkEnableOption "jaq";
package = lib.mkPackageOption pkgs "jaq" { };
};

config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
cfg.package
];
};
}
28 changes: 28 additions & 0 deletions projects/jaq/programs/jaq/tests/basic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
sources,
...
}:

{
name = "jaq";

nodes = {
machine =
{ ... }:
{
imports = [
sources.modules.ngipkgs
sources.modules.programs.jaq
sources.examples.jaq.basic
];
};
};

testScript =
{ nodes, ... }:
''
start_all()

machine.succeed("jaq --version")
'';
}