mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 01:00:49 +00:00
Update nix flake
This commit is contained in:
parent
147976f2cc
commit
e73247e7d4
2 changed files with 17 additions and 67 deletions
41
flake.nix
41
flake.nix
|
@ -1,30 +1,16 @@
|
|||
{
|
||||
description = "A discord bot for Dự Tuyển Tổng Hợp server";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||
naersk.url = "github:nix-community/naersk";
|
||||
naersk.inputs.nixpkgs.follows = "nixpkgs";
|
||||
nixpkgs-mozilla = {
|
||||
url = github:mozilla/nixpkgs-mozilla;
|
||||
flake = false;
|
||||
};
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, naersk, flake-utils, nixpkgs-mozilla }: flake-utils.lib.eachDefaultSystem (system:
|
||||
outputs = { self, nixpkgs, naersk, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; overlays = [ (import nixpkgs-mozilla) ]; };
|
||||
pkgs-unstable = import nixpkgs-unstable { inherit system; };
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
|
||||
rust-toolchain = (pkgs.rustChannelOf {
|
||||
channel = "1.65.0";
|
||||
sha256 = "sha256-DzNEaW724O8/B8844tt5AVHmSjSQ3cmzlU4BP90oRlY=";
|
||||
});
|
||||
|
||||
naersk' = pkgs.callPackage naersk {
|
||||
cargo = rust-toolchain.rust;
|
||||
rustc = rust-toolchain.rust;
|
||||
};
|
||||
naersk' = pkgs.callPackage naersk { };
|
||||
in
|
||||
rec {
|
||||
packages.youmubot = naersk'.buildPackage {
|
||||
|
@ -56,23 +42,20 @@
|
|||
devShell = pkgs.mkShell
|
||||
{
|
||||
buildInputs =
|
||||
with rust-toolchain; [ rust ]
|
||||
++ (with pkgs-unstable; [ rustfmt ])
|
||||
++ nixpkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [
|
||||
libiconv
|
||||
darwin.apple_sdk.frameworks.Security
|
||||
])
|
||||
++ (with pkgs; [
|
||||
nixpkgs.lib.optionals pkgs.stdenv.isDarwin
|
||||
(with pkgs; [
|
||||
libiconv
|
||||
darwin.apple_sdk.frameworks.Security
|
||||
])
|
||||
++ (with pkgs; [
|
||||
openssl
|
||||
cargo
|
||||
rustfmt
|
||||
]);
|
||||
|
||||
nativeBuildInputs = nixpkgs.lib.optionals pkgs.stdenv.isLinux (with pkgs; [
|
||||
pkg-config
|
||||
]);
|
||||
|
||||
shellHook = ''
|
||||
export RUST_SRC_PATH="${rust-toolchain.rust-src}/lib/rustlib/src/rust/library";
|
||||
'';
|
||||
};
|
||||
# module
|
||||
nixosModule = import ./module.nix defaultPackage;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue