Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
/bin/index.mjs
/.vscode
/output-es/
/result
3 changes: 3 additions & 0 deletions CHANGELOG.d/feature_nix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Added nix flake
* Updated README with nix example
* Merged internal bin package with root to allow nix build
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ A port of the work done in [`purescript/purescript#4392`](https://github.com/pur

![ci badge](https://github.com/purescript-contrib/uplog/actions/workflows/ci.yml/badge.svg)

## Install
## Getting started

The first working release is `v0.5.1`.

```sh
npm i chnglg
```

```sh
nix run github:purescript-contrib/chnglg
```

## Why

To make it easier to keep a good changelog that
Expand Down
2 changes: 2 additions & 0 deletions bin/index.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
import("../output/Main/index.js").then(m => m.main())
38 changes: 0 additions & 38 deletions bin/spago.dhall

This file was deleted.

181 changes: 181 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
nixConfig.sandbox = "relaxed";

description = "A maintainer and contributor-friendly tool for generating a human-readable CHANGELOG.md";


inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:ursi/flake-utils";
easy-ps.url = "github:justinwoo/easy-purescript-nix";
spago2nix.url = "github:justinwoo/spago2nix";
};

outputs = { self, utils, ... }@inputs:
utils.apply-systems
{ inherit inputs; }
({ system, pkgs, easy-ps, spago2nix, ... }:
let
chnglg = pkgs.stdenv.mkDerivation
{
name = "chnglg";
src = pkgs.nix-gitignore.gitignoreSource [ ".git" ] ./.;
nativeBuildInputs = [
easy-ps.purs
] ++ (
spago2nix.spago2nix_nativeBuildInputs {
srcs-dhall = [
./spago.dhall
./packages.dhall
];
}
);
unpackPhase = ''
cp -r $src/{src,bin} .
install-spago-style
'';
buildInputs = with pkgs; [ nodejs ];
buildPhase = ''
mkdir -p $out/bin
build-spago-style "./src/**/*.purs" "./bin/**/*.purs"
mv output $out/
install $src/bin/index.dev.js $out/bin/$name
'';
};
in
{
packages = {
inherit chnglg;
default = self.packages.${system}.chnglg;
};
});
}
6 changes: 5 additions & 1 deletion spago.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
, dependencies =
[ "aff"
, "argonaut-codecs"
, "argparse-basic"
, "arrays"
, "bifunctors"
, "console"
, "control"
, "datetime"
, "effect"
Expand All @@ -20,6 +23,7 @@
, "node-execa"
, "node-fs"
, "node-path"
, "node-process"
, "nullable"
, "parsing"
, "precise-datetime"
Expand All @@ -30,5 +34,5 @@
, "versions"
]
, packages = ./packages.dhall
, sources = [ "src/**/*.purs" ]
, sources = [ "src/**/*.purs", "bin/**/*.purs" ]
}