Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a728b57d6bf5
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9fc484c37326
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 13, 2020

  1. nixos/codimd: add package option, refactor prettyJSON

    This adds a `package` option to allow for easier overriding of the used
    CodiMD version and `runCommandLocal` with `nativeBuildInputs` is now
    used to pretty print the configuration.
    WilliButz committed Nov 13, 2020
    Copy the full SHA
    74d354a View commit details

Commits on Nov 16, 2020

  1. Merge pull request #103717 from WilliButz/codimd/add-package-option

    nixos/codimd: add package option, refactor prettyJSON
    Ma27 authored Nov 16, 2020
    Copy the full SHA
    9fc484c View commit details
Showing with 13 additions and 4 deletions.
  1. +13 −4 nixos/modules/services/web-apps/codimd.nix
17 changes: 13 additions & 4 deletions nixos/modules/services/web-apps/codimd.nix
Original file line number Diff line number Diff line change
@@ -6,8 +6,10 @@ let
cfg = config.services.codimd;

prettyJSON = conf:
pkgs.runCommand "codimd-config.json" { preferLocalBuild = true; } ''
echo '${builtins.toJSON conf}' | ${pkgs.jq}/bin/jq \
pkgs.runCommandLocal "codimd-config.json" {
nativeBuildInputs = [ pkgs.jq ];
} ''
echo '${builtins.toJSON conf}' | jq \
'{production:del(.[]|nulls)|del(.[][]?|nulls)}' > $out
'';
in
@@ -878,7 +880,6 @@ in
};
};


environmentFile = mkOption {
type = with types; nullOr path;
default = null;
@@ -908,6 +909,14 @@ in
<literal>CodiMD</literal> is running.
'';
};

package = mkOption {
type = types.package;
default = pkgs.codimd;
description = ''
Package that provides CodiMD.
'';
};
};

config = mkIf cfg.enable {
@@ -938,7 +947,7 @@ in
'';
serviceConfig = {
WorkingDirectory = cfg.workDir;
ExecStart = "${pkgs.codimd}/bin/codimd";
ExecStart = "${cfg.package}/bin/codimd";
EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
Environment = [
"CMD_CONFIG_FILE=${cfg.workDir}/config.json"