qclk/flake.nix

45 lines
1016 B
Nix
Raw Normal View History

2024-05-09 20:29:14 +01:00
{
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
devenv.url = "github:cachix/devenv";
devenv.inputs.nixpkgs.follows = "nixpkgs";
2024-08-31 23:08:26 +01:00
impermanence.url = "github:nix-community/impermanence";
2024-05-09 20:29:14 +01:00
rootdir = {
url = "file+file:///dev/null";
flake = false;
};
};
outputs = inputs@{ nixpkgs, flake-parts, devenv, rootdir, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
devenv.flakeModule
2024-08-31 15:00:30 +01:00
./mcu
2024-08-31 16:07:55 +01:00
./firmware
2024-05-09 20:29:14 +01:00
];
systems = [ "x86_64-linux" ];
2024-08-04 20:15:24 +01:00
perSystem = { inputs', system, lib, pkgs, config, ... }:
2024-05-09 20:29:14 +01:00
let
2024-08-04 20:15:24 +01:00
inherit (lib) mkMerge;
2024-05-09 20:29:14 +01:00
rootdirOpt =
let
rootFileContent = builtins.readFile rootdir.outPath;
in
pkgs.lib.mkIf (rootFileContent != "") rootFileContent;
in
{
2024-08-31 15:00:30 +01:00
_module.args.libMy = {
withRootdir = c: mkMerge [
c
{ devenv.root = rootdirOpt; }
];
2024-05-09 20:29:14 +01:00
};
};
};
}