From abfa7ef836d777f4b354c86c58dc88bc823bc437 Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Thu, 1 Feb 2024 07:52:15 -0700 Subject: [PATCH] Simplify `flake.nix` and `.gitignore`. --- .gitignore | 6 ++++++ flake.nix | 22 ++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a1c7493 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.direnv +result +notes/.obsidian.mobile +notes/.obsidian/appearance.json +notes/.obsidian/hotkeys.json +notes/.obsidian/workspace.json diff --git a/flake.nix b/flake.nix index 4c8bf0d..5f397c5 100644 --- a/flake.nix +++ b/flake.nix @@ -18,14 +18,16 @@ let pkgs = nixpkgs.legacyPackages.${system}; - quartz = pkgs.fetchFromGitHub { - owner = "jrpotter"; - repo = "quartz"; - rev = "8c126e9d21cd0bc90da5f78677d458fc81892af1"; - hash = "sha256-caB9F5lvroQ+ZcvzKW8RnKfzSHjEiYfZUSqZiuaggVs="; + quartz = rec { + src = pkgs.fetchFromGitHub { + owner = "jrpotter"; + repo = "quartz"; + rev = "8c126e9d21cd0bc90da5f78677d458fc81892af1"; + hash = "sha256-caB9F5lvroQ+ZcvzKW8RnKfzSHjEiYfZUSqZiuaggVs="; + }; + nodeDependencies = (pkgs.callPackage "${src}/default.nix" {}).nodeDependencies; }; - nodeDependencies = (pkgs.callPackage "${quartz}/default.nix" {}).nodeDependencies; in { packages = { @@ -37,13 +39,13 @@ nativeBuildInputs = [ pkgs.nodejs ]; buildPhase = '' - cp -r ${quartz} quartz + cp -r ${quartz.src} quartz cd quartz find -type f -execdir chmod 644 {} + find -type d -execdir chmod 755 {} + - ln -s ${nodeDependencies}/lib/node_modules ./node_modules - export PATH="${nodeDependencies}/bin:$PATH" + ln -s ${quartz.nodeDependencies}/lib/node_modules ./node_modules + export PATH="${quartz.nodeDependencies}/bin:$PATH" rm -r content cp -r ${./notes} content @@ -55,7 +57,7 @@ installPhase = '' mkdir $out - cp -r public $out + cp -r public $out/share ''; };