From eda162a7ff357ac93653eab3dd8f154dea427805 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 8 Jun 2024 17:04:37 +0100 Subject: [PATCH] zotero prefs --- flake.lock | 20 +++++------ .../optional/desktop/common/default.nix | 1 + .../common/optional/desktop/common/zotero.nix | 33 +++++++++++++++++++ hosts/common/users/sam/default.nix | 10 +++--- 4 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 home/common/optional/desktop/common/zotero.nix diff --git a/flake.lock b/flake.lock index 848c7a8..b633cf0 100644 --- a/flake.lock +++ b/flake.lock @@ -333,11 +333,11 @@ "nix-secrets": { "flake": false, "locked": { - "lastModified": 1717581732, - "narHash": "sha256-mBkVq89pmsOGRIBVANJYILV81YXHBmK3xHbhqxvoR8s=", + "lastModified": 1717760051, + "narHash": "sha256-4yXaR3PIOJGQwTxA3eVDEu1iBlsmuvXWv3Ed0NrJgtU=", "ref": "refs/heads/master", - "rev": "0d2708ad195b6ec5e8ede2a6bc3876c855710d26", - "revCount": 86, + "rev": "521163d7278e71f084497910fa756bedcbfe97eb", + "revCount": 88, "type": "git", "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" }, @@ -407,11 +407,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1717653235, - "narHash": "sha256-wODpVx0FtLHnyKIOnm4V7fE9P8Pg12u/8ytY++VYMK0=", + "lastModified": 1717737457, + "narHash": "sha256-hqHp0W7ibfdu5DFc6EG3S3c+GSAbti7VUldFXSf/WiI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "844ccd07fb2aa17250952aee34a6fefd914b4638", + "rev": "bf3faad723ca984fc4ea95c1cee1d975a8ca2a28", "type": "github" }, "original": { @@ -450,11 +450,11 @@ }, "nur": { "locked": { - "lastModified": 1717691888, - "narHash": "sha256-YbIJbbPrKWhjM+ZvPelG/iDfSU3/qwPOI3vAIi+lFYI=", + "lastModified": 1717749895, + "narHash": "sha256-E6fEND68P37NMIhPyvgZl0jD7KlSg2QKZ1zpsXpobfQ=", "owner": "nix-community", "repo": "NUR", - "rev": "4266b44cd241e3d2baf38bdbe8ce1254defcee6f", + "rev": "b93b6c0b706d78ad95d52104728fd6eed3460f80", "type": "github" }, "original": { diff --git a/home/common/optional/desktop/common/default.nix b/home/common/optional/desktop/common/default.nix index d507708..10be23e 100644 --- a/home/common/optional/desktop/common/default.nix +++ b/home/common/optional/desktop/common/default.nix @@ -2,6 +2,7 @@ imports = [ ./firefox.nix ./alacritty.nix + ./zotero.nix ]; nixpkgs.overlays = [ diff --git a/home/common/optional/desktop/common/zotero.nix b/home/common/optional/desktop/common/zotero.nix new file mode 100644 index 0000000..f6b21c6 --- /dev/null +++ b/home/common/optional/desktop/common/zotero.nix @@ -0,0 +1,33 @@ +{ pkgs, config, ... }: +let + user = config.home.username; +in +{ + home.packages = [ + pkgs.zotero + ]; + + home.file.".zotero/zotero/profiles.ini".text = '' + [General] + StartWithLastProfile=1 + + [Profile0] + Name=default + IsRelative=1 + Path=zprofile.default + Default=1 + ''; + + home.file.".zotero/zotero/zprofile.default/user.js".text = '' + user_pref("extensions.zotero.dataDir", "/home/${user}/.local/share/Zotero"); + user_pref("extensions.zotero.firstRun.skipFirefoxProfileAccessCheck", true); + user_pref("extensions.zotero.firstRun2", false); + user_pref("extensions.zotero.useDataDir", true); + user_pref("intl.accept_languages", "en-GB, en"); + user_pref("extensions.zotero.sync.server.username", "samual.shop@proton.me"); + user_pref("extensions.zotero.sync.fulltext.enabled", false); + user_pref("extensions.zotero.sync.storage.enabled", false); + user_pref("extensions.zotero.sync.storage.groups.enabled", false); + ''; + +} diff --git a/hosts/common/users/sam/default.nix b/hosts/common/users/sam/default.nix index 4ee6230..8c5c1f2 100644 --- a/hosts/common/users/sam/default.nix +++ b/hosts/common/users/sam/default.nix @@ -36,6 +36,9 @@ in owner = "${username}"; }; "passwords/postgres" = { }; + "software/zotero/username" = { }; + "software/zotero/password" = { }; + "software/zotero/guid" = { }; }; # Setup postgres connections for db_ui @@ -56,10 +59,10 @@ in ''; }; - # The containing ssh folders are created as root and if this is the first ~/.ssh/ entry when writing keys, - # the ownership is busted and home-manager can't target because it can't write into .ssh... + # The containing folders are created as root and if this is the first entry when writing keys, + # the ownership is busted and home-manager can't target because it can't write to these dirs... # FIXME: We might not need this depending on how https://github.com/Mic92/sops-nix/issues/381 is fixed - system.activationScripts.sopsSetSshOwnwership = + system.activationScripts.sopsSetOwnwership = let sshFolder = "/home/${username}/.ssh"; user = config.users.users.${username}.name; @@ -76,7 +79,6 @@ in ]; }; - programs.zsh.enable = true; home-manager = {