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

support Guix and Nix shell #352

Open
wants to merge 2 commits into
base: master
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
64 changes: 64 additions & 0 deletions guix.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021, 2022 Attila Lendvai <[email protected]>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.


;; Note that this file is half-baked: it's enough for `guix shell`,
;; but it's not detailed enough to build/install the package using Guix.

;; To enter a shell with the necessary dependencies for development:
;; guix shell
;;
;; To build and install:
;; guix package -f guix.scm
;;
;; To build it, but not install it:
;; guix build -f guix.scm
;;

(use-modules
(gnu packages node)
(git)
(guix build-system node)
(guix gexp)
(guix git)
(guix git-download)
((guix licenses) #:prefix license:)
(guix packages))

(define *source-dir* (dirname (current-filename)))

(define *with-worktree-changes* #false)

(define (latest-git-commit-hash dir)
(with-repository dir repo
(oid->string (object-id (revparse-single repo "HEAD")))))

(package
(name "swarm-cli")
(version "dev")
(source (if *with-worktree-changes*
(local-file *source-dir*
#:recursive? #t
#:select? (git-predicate *source-dir*))
(git-checkout (url *source-dir*)
(branch "master"))))
(build-system node-build-system)
(home-page "https://github.com/ethersphere/swarm-cli")
(synopsis "")
(description "")
(license license:bsd-3))
17 changes: 17 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This is a descriptor for the Nix package manager.
# Invoke nix-shell in this directory to enter an environment where
# everything gets downloaded and made available for development.

{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
buildInputs = with pkgs; [
coreutils diffutils
bash-completion less
gitFull
nodejs

# keep this line if you use bash
bashInteractive
];
}