From 4bef2b666f32b86cc96d17b0f8e0b52c53b0687d Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Sat, 23 Mar 2024 21:59:42 +0200 Subject: [PATCH] add non-flake package --- default.nix | 15 +++++++++++++++ flake.nix | 15 ++------------- 2 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..776bbb4 --- /dev/null +++ b/default.nix @@ -0,0 +1,15 @@ +{ lib, + buildNpmPackage, + version ? "git", +}: +buildNpmPackage { + pname = "portfolio-website"; + inherit version; + + src = lib.cleanSource ./.; + npmDepsHash = "sha256-IQ96wS7EBN5D8VpDCdJJTzJky+fybIZjq4k/oASYwZk="; + installPhase = '' + mkdir -p $out/www + cp -r build/* $out/www + ''; +} diff --git a/flake.nix b/flake.nix index 16b3376..752818e 100644 --- a/flake.nix +++ b/flake.nix @@ -10,20 +10,9 @@ flake-utils.lib.eachDefaultSystem(system: let version = builtins.substring 0 8 self.lastModifiedDate; - pkgs = import nixpkgs { - inherit system; - }; + pkgs = import nixpkgs { inherit system; }; in { - packages.default = pkgs.buildNpmPackage { - pname = "portfolio-website"; - version = version; - src = pkgs.lib.sources.cleanSource ./.; - npmDepsHash = "sha256-IQ96wS7EBN5D8VpDCdJJTzJky+fybIZjq4k/oASYwZk="; - installPhase = '' - mkdir -p $out/www - cp -r build/* $out/www - ''; - }; + packages.default = pkgs.callPackage ./. { inherit version; }; }); }