mcuxpresso: add feature flag for udev rules only
This commit is contained in:
parent
0eab12a13f
commit
61bc1ea56d
4 changed files with 31 additions and 8 deletions
12
config/nixos/hardware/mcuxpresso.nix
Normal file
12
config/nixos/hardware/mcuxpresso.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
services.udev.packages = [
|
||||||
|
(inputs.self.packages.${pkgs.system}.mcuxpresso.ide.override
|
||||||
|
{
|
||||||
|
onlyUdevRules = true;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
|
@ -24,6 +24,7 @@ in {
|
||||||
"${nixos}/core/lanzaboote.nix"
|
"${nixos}/core/lanzaboote.nix"
|
||||||
|
|
||||||
"${nixos}/hardware/fprintd.nix"
|
"${nixos}/hardware/fprintd.nix"
|
||||||
|
"${nixos}/hardware/mcuxpresso.nix"
|
||||||
"${nixos}/services/power.nix"
|
"${nixos}/services/power.nix"
|
||||||
"${nixos}/services/brightness.nix"
|
"${nixos}/services/brightness.nix"
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
# mcuxpresso = import ./mcuxpresso pkgs;
|
mcuxpresso = import ./mcuxpresso pkgs;
|
||||||
# this is unfortunately needed since bolt-launcher makes use of openssl-1.1.1w, and since it is not part of hosts, we have to add it this way
|
# this is unfortunately needed since bolt-launcher makes use of openssl-1.1.1w, and since it is not part of hosts, we have to add it this way
|
||||||
bolt-launcher =
|
bolt-launcher =
|
||||||
(import inputs.nixpkgs {
|
(import inputs.nixpkgs {
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
# https://github.com/KoviRobi/nixos-config/blob/3ab3f8372d1fd021a235de4d314ef7147846513e/overlays/mcuxpresso.nix
|
{
|
||||||
{pkgs, ...}: let
|
pkgs,
|
||||||
|
onlyUdevRules ? false,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
name = "mcuxpressoide";
|
name = "mcuxpressoide";
|
||||||
version = "24.9.25";
|
version = "24.9.25";
|
||||||
description = "MCUXpresso IDE";
|
description = "MCUXpresso IDE";
|
||||||
|
@ -50,7 +53,6 @@
|
||||||
pkgs.stdenv.cc.cc.lib
|
pkgs.stdenv.cc.cc.lib
|
||||||
pkgs.gcc
|
pkgs.gcc
|
||||||
pkgs.libgcc
|
pkgs.libgcc
|
||||||
pkgs.libstdcxx5
|
|
||||||
pkgs.xorg.libXext
|
pkgs.xorg.libXext
|
||||||
pkgs.xorg.libX11
|
pkgs.xorg.libX11
|
||||||
pkgs.xorg.libXrender
|
pkgs.xorg.libXrender
|
||||||
|
@ -73,7 +75,6 @@
|
||||||
runScript = "${mcuxpressoide}/bin/eclipse";
|
runScript = "${mcuxpressoide}/bin/eclipse";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
# wrapper with desktop entry and udev rules
|
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
inherit name version description;
|
inherit name version description;
|
||||||
dontUnpack = true;
|
dontUnpack = true;
|
||||||
|
@ -90,11 +91,20 @@ in
|
||||||
];
|
];
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
mkdir -p $out/bin $out/lib/udev/rules.d $out/eclipse $out/mcu_data
|
mkdir -p $out/lib/udev/rules.d
|
||||||
|
|
||||||
cp ${mcuxpressoide}/lib/udev/rules.d/85-mcuxpresso.rules ${mcuxpressoide}/lib/udev/rules.d/56-pemicro.rules $out/lib/udev/rules.d/
|
if [ ${toString onlyUdevRules} = "true" ]; then
|
||||||
|
# only copy udev rules
|
||||||
|
cp ${mcuxpressoide}/lib/udev/rules.d/85-mcuxpresso.rules ${mcuxpressoide}/lib/udev/rules.d/56-pemicro.rules $out/lib/udev/rules.d/
|
||||||
|
else
|
||||||
|
# copy full installation
|
||||||
|
mkdir -p $out/bin $out/eclipse $out/mcu_data
|
||||||
|
cp ${mcuxpressoide}/lib/udev/rules.d/85-mcuxpresso.rules ${mcuxpressoide}/lib/udev/rules.d/56-pemicro.rules $out/lib/udev/rules.d/
|
||||||
|
cp -r ${mcuxpressoide}/eclipse $out/eclipse
|
||||||
|
cp -r ${mcuxpressoide}/mcu_data $out/mcu_data
|
||||||
|
ln -s ${mcuxpressoFhsEnv}/bin/mcuxpresso-env $out/bin/mcuxpresso
|
||||||
|
fi
|
||||||
|
|
||||||
ln -s ${mcuxpressoFhsEnv}/bin/mcuxpresso-env $out/bin/mcuxpresso
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue