Compare commits
2 commits
87f6792f12
...
d852199742
Author | SHA1 | Date | |
---|---|---|---|
d852199742 |
|||
4834edd2d4 |
14 changed files with 63 additions and 4 deletions
|
@ -42,6 +42,8 @@
|
|||
program = "${helix}/bin/hx";
|
||||
};
|
||||
});
|
||||
|
||||
templates = import ./templates;
|
||||
};
|
||||
inputs = {
|
||||
# Unstable nixpkgs baby!
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
{pkgs}: let
|
||||
inherit (pkgs) lib;
|
||||
wrapped-helix = pkgs.callPackage ./helix {};
|
||||
helix = pkgs.callPackage ./helix {};
|
||||
kakoune = pkgs.callPackage ./kakoune.nix {};
|
||||
fish = pkgs.callPackage ./shell {inherit lib;};
|
||||
fish = pkgs.callPackage ./fish {inherit lib;};
|
||||
in {
|
||||
inherit kakoune fish;
|
||||
helix = wrapped-helix;
|
||||
inherit kakoune fish helix;
|
||||
}
|
||||
|
|
6
templates/default.nix
Normal file
6
templates/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
rust = {
|
||||
path = ./rust;
|
||||
description = "Rust project template";
|
||||
};
|
||||
}
|
1
templates/rust/.envrc
Normal file
1
templates/rust/.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use flake
|
5
templates/rust/Cargo.toml
Normal file
5
templates/rust/Cargo.toml
Normal file
|
@ -0,0 +1,5 @@
|
|||
[package]
|
||||
name = "sample-rust"
|
||||
version = "0.0.1"
|
||||
license = "GPL-3.0-only"
|
||||
edition = "2024"
|
8
templates/rust/default.nix
Normal file
8
templates/rust/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{rustPlatform}:
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "some-rust-package";
|
||||
version = "0.0.1";
|
||||
|
||||
src = ./.;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
}
|
35
templates/rust/flake.nix
Normal file
35
templates/rust/flake.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
description = "Rust project template";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
systems.url = "github:nix-systems/default-linux";
|
||||
};
|
||||
|
||||
outputs = inputs: let
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
inherit (lib.attrsets) genAttrs mapAttrs;
|
||||
|
||||
eachSystem = genAttrs (import inputs.systems);
|
||||
pkgsFor = inputs.nixpkgs.legacyPackages;
|
||||
in {
|
||||
packages = eachSystem (system: {
|
||||
default = inputs.self.packages.${system}.ralc;
|
||||
ralc = pkgsFor.${system}.callPackage ./nix/package.nix {};
|
||||
});
|
||||
|
||||
devShells =
|
||||
mapAttrs (system: pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
cargo
|
||||
rustc
|
||||
rustfmt
|
||||
bacon
|
||||
rust-analyzer
|
||||
rustPackages.clippy
|
||||
];
|
||||
};
|
||||
})
|
||||
pkgsFor;
|
||||
};
|
||||
}
|
3
templates/rust/src/main.rs
Normal file
3
templates/rust/src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello World!");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue