Skip to content

Commit

Permalink
Merge pull request #60 from happysalada/add_nix_instructions
Browse files Browse the repository at this point in the history
add nix instructions for quick setup
  • Loading branch information
ibnuda authored Oct 18, 2020
2 parents 7b485f5 + 2e37e40 commit 0674820
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use_nix
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ Temporary Items
*.gcode
*.scad
*.calva/

# Nix
.direnv
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ To tinker around this thing, follow these steps:
4. Change something in `src/dactyl_keyboard/handler.clj`.
5. Open [localhost:3030](http://localhost:3030).

### With Nix

1. run `direnv allow` when you first cd into the project
2. nix will then install and cache dependencies
3. running `lein ring server-headless` will run the server with hot-reloading on port 3030

## Deployment

To deploy it in a computer, follow these steps:
Expand Down
22 changes: 22 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
with import <nixpkgs> { };
let

# define packages to install with special handling for OSX
basePackages = [
# Core runtime libraries
clojure
jdk
leiningen
];

inputs = basePackages ++ lib.optional stdenv.isLinux inotify-tools
++ lib.optionals stdenv.isDarwin
(with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices ]);

# define shell startup command
hooks = "";

in mkShell {
buildInputs = inputs;
shellHook = hooks;
}

0 comments on commit 0674820

Please sign in to comment.