obsidian from unstable

This commit is contained in:
Daniel Langbein 2024-01-01 16:21:47 +01:00
parent a549375361
commit 7cebbf2f09
2 changed files with 29 additions and 9 deletions

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
{ {
# How NUR (or unstable) can be imported without `niv`. # How NUR (or unstable) can be imported without `niv`.
#nixpkgs.config.packageOverrides = pkgs: { #nixpkgs.config.packageOverrides = pkgs: {
@ -15,6 +15,20 @@
# Import unstable with niv. # Import unstable with niv.
unstable = import (import ../nix/sources.nix).unstable { unstable = import (import ../nix/sources.nix).unstable {
inherit pkgs; inherit pkgs;
# "unstable" `nixpkgs.config` has to be configured here where we import it.
# https://github.com/NixOS/nixpkgs/issues/69347#issuecomment-534573461
config = {
# Required for unstable.obsidian (see obsidan.nix)
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"obsidian"
];
permittedInsecurePackages = [
"electron-25.9.0"
];
};
}; };
}; };

View File

@ -1,17 +1,23 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ # TODO.
"obsidian" # As of 01.01.2024, the Electron version of Obsidian does not find some GL libraries.
]; # Temporary workaround (https://github.com/NixOS/nixpkgs/issues/268490#issuecomment-1817991394):
# export LD_LIBRARY_PATH=$(nix --extra-experimental-features nix-command --extra-experimental-features flakes build --print-out-paths --no-link nixpkgs#libGL)/lib
# obsidian
# TODO: Disallow insecure Electron version. # This `config` is only for "stable" `nixpkgs`, not for "unstable".
nixpkgs.config.permittedInsecurePackages = [ # See nur-and-unstable.nix
"electron-25.9.0" # nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
]; # "obsidian"
# ];
# TODO go back to stable nixpkgs.
# As of 01.01.2024, obsidian did not start on Wayland and it is using an insecure Electron version.
# Thus, we are currently running it from unstable.
users.users.yoda = { users.users.yoda = {
packages = with pkgs; [ packages = with pkgs; [
obsidian # Markdown notes unstable.obsidian # Markdown notes
]; ];
}; };
} }