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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Files and directories created by pub
.dart_tool/
.packages
# Remove the following pattern if you wish to check in your lock file
pubspec.lock

# Conventional directory for build outputs
build/
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ Or, if you have the Flutter SDK installed:
You might need to follow instructions that `pub` gives you, but after that,
you can just run `unsure` as a regular command line program from anywhere.

Run it with `nix`:
```shell
nix run github:/filiph/unsure
```

Or when in the directory:
```shell
nix run .#unsure
```

## Package

Expand Down Expand Up @@ -146,4 +155,4 @@ probabilities with untrained statisticians (such as myself).

[webapp]: https://filiph.github.io/unsure
[Build Status - Cirrus]: https://api.cirrus-ci.com/github/filiph/unsure.svg
[Build status]: https://cirrus-ci.com/github/filiph/unsure/master
[Build status]: https://cirrus-ci.com/github/filiph/unsure/master
61 changes: 61 additions & 0 deletions flake.lock

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

50 changes: 50 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
description = "Unsure is used to calculate with numbers you're not sure about";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = {
self,
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
with nixpkgs; let
pkgs = import nixpkgs {
inherit system;
};
unsure = nixpkgs.outputs.legacyPackages.${system}.buildDartApplication rec {
pname = "unsure";
name = pname;
version = "0.4.0";

src = ./.;

# Convert lockfile with `yq . pubspec.lock >"pubspec.lock.json"`
pubspecLock = lib.importJSON ./pubspec.lock.json;
};
in {
packages = {
default = unsure;
unsure = unsure;
};
apps = rec {
unsure = flake-utils.lib.mkApp {
drv = self.packages.${system}.unsure;
};
default = unsure;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
dart
yq # To convert the lockfile to json
];
};
}
);
}
Loading