56 lines
1.7 KiB
Nix
56 lines
1.7 KiB
Nix
{
|
|
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-fmx7Ee+Idx91w9VwV/yeHgJ+4OHiVevfFJ46LTtmZl4=";
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
mv dist $out
|
|
'';
|
|
};
|
|
};
|
|
|
|
devShell = pkgs.mkShell { packages = with toolchain; [ cargo rustc ]; };
|
|
});
|
|
}
|