quote flake urls
All checks were successful
Hydra x86_64-linux.checks.rust-template Hydra build #33344 of procyos:rust-template-pr7:x86_64-linux.checks.rust-template
Hydra x86_64-linux.packages.rust-template Hydra build #33347 of procyos:rust-template:x86_64-linux.packages.rust-template

This commit is contained in:
Charlotte 🦝 Delenk 2024-12-26 17:02:55 +01:00
parent 696fb0e0a0
commit 7ce21fc8d0
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122

108
flake.nix
View file

@ -2,16 +2,16 @@
description = "rust-template";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs;
flake-utils.url = github:numtide/flake-utils;
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = github:oxalica/rust-overlay;
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
cargo2nix = {
url = github:DarkKirb/cargo2nix/master;
url = "github:DarkKirb/cargo2nix/master";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.rust-overlay.follows = "rust-overlay";
@ -19,53 +19,59 @@
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
};
outputs = {
self,
nixpkgs,
flake-utils,
rust-overlay,
cargo2nix,
...
} @ inputs:
flake-utils.lib.eachSystem ["x86_64-linux"] (system: let
overlays = [
cargo2nix.overlays.default
(import rust-overlay)
];
pkgs = import nixpkgs {
inherit system overlays;
};
rustPkgs = pkgs.rustBuilder.makePackageSet {
packageFun = import ./Cargo.nix;
rustChannel = "nightly";
rustVersion = "latest";
packageOverrides = pkgs: pkgs.rustBuilder.overrides.all;
};
in rec {
devShells.default = with pkgs;
mkShell {
buildInputs = [
(rust-bin.nightly.latest.default.override {
extensions = ["rust-src"];
})
cargo2nix.packages.${system}.cargo2nix
llvmPackages_19.bintools
rustfilt
openssl
pkg-config
gdb
];
outputs =
{
self,
nixpkgs,
flake-utils,
rust-overlay,
cargo2nix,
...
}@inputs:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (
system:
let
overlays = [
cargo2nix.overlays.default
(import rust-overlay)
];
pkgs = import nixpkgs {
inherit system overlays;
};
packages = pkgs.lib.mapAttrs (_: v: v {}) rustPkgs.workspace;
nixosModules.default = import ./nixos {
inherit inputs system;
};
checks = pkgs.lib.mapAttrs (_: v: pkgs.rustBuilder.runTests v {}) rustPkgs.workspace;
hydraJobs = {
inherit packages checks;
};
formatter = pkgs.alejandra;
});
rustPkgs = pkgs.rustBuilder.makePackageSet {
packageFun = import ./Cargo.nix;
rustChannel = "nightly";
rustVersion = "latest";
packageOverrides = pkgs: pkgs.rustBuilder.overrides.all;
};
in
rec {
devShells.default =
with pkgs;
mkShell {
buildInputs = [
(rust-bin.nightly.latest.default.override {
extensions = [ "rust-src" ];
})
cargo2nix.packages.${system}.cargo2nix
llvmPackages_19.bintools
rustfilt
openssl
pkg-config
gdb
nixfmt-rfc-style
];
};
packages = pkgs.lib.mapAttrs (_: v: v { }) rustPkgs.workspace;
nixosModules.default = import ./nixos {
inherit inputs system;
};
checks = pkgs.lib.mapAttrs (_: v: pkgs.rustBuilder.runTests v { }) rustPkgs.workspace;
hydraJobs = {
inherit packages checks;
};
formatter = pkgs.nixfmt-rfc-style;
}
);
}
# Trick renovate into working: "github:NixOS/nixpkgs/nixpkgs-unstable"