add openmodelica
This commit is contained in:
@@ -6,8 +6,7 @@
|
|||||||
let
|
let
|
||||||
myRizin = pkgs.rizin.passthru.withPlugins
|
myRizin = pkgs.rizin.passthru.withPlugins
|
||||||
(plugins: [ plugins.jsdec plugins.rz-ghidra ]);
|
(plugins: [ plugins.jsdec plugins.rz-ghidra ]);
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./services/virtual.nix
|
./services/virtual.nix
|
||||||
@@ -19,23 +18,21 @@ in
|
|||||||
services.logind.lidSwitch = "suspend";
|
services.logind.lidSwitch = "suspend";
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
boot.kernel.sysctl = {
|
boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; };
|
||||||
"net.ipv4.ip_forward" = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
#boot.loader.grub.device = "/dev/nvme1n1p1";
|
#boot.loader.grub.device = "/dev/nvme1n1p1";
|
||||||
boot.loader = {
|
boot.loader = {
|
||||||
systemd-boot.enable = false;
|
systemd-boot.enable = false;
|
||||||
efi = {
|
efi = {
|
||||||
canTouchEfiVariables = true;
|
canTouchEfiVariables = true;
|
||||||
efiSysMountPoint = "/boot/efi";
|
efiSysMountPoint = "/boot/efi";
|
||||||
};
|
};
|
||||||
grub = {
|
grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
device = "nodev";
|
device = "nodev";
|
||||||
efiSupport = true;
|
efiSupport = true;
|
||||||
useOSProber = true;
|
useOSProber = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -113,9 +110,20 @@ in
|
|||||||
myRizin
|
myRizin
|
||||||
libgit2
|
libgit2
|
||||||
inputs.helix.packages."${pkgs.system}".helix
|
inputs.helix.packages."${pkgs.system}".helix
|
||||||
|
openmodelica
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
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 = {
|
environment.variables = {
|
||||||
LD_LIBRARY_PATH = lib.makeLibraryPath [
|
LD_LIBRARY_PATH = lib.makeLibraryPath [
|
||||||
|
|||||||
10
flake.nix
10
flake.nix
@@ -16,6 +16,15 @@
|
|||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
./configuration.nix
|
./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.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
home-manager.useGlobalPkgs = true;
|
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
|
gptfdisk
|
||||||
openocd
|
openocd
|
||||||
probe-rs-tools
|
probe-rs-tools
|
||||||
|
cachix
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user