feat: add templates
This commit is contained in:
14
template/rust/devshell/default.nix
Normal file
14
template/rust/devshell/default.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ pkgs }: let
|
||||
dev-help = pkgs.writeShellScriptBin "dev-help" /* sh */ ''
|
||||
printf '%s\n' \
|
||||
'phph'
|
||||
'';
|
||||
rustToolchain = pkgs.pkgsBuildHost.rust-bin.stable."1.87.0".default;
|
||||
in
|
||||
pkgs.mkShell {
|
||||
buildInputs = [ dev-help ];
|
||||
nativeBuildInputs = [ rustToolchain pkgs.pkg-config ];
|
||||
|
||||
# environment
|
||||
PAGER="${pkgs.hectic.nvim-pager}/bin/pager";
|
||||
}
|
||||
109
template/rust/flake.lock
generated
Normal file
109
template/rust/flake.lock
generated
Normal file
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1754292888,
|
||||
"narHash": "sha256-1ziydHSiDuSnaiPzCQh1mRFBsM2d2yRX9I+5OPGEmIE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ce01daebf8489ba97bd1609d185ea276efdeb121",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-25.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1739451785,
|
||||
"narHash": "sha256-3ebRdThRic9bHMuNi2IAA/ek9b32bsy8F5R4SvGTIog=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1128e89fd5e11bb25aedbfc287733c6502202ea9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rust-overlay": "rust-overlay",
|
||||
"util": "util"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1754362243,
|
||||
"narHash": "sha256-QHNTUdI6oIYuuazGuKGhVk5RCOM1nIzDUc/AGgL7Szw=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "3ec3244ffb877f1b7f5d2dbff19241982ab25ff2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rust-overlay_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"util",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1738290352,
|
||||
"narHash": "sha256-YKOHUmc0Clm4tMV8grnxYL4IIwtjTayoq/3nqk0QM7k=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "b031b584125d33d23a0182f91ddbaf3ab4880236",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"util": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"rust-overlay": "rust-overlay_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1751301064,
|
||||
"narHash": "sha256-/fYo5Emc7Ahvdx2u2o+6lyQxe+ECP0808q4gI5tfAGA=",
|
||||
"owner": "hectic-lab",
|
||||
"repo": "util.nix",
|
||||
"rev": "5e112f5df8b977c64fa026ff1bc31a47eb48ec02",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hectic-lab",
|
||||
"ref": "fix/postgres-extension",
|
||||
"repo": "util.nix",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
34
template/rust/flake.nix
Normal file
34
template/rust/flake.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
description = "";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
util = {
|
||||
url = "github:hectic-lab/util.nix?ref=fix/postgres-extension";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, rust-overlay, util }:
|
||||
let
|
||||
overlays = [ (import rust-overlay) util.overlays.default ];
|
||||
in
|
||||
util.lib.forAllSystemsWithPkgs overlays ({ system, pkgs }:
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
in
|
||||
{
|
||||
### DEV SHELL ###
|
||||
devShells.${system} = {
|
||||
default = import ./devshell/default.nix { inherit pkgs; };
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user