From 237d56ee0ee3f6474a86a25007eef040d73906fa Mon Sep 17 00:00:00 2001 From: rotterdam Date: Wed, 5 Apr 2023 14:39:47 -0300 Subject: [PATCH] Added hello template --- flake.nix | 8 ++++++-- hello/flake.nix | 12 ++++++++++++ rust/flake.nix | 23 +++++++---------------- 3 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 hello/flake.nix diff --git a/flake.nix b/flake.nix index edf7c30..e3534b2 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; }; }; }; diff --git a/hello/flake.nix b/hello/flake.nix new file mode 100644 index 0000000..587a41a --- /dev/null +++ b/hello/flake.nix @@ -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 ]; }; }); +} diff --git a/rust/flake.nix b/rust/flake.nix index 56cd0b1..3f0ae71 100644 --- a/rust/flake.nix +++ b/rust/flake.nix @@ -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 ]; }; - } - ); + }); }