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 .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
/.vscode
/.idea
entries

.direnv/
result
1,098 changes: 1,098 additions & 0 deletions Cargo.nix

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions FLAKES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## flakes

https://nixos.wiki/wiki/Flakes

## dev shell

```
nix develop
```

## build project

```
nix build
```

run the executable:

```
./result/bin/dlog
```

## keeping `Cargo.nix` up to date

this should be run if `Cargo.toml` / `Cargo.lock` are changed. `Cargo.nix` is used for `nix build`.

```
cargo2nix -f
```
212 changes: 212 additions & 0 deletions flake.lock

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

37 changes: 37 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
description = "dlog";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
cargo2nix.url = "github:cargo2nix/cargo2nix/feature/add-basic-flake-support";
};

outputs = { self, nixpkgs, flake-utils, rust-overlay, cargo2nix, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [
(import rust-overlay)
(import "${cargo2nix}/overlay")
];
pkgs = import nixpkgs {
inherit system overlays;
};
in
with pkgs;
{
devShell = mkShell {
buildInputs = [
rust-bin.stable.latest.default
cargo2nix.defaultPackage.${system}
];
};

defaultPackage =
(pkgs.rustBuilder.makePackageSet' {
rustChannel = "stable";
packageFun = import ./Cargo.nix;
}).workspace.dlog {};
});
}