aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--README.md1
-rw-r--r--flake.lock143
-rw-r--r--flake.nix62
-rw-r--r--modules/home-manager/cook-cli/default.nix6
-rw-r--r--modules/home-manager/cook-cli/program.nix14
-rw-r--r--modules/home-manager/cook-cli/service.nix56
-rw-r--r--modules/home-manager/cooklang-chef/default.nix6
-rw-r--r--modules/home-manager/cooklang-chef/program.nix32
-rw-r--r--modules/home-manager/cooklang-chef/service.nix56
-rw-r--r--modules/home-manager/default.nix6
-rw-r--r--modules/nixos/cook-cli.nix118
-rw-r--r--modules/nixos/cooklang-chef.nix130
-rw-r--r--modules/nixos/default.nix5
-rw-r--r--overlays/default.nix11
-rw-r--r--pkgs/chef/default.nix39
-rw-r--r--pkgs/cook-import/default.nix17
-rw-r--r--pkgs/vim-cooklang.nix15
18 files changed, 719 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..93d6426
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+result
+result*
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0e18b3f
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+Nix derivations for [cooklang](https://cooklang.org/).
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..9d40a88
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,143 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1710146030,
+ "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nix-github-actions": {
+ "inputs": {
+ "nixpkgs": [
+ "poetry2nix",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1703863825,
+ "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=",
+ "owner": "nix-community",
+ "repo": "nix-github-actions",
+ "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "nix-github-actions",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1726150823,
+ "narHash": "sha256-xGZgwHKZWLfs1xsS6hzGl+sDZTmXPsdbYd5acTgvQgs=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "329e7d9382cbe4eb605e203565c0864874785032",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "poetry2nix": {
+ "inputs": {
+ "flake-utils": [
+ "flake-utils"
+ ],
+ "nix-github-actions": "nix-github-actions",
+ "nixpkgs": [
+ "nixpkgs"
+ ],
+ "systems": "systems_2",
+ "treefmt-nix": "treefmt-nix"
+ },
+ "locked": {
+ "lastModified": 1725532428,
+ "narHash": "sha256-dCfawQDwpukcwQw++Cn/3LIh/RZMmH+k3fm91Oc5Pf0=",
+ "owner": "nix-community",
+ "repo": "poetry2nix",
+ "rev": "a313fd7169ae43ecd1a2ea2f1e4899fe3edba4d2",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "poetry2nix",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs",
+ "poetry2nix": "poetry2nix"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ },
+ "systems_2": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "id": "systems",
+ "type": "indirect"
+ }
+ },
+ "treefmt-nix": {
+ "inputs": {
+ "nixpkgs": [
+ "poetry2nix",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1719749022,
+ "narHash": "sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg=",
+ "owner": "numtide",
+ "repo": "treefmt-nix",
+ "rev": "8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "treefmt-nix",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..ce7fc5c
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,62 @@
+{
+ description = "cooklang utilities";
+
+ inputs = {
+ nixpkgs.url = github:nixos/nixpkgs;
+ flake-utils.url = github:numtide/flake-utils;
+ poetry2nix = {
+ url = github:nix-community/poetry2nix;
+ inputs = {
+ nixpkgs.follows = "nixpkgs";
+ flake-utils.follows = "flake-utils";
+ };
+ };
+ };
+
+ outputs = inputs@{ self, nixpkgs, flake-utils, poetry2nix, ... }: {
+
+ overlays = {
+ default = import ./overlays;
+ };
+
+ nixosModules = {
+ default = import ./modules/nixos;
+ };
+
+ homeManagerModules = {
+ default = import ./modules/home-manager;
+ };
+
+ } // flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = import nixpkgs {
+ inherit system;
+ overlays = [
+ self.overlays.default
+ (prev: final: {
+ poetry2nix = poetry2nix.lib.mkPoetry2Nix { pkgs = prev; };
+ })
+ ];
+ };
+ in {
+ packages = {
+ inherit (pkgs) cooklang-chef cook-cli;
+ inherit (pkgs.vimPlugins) vim-cooklang;
+ };
+
+ apps = {
+ chef = {
+ type = "app";
+ program = pkgs.lib.getExe pkgs.cooklang-chef;
+ };
+ cookcli = {
+ type = "app";
+ program = pkgs.lib.getExe pkgs.cook-cli;
+ };
+ cook-import = {
+ type = "app";
+ program = pkgs.lib.getExe pkgs.cook-import;
+ };
+ };
+ });
+}
diff --git a/modules/home-manager/cook-cli/default.nix b/modules/home-manager/cook-cli/default.nix
new file mode 100644
index 0000000..f42e210
--- /dev/null
+++ b/modules/home-manager/cook-cli/default.nix
@@ -0,0 +1,6 @@
+{
+ imports = [
+ ./program.nix
+ ./service.nix
+ ];
+}
diff --git a/modules/home-manager/cook-cli/program.nix b/modules/home-manager/cook-cli/program.nix
new file mode 100644
index 0000000..e31187f
--- /dev/null
+++ b/modules/home-manager/cook-cli/program.nix
@@ -0,0 +1,14 @@
+{ config, pkgs, lib, ... }:
+with builtins // lib;
+let
+ cfg = config.programs.cook-cli;
+in {
+ options.programs.cook-cli = {
+ enable = mkEnableOption "cook-cli";
+ package = mkPackageOption pkgs "cook-cli" {};
+ };
+
+ config = mkIf cfg.enable {
+ home.packages = [ cfg.package ];
+ };
+}
diff --git a/modules/home-manager/cook-cli/service.nix b/modules/home-manager/cook-cli/service.nix
new file mode 100644
index 0000000..c4e8083
--- /dev/null
+++ b/modules/home-manager/cook-cli/service.nix
@@ -0,0 +1,56 @@
+{ config, pkgs, lib, ... }:
+with builtins // lib;
+let
+ cfg = config.services.cook-cli;
+ pcfg = config.programs.cook-cli;
+ args = escapeShellArgs ([
+ "--port"
+ (toString cfg.port)
+ ] ++ cfg.extraArgs ++ [
+ cfg.recipeRoot
+ ]);
+in {
+ options.services.cook-cli = {
+ enable = mkEnableOption "cook-cli webserver";
+ package = mkOption {
+ type = types.package;
+ default = pcfg.package;
+ description = ''
+ cook-cli package. It is recommended to set this only in programs.cook-cli
+ '';
+ };
+
+ recipeRoot = mkOption {
+ type = types.path;
+ default = "${config.xdg.dataHome}/cookbook";
+ };
+
+ port = mkOption {
+ type = types.port;
+ defulat = 9080;
+ };
+
+ extraArgs = mkOption {
+ type = with types; listOf str;
+ default = [];
+ };
+ };
+
+ config = mkIf cfg.enable {
+ systemd.user.services.cook-cli = {
+ Unit = {
+ Description = "A website for serving cooklang cookbooks";
+ After = [ "network.target" ];
+ };
+ Service = {
+ Restart = "on-failure";
+ RestartSec = 10;
+ Type = "simple";
+ ExecStart = "${getExe cfg.package} server ${args}";
+ };
+ Install = {
+ WantedBy = [ "default.target" ];
+ };
+ };
+ };
+}
diff --git a/modules/home-manager/cooklang-chef/default.nix b/modules/home-manager/cooklang-chef/default.nix
new file mode 100644
index 0000000..f42e210
--- /dev/null
+++ b/modules/home-manager/cooklang-chef/default.nix
@@ -0,0 +1,6 @@
+{
+ imports = [
+ ./program.nix
+ ./service.nix
+ ];
+}
diff --git a/modules/home-manager/cooklang-chef/program.nix b/modules/home-manager/cooklang-chef/program.nix
new file mode 100644
index 0000000..4cbed5c
--- /dev/null
+++ b/modules/home-manager/cooklang-chef/program.nix
@@ -0,0 +1,32 @@
+{ config, pkgs, lib, ... }:
+with builtins // lib;
+let
+ cfg = config.programs.cooklang-chef;
+ toml = pkgs.formats.toml {};
+in {
+ options.programs.cooklang-chef = {
+ enable = mkEnableOption "cooklang-chef";
+ package = mkPackageOption pkgs "cooklang-chef" {};
+
+ settings = mkOption {
+ type = toml.type;
+ default = {};
+ description = "https://github.com/Zheoni/cooklang-chef/blob/main/docs/cli.md";
+ };
+
+ };
+
+ config = mkIf cfg.enable {
+ home.packages = [ cfg.package ];
+
+ programs.cooklang-chef.settings = {
+ default_collection = mkDefault "${config.xdg.dataHome}/cookbook";
+ };
+
+ xdg.configFile = {
+ "cooklang-chef/chef-config.toml" = mkIf (cfg.settings != {}) {
+ source = toml.generate "chef-config.toml" cfg.settings;
+ };
+ };
+ };
+}
diff --git a/modules/home-manager/cooklang-chef/service.nix b/modules/home-manager/cooklang-chef/service.nix
new file mode 100644
index 0000000..8a9e34b
--- /dev/null
+++ b/modules/home-manager/cooklang-chef/service.nix
@@ -0,0 +1,56 @@
+{ config, pkgs, lib, ... }:
+with builtins // lib;
+let
+ cfg = config.services.cooklang-chef;
+ pcfg = config.programs.cooklang-chef;
+ args = escapeShellArgs ([
+ "--port"
+ (toString cfg.port)
+ "--path"
+ cfg.recipeRoot
+ ] ++ cfg.extraArgs);
+in {
+ options.services.cooklang-chef = {
+ enable = mkEnableOption "cooklang-chef webserver";
+ package = mkOption {
+ type = types.package;
+ default = pcfg.package;
+ description = ''
+ cooklang-chef package. It is recommended to set this only in programs.cooklang-chef.
+ '';
+ };
+
+ recipeRoot = mkOption {
+ type = types.path;
+ default = pcfg.settings.default_collection or "${config.xdg.dataHome}/cookbook";
+ };
+
+ port = mkOption {
+ type = types.port;
+ default = 9080;
+ };
+
+ extraArgs = mkOption {
+ type = with types; listOf str;
+ default = [];
+ };
+ };
+
+ config = mkIf cfg.enable {
+ systemd.user.services.cooklang-chef = {
+ Unit = {
+ Description = "A website for serving cooklang cookbooks";
+ After = [ "network.target" ];
+ };
+ Service = {
+ Restart = "on-failure";
+ RestartSec = 10;
+ Type = "simple";
+ ExecStart = "${getExe cfg.package} serve ${args}";
+ };
+ Install = {
+ WantedBy = [ "default.target" ];
+ };
+ };
+ };
+}
diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix
new file mode 100644
index 0000000..d4f83da
--- /dev/null
+++ b/modules/home-manager/default.nix
@@ -0,0 +1,6 @@
+{
+ imports = [
+ ./cook-cli
+ ./cooklang-chef
+ ];
+}
diff --git a/modules/nixos/cook-cli.nix b/modules/nixos/cook-cli.nix
new file mode 100644
index 0000000..bfee526
--- /dev/null
+++ b/modules/nixos/cook-cli.nix
@@ -0,0 +1,118 @@
+{ config, pkgs, lib, ... }:
+with builtins // lib;
+let
+ cfg = config.services.cook-cli;
+ args = escapeShellArgs ([
+ "--port"
+ (toString cfg.port)
+ ] ++ cfg.extraArgs ++ [
+ cfg.recipeRoot
+ ]);
+in {
+ options.services.cook-cli = {
+ enable = mkEnableOption "cook-cli webserver";
+ package = mkPackageOption pkgs "cook-cli" {};
+
+ recipeRoot = mkOption {
+ type = types.path;
+ default = "/var/lib/cookbook";
+ };
+
+ user = mkOption {
+ type = types.str;
+ default = "cook-cli";
+ };
+
+ group = mkOption {
+ type = types.str;
+ default = "cook-cli";
+ };
+
+ port = mkOption {
+ type = types.port;
+ default = 9080;
+ };
+
+ extraArgs = mkOption {
+ type = with types; listOf str;
+ default = [];
+ };
+
+ nginx = {
+ enable = mkEnableOption "nginx reverse proxy";
+ virtualHost = mkOption {
+ type = types.str;
+ example = mdDoc ''
+ cook.example.com
+ '';
+ };
+ location = mkOption {
+ type = types.str;
+ default = "/";
+ };
+ };
+ };
+
+ config = mkIf cfg.enable {
+ users = {
+ users = mkIf (cfg.user == "cook-cli") {
+ ${cfg.user} = {
+ isSystemUser = true;
+ group = cfg.group;
+ };
+ };
+ groups = mkIf (cfg.group == "cook-cli") {
+ ${cfg.group} = {};
+ };
+ };
+
+ systemd.services.cooklang-chef = {
+ description = "A website for serving cooklang cookbooks";
+ after = [ "network.target" ];
+ requires = [ "network.target" ];
+ wantedBy = [ "multi-user.target" ];
+ serviceConfig = {
+ ExecStart = "${getExe cfg.package} server ${args}";
+ User = cfg.user;
+ Group = cfg.group;
+ IPAddressAllow = "localhost";
+ IPAddressDeny = "any";
+ LockPersonality = true;
+ MemoryDenyWriteExecute = true;
+ NoNewPrivileges = true;
+ PrivateDevices = true;
+ PrivateTmp = true;
+ PrivateUsers = true;
+ ProcSubset = "pid";
+ ProtectClock = true;
+ ProtectControlGroups = true;
+ ProtectHome = true;
+ ProtectHostname = true;
+ ProtectKernelLogs = true;
+ ProtectKernelModules = true;
+ ProtectKernelTunables = true;
+ ProtectProc = "invisible";
+ ProtectSystem = "strict";
+ ReadWritePaths = cfg.recipeRoot;
+ RemoveIPC = true;
+ RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
+ RestrictNamespaces = true;
+ RestrictRealtime = true;
+ RestrictSUIDSGID = true;
+ SystemCallArchitectures = "native";
+ SystemCallFilter = [ "@system-service" "~@privileged" "~@resources" ];
+ UMask = "0027";
+ WorkingDirectory = cfg.recipeRoot;
+ };
+ };
+
+ services.nginx = mkIf cfg.nginx.enable {
+ enable = mkDefault true;
+ virtualHosts.${cfg.nginx.virtualHost} = {
+ locations.${cfg.nginx.location} = {
+ proxyPass = "http://127.0.0.1:${toString cfg.port}";
+ };
+ };
+ };
+ };
+}
diff --git a/modules/nixos/cooklang-chef.nix b/modules/nixos/cooklang-chef.nix
new file mode 100644
index 0000000..65af966
--- /dev/null
+++ b/modules/nixos/cooklang-chef.nix
@@ -0,0 +1,130 @@
+{ config, pkgs, lib, ... }:
+with builtins // lib;
+let
+ cfg = config.services.cooklang-chef;
+ args = escapeShellArgs ([
+ "--port"
+ (toString cfg.port)
+ "--path"
+ cfg.recipeRoot
+ ] ++ cfg.extraArgs);
+in {
+ options.services.cooklang-chef = {
+ enable = mkEnableOption "cooklang-chef webserver";
+ package = mkPackageOption pkgs "cooklang-chef" {};
+
+ recipeRoot = mkOption {
+ type = types.path;
+ default = "${cfg.dataDir}/cookbook";
+ };
+
+ user = mkOption {
+ type = types.str;
+ default = "cooklang-chef";
+ };
+
+ group = mkOption {
+ type = types.str;
+ default = "cooklang-chef";
+ };
+
+ dataDir = mkOption {
+ type = types.path;
+ default = "/var/lib/cooklang-chef";
+ description = ''
+ Home directory for ${cfg.user}.
+ '';
+ };
+
+ port = mkOption {
+ type = types.port;
+ default = 9080;
+ };
+
+ extraArgs = mkOption {
+ type = with types; listOf str;
+ default = [];
+ };
+
+ nginx = {
+ enable = mkEnableOption "nginx reverse proxy";
+ virtualHost = mkOption {
+ type = types.str;
+ example = mdDoc ''
+ cook.example.com
+ '';
+ };
+ location = mkOption {
+ type = types.str;
+ default = "/";
+ };
+ };
+ };
+
+ config = mkIf cfg.enable {
+ users = {
+ users = mkIf (cfg.user == "cooklang-chef") {
+ ${cfg.user} = {
+ isSystemUser = true;
+ group = cfg.group;
+ home = cfg.dataDir;
+ };
+ };
+ groups = mkIf (cfg.group == "cooklang-chef") {
+ ${cfg.group} = {};
+ };
+ };
+
+ systemd.services.cooklang-chef = {
+ description = "A website for serving cooklang cookbooks";
+ after = [ "network.target" ];
+ requires = [ "network.target" ];
+ wantedBy = [ "multi-user.target" ];
+ unitConfig.RequiresMountsFor = cfg.recipeRoot;
+ serviceConfig = {
+ StateDirectory = "cooklang-chef cooklang-chef/.config";
+ StateDirectoryMode = "0750";
+ ExecStart = "${getExe cfg.package} serve ${args}";
+ User = cfg.user;
+ Group = cfg.group;
+ IPAddressAllow = "localhost";
+ IPAddressDeny = "any";
+ LockPersonality = true;
+ MemoryDenyWriteExecute = true;
+ NoNewPrivileges = true;
+ PrivateDevices = true;
+ PrivateTmp = true;
+ PrivateUsers = true;
+ ProcSubset = "pid";
+ ProtectClock = true;
+ ProtectControlGroups = true;
+ ProtectHome = true;
+ ProtectHostname = true;
+ ProtectKernelLogs = true;
+ ProtectKernelModules = true;
+ ProtectKernelTunables = true;
+ ProtectProc = "invisible";
+ ProtectSystem = "strict";
+ ReadWritePaths = cfg.dataDir;
+ RemoveIPC = true;
+ RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
+ RestrictNamespaces = true;
+ RestrictRealtime = true;
+ RestrictSUIDSGID = true;
+ SystemCallArchitectures = "native";
+ SystemCallFilter = [ "@system-service" "~@privileged" "~@resources" ];
+ UMask = "0027";
+ WorkingDirectory = cfg.dataDir;
+ };
+ };
+
+ services.nginx = mkIf cfg.nginx.enable {
+ enable = mkDefault true;
+ virtualHosts.${cfg.nginx.virtualHost} = {
+ locations.${cfg.nginx.location} = {
+ proxyPass = "http://127.0.0.1:${toString cfg.port}";
+ };
+ };
+ };
+ };
+}
diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix
new file mode 100644
index 0000000..d60e5e9
--- /dev/null
+++ b/modules/nixos/default.nix
@@ -0,0 +1,5 @@
+{
+ imports = [
+ ./cooklang-chef.nix
+ ];
+}
diff --git a/overlays/default.nix b/overlays/default.nix
new file mode 100644
index 0000000..1133f88
--- /dev/null
+++ b/overlays/default.nix
@@ -0,0 +1,11 @@
+final: prev: {
+
+ cooklang-chef = prev.callPackage ../pkgs/chef {};
+
+ cook-import = prev.callPackage ../pkgs/cook-import {};
+
+ vimPlugins = prev.vimPlugins.extend (_: _: {
+ vim-cooklang = prev.callPackage ../pkgs/vim-cooklang.nix {};
+ });
+
+}
diff --git a/pkgs/chef/default.nix b/pkgs/chef/default.nix
new file mode 100644
index 0000000..cb8e72b
--- /dev/null
+++ b/pkgs/chef/default.nix
@@ -0,0 +1,39 @@
+{ rustPlatform, fetchFromGitHub, lib, installShellFiles
+, ... }:
+let
+ pname = "cooklang-chef";
+ version = "0.9.1";
+ src = fetchFromGitHub {
+ owner = "Zheoni";
+ repo = "cooklang-chef";
+ rev = "v${version}";
+ hash = "sha256-zst5dsRbSMP9b6XcWua3DFkQK9XjYytoxvbmhmkqTmk=";
+ };
+in rustPlatform.buildRustPackage {
+ inherit pname version src;
+
+ cargoHash = "sha256-NH8LznrRHcv93wtI6i6kCLGmzGKnqsbQQN6UUTt42MQ=";
+
+ nativeBuildInputs = [
+ installShellFiles
+ ];
+
+ postInstall = ''
+ export XDG_CONFIG_HOME=$out/share
+
+ for s in bash fish zsh; do
+ installShellCompletion --cmd chef --$s <($out/bin/chef generate-completions $s)
+ done
+ '';
+
+ # passthru = {
+ # inherit ui;
+ # };
+
+ meta = with lib; {
+ homepage = "https://github.com/Zheoni/cooklang-chef";
+ description = "A CLI to manage cooklang recipes with extensions";
+ license = licenses.mit;
+ mainProgram = "chef";
+ };
+}
diff --git a/pkgs/cook-import/default.nix b/pkgs/cook-import/default.nix
new file mode 100644
index 0000000..512745e
--- /dev/null
+++ b/pkgs/cook-import/default.nix
@@ -0,0 +1,17 @@
+{ poetry2nix, fetchFromGitHub, lib, ... }:
+poetry2nix.mkPoetryApplication {
+ projectDir = fetchFromGitHub {
+ owner = "cooklang";
+ repo = "cook-import";
+ rev = "d92e44a";
+ hash = "sha256-SSrLN0qhHNalF8RrsZvezqZvAkcKCLukSGW9f3IHIIE=";
+ };
+
+ meta = with lib; {
+ homepage = "https://github.com/cooklang/cook-import";
+ description = "A command-line tool to import recipes into Cooklang format";
+ license = licenses.mit;
+ mainProgram = "cook-import";
+ broken = true;
+ };
+}
diff --git a/pkgs/vim-cooklang.nix b/pkgs/vim-cooklang.nix
new file mode 100644
index 0000000..efe2f23
--- /dev/null
+++ b/pkgs/vim-cooklang.nix
@@ -0,0 +1,15 @@
+{ vimUtils, fetchFromGitHub, lib, ... }:
+vimUtils.buildVimPlugin {
+ name = "vim-cooklang";
+ src = fetchFromGitHub {
+ owner = "luizribeiro";
+ repo = "vim-cooklang";
+ rev = "861b7ab";
+ sha256 = "sha256-3cppQJ4xo13kML8A0OQqV+p01Wxx3dV94ddjBAkFmp0=";
+ };
+
+ meta = with lib; {
+ homepage = "https://github.com/luizribeiro/vim-cooklang";
+ description = "A cooklang syntax highlighting plugin for vim";
+ };
+}