Skip to content

Commit

Permalink
Merge pull request #1 from gildlab/2023-06-27-nix-flake
Browse files Browse the repository at this point in the history
2023 06 27 nix flake
  • Loading branch information
thedavidmeister authored Jun 27, 2023
2 parents 89bda68 + 0d0584f commit cfc5b7b
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 33 deletions.
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

# Devenv
.devenv*
devenv.local.nix



# Added by cargo

/target

# flakes
result
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[package]
name = "gildlab-cli"
license = "CAL-1.0"
description = "CLI tools for gildlab nodes."
version = "0.1.0"
edition = "2021"

Expand Down
26 changes: 0 additions & 26 deletions default.nix

This file was deleted.

94 changes: 94 additions & 0 deletions flake.lock

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

34 changes: 34 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};

outputs = { self, flake-utils, naersk, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = (import nixpkgs) {
inherit system;
};

naersk' = pkgs.callPackage naersk {};

in rec {
# For `nix build` & `nix run`:
defaultPackage = naersk'.buildPackage {
src = ./.;
nativeBuildInputs = with pkgs; [ pkg-config openssl ];
};

# For `nix develop`:
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ rustc cargo iconv ] ++ (pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.Security
pkgs.darwin.apple_sdk.frameworks.CoreFoundation
pkgs.darwin.apple_sdk.frameworks.CoreServices
]);
};
}
);
}

0 comments on commit cfc5b7b

Please sign in to comment.