aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2022-11-29 21:26:41 +0000
committerAlex <alex@adnab.me>2022-11-29 21:26:41 +0000
commit448dcc5cf4685f6a321b84ba1aa38e560f63a90a (patch)
tree5318ef82fd95e007e6738cce58fd22c9f446a886 /flake.nix
parent280330ac72a12fbfb9c22018bb33d5a490c7a016 (diff)
parent60c26fbc628d7b450ae39214b578ab6a30583d5c (diff)
downloadgarage-448dcc5cf4685f6a321b84ba1aa38e560f63a90a.tar.gz
garage-448dcc5cf4685f6a321b84ba1aa38e560f63a90a.zip
Merge pull request 'Make repository into a Nix flake' (#424) from nix-remove-system into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/424
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 00000000..7d152195
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,28 @@
+{
+ description = "Garage, an S3-compatible distributed object store for self-hosted deployments";
+
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/a3073c49bc0163fea6a121c276f526837672b555";
+ inputs.cargo2nix = {
+ # As of 2022-10-18: two small patches over unstable branch, one for clippy and one to fix feature detection
+ url = "github:Alexis211/cargo2nix/a7a61179b66054904ef6a195d8da736eaaa06c36";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+
+ outputs = { self, nixpkgs, cargo2nix }: let
+ git_version = self.lastModifiedDate;
+ compile = import ./nix/compile.nix;
+ forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
+ in
+ {
+ packages = forAllSystems (system: {
+ default = (compile {
+ inherit system git_version;
+ pkgsSrc = nixpkgs;
+ cargo2nixOverlay = cargo2nix.overlays.default;
+ release = true;
+ }).workspace.garage {
+ compileMode = "build";
+ };
+ });
+ };
+}