parent
c653a0d276
commit
69c9a9cb62
|
@ -1,7 +1,7 @@
|
|||
# devflake
|
||||
# flake
|
||||
|
||||
Create a simple `flake.nix` for `nix develop`
|
||||
Create a simple `flake.nix` for nix.
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
[MIT](LICENSE)
|
||||
|
|
|
@ -1,25 +1,47 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs{{if unstable}}/nixpkgs-unstable{{end}}";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
description = "{{description}}";
|
||||
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs{{if unstable}}/nixpkgs-unstable{{end}}";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
flake-utils,
|
||||
nixpkgs,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
}: let
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
in
|
||||
builtins.map (
|
||||
system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
{{if pname}}
|
||||
packages.${system}.default = pkgs.buildGoModule {
|
||||
pname = {{pname}};
|
||||
version = {{version}};
|
||||
src = ./.;
|
||||
vendorHash = "";
|
||||
meta = with pkgs.lib; {
|
||||
description = "{{description}}";
|
||||
homepage = "{{url}}";
|
||||
maintainers = with maintainers; [jolheiser];
|
||||
mainProgram = "{{pname}}";
|
||||
};
|
||||
};
|
||||
{{end}}
|
||||
{{if packages}}
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
{{- range $pkg := (splitList "\n" packages)}}
|
||||
{{trim $pkg}}
|
||||
{{- end}}
|
||||
];
|
||||
};
|
||||
{{end}}
|
||||
}
|
||||
);
|
||||
}
|
||||
)
|
||||
systems;
|
||||
}
|
||||
|
|
13
tmpl.yaml
13
tmpl.yaml
|
@ -2,6 +2,19 @@ prompts:
|
|||
- id: unstable
|
||||
label: Use unstable
|
||||
type: confirm
|
||||
- id: pname
|
||||
label: pname
|
||||
help: Program name
|
||||
type: input
|
||||
- id: version
|
||||
label: Version
|
||||
type: input
|
||||
- id: description
|
||||
label: Description
|
||||
type: multi
|
||||
- id: url
|
||||
label: Project URL
|
||||
type: input
|
||||
- id: packages
|
||||
label: Packages
|
||||
help: nixpkgs, one on each line
|
||||
|
|
Loading…
Reference in New Issue