This repository has been archived on 2024-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
staxman-old/flake.nix
2023-11-29 17:29:24 +01:00

69 lines
1.6 KiB
Nix

{
description = "staxman";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-crate2nix = {
url = "github:nix-community/crate2nix";
flake = false;
};
};
outputs =
inputs @ { self
, nixpkgs
, flake-parts
, rust-overlay
, rust-crate2nix
, ...
}: flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
];
flake = {
nixosModules.default = import ./nixos.nix self;
};
perSystem = { system, pkgs, ... }:
let
overlays = [
(import rust-overlay)
(self: super:
let
toolchain = super.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
in
{
rustc = toolchain;
})
];
pkgs = import nixpkgs { inherit system overlays; };
project =
let
crateTools = pkgs.callPackage "${rust-crate2nix}/tools.nix" { inherit pkgs; };
in
import
(crateTools.generatedCargoNix {
name = "staxman";
src = ./.;
})
{
inherit pkgs;
};
in
rec {
packages = {
staxman = project.rootCrate.build;
default = packages.staxman;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
rustc
cargo-watch
clang
];
};
};
};
}