44 lines
1.3 KiB
Nix
44 lines
1.3 KiB
Nix
|
{
|
||
|
description = "shitter";
|
||
|
inputs = {
|
||
|
utils.url = "github:numtide/flake-utils";
|
||
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
||
|
crate2nix = { url = "github:kolloch/crate2nix"; flake = false; };
|
||
|
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
|
||
|
};
|
||
|
|
||
|
outputs = { self, nixpkgs, utils, rust-overlay, crate2nix, ... }:
|
||
|
let
|
||
|
name = "shitter";
|
||
|
rustChannel = "stable";
|
||
|
in
|
||
|
utils.lib.eachDefaultSystem
|
||
|
(system:
|
||
|
let
|
||
|
pkgs = import nixpkgs {
|
||
|
inherit system;
|
||
|
overlays = [
|
||
|
rust-overlay.overlay
|
||
|
(self: super: {
|
||
|
rustc = self.rust-bin.${rustChannel}.latest.default;
|
||
|
cargo = self.rust-bin.${rustChannel}.latest.default;
|
||
|
})
|
||
|
];
|
||
|
};
|
||
|
inherit (import "${crate2nix}/tools.nix" { inherit pkgs; }) generatedCargoNix;
|
||
|
project = pkgs.callPackage
|
||
|
(generatedCargoNix { inherit name; src = ./.; })
|
||
|
{ defaultCrateOverrides = pkgs.defaultCrateOverrides; };
|
||
|
buildInputs = with pkgs; [];
|
||
|
in rec {
|
||
|
packages.${name} = project.rootCrate.build;
|
||
|
defaultPackage = packages.${name};
|
||
|
apps.${name} = utils.lib.mkApp {
|
||
|
inherit name;
|
||
|
drv = packages.${name};
|
||
|
};
|
||
|
defaultApp = apps.${name};
|
||
|
}
|
||
|
);
|
||
|
}
|