Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos nix build support #301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/windows_package_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
with:
name: melbournehighschoolrobotics
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'


- run: nix build --print-build-logs ".#unix"
- run: nix build --print-build-logs ".#windows"
- run: nix flake check

- uses: actions/upload-artifact@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ To build installers for Windows:

nix build ".#windows"

To build for Linux:
To build for Linux and macOS:

.. code-block:: bash

nix build ".#linux"
nix build ".#unix"
7 changes: 6 additions & 1 deletion ev3sim/file_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def find_platform_location(dir_type):
"""
Attempt to find and create operating system data folders
"""
if platform.system() == "Linux":
p = platform.system()
if p == "Linux":
home_dir = os.path.expanduser("~")
if dir_type == "config":
xdg_dir = os.environ.get("XDG_CONFIG_HOME") or os.path.join(home_dir, ".config")
Expand All @@ -22,6 +23,10 @@ def find_platform_location(dir_type):
ev3sim_dir = os.path.join(xdg_dir, "ev3sim")
Path(ev3sim_dir).mkdir(parents=True, exist_ok=True)
return ev3sim_dir
elif p == "Darwin":
directory = os.path.expanduser("~/Library/Application Support/ev3sim/" + dir_type)
Path(directory).mkdir(parents=True, exist_ok=True)
return directory
return None


Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
inputs.mindpile.inputs.flake-utils.follows = "flake-utils";

outputs = { nixpkgs, flake-utils, mindpile, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
mp = mindpile.legacyPackages.${system};
in rec {
packages = {
linux = pkgs.callPackage ./nix/linux.nix {
unix = pkgs.callPackage ./nix/unix.nix {
inherit (mp) mindpile;
};

windows = pkgs.callPackage ./nix/windows-installer.nix { };
};
defaultPackage = packages.linux;
defaultPackage = packages.unix;
});
}
File renamed without changes.