Skip to content

Commit

Permalink
flake: Add initial version
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Salvador <[email protected]>
  • Loading branch information
otavio committed Jun 15, 2024
1 parent 53c6c89 commit 47c3ef2
Show file tree
Hide file tree
Showing 2 changed files with 293 additions and 0 deletions.
203 changes: 203 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";

flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};

treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};


nix-github-actions = {
url = "github:nix-community/nix-github-actions";
inputs.nixpkgs.follows = "nixpkgs";
};

zephyr-nix = {
url = "github:OSSystems/zephyr-nix/pending";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs@{ flake-parts, ... }:
let
inherit (inputs.nixpkgs) lib;
inherit (inputs) self;
in
flake-parts.lib.mkFlake { inherit inputs; } {
systems = lib.systems.flakeExposed;

imports = [
inputs.treefmt-nix.flakeModule
];

flake.githubActions = inputs.nix-github-actions.lib.mkGithubMatrix {
checks = {
inherit (self.checks) x86_64-linux;
};
};

perSystem = { config, inputs', pkgs, ... }:
let
zephyr = inputs'.zephyr-nix.packages;
in
{
treefmt.config = {
projectRootFile = "flake.nix";

programs = {
black.enable = true;
clang-format = {
enable = true;
package = pkgs.clang-tools_17;
};
nixpkgs-fmt.enable = true;
shfmt.enable = true;
};
};

devShells.default = pkgs.mkShell {
inputsFrom = [
config.treefmt.build.devShell
];

packages = [
(zephyr.sdk.override {
targets = [
"arm-zephyr-eabi"
];
})

(zephyr.pythonEnv.override {
extraLibs = [
zephyr.pythonEnv.pkgs.stringcase
];
})

zephyr.hosttools

pkgs.cmake
pkgs.ninja
];
};
};
};
}

0 comments on commit 47c3ef2

Please sign in to comment.