Commit 463d46b8ab

463d46b8ab31ab581d9a46333db94b47f1d56739

parent: 274234ce4c

Unregistered key

Benjamin Große <ste3ls@gmail.com> · 2023-03-24 10:32 UTC
committer: <git@ulyssa.dev>

Add Nix flake (#73)

Layout: unified · split

README.md +6
@@ -43,6 +43,12 @@ On Arch Linux a package is available in the Arch User Repositories (AUR). To ins
43paru iamb-git 43paru iamb-git
44``` 44```
45 45
46### Nix / NixOS (flake)
47
48```
49nix profile install "github:ulyssa/iamb"
50```
51
46## Configuration 52## Configuration
47 53
48You can create a basic configuration in `$CONFIG_DIR/iamb/config.json` that looks like: 54You can create a basic configuration in `$CONFIG_DIR/iamb/config.json` that looks like:
flake.lock added +94
@@ -0,0 +1,94 @@
1{
2 "nodes": {
3 "flake-utils": {
4 "locked": {
5 "lastModified": 1678901627,
6 "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
7 "owner": "numtide",
8 "repo": "flake-utils",
9 "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
10 "type": "github"
11 },
12 "original": {
13 "owner": "numtide",
14 "repo": "flake-utils",
15 "type": "github"
16 }
17 },
18 "flake-utils_2": {
19 "locked": {
20 "lastModified": 1659877975,
21 "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
22 "owner": "numtide",
23 "repo": "flake-utils",
24 "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
25 "type": "github"
26 },
27 "original": {
28 "owner": "numtide",
29 "repo": "flake-utils",
30 "type": "github"
31 }
32 },
33 "nixpkgs": {
34 "locked": {
35 "lastModified": 1679437018,
36 "narHash": "sha256-vOuiDPLHSEo/7NkiWtxpHpHgoXoNmrm+wkXZ6a072Fc=",
37 "owner": "nixos",
38 "repo": "nixpkgs",
39 "rev": "19cf008bb18e47b6e3b4e16e32a9a4bdd4b45f7e",
40 "type": "github"
41 },
42 "original": {
43 "owner": "nixos",
44 "ref": "nixos-unstable",
45 "repo": "nixpkgs",
46 "type": "github"
47 }
48 },
49 "nixpkgs_2": {
50 "locked": {
51 "lastModified": 1665296151,
52 "narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
53 "owner": "NixOS",
54 "repo": "nixpkgs",
55 "rev": "14ccaaedd95a488dd7ae142757884d8e125b3363",
56 "type": "github"
57 },
58 "original": {
59 "owner": "NixOS",
60 "ref": "nixpkgs-unstable",
61 "repo": "nixpkgs",
62 "type": "github"
63 }
64 },
65 "root": {
66 "inputs": {
67 "flake-utils": "flake-utils",
68 "nixpkgs": "nixpkgs",
69 "rust-overlay": "rust-overlay"
70 }
71 },
72 "rust-overlay": {
73 "inputs": {
74 "flake-utils": "flake-utils_2",
75 "nixpkgs": "nixpkgs_2"
76 },
77 "locked": {
78 "lastModified": 1679624450,
79 "narHash": "sha256-wiDqUaklmc31E1+wz5sv52sMcWvZKsL1FBeGJCxz628=",
80 "owner": "oxalica",
81 "repo": "rust-overlay",
82 "rev": "afbdcf305fd6f05f708fe76d52f24d37d066c251",
83 "type": "github"
84 },
85 "original": {
86 "owner": "oxalica",
87 "repo": "rust-overlay",
88 "type": "github"
89 }
90 }
91 },
92 "root": "root",
93 "version": 7
94}
flake.nix added +39
@@ -0,0 +1,39 @@
1{
2 description = "iamb";
3 nixConfig.bash-prompt = "\[nix-develop\]$ ";
4
5 inputs = {
6 nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
7 flake-utils.url = "github:numtide/flake-utils";
8 rust-overlay.url = "github:oxalica/rust-overlay";
9 };
10
11 outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }:
12 flake-utils.lib.eachDefaultSystem (system:
13 let
14 # We only need the nightly overlay in the devShell because .rs files are formatted with nightly.
15 overlays = [ (import rust-overlay) ];
16 pkgs = import nixpkgs { inherit system overlays; };
17 rustNightly = pkgs.rust-bin.nightly."2023-03-17".default;
18 in
19 with pkgs;
20 {
21 packages.default = pkgs.rustPlatform.buildRustPackage {
22 pname = "iamb";
23 version = "0.0.7";
24 src = ./.;
25 cargoLock.lockFile = ./Cargo.lock;
26 nativeBuildInputs = [ pkgs.openssl pkgs.pkgconfig ];
27 buildInputs = [ pkgs.openssl ];
28 };
29 devShell = mkShell {
30 buildInputs = [
31 (rustNightly.override { extensions = [ "rust-src" ]; })
32 pkg-config
33 cargo-tarpaulin
34 rust-analyzer
35 rustfmt
36 ];
37 };
38 });
39}