medit/flake.nix

47 lines
1.4 KiB
Nix
Raw Normal View History

2022-08-16 01:42:40 +00:00
{
description = "Description for the project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
rust.url = "github:oxalica/rust-overlay";
rust.inputs.nixpkgs.follows = "nixpkgs";
2022-08-16 03:28:39 +00:00
naersk.url = "github:nix-community/naersk";
naersk.inputs.nixpkgs.follows = "nixpkgs";
2022-08-16 01:42:40 +00:00
};
2022-08-16 03:28:39 +00:00
outputs = { self, flake-parts, nixpkgs, naersk, rust }:
let
overlays = [ rust.overlays.default ];
in
2022-08-16 01:42:40 +00:00
flake-parts.lib.mkFlake { inherit self; } {
imports = [{
config.perSystem = { system, ... }: {
2022-08-16 03:28:39 +00:00
config._module.args.pkgs = import nixpkgs { inherit system overlays; };
2022-08-16 01:42:40 +00:00
};
}];
2022-08-16 03:28:39 +00:00
systems = nixpkgs.lib.systems.flakeExposed;
perSystem = { config, self', inputs', pkgs, system, ... }:
let
toolchain = pkgs.rust-bin.stable.latest.default;
naersk-lib = pkgs.callPackage naersk {
cargo = toolchain;
rustc = toolchain;
};
in
{
packages.default = naersk-lib.buildPackage {
src = ./.;
buildInputs = with pkgs; [ SDL2 ];
};
apps.default.program = "${config.packages.default}/bin/medit";
devShells.default = pkgs.mkShell {
nativeBuildInputs = [ toolchain ];
};
};
2022-08-16 01:42:40 +00:00
};
}