Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
jolheiser | fd47f49a3b | |
jolheiser | 69c9a9cb62 | |
jolheiser | c653a0d276 | |
jolheiser | 27a9c23600 |
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
||||||
Copyright (c) 2020 John Olheiser
|
Copyright (c) 2023 John Olheiser
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# tmpl templates
|
# flake
|
||||||
|
|
||||||
Check out the various branches for some basic examples of templates.
|
Create a simple `flake.nix` for nix.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Delete this file and put something else here!
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
description = "{{description}}";
|
||||||
|
|
||||||
|
inputs.nixpkgs.url = "github:nixos/nixpkgs{{if unstable}}/nixpkgs-unstable{{end}}";
|
||||||
|
|
||||||
|
outputs = {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
}: let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in {
|
||||||
|
{{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}}
|
||||||
|
};
|
||||||
|
}
|
29
tmpl.yaml
29
tmpl.yaml
|
@ -1,11 +1,22 @@
|
||||||
# tmpl.yaml
|
|
||||||
# Write any template args here to prompt the user for, giving any defaults/options as applicable
|
|
||||||
|
|
||||||
prompts:
|
prompts:
|
||||||
- id: name
|
- id: unstable
|
||||||
label: Name
|
label: Use unstable
|
||||||
default: MyProject
|
type: confirm
|
||||||
- id: lang
|
- id: pname
|
||||||
label: Language
|
label: pname
|
||||||
default: Go
|
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
|
||||||
|
type: multi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue