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

70 lines
1.6 KiB
Nix
Raw Normal View History

2023-11-27 12:33:52 +00:00
{
2023-11-27 12:34:49 +00:00
description = "staxman";
2023-11-27 12:33:52 +00:00
inputs = {
2023-11-27 12:34:49 +00:00
flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-crate2nix = {
2023-11-29 14:39:54 +00:00
url = "github:nix-community/crate2nix";
2023-11-27 12:33:52 +00:00
flake = false;
};
};
outputs =
2023-11-27 12:34:49 +00:00
inputs @ { self
2023-11-27 12:33:52 +00:00
, nixpkgs
2023-11-27 12:34:49 +00:00
, flake-parts
, rust-overlay
, rust-crate2nix
, ...
}: flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
];
flake = {
nixosModules.default = import ./nixos.nix self;
2023-11-27 12:33:52 +00:00
};
2023-11-27 12:34:49 +00:00
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; };
2023-11-27 12:33:52 +00:00
2023-11-27 12:34:49 +00:00
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;
};
2023-11-29 16:29:24 +00:00
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
rustc
cargo-watch
clang
];
};
2023-11-27 12:33:52 +00:00
};
2023-11-27 12:34:49 +00:00
};
}