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
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
'';
};