aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix42
1 files changed, 25 insertions, 17 deletions
diff --git a/flake.nix b/flake.nix
index 7d152195..c1d772bb 100644
--- a/flake.nix
+++ b/flake.nix
@@ -7,22 +7,30 @@
url = "github:Alexis211/cargo2nix/a7a61179b66054904ef6a195d8da736eaaa06c36";
inputs.nixpkgs.follows = "nixpkgs";
};
+ inputs.flake-utils.url = "github:numtide/flake-utils";
- 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";
- };
- });
- };
+ outputs = { self, nixpkgs, cargo2nix, flake-utils }:
+ let
+ git_version = self.lastModifiedDate;
+ compile = import ./nix/compile.nix;
+ in flake-utils.lib.eachDefaultSystem (system:
+ let pkgs = nixpkgs.legacyPackages.${system};
+ in {
+ packages = {
+ default = (compile {
+ inherit system git_version;
+ pkgsSrc = nixpkgs;
+ cargo2nixOverlay = cargo2nix.overlays.default;
+ release = true;
+ }).workspace.garage { compileMode = "build"; };
+ };
+ devShell = ((compile {
+ inherit system git_version;
+ pkgsSrc = nixpkgs;
+ cargo2nixOverlay = cargo2nix.overlays.default;
+ release = false;
+ }).workspaceShell {
+ packages = [ pkgs.rustfmt cargo2nix.packages.${system}.default ];
+ });
+ });
}