-
-
Notifications
You must be signed in to change notification settings - Fork 15
Provide Nix flake, package and shell #61
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
base: 0.7
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| use flake |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| let | ||
| lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
| flakeCompat = fetchTarball { | ||
| url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
| sha256 = lock.nodes.flake-compat.locked.narHash; | ||
| }; | ||
| pesde = import flakeCompat { | ||
| src = ./.; | ||
| }; | ||
| in | ||
| pesde.defaultNix |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| { | ||
| description = "pesde; A package manager for the Luau programming language, supporting multiple runtimes including Roblox and Lune"; | ||
| inputs = { | ||
| flake-compat = { | ||
| url = "github:edolstra/flake-compat"; | ||
| flake = false; | ||
| }; | ||
| nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
| }; | ||
|
|
||
| outputs = { | ||
| flake-utils, | ||
| nixpkgs, | ||
| ... | ||
| } @ inputs: | ||
| flake-utils.lib.eachDefaultSystem (system: let | ||
| treefmtEval = inputs.treefmt-nix.lib.evalModule inputs.nixpkgs.legacyPackages.${system} ./treefmt.nix; | ||
| pkgs = nixpkgs.legacyPackages.${system}; | ||
| in { | ||
| devShells.default = import ./nix/shell.nix {inherit pkgs;}; | ||
|
|
||
| packages = let | ||
| pesde = pkgs.callPackage ./nix/package.nix {}; | ||
| in { | ||
| inherit pesde; | ||
| default = pesde; | ||
| }; | ||
| }); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| lib, | ||
| rustPlatform, | ||
| pkg-config, | ||
| openssl, | ||
| dbus, | ||
| }: | ||
| rustPlatform.buildRustPackage (_finalAttrs: { | ||
| pname = "pesde"; | ||
| version = "0.7.1"; | ||
|
Comment on lines
+9
to
+10
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally these would be read from the Cargo manifest. |
||
|
|
||
| src = ../.; | ||
|
|
||
| cargoHash = "sha256-7rEU4vU6qp6eaj777cC3BgrRyiLRe+5xZC+cqV5TTc4="; | ||
|
|
||
| buildNoDefaultFeatures = true; | ||
| buildFeatures = [ | ||
| "bin" | ||
| "version-management" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually made |
||
| ]; | ||
|
|
||
| nativeBuildInputs = [ | ||
| pkg-config | ||
| ]; | ||
| buildInputs = [ | ||
| openssl | ||
| dbus | ||
| ]; | ||
|
|
||
| meta = { | ||
| mainProgram = "pesde"; | ||
| description = "A package manager for the Luau programming language, supporting multiple runtimes including Roblox and Lune"; | ||
| homepage = "https://github.com/pesde-pkg/pesde"; | ||
| license = lib.licenses.mit; | ||
| maintainers = []; | ||
| }; | ||
| }) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| {pkgs ? import <nixpkgs> {}, ...}: pkgs.mkShell { | ||
| packages = with pkgs; [ | ||
| pkg-config | ||
| openssl | ||
| dbus | ||
| cargo | ||
| rustc | ||
| clippy | ||
| rust-analyzer | ||
| (rustfmt.override { | ||
| asNightly = true; | ||
| }) | ||
| ]; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Nix is to be added, I think I'd prefer for it to use crate2nix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would agree for the packaging within this repository, but when upstreaming it to nixpkgs this would be a bad idea.