-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
rust-overlay = { | ||
url = "github:oxalica/rust-overlay"; | ||
inputs = { | ||
nixpkgs.follows = "nixpkgs"; | ||
flake-utils.follows = "flake-utils"; | ||
}; | ||
}; | ||
}; | ||
outputs = { self, nixpkgs, flake-utils, rust-overlay }: | ||
flake-utils.lib.eachDefaultSystem | ||
(system: | ||
let | ||
overlays = [ (import rust-overlay) ]; | ||
pkgs = import nixpkgs { | ||
inherit system overlays; | ||
}; | ||
in | ||
with pkgs; | ||
{ | ||
packages.sheldon = pkgs.callPackage ./sheldon.nix { | ||
inherit (pkgs.darwin.apple_sdk.frameworks) Security; | ||
}; | ||
packages.default = self.outputs.packages.${system}.sheldon; | ||
defaultPackage = self.packages.${system}.sheldon; | ||
devShells.default = mkShell { | ||
buildInputs = [ rust-bin.stable.latest.default ]; | ||
}; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Sheldon package definition | ||
# | ||
# This file will be similar to the package definition in nixpkgs: | ||
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/sh/sheldon/package.nix | ||
# | ||
# Helpful documentation: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md | ||
{ | ||
pkgs, | ||
lib, | ||
stdenv, | ||
installShellFiles, | ||
rustPlatform, | ||
Security, | ||
}: | ||
rustPlatform.buildRustPackage { | ||
name = "sheldon"; | ||
|
||
src = lib.cleanSource ./.; | ||
|
||
cargoLock = { | ||
lockFile = ./Cargo.lock; | ||
# Allow dependencies to be fetched from git and avoid having to set the outputHashes manually | ||
allowBuiltinFetchGit = true; | ||
}; | ||
|
||
nativeBuildInputs = [installShellFiles]; | ||
|
||
buildInputs = [ pkgs.openssl pkgs.curl ] ++ lib.optionals stdenv.isDarwin [Security]; | ||
|
||
doCheck = false; | ||
|
||
meta = with lib; { | ||
description = "Fast, configurable, shell plugin manager"; | ||
homepage = "https://github.com/rossmacarthur/sheldon"; | ||
license = licenses.mit; | ||
mainProgram = "sheldon"; | ||
}; | ||
} |