summaryrefslogtreecommitdiff
path: root/templates/full/nix/packages
diff options
context:
space:
mode:
Diffstat (limited to 'templates/full/nix/packages')
-rw-r--r--templates/full/nix/packages/default.nix23
-rw-r--r--templates/full/nix/packages/hello.nix29
2 files changed, 52 insertions, 0 deletions
diff --git a/templates/full/nix/packages/default.nix b/templates/full/nix/packages/default.nix
new file mode 100644
index 0000000..78e10db
--- /dev/null
+++ b/templates/full/nix/packages/default.nix
@@ -0,0 +1,23 @@
+{self, ...}: let
+ version = builtins.substring 0 8 self.lastModifiedDate;
+
+ packageFn = pkgs: {
+ hello = pkgs.callPackage ./hello.nix {inherit version;};
+ };
+in {
+ systems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
+ ];
+
+ flake.overlays = final: _: packageFn final;
+
+ perSystem = {pkgs, ...}: {
+ packages = let
+ p = packageFn pkgs;
+ in
+ p // {default = p.hello;};
+ };
+}
diff --git a/templates/full/nix/packages/hello.nix b/templates/full/nix/packages/hello.nix
new file mode 100644
index 0000000..30cfc8d
--- /dev/null
+++ b/templates/full/nix/packages/hello.nix
@@ -0,0 +1,29 @@
+{
+ lib,
+ stdenv,
+ version,
+ ...
+}: let
+ inherit (lib) licenses maintainers platforms;
+in
+ stdenv.mkDerivation rec {
+ pname = "hello";
+ inherit version;
+
+ src = builtins.path {
+ name = "${pname}-src";
+ path = ./.;
+ };
+
+ installPhase = ''
+ echo "hi" > $out
+ '';
+
+ meta = {
+ description = "";
+ homepage = "";
+ license = licenses.mit;
+ maintainers = [maintainers.getchoo];
+ platforms = platforms.linux;
+ };
+ }