Skip to content

Commit

Permalink
Fix nix build second attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
sayanarijit committed Nov 12, 2022
1 parent a0c1902 commit ca4f4f3
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 26 deletions.
10 changes: 10 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
91 changes: 81 additions & 10 deletions flake.lock

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

40 changes: 24 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,33 @@
description = "xplr - A hackable, minimal, fast TUI file explorer";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs";
nix.url = "github:domenkozar/nix/relaxed-flakes";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
rec {
packages = flake-utils.lib.flattenTree {
xplr = pkgs.rustPlatform.buildRustPackage rec {
name = "xplr";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
outputs = { self, nixpkgs, nix, ... }:
let
systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = f: builtins.listToAttrs (map (name: { inherit name; value = f name; }) systems);
in
{
packages = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
xplr = pkgs.rustPlatform.buildRustPackage rec {
name = "xplr";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
};
defaultPackage = packages.xplr;
}
);
});
defaultPackage = forAllSystems (system: self.packages.${system}.xplr);
};
}

0 comments on commit ca4f4f3

Please sign in to comment.