2021-12-28 22:06:17 +00:00
|
|
|
{
|
|
|
|
description = "Project for syncing various home-system configuration files.";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2022-01-09 14:38:13 +00:00
|
|
|
cargo2nix.url = "github:cargo2nix/cargo2nix/master";
|
|
|
|
rust-overlay = {
|
|
|
|
url = "github:oxalica/rust-overlay";
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
flake-utils.follows = "flake-utils";
|
|
|
|
};
|
|
|
|
};
|
2021-12-28 22:06:17 +00:00
|
|
|
};
|
|
|
|
|
2022-01-09 14:38:13 +00:00
|
|
|
outputs = { self, nixpkgs, flake-utils, cargo2nix, rust-overlay }:
|
2021-12-28 22:06:17 +00:00
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
2022-01-09 14:38:13 +00:00
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [
|
|
|
|
(import "${cargo2nix}/overlay") rust-overlay.overlay
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
rustPkgs = pkgs.rustBuilder.makePackageSet' {
|
|
|
|
rustChannel = "1.56.1";
|
|
|
|
packageFun = import ./Cargo.nix;
|
|
|
|
};
|
|
|
|
in rec {
|
|
|
|
packages = {
|
|
|
|
homesync = (rustPkgs.workspace.homesync {}).bin;
|
|
|
|
};
|
|
|
|
|
|
|
|
defaultPackage = packages.homesync;
|
|
|
|
|
2021-12-28 22:06:17 +00:00
|
|
|
devShell = with pkgs; mkShell {
|
|
|
|
buildInputs = [
|
|
|
|
cargo
|
2021-12-29 13:15:19 +00:00
|
|
|
rls
|
2021-12-30 13:37:53 +00:00
|
|
|
libiconv
|
2021-12-28 22:06:17 +00:00
|
|
|
rustc
|
2021-12-29 13:15:19 +00:00
|
|
|
rustfmt
|
2021-12-30 13:37:53 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin (
|
2022-01-02 18:48:18 +00:00
|
|
|
with darwin.apple_sdk.frameworks; [ CoreServices ]
|
|
|
|
) ++ lib.optionals stdenv.isLinux [
|
|
|
|
pkgs.openssl
|
|
|
|
pkgs.zlib
|
|
|
|
];
|
2021-12-28 22:06:17 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|