feat(nix): set up flake-compat

This commit is contained in:
Harsh Shandilya 2023-02-16 14:26:30 +00:00
parent 4d035126a5
commit 6c7ce91a48
4 changed files with 83 additions and 52 deletions

8
default.nix Normal file
View File

@ -0,0 +1,8 @@
(import (let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.defaultNix

View File

@ -18,7 +18,9 @@
},
"crane": {
"inputs": {
"flake-compat": "flake-compat",
"flake-compat": [
"flake-compat"
],
"flake-utils": [
"flake-utils"
],
@ -94,6 +96,7 @@
"inputs": {
"advisory-db": "advisory-db",
"crane": "crane",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"

View File

@ -3,9 +3,11 @@
inputs = {
nixpkgs = {url = "github:NixOS/nixpkgs/nixpkgs-unstable";};
flake-utils = {url = "github:numtide/flake-utils";};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
@ -13,26 +15,31 @@
flake-utils.follows = "flake-utils";
};
};
crane = {
url = "github:ipetkov/crane";
inputs = {
flake-utils.follows = "flake-utils";
flake-compat.follows = "flake-compat";
nixpkgs.follows = "nixpkgs";
rust-overlay.follows = "rust-overlay";
};
};
advisory-db = {
url = "github:rustsec/advisory-db";
flake = false;
};
};
outputs =
{ self, nixpkgs, crane, flake-utils, advisory-db, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
outputs = {
self,
nixpkgs,
crane,
flake-utils,
advisory-db,
rust-overlay,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
@ -62,8 +69,13 @@
};
in {
checks = {
inherit text-editor text-editor-audit text-editor-clippy
text-editor-fmt text-editor-nextest;
inherit
text-editor
text-editor-audit
text-editor-clippy
text-editor-fmt
text-editor-nextest
;
};
packages.default = text-editor;

8
shell.nix Normal file
View File

@ -0,0 +1,8 @@
(import (let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.shellNix