Simplify `flake.nix` and `.gitignore`.

pull/2/head
Joshua Potter 2024-02-01 07:52:15 -07:00
parent 21dab012ba
commit abfa7ef836
2 changed files with 18 additions and 10 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.direnv
result
notes/.obsidian.mobile
notes/.obsidian/appearance.json
notes/.obsidian/hotkeys.json
notes/.obsidian/workspace.json

View File

@ -18,14 +18,16 @@
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
quartz = pkgs.fetchFromGitHub { quartz = rec {
src = pkgs.fetchFromGitHub {
owner = "jrpotter"; owner = "jrpotter";
repo = "quartz"; repo = "quartz";
rev = "8c126e9d21cd0bc90da5f78677d458fc81892af1"; rev = "8c126e9d21cd0bc90da5f78677d458fc81892af1";
hash = "sha256-caB9F5lvroQ+ZcvzKW8RnKfzSHjEiYfZUSqZiuaggVs="; hash = "sha256-caB9F5lvroQ+ZcvzKW8RnKfzSHjEiYfZUSqZiuaggVs=";
}; };
nodeDependencies = (pkgs.callPackage "${src}/default.nix" {}).nodeDependencies;
};
nodeDependencies = (pkgs.callPackage "${quartz}/default.nix" {}).nodeDependencies;
in in
{ {
packages = { packages = {
@ -37,13 +39,13 @@
nativeBuildInputs = [ pkgs.nodejs ]; nativeBuildInputs = [ pkgs.nodejs ];
buildPhase = '' buildPhase = ''
cp -r ${quartz} quartz cp -r ${quartz.src} quartz
cd quartz cd quartz
find -type f -execdir chmod 644 {} + find -type f -execdir chmod 644 {} +
find -type d -execdir chmod 755 {} + find -type d -execdir chmod 755 {} +
ln -s ${nodeDependencies}/lib/node_modules ./node_modules ln -s ${quartz.nodeDependencies}/lib/node_modules ./node_modules
export PATH="${nodeDependencies}/bin:$PATH" export PATH="${quartz.nodeDependencies}/bin:$PATH"
rm -r content rm -r content
cp -r ${./notes} content cp -r ${./notes} content
@ -55,7 +57,7 @@
installPhase = '' installPhase = ''
mkdir $out mkdir $out
cp -r public $out cp -r public $out/share
''; '';
}; };