Skip to content

Commit 7c049f4

Browse files
committed
added nix flake so I can work on it
1 parent d6a62f6 commit 7c049f4

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

crates.nix

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{...}: {
2+
perSystem = {
3+
pkgs,
4+
config,
5+
...
6+
}: let
7+
# TODO: change this to your crate's name
8+
crateName = "freenet-scaffold";
9+
in {
10+
# declare projects
11+
# TODO: change this to your crate's path
12+
nci.projects.${crateName}.path = ./.;
13+
# configure crates
14+
nci.crates.${crateName} = {};
15+
};
16+
}

flake.nix

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
3+
inputs.nci.url = "github:yusdacra/nix-cargo-integration";
4+
inputs.nci.inputs.nixpkgs.follows = "nixpkgs";
5+
inputs.parts.url = "github:hercules-ci/flake-parts";
6+
inputs.parts.inputs.nixpkgs-lib.follows = "nixpkgs";
7+
8+
outputs = inputs @ {
9+
parts,
10+
nci,
11+
...
12+
}:
13+
parts.lib.mkFlake {inherit inputs;} {
14+
systems = ["x86_64-linux"];
15+
imports = [
16+
nci.flakeModule
17+
./crates.nix
18+
];
19+
perSystem = {
20+
pkgs,
21+
config,
22+
...
23+
}: let
24+
# shorthand for accessing this crate's outputs
25+
# you can access crate outputs under `config.nci.outputs.<crate name>` (see documentation)
26+
crateOutputs = config.nci.outputs."freenet-scaffold";
27+
in {
28+
# export the crate devshell as the default devshell
29+
devShells.default = crateOutputs.devShell;
30+
# export the release package of the crate as default package
31+
packages.default = crateOutputs.packages.release;
32+
};
33+
};
34+
}

0 commit comments

Comments
 (0)