add openmodelica

This commit is contained in:
2026-05-07 17:40:59 +09:00
parent 142038a7b5
commit 097ad8118e
8 changed files with 189 additions and 27 deletions

View File

@@ -30,6 +30,9 @@ in
]; ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nixpkgs.config.permittedInsecurePackages = [
"qtwebkit-5.212.0-alpha4"
];
services.nfs.server = { services.nfs.server = {
enable = true; enable = true;
@@ -61,7 +64,7 @@ in
services.resolved = { services.resolved = {
enable = true; enable = true;
dnssec = "allow-downgrade"; dnssec = "false";
}; };
networking.nameservers = [ networking.nameservers = [
"1.1.1.1" "1.1.1.1"
@@ -207,6 +210,7 @@ in
# List packages installed in system profile. # List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options). # You can use https://search.nixos.org/ to find more packages (and options).
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
openmodelica
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
pkg-config pkg-config
wget wget

View File

@@ -17,19 +17,39 @@
}; };
outputs = outputs =
{ self, nixpkgs, home-manager, split-monitor-workspaces, ... }@inputs: {
self,
nixpkgs,
home-manager,
split-monitor-workspaces,
...
}@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
config = { allowUnfree = true; }; config = {
allowUnfree = true;
};
}; };
in { in
{
nixosConfigurations.haskell = nixpkgs.lib.nixosSystem { nixosConfigurations.haskell = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
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;

View File

@@ -35,6 +35,10 @@
]; ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.18.22") (
lib.mkDefault pkgs.linuxPackages_6_18
);
# 1050 passthrough # 1050 passthrough
boot.extraModprobeConfig = boot.extraModprobeConfig =
"" ""
@@ -100,7 +104,6 @@
"defaults" "defaults"
"ssd" "ssd"
"noatime" "noatime"
"noauto"
]; ];
}; };

View File

@@ -1,4 +1,9 @@
{ inputs, split-monitor-workspaces, pkgs, ... }: {
inputs,
split-monitor-workspaces,
pkgs,
...
}:
{ {
imports = [ imports = [
@@ -20,26 +25,29 @@
"Xft.dpi" = 172; "Xft.dpi" = 172;
}; };
home.packages = let nixpkgs.config.permittedInsecurePackages = [ "qtwebkit-5.212.0-alpha4" ];
fonts = import ./pkgs/fonts.nix { inherit pkgs; };
minecraft = import ./pkgs/minecraft.nix { inherit pkgs; };
misc = import ./pkgs/misc.nix { inherit pkgs; };
network = import ./pkgs/network.nix { inherit pkgs; };
programming = import ./pkgs/programming.nix { inherit pkgs; };
tools = import ./pkgs/tools.nix { inherit pkgs; };
util = import ./pkgs/util.nix { inherit pkgs; };
games = import ./pkgs/games.nix { inherit pkgs; };
unstable = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
sha256 = "1ijgd8hy1ii0k0s48yhnzw09c7zdjnp1fq8wfj7jgajwmlfwy3xg";
}) { system = "x86_64-linux"; };
unstables = import ./pkgs/unstable.nix {
inherit pkgs;
inherit unstable;
};
in fonts ++ minecraft ++ misc ++ network ++ programming ++ tools ++ util home.packages =
++ games ++ unstables; let
fonts = import ./pkgs/fonts.nix { inherit pkgs; };
minecraft = import ./pkgs/minecraft.nix { inherit pkgs; };
misc = import ./pkgs/misc.nix { inherit pkgs; };
network = import ./pkgs/network.nix { inherit pkgs; };
programming = import ./pkgs/programming.nix { inherit pkgs; };
tools = import ./pkgs/tools.nix { inherit pkgs; };
util = import ./pkgs/util.nix { inherit pkgs; };
games = import ./pkgs/games.nix { inherit pkgs; };
unstable = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
sha256 = "1ijgd8hy1ii0k0s48yhnzw09c7zdjnp1fq8wfj7jgajwmlfwy3xg";
}) { system = "x86_64-linux"; };
unstables = import ./pkgs/unstable.nix {
inherit pkgs;
inherit unstable;
};
in
fonts ++ minecraft ++ misc ++ network ++ programming ++ tools ++ util ++ games ++ unstables;
programs.direnv.enable = true; programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true; programs.direnv.nix-direnv.enable = true;

94
nixpkgs/openmodelica.nix Normal file
View File

@@ -0,0 +1,94 @@
{
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
];
}

View File

@@ -2,7 +2,8 @@
{ pkgs, ... }: { pkgs, ... }:
with pkgs; [ with pkgs;
[
radare2 radare2
# (python3.withPackages (python-pkgs: with python-pkgs; [ jupyter-client ])) # (python3.withPackages (python-pkgs: with python-pkgs; [ jupyter-client ]))
# gdb # gdb
@@ -22,7 +23,14 @@ with pkgs; [
gh gh
platformio platformio
python313Packages.r2pipe python313Packages.r2pipe
(python313.withPackages(ps: with ps; [ jupyter-client pynvim wand ipykernel ])) (python313.withPackages (
ps: with ps; [
jupyter-client
pynvim
wand
ipykernel
]
))
python313Packages.pip python313Packages.pip
nodejs nodejs
go go
@@ -62,4 +70,5 @@ with pkgs; [
libllvm libllvm
bun bun
jetbrains.rider jetbrains.rider
julia-bin
] ]

View File

@@ -107,4 +107,6 @@ with pkgs;
pev pev
virtiofsd virtiofsd
exfatprogs exfatprogs
python313Packages.scrapy
atopile
] ]

View File

@@ -17,6 +17,28 @@
lxc.enable = true; lxc.enable = true;
}; };
users.users.root.subUidRanges = [
{
startUid = 1000;
count = 1;
}
{
startUid = 1000000;
count = 65536;
}
];
users.users.root.subGidRanges = [
{
startGid = 1000;
count = 1;
}
{
startGid = 1000000;
count = 65536;
}
];
programs.virt-manager.enable = true; programs.virt-manager.enable = true;
virtualisation.virtualbox.host.enable = true; virtualisation.virtualbox.host.enable = true;
} }