add openmodelica
This commit is contained in:
@@ -6,8 +6,7 @@
|
||||
let
|
||||
myRizin = pkgs.rizin.passthru.withPlugins
|
||||
(plugins: [ plugins.jsdec plugins.rz-ghidra ]);
|
||||
in
|
||||
{
|
||||
in {
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./services/virtual.nix
|
||||
@@ -20,9 +19,7 @@ in
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
"net.ipv4.ip_forward" = 1;
|
||||
};
|
||||
boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; };
|
||||
|
||||
#boot.loader.grub.device = "/dev/nvme1n1p1";
|
||||
boot.loader = {
|
||||
@@ -113,9 +110,20 @@ in
|
||||
myRizin
|
||||
libgit2
|
||||
inputs.helix.packages."${pkgs.system}".helix
|
||||
openmodelica
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
nix.settings.trusted-users = [ "root" "allen" ];
|
||||
|
||||
nix.settings = {
|
||||
substituters =
|
||||
[ "https://allen-nixpkgs.cachix.org" "https://cache.nixos.org" ];
|
||||
trusted-public-keys = [
|
||||
"allen-nixpkgs.cachix.org-1:GS5qDYVloEiC6oeJQNijR3hsMKPqDSGbYUz35qtbMpg="
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
];
|
||||
};
|
||||
|
||||
environment.variables = {
|
||||
LD_LIBRARY_PATH = lib.makeLibraryPath [
|
||||
|
||||
10
flake.nix
10
flake.nix
@@ -16,6 +16,15 @@
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
./configuration.nix
|
||||
|
||||
({ pkgs, ... }: {
|
||||
# Define the overlay inline or in a separate file
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
openmodelica = final.callPackage ./nixpkgs/openmodelica.nix { };
|
||||
})
|
||||
];
|
||||
})
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
@@ -27,3 +36,4 @@
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
95
nixpkgs/openmodelica.nix
Normal file
95
nixpkgs/openmodelica.nix
Normal file
@@ -0,0 +1,95 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
}:
|
||||
let
|
||||
desktopItem = pkgs.makeDesktopItem {
|
||||
name = "openmodelica";
|
||||
desktopName = "OpenModelica Connection Editor";
|
||||
exec = "OMEdit";
|
||||
icon = "openmodelica";
|
||||
categories = [
|
||||
"Development"
|
||||
"Science"
|
||||
"Education"
|
||||
];
|
||||
comment = "Modelica-based modeling and simulation environment";
|
||||
};
|
||||
in
|
||||
|
||||
with pkgs;
|
||||
stdenv.mkDerivation {
|
||||
name = "openmodelica-bin";
|
||||
version = "custom";
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://github.com/OpenModelica/OpenModelica.git";
|
||||
rev = "959f964dadf1b928f03e3c2f74b8f816f95df1ef";
|
||||
fetchSubmodules = true;
|
||||
sha256 = "sha256-3rFIrg7+t/eX2mq21v9AcYhV3Adloa8Sae9uRGtbyrY=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
cmake
|
||||
gfortran
|
||||
pkg-config
|
||||
qt6.wrapQtAppsHook
|
||||
autoPatchelfHook
|
||||
flex
|
||||
autoconf
|
||||
automake
|
||||
libtool
|
||||
ninja
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
cmake -S . -B build_cmake -GNinja -DOM_USE_CCACHE=OFF -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX=$out
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
cmake --build build_cmake --parallel $NIX_BUILD_CORES --target install
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cmake --install build_cmake --prefix $out
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
if [ -d "$out/lib64" ]; then
|
||||
mkdir -p $out/lib
|
||||
cp -rn $out/lib64/* $out/lib/
|
||||
rm -rf $out/lib64
|
||||
fi
|
||||
|
||||
mkdir -p $out/share/applications
|
||||
cp ${desktopItem}/share/applications/* $out/share/applications/
|
||||
|
||||
# If you have an icon file in your source, install it too
|
||||
# mkdir -p $out/share/icons/hicolor/scalable/apps
|
||||
# cp $src/path/to/icon.svg $out/share/icons/hicolor/scalable/apps/openmodelica.svg
|
||||
'';
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
# Compilers and Build Tools
|
||||
|
||||
# Dependencies
|
||||
boost
|
||||
hwloc
|
||||
jdk
|
||||
lapack
|
||||
blas
|
||||
hdf5
|
||||
expat
|
||||
omniorb
|
||||
curl
|
||||
ncurses
|
||||
readline
|
||||
openscenegraph
|
||||
qt6.qt5compat
|
||||
qt6.qtbase
|
||||
qt6.qtwebengine
|
||||
qt6.qtdeclarative
|
||||
qt6.qttools
|
||||
lapack-reference
|
||||
];
|
||||
}
|
||||
|
||||
@@ -72,4 +72,5 @@ with pkgs; [
|
||||
gptfdisk
|
||||
openocd
|
||||
probe-rs-tools
|
||||
cachix
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user