grub/flake.nix

57 lines
1.7 KiB
Nix
Raw Normal View History

2023-08-11 00:24:37 +00:00
{
description = "A very basic flake";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
inputs.napalm.url = "github:nix-community/napalm";
outputs = { self, nixpkgs, flake-utils, fenix, napalm }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ fenix.overlays.default napalm.overlays.default ];
};
toolchain = pkgs.fenix.stable;
rustPlatform =
pkgs.makeRustPlatform { inherit (toolchain) cargo rustc; };
version = "0.1.0";
in rec {
defaultPackage = packages.grub;
packages = rec {
grub = rustPlatform.buildRustPackage {
name = "grub";
inherit version;
src = pkgs.symlinkJoin {
name = "grub-src";
paths = [
(pkgs.nix-gitignore.gitignoreSource [ ./.gitignore ] ./.)
frontend
];
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"mzlib-0.1.0" =
"sha256-J7dEeCTPIoKmldpAkQadDBXhJP+Zv9hNlUdpMl2L5QM=";
};
};
};
frontend = pkgs.buildNpmPackage {
name = "frontend";
inherit version;
src = pkgs.nix-gitignore.gitignoreSource [ ./.gitignore ] ./.;
npmDepsHash = "sha256-8XYO7U5+X9/8vx/PbTWpgvbJv1D140srgOv5IaVLRxY=";
installPhase = ''
mkdir -p $out
mv dist $out
'';
};
};
devShell = pkgs.mkShell { packages = with toolchain; [ cargo rustc ]; };
});
}