~dkellner/chronofold

f22a412f92248f1d310f7aea1928563875a9f0b3 — Dominik Kellner 9 months ago 879d323
Add `flake.{nix,lock}` for Nix Flakes support
3 files changed, 118 insertions(+), 1 deletions(-)

M .gitignore
A flake.lock
A flake.nix
M .gitignore => .gitignore +1 -1
@@ 1,4 1,4 @@
.envrc
.direnv
/target
Cargo.lock
shell.nix

A flake.lock => flake.lock +92 -0
@@ 0,0 1,92 @@
{
  "nodes": {
    "flake-utils": {
      "locked": {
        "lastModified": 1644229661,
        "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "flake-utils_2": {
      "locked": {
        "lastModified": 1637014545,
        "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1644486793,
        "narHash": "sha256-EeijR4guVHgVv+JpOX3cQO+1XdrkJfGmiJ9XVsVU530=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "1882c6b7368fd284ad01b0a5b5601ef136321292",
        "type": "github"
      },
      "original": {
        "id": "nixpkgs",
        "type": "indirect"
      }
    },
    "nixpkgs_2": {
      "locked": {
        "lastModified": 1637453606,
        "narHash": "sha256-Gy6cwUswft9xqsjWxFYEnx/63/qzaFUwatcbV5GF/GQ=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "8afc4e543663ca0a6a4f496262cd05233737e732",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixpkgs-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "flake-utils": "flake-utils",
        "nixpkgs": "nixpkgs",
        "rust-overlay": "rust-overlay"
      }
    },
    "rust-overlay": {
      "inputs": {
        "flake-utils": "flake-utils_2",
        "nixpkgs": "nixpkgs_2"
      },
      "locked": {
        "lastModified": 1644546876,
        "narHash": "sha256-EB3Xw30GnqhEdezEWlPy8XYsZaNDu9hScwVbI7/busA=",
        "owner": "oxalica",
        "repo": "rust-overlay",
        "rev": "b4532ea48564cd25534203b78dc54cc6327e0658",
        "type": "github"
      },
      "original": {
        "owner": "oxalica",
        "repo": "rust-overlay",
        "type": "github"
      }
    }
  },
  "root": "root",
  "version": 7
}

A flake.nix => flake.nix +25 -0
@@ 0,0 1,25 @@
{
  inputs = {
    nixpkgs.url = "nixpkgs";
    flake-utils.url = "github:numtide/flake-utils";
    rust-overlay.url = "github:oxalica/rust-overlay";
  };

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