Compare commits

...

2 commits

Author SHA1 Message Date
d852199742
packages: shell => fish 2025-06-07 17:54:40 +02:00
4834edd2d4
templates: rust: init 2025-06-07 17:32:25 +02:00
14 changed files with 63 additions and 4 deletions

View file

@ -42,6 +42,8 @@
program = "${helix}/bin/hx"; program = "${helix}/bin/hx";
}; };
}); });
templates = import ./templates;
}; };
inputs = { inputs = {
# Unstable nixpkgs baby! # Unstable nixpkgs baby!

View file

@ -1,9 +1,8 @@
{pkgs}: let {pkgs}: let
inherit (pkgs) lib; inherit (pkgs) lib;
wrapped-helix = pkgs.callPackage ./helix {}; helix = pkgs.callPackage ./helix {};
kakoune = pkgs.callPackage ./kakoune.nix {}; kakoune = pkgs.callPackage ./kakoune.nix {};
fish = pkgs.callPackage ./shell {inherit lib;}; fish = pkgs.callPackage ./fish {inherit lib;};
in { in {
inherit kakoune fish; inherit kakoune fish helix;
helix = wrapped-helix;
} }

6
templates/default.nix Normal file
View file

@ -0,0 +1,6 @@
{
rust = {
path = ./rust;
description = "Rust project template";
};
}

1
templates/rust/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

View file

@ -0,0 +1,5 @@
[package]
name = "sample-rust"
version = "0.0.1"
license = "GPL-3.0-only"
edition = "2024"

View 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
View 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;
};
}

View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello World!");
}