Added hello template

This commit is contained in:
rotterdam 2023-04-05 14:39:47 -03:00
parent cfb010fb36
commit 237d56ee0e
3 changed files with 25 additions and 18 deletions

View file

@ -3,9 +3,13 @@
outputs = { self }: {
templates = {
hello = {
path = ./hello;
description = "Template including hello in shell packages";
};
rust = {
path = ./rust;
description = "Rust template, using oxalica/rust-overlay";
path = ./rust;
description = "Rust template, using oxalica/rust-overlay";
};
};
};

12
hello/flake.nix Normal file
View file

@ -0,0 +1,12 @@
{
description = "Flake template for a rust project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem
(system: { devShells.default = mkShell { packages = [ hello ]; }; });
}

View file

@ -2,29 +2,20 @@
description = "Flake template for a rust project";
inputs = {
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
in
with pkgs;
{
pkgs = import nixpkgs { inherit system overlays; };
in with pkgs; {
devShells.default = mkShell {
buildInputs = [
rust-bin.stable.latest.default
];
packages = [
rust-analyzer
];
buildInputs = [ rust-bin.stable.latest.default ];
packages = [ rust-analyzer ];
};
}
);
});
}