nix
This commit is contained in:
parent
96cb2c80d8
commit
7ab5893f67
4 changed files with 59 additions and 14 deletions
2
.envrc
2
.envrc
|
@ -1,3 +1,3 @@
|
|||
use nix
|
||||
use flake . --accept-flake-config;
|
||||
|
||||
source .envrc-local
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,4 +1,7 @@
|
|||
/target
|
||||
.DS_Store
|
||||
*/.DS_Store
|
||||
.envrc-local
|
||||
.envrc-local
|
||||
/.vscode
|
||||
/.direnv
|
||||
/result
|
54
flake.nix
Normal file
54
flake.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
description = "PlanetSide 2 Metagame Harvesting Service";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
fenix = {
|
||||
url = "github:nix-community/fenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
nixConfig = {
|
||||
extra-substituters = [
|
||||
"https://nix-community.cachix.org"
|
||||
];
|
||||
|
||||
extra-trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
};
|
||||
|
||||
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
perSystem = { config, self', pkgs, lib, system, ... }: let
|
||||
fenix = inputs.fenix.packages.${system}.minimal;
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||
|
||||
buildDeps = [
|
||||
pkgs.openssl
|
||||
];
|
||||
|
||||
devDeps = [
|
||||
fenix.toolchain
|
||||
];
|
||||
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
||||
in {
|
||||
packages.default = (pkgs.makeRustPlatform {
|
||||
cargo = fenix.toolchain;
|
||||
rustc = fenix.toolchain;
|
||||
}).buildRustPackage {
|
||||
inherit (cargoToml.package) name version;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
src = ./.;
|
||||
nativeBuildInputs = [ pkgs.pkg-config ];
|
||||
buildInputs = buildDeps ++ devDeps;
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = buildDeps ++ devDeps;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
12
shell.nix
12
shell.nix
|
@ -1,12 +0,0 @@
|
|||
let
|
||||
moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
|
||||
nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
|
||||
in
|
||||
with nixpkgs;
|
||||
stdenv.mkDerivation {
|
||||
name = "moz_overlay_shell";
|
||||
buildInputs = [
|
||||
nixpkgs.latest.rustChannels.nightly.rust
|
||||
nixpkgs.rust-analyzer
|
||||
];
|
||||
}
|
Loading…
Add table
Reference in a new issue