Skip to content

Commit f8508d6

Browse files
committed
macos nix build support
1 parent 3a194bc commit f8508d6

5 files changed

Lines changed: 17 additions & 12 deletions

File tree

docs/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ To build installers for Windows:
6767
6868
nix build ".#windows"
6969
70-
To build for Linux:
70+
To build for Linux and macOS:
7171

7272
.. code-block:: bash
7373
74-
nix build ".#linux"
74+
nix build ".#unix"

ev3sim/file_helper.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def find_platform_location(dir_type):
1313
"""
1414
Attempt to find and create operating system data folders
1515
"""
16-
if platform.system() == "Linux":
16+
p = platform.system()
17+
if p == "Linux":
1718
home_dir = os.path.expanduser("~")
1819
if dir_type == "config":
1920
xdg_dir = os.environ.get("XDG_CONFIG_HOME") or os.path.join(home_dir, ".config")
@@ -22,6 +23,10 @@ def find_platform_location(dir_type):
2223
ev3sim_dir = os.path.join(xdg_dir, "ev3sim")
2324
Path(ev3sim_dir).mkdir(parents=True, exist_ok=True)
2425
return ev3sim_dir
26+
elif p == "Darwin":
27+
directory = os.path.expanduser("~/Library/Application Support/ev3sim/" + dir_type)
28+
Path(directory).mkdir(parents=True, exist_ok=True)
29+
return directory
2530
return None
2631

2732

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
inputs.mindpile.inputs.flake-utils.follows = "flake-utils";
1010

1111
outputs = { nixpkgs, flake-utils, mindpile, ... }:
12-
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
12+
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
1313
let
1414
pkgs = nixpkgs.legacyPackages.${system};
1515
mp = mindpile.legacyPackages.${system};
1616
in rec {
1717
packages = {
18-
linux = pkgs.callPackage ./nix/linux.nix {
18+
unix = pkgs.callPackage ./nix/unix.nix {
1919
inherit (mp) mindpile;
2020
};
2121

2222
windows = pkgs.callPackage ./nix/windows-installer.nix { };
2323
};
24-
defaultPackage = packages.linux;
24+
defaultPackage = packages.unix;
2525
});
2626
}
File renamed without changes.

0 commit comments

Comments
 (0)