Flake: Use flake-utils instead of a self-written solution

This commit is contained in:
Weckyy702
2026-03-06 17:15:12 +01:00
parent ceb9d9fc17
commit 41bf80157b
2 changed files with 58 additions and 52 deletions

27
flake.lock generated
View File

@@ -1,5 +1,23 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1771369470,
@@ -18,8 +36,8 @@
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"systems": "systems"
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
@@ -32,8 +50,9 @@
"type": "github"
},
"original": {
"id": "systems",
"type": "indirect"
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},

View File

@@ -1,51 +1,38 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs =
inputs @ { nixpkgs
, systems
, ...
}:
let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system:
import nixpkgs {
localSystem = system;
});
in
{
devShells =
eachSystem
(system: {
default =
let
pkgs = pkgsFor.${system};
pico-sdk = pkgs.pico-sdk.override {
withSubmodules = true;
};
PICO_SDK_PATH = "${pico-sdk}/lib/pico-sdk";
in
pkgs.mkShell {
name = "PicoVGA dev shell";
inputsFrom = [ pico-sdk ];
packages = with pkgs;
[
gcc-arm-embedded
python3
usbutils
picotool
picocom
]
++ [ pico-sdk ];
shellHook = ''
ln -sf ${PICO_SDK_PATH}/external/pico_sdk_import.cmake pico_sdk_import.cmake
'';
inherit PICO_SDK_PATH;
};
});
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
flake-utils,
...
}: flake-utils.lib.eachDefaultSystem(system:
let
pkgs = import nixpkgs { inherit system; };
pico-sdk = pkgs.pico-sdk.override {
withSubmodules = true;
};
PICO_SDK_PATH = "${pico-sdk}/lib/pico-sdk";
in {
devShell = pkgs.mkShell {
name = "PicoVGA dev shell";
inputsFrom = [ pico-sdk ];
packages = with pkgs; [
gcc-arm-embedded
python3
usbutils
picotool
pico-sdk
];
shellHook = ''
ln -sf ${PICO_SDK_PATH}/external/pico_sdk_import.cmake pico_sdk_import.cmake
'';
inherit PICO_SDK_PATH;
};
});
}