Add flake for zephyr dev

This commit is contained in:
Artemis Tosini 2023-11-12 22:27:50 +00:00
parent cf08a478a4
commit ee90766969
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
4 changed files with 119 additions and 0 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
*.py[co]
__pycache__/
*~
.direnv/

85
flake.lock Normal file
View file

@ -0,0 +1,85 @@
{
"nodes": {
"artemist-packages": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": [
"utils"
]
},
"locked": {
"lastModified": 1699827895,
"narHash": "sha256-Fzjd9h3TDPXORNl6pek+e79eFjbmSaU4Hi/MUpjSRz4=",
"ref": "refs/heads/canon",
"rev": "763d83f15705ab6c6b033e445f96d40bc4f10eb4",
"revCount": 9,
"type": "git",
"url": "https://git.mildlyfunctional.gay/artemist/packages.git"
},
"original": {
"type": "git",
"url": "https://git.mildlyfunctional.gay/artemist/packages.git"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1699725108,
"narHash": "sha256-NTiPW4jRC+9puakU4Vi8WpFEirhp92kTOSThuZke+FA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "911ad1e67f458b6bcf0278fa85e33bb9924fed7e",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"artemist-packages": "artemist-packages",
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

32
flake.nix Normal file
View file

@ -0,0 +1,32 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
artemist-packages = {
url = "git+https://git.mildlyfunctional.gay/artemist/packages.git";
inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "utils";
};
};
outputs = { self, nixpkgs, utils, artemist-packages }:
utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in {
devShells.zephyr =
artemist-packages.devShells.${system}.zephyr.override {
toolchains =
with artemist-packages.packages.${system}.zephyr.toolchains; [
arm-zephyr-eabi
riscv64-zephyr-elf
];
zephyrSrc = pkgs.fetchFromGitHub {
owner = "zephyrproject-rtos";
repo = "zephyr";
rev = "v3.5.0";
hash = "sha256-72QFsKOWkF6BiP4XgZAXXSBcN4t6yvhAeXCpgCYrhe8=";
};
};
formatter = pkgs.nixfmt;
});
}

1
zephyr/.envrc Normal file
View file

@ -0,0 +1 @@
use flake ..#zephyr