Skip to content

Commit

Permalink
chore: update Nix config
Browse files Browse the repository at this point in the history
  • Loading branch information
imatpot committed Aug 30, 2024
1 parent c31ea78 commit 6f5a8e1
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 70 deletions.
21 changes: 9 additions & 12 deletions flake.lock

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

116 changes: 58 additions & 58 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,65 +14,65 @@
};
};

outputs = { self, nixpkgs, utils, rust }: utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust) ];
};
ssl-toolchain = with pkgs; [
openssl.dev
pkg-config
];
rust-toolchain = with pkgs; [
(rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
})
];
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in
with pkgs; {
packages.default = rustPlatform.buildRustPackage {
inherit (cargoToml.package) name version;
outputs = { self, nixpkgs, utils, rust }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust) ];
};
ssl-toolchain = with pkgs; [ openssl.dev pkg-config ];
rust-toolchain = with pkgs;
[
(rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
})
];
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in with pkgs; {
packages.default = rustPlatform.buildRustPackage {
inherit (cargoToml.package) name version;

src = ./.;
cargoLock.lockFile = ./Cargo.lock;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;

# https://github.com/sfackler/rust-openssl/issues/1663#issuecomment-1541050597
nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ];
buildInputs = lib.optionals stdenv.isLinux [ openssl openssl.dev ];
OPENSSL_NO_VENDOR = 1;
};
# https://github.com/sfackler/rust-openssl/issues/1663#issuecomment-1541050597
nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ];
buildInputs = lib.optionals stdenv.isLinux [ openssl openssl.dev ];
OPENSSL_NO_VENDOR = 1;
};

devShells.default = mkShell {
name = "${cargoToml.package.name}-${cargoToml.package.version}";
buildInputs = rust-toolchain ++ ssl-toolchain;
shellHook = ''
echo
echo "The near Moon eclipses the far Sun."
echo
echo " .... ..=#%#."
echo " .+%@@@# -*@@@@@@:"
echo " :. =@@*@@@+.=++- .#@@=+@@@%."
echo " =%@@# :@@%:-@@@%@@#=. ... :#@@@:.#@@#."
echo " #@@@+ -@@. #@@@%- :=+#%@@@@@%- %@@@%+@@%-"
echo " :=. :. :@@@= :*@@@@%++++*%%* .@@@@@%=."
echo " :=*#%%**+--..-- :=***+=-:. =*- -*%@@@@@%*+=-. :=--"
echo "*%#****%@@@@@@@@=. +%@%*#%@@@@@@#**%# *@@@@@@%%%@@@@@@+."
echo " .-#@@@@@@@%+:. .:+%@@@@@@@*-. . .. :+%@@%."
echo " .@@@@@@@@@@%*=. .=#@@@@@@@%*=: .+@#."
echo " .. .-+%@@@@@@#*=:. .-@#+=*%@@@@@@%*=. -="
echo " .:=#@@@@@@@@@@#. :+%@@@@@@@#=:"
echo " .--+**=-. ..=*%@@@@@%*+-."
echo " :=*%@@@@@%*=-."
echo " .=*%@@@@@@%+:"
echo " .-+#@@@@@@%*=."
echo " .=*%@@@@@@@%*#%*"
echo
echo "- $(rustc --version)"
echo "- $(cargo --version)"
echo
'';
};
});
devShells.default = mkShell {
name = "${cargoToml.package.name}-${cargoToml.package.version}";

buildInputs = rust-toolchain ++ ssl-toolchain
++ pkgs.lib.optionals pkgs.stdenv.isDarwin
[ pkgs.darwin.apple_sdk.frameworks.SystemConfiguration ];

shellHook = ''
echo
echo " .... ..=#%#."
echo " .+%@@@# -*@@@@@@:"
echo " :. =@@*@@@+.=++- .#@@=+@@@%."
echo " =%@@# :@@%:-@@@%@@#=. ... :#@@@:.#@@#."
echo " #@@@+ -@@. #@@@%- :=+#%@@@@@%- %@@@%+@@%-"
echo " :=. :. :@@@= :*@@@@%++++*%%* .@@@@@%=."
echo " :=*#%%**+--..-- :=***+=-:. =*- -*%@@@@@%*+=-. :=--"
echo "*%#****%@@@@@@@@=. +%@%*#%@@@@@@#**%# *@@@@@@%%%@@@@@@+."
echo " .-#@@@@@@@%+:. .:+%@@@@@@@*-. . .. :+%@@%."
echo " .@@@@@@@@@@%*=. .=#@@@@@@@%*=: .+@#."
echo " .. .-+%@@@@@@#*=:. .-@#+=*%@@@@@@%*=. -="
echo " .:=#@@@@@@@@@@#. :+%@@@@@@@#=:"
echo " .--+**=-. ..=*%@@@@@%*+-."
echo " :=*%@@@@@%*=-."
echo " .=*%@@@@@@%+:"
echo " .-+#@@@@@@%*=."
echo "The near Moon eclipses the far Sun. .=*%@@@@@@@%*#%*"
echo
echo "- $(rustc --version)"
echo "- $(cargo --version)"
echo
'';
};
});
}

0 comments on commit 6f5a8e1

Please sign in to comment.