Skip to content

Commit

Permalink
nixos/openfoam: init
Browse files Browse the repository at this point in the history
  • Loading branch information
gusgibbon committed Jul 25, 2024
1 parent 9711450 commit effd0a0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
./programs/joycond-cemuhook.nix
./programs/k3b.nix
./programs/kde-pim.nix
./programs/openfoam.nix
./programs/k40-whisperer.nix
./programs/kbdlight.nix
./programs/kclock.nix
Expand Down
29 changes: 29 additions & 0 deletions nixos/modules/programs/openfoam.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.openfoam;
in
{
meta.maintainers = with lib.maintainers; [ gusgibbon ];

options.programs.openfoam = {
enable = lib.mkEnableOption "The open source CFD toolkit (openfoam.org)";
package = lib.mkPackageOption pkgs "openfoam-org" { };
};
config = {
environment = lib.mkIf cfg.enable {
# hardcoded OpenFOAM-12 may need to be changed in the futre to accomodate for the openfoam.com fork
interactiveShellInit = ''
alias ofoam="source ${cfg.package}/opt/OpenFOAM-12/etc/bashrc"
'';
systemPackages = with pkgs; [
mpi
mpi.dev
];
};
};
}

0 comments on commit effd0a0

Please sign in to comment.