Compare commits
3 commits
8c984a2516
...
ce8a2e6453
Author | SHA1 | Date | |
---|---|---|---|
ce8a2e6453 | |||
4ed7283490 | |||
490fac55f2 |
12 changed files with 241 additions and 68 deletions
95
flake.lock
generated
95
flake.lock
generated
|
@ -99,16 +99,17 @@
|
|||
"base16-vim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1735953590,
|
||||
"narHash": "sha256-YbQwaApLFJobn/0lbpMKcJ8N5axKlW2QIGkDS5+xoSU=",
|
||||
"lastModified": 1732806396,
|
||||
"narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=",
|
||||
"owner": "tinted-theming",
|
||||
"repo": "base16-vim",
|
||||
"rev": "c2a1232aa2c0ed27dcbf005779bcfe0e0ab5e85d",
|
||||
"rev": "577fe8125d74ff456cf942c733a85d769afe58b7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "tinted-theming",
|
||||
"repo": "base16-vim",
|
||||
"rev": "577fe8125d74ff456cf942c733a85d769afe58b7",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
|
@ -162,11 +163,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737085297,
|
||||
"narHash": "sha256-0gpgsX7hCauT6pblVg+hrDnt83lPoYzq/2BqqyvU8Tc=",
|
||||
"lastModified": 1738033138,
|
||||
"narHash": "sha256-qlIM8A3bdL9c6PexhpS+QyZLO9y/8a3V75HVyJgDE5Q=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "09414c7e2def24a5c52e588017b8524bcb68972a",
|
||||
"rev": "349a74c66c596ef97ee97b4d80a3ca61227b6120",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -182,11 +183,11 @@
|
|||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733098767,
|
||||
"narHash": "sha256-XLxNWOclBjSrzbbLQoOUNWyuF306/R0n4mMGxT3a698=",
|
||||
"lastModified": 1738140586,
|
||||
"narHash": "sha256-Vn4PD4eH18QklgDY1vnjXJqNPmP3SJNejcBroW0yTTA=",
|
||||
"owner": "mirrexagon",
|
||||
"repo": "nixpkgs-esp-dev",
|
||||
"rev": "31ee58005f43e93a6264e3667c9bf5c31b368733",
|
||||
"rev": "29517b39abe729e04118bf77af526f9947f6c476",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -482,11 +483,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737075266,
|
||||
"narHash": "sha256-u1gk5I1an975FOAMMdS6oBKnSIsZza5ZKhaeBZAskVo=",
|
||||
"lastModified": 1738228963,
|
||||
"narHash": "sha256-Ee5hVHM7AWxaq7XJN6xiZztTZX8csdXernjqaTW5r9I=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "12851ae7467bad8ef422b20806ab4d6d81e12d29",
|
||||
"rev": "d963ed335b890a70ed53eecf14cdb21528eda9b8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -526,11 +527,11 @@
|
|||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737086202,
|
||||
"narHash": "sha256-33tcNERQt1R7tr/W7pvQj8R6NJktyTOKMIfY16RHLK8=",
|
||||
"lastModified": 1738174211,
|
||||
"narHash": "sha256-eYmp1mKM4kULV1W+EBtCPk6LmKWl2REivaYfGRl+AWo=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "0d14c2b67a407825e3427bf079b31de069d9653a",
|
||||
"revCount": 16626,
|
||||
"rev": "64e33a7e09a0d1faacf2fd3f6ebd647fe4d8346a",
|
||||
"revCount": 17329,
|
||||
"type": "git",
|
||||
"url": "https://git@git.lix.systems/lix-project/lix"
|
||||
},
|
||||
|
@ -569,11 +570,11 @@
|
|||
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737109534,
|
||||
"narHash": "sha256-ONWusynmMvogEBeCTeZewIDmY4kZYxgv9D/TSL5kH70=",
|
||||
"lastModified": 1738237661,
|
||||
"narHash": "sha256-9QNTd6lazGEqDEkI13itPwq6uvh9z7LGmn4OY1+xAL0=",
|
||||
"owner": "sodiboo",
|
||||
"repo": "niri-flake",
|
||||
"rev": "ce46857ea5bcd4e40040d46c6f495fa387fb812a",
|
||||
"rev": "5921aa096d1bc92fb1960f8f1db78f58a96b4c51",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -602,11 +603,11 @@
|
|||
"niri-unstable": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1737102881,
|
||||
"narHash": "sha256-5Lyjc7NduC+5t/Ypuj8DwjfJmdxetzELj6noRNBY8fQ=",
|
||||
"lastModified": 1738234654,
|
||||
"narHash": "sha256-HJR2r/e4ZxbAfLYHNrQD8vaxZDZvKpma9jchJr8zYH8=",
|
||||
"owner": "YaLTeR",
|
||||
"repo": "niri",
|
||||
"rev": "b4add625b2ffdad3e003b3e437891daacf53a12f",
|
||||
"rev": "fb5fedbf24aa66909bb9d112856f27ceb04766a8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -698,11 +699,11 @@
|
|||
},
|
||||
"nix-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1736978406,
|
||||
"narHash": "sha256-oMr3PVIQ8XPDI8/x6BHxsWEPBRU98Pam6KGVwUh8MPk=",
|
||||
"lastModified": 1737751639,
|
||||
"narHash": "sha256-ZEbOJ9iT72iwqXsiEMbEa8wWjyFvRA9Ugx8utmYbpz4=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "b678606690027913f3434dea3864e712b862dde5",
|
||||
"rev": "dfad538f751a5aa5d4436d9781ab27a6128ec9d4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -757,11 +758,11 @@
|
|||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1736978406,
|
||||
"narHash": "sha256-oMr3PVIQ8XPDI8/x6BHxsWEPBRU98Pam6KGVwUh8MPk=",
|
||||
"lastModified": 1737751639,
|
||||
"narHash": "sha256-ZEbOJ9iT72iwqXsiEMbEa8wWjyFvRA9Ugx8utmYbpz4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "b678606690027913f3434dea3864e712b862dde5",
|
||||
"rev": "dfad538f751a5aa5d4436d9781ab27a6128ec9d4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -851,11 +852,11 @@
|
|||
},
|
||||
"nixpkgs-stable_2": {
|
||||
"locked": {
|
||||
"lastModified": 1736916166,
|
||||
"narHash": "sha256-puPDoVKxkuNmYIGMpMQiK8bEjaACcCksolsG36gdaNQ=",
|
||||
"lastModified": 1738163270,
|
||||
"narHash": "sha256-B/7Y1v4y+msFFBW1JAdFjNvVthvNdJKiN6EGRPnqfno=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e24b4c09e963677b1beea49d411cd315a024ad3a",
|
||||
"rev": "59e618d90c065f55ae48446f307e8c09565d5ab0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -914,11 +915,11 @@
|
|||
},
|
||||
"nixpkgs_5": {
|
||||
"locked": {
|
||||
"lastModified": 1736883708,
|
||||
"narHash": "sha256-uQ+NQ0/xYU0N1CnXsa2zghgNaOPxWpMJXSUJJ9W7140=",
|
||||
"lastModified": 1738142207,
|
||||
"narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "eb62e6aa39ea67e0b8018ba8ea077efe65807dc8",
|
||||
"rev": "9d3ae807ebd2981d593cddd0080856873139aa40",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -930,11 +931,11 @@
|
|||
},
|
||||
"nixpkgs_6": {
|
||||
"locked": {
|
||||
"lastModified": 1736883708,
|
||||
"narHash": "sha256-uQ+NQ0/xYU0N1CnXsa2zghgNaOPxWpMJXSUJJ9W7140=",
|
||||
"lastModified": 1738142207,
|
||||
"narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "eb62e6aa39ea67e0b8018ba8ea077efe65807dc8",
|
||||
"rev": "9d3ae807ebd2981d593cddd0080856873139aa40",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -961,10 +962,10 @@
|
|||
},
|
||||
"nixpkgs_8": {
|
||||
"locked": {
|
||||
"lastModified": 1736883708,
|
||||
"narHash": "sha256-uQ+NQ0/xYU0N1CnXsa2zghgNaOPxWpMJXSUJJ9W7140=",
|
||||
"path": "/nix/store/xb4yfxa32hsjpincdgjv7xdq9kyys8l9-source",
|
||||
"rev": "eb62e6aa39ea67e0b8018ba8ea077efe65807dc8",
|
||||
"lastModified": 1737632463,
|
||||
"narHash": "sha256-38J9QfeGSej341ouwzqf77WIHAScihAKCt8PQJ+NH28=",
|
||||
"path": "/nix/store/8dh0832snzamw6wk2rdfjz29xdzgma49-source",
|
||||
"rev": "0aa475546ed21629c4f5bbf90e38c846a99ec9e9",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1142,11 +1143,11 @@
|
|||
"tinted-zed": "tinted-zed"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1736993991,
|
||||
"narHash": "sha256-kPDt3QgeIsct9f375LIGmSoZKl7Z4AVzXX+9U0VV5PI=",
|
||||
"lastModified": 1738025638,
|
||||
"narHash": "sha256-nU3JpvIeEmcDHzQK4OTD1KXSoL/GOff6j9kuSO4X8eM=",
|
||||
"owner": "danth",
|
||||
"repo": "stylix",
|
||||
"rev": "a88c4d264a4379b7fe5a9e75ed51bea96f8dd407",
|
||||
"rev": "55418e8fc8d4696af619176a22cefcfac56ad2ef",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1371,11 +1372,11 @@
|
|||
"xwayland-satellite-unstable": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1736487362,
|
||||
"narHash": "sha256-4kGoOA7FgK9N2mzS+TFEn41kUUNY6KwdiA/0rqlr868=",
|
||||
"lastModified": 1737837494,
|
||||
"narHash": "sha256-wIMowP8Juas4ZwMRcpc+58sZ0kKTDu8fm13THPmv/F8=",
|
||||
"owner": "Supreeeme",
|
||||
"repo": "xwayland-satellite",
|
||||
"rev": "8f55e27f63a749881c4bbfbb6b1da028342a91d1",
|
||||
"rev": "3944c9a0e40e5629f16ad023bbc90dac80d35a0f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -131,6 +131,7 @@
|
|||
|
||||
./nixos/services/tailscale.nix
|
||||
|
||||
agenix.nixosModules.default
|
||||
home-manager.nixosModules.home-manager
|
||||
];
|
||||
|
||||
|
@ -165,8 +166,8 @@
|
|||
|
||||
./nixos/configs/gui
|
||||
./nixos/configs/flatpak.nix
|
||||
./nixos/configs/music-server
|
||||
./nixos/configs/fonts-linux.nix
|
||||
./nixos/configs/music-server.nix
|
||||
|
||||
./nixos/overlays/fixup-signal
|
||||
./nixos/overlays/fixup-imhex.nix
|
||||
|
|
|
@ -184,6 +184,21 @@ in
|
|||
default-column-width = { };
|
||||
}
|
||||
|
||||
# Make anki flashcard windows modal floats.
|
||||
{
|
||||
matches = [{
|
||||
app-id = "^anki$";
|
||||
title = "Add";
|
||||
}];
|
||||
|
||||
open-floating = true;
|
||||
default-floating-position = {
|
||||
x = 0;
|
||||
y = 0;
|
||||
relative-to = "top-right";
|
||||
};
|
||||
}
|
||||
|
||||
# Talon windows should show over other ones.
|
||||
{
|
||||
matches = [ { app-id = "talon"; } ];
|
||||
|
|
97
nixos/configs/music-server/001-fix-mopidy-bandcamp.patch
Normal file
97
nixos/configs/music-server/001-fix-mopidy-bandcamp.patch
Normal file
|
@ -0,0 +1,97 @@
|
|||
diff --git a/mopidy_bandcamp/bandcamp.py b/mopidy_bandcamp/bandcamp.py
|
||||
index ff8c737..7d0b866 100644
|
||||
--- a/mopidy_bandcamp/bandcamp.py
|
||||
+++ b/mopidy_bandcamp/bandcamp.py
|
||||
@@ -2,11 +2,38 @@ import json
|
||||
import mopidy_bandcamp
|
||||
import re
|
||||
import requests
|
||||
+import ssl
|
||||
|
||||
from html import unescape
|
||||
from mopidy import httpclient
|
||||
from time import time
|
||||
+from requests.adapters import HTTPAdapter
|
||||
|
||||
+class BandcampHTTPAdapter(HTTPAdapter):
|
||||
+ def init_poolmanager(self, *args, **kwargs):
|
||||
+ context = ssl.create_default_context()
|
||||
+ DEFAULT_CIPHERS = ":".join(
|
||||
+ [
|
||||
+ "ECDHE+AESGCM",
|
||||
+ "ECDHE+CHACHA20",
|
||||
+ "DHE+AESGCM",
|
||||
+ "DHE+CHACHA20",
|
||||
+ "ECDH+AESGCM",
|
||||
+ "DH+AESGCM",
|
||||
+ "ECDH+AES",
|
||||
+ "DH+AES",
|
||||
+ "RSA+AESGCM",
|
||||
+ "RSA+AES",
|
||||
+ "!aNULL",
|
||||
+ "!eNULL",
|
||||
+ "!MD5",
|
||||
+ "!DSS",
|
||||
+ "!AESCCM",
|
||||
+ ]
|
||||
+ )
|
||||
+ context.set_ciphers(DEFAULT_CIPHERS)
|
||||
+ kwargs["ssl_context"] = context
|
||||
+ return super().init_poolmanager(*args, **kwargs)
|
||||
|
||||
class BandcampClient:
|
||||
BASE_URL = "https://bandcamp.com/api"
|
||||
@@ -43,6 +70,8 @@ class BandcampClient:
|
||||
}
|
||||
|
||||
def __init__(self, config):
|
||||
+ self.bandcamp_session = requests.Session()
|
||||
+ self.bandcamp_session.mount("https://", BandcampHTTPAdapter())
|
||||
self.proxy = httpclient.format_proxy(config["proxy"])
|
||||
self.ua_str = httpclient.format_user_agent(
|
||||
f"{mopidy_bandcamp.Extension.dist_name}/{mopidy_bandcamp.__version__}"
|
||||
@@ -53,7 +82,7 @@ class BandcampClient:
|
||||
|
||||
def _get(self, *args, **kwargs):
|
||||
headers = {"User-Agent": self.ua_str}
|
||||
- resp = requests.get(*args, **kwargs, headers=headers, proxies=self.proxy)
|
||||
+ resp = self.bandcamp_session.get(*args, **kwargs, headers=headers, proxies=self.proxy)
|
||||
resp.raise_for_status()
|
||||
js = resp.json()
|
||||
if "error" in js:
|
||||
@@ -62,7 +91,7 @@ class BandcampClient:
|
||||
|
||||
def _post(self, *args, **kwargs):
|
||||
headers = {"User-Agent": self.ua_str}
|
||||
- resp = requests.post(*args, **kwargs, headers=headers, proxies=self.proxy)
|
||||
+ resp = self.bandcamp_session.post(*args, **kwargs, headers=headers, proxies=self.proxy)
|
||||
resp.raise_for_status()
|
||||
js = resp.json()
|
||||
if "error" in js:
|
||||
@@ -73,7 +102,7 @@ class BandcampClient:
|
||||
headers = {"User-Agent": self.ua_str}
|
||||
if self.identity:
|
||||
headers["Cookie"] = f"identity={self.identity}"
|
||||
- resp = requests.get(uri, headers=headers, proxies=self.proxy)
|
||||
+ resp = self.bandcamp_session.get(uri, headers=headers, proxies=self.proxy)
|
||||
resp.raise_for_status()
|
||||
# Build the tralbum data by joining multiple json chunks.
|
||||
data = re.search(r'\s+data-tralbum="(.*?)"', resp.text)
|
||||
@@ -127,7 +156,7 @@ class BandcampClient:
|
||||
return []
|
||||
headers = {"User-Agent": self.ua_str, "Cookie": f"identity={self.identity}"}
|
||||
if self.fan_id is None:
|
||||
- resp = requests.get(
|
||||
+ resp = self.bandcamp_session.get(
|
||||
self.BASE_URL + "/fan/2/collection_summary",
|
||||
headers=headers,
|
||||
proxies=self.proxy,
|
||||
@@ -141,7 +170,7 @@ class BandcampClient:
|
||||
endpoint = "wishlist_items"
|
||||
elif ctype == "following":
|
||||
endpoint = "following_bands"
|
||||
- resp = requests.post(
|
||||
+ resp = self.bandcamp_session.post(
|
||||
self.BASE_URL + "/fancollection/1/" + endpoint,
|
||||
headers=headers,
|
||||
proxies=self.proxy,
|
13
nixos/configs/music-server/bandcamp.cfg.age
Normal file
13
nixos/configs/music-server/bandcamp.cfg.age
Normal file
|
@ -0,0 +1,13 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 43BYZQ qE9XFnsHJF9NJv0DfT8a+JF8mo70euESoJCJMsbxciE
|
||||
IhivK/mISf3SWgwfFcefN/s36SJNB/TXWUNU+uOHsnc
|
||||
-> piv-p256 KIqJqw AhuaGHGWmOL6LgBt8M+LHn3x+YRVSKnri8g5CMeed4qn
|
||||
cYSr1l3qKd9UWfkPlEdOg+1QvSf3AqoJ6r50OU2a8ik
|
||||
-> piv-p256 1xsogw Am7HwNqAbocNxzv7zmZtDIYFD8yDv1RScJjEWaMMiA1J
|
||||
0HJp/27IXNjQMPY2uI1tgMGKbaoboHTmCjAyn4h0FgE
|
||||
-> piv-p256 Dzogow A/ear9Fq6u4jjI6WZJmTpaPuzwaHLPP9P5LBemsOqEll
|
||||
eetDKjZGZJQ1GGwBHfzF8Uxeteq8XzXsSegixuw1U0M
|
||||
-> piv-p256 WHAQQQ A3sSwFcNtkfAsyrX14e+1Y7b7h1eK+Oa5PrEnWKpxmfs
|
||||
/uDeyV5+GRlsWgzYEhbbM65ZLRIh9snLD1nvvcTP4X4
|
||||
--- VySB9QNJqMhQouE8l+dtoPABJEhXkgfG6iBLNYGMV6Q
|
||||
x(¯rµ(>.òrœ«ýWyv %iš-/<2F>›ÚÅôiž”“MUfnN<6E>-ß¾Hœ³²—žøU[—’«ë¥DÀÿ裸Ân
ªñú>ÃLúõ#( s&V?#qÆF¹8hé®ÇZæ§ä$[þ?òûûŸDÓË«e#O¥7?Æ&dÂV’SéÍ穹Yj_<6A>Ž@ZnØ‚Ú=aÅC¿ )
|
|
@ -3,11 +3,12 @@
|
|||
#
|
||||
# vim: et:ts=2:sw=2:
|
||||
#
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
age.secrets.bandcamp.file = ./bandcamp.cfg.age;
|
||||
|
||||
home-manager.users.deprekated =
|
||||
{ pkgs, config, ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
# Use mopidy as our music server.
|
||||
|
@ -18,18 +19,26 @@
|
|||
mopidy-iris
|
||||
mopidy-mpd
|
||||
mopidy-tidal
|
||||
mopidy-bandcamp
|
||||
(mopidy-bandcamp.overrideAttrs (prev: {
|
||||
patches = [ ./001-fix-mopidy-bandcamp.patch ];
|
||||
}))
|
||||
];
|
||||
|
||||
settings = {
|
||||
|
||||
# Use tidal, for now.
|
||||
# Tidal for streaming more-commercial music.
|
||||
tidal = {
|
||||
enabled = true;
|
||||
quality = "LOSSLESS";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
# Probvide our bandcamp authentication as an extra config file.
|
||||
extraConfigFiles = [
|
||||
config.age.secrets.bandcamp.path
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
# Translate our commands over MPRIS2.
|
|
@ -141,6 +141,16 @@ in
|
|||
# Enable fingerprint reader.
|
||||
services.fprintd.enable = true;
|
||||
|
||||
# Enable steam.
|
||||
programs.gamescope = {
|
||||
enable = true;
|
||||
capSysNice = true;
|
||||
};
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
gamescopeSession.enable = true;
|
||||
};
|
||||
|
||||
#
|
||||
# Niri configuration for our monitors.
|
||||
#
|
||||
|
|
|
@ -117,6 +117,7 @@ with pkgs;
|
|||
rclone
|
||||
ripgrep
|
||||
rr
|
||||
translate-shell
|
||||
unzip
|
||||
unar
|
||||
unrar
|
||||
|
|
|
@ -79,6 +79,9 @@ with pkgs;
|
|||
deprekages.argos
|
||||
tidal-hifi
|
||||
vlc
|
||||
|
||||
# Learning
|
||||
anki
|
||||
]
|
||||
|
||||
# Linux-only packages.
|
||||
|
|
|
@ -2,34 +2,29 @@
|
|||
stdenv,
|
||||
fetchurl,
|
||||
fetchzip,
|
||||
electron_31,
|
||||
electron_33,
|
||||
_7zz,
|
||||
asar,
|
||||
writeScriptBin,
|
||||
bash,
|
||||
libgcc
|
||||
}:
|
||||
let
|
||||
better-sqlite3-version = "11.3.0";
|
||||
bufferutil-version = "4.0.8";
|
||||
electron-version = "125";
|
||||
better-sqlite3-version = "11.4.0";
|
||||
electron-version = "130";
|
||||
|
||||
notion-app-unwrapped = stdenv.mkDerivation rec {
|
||||
name = "notion-app-unwrapped";
|
||||
version = "3.15.0";
|
||||
version = "4.4.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://desktop-release.notion-static.com/Notion-${version}.dmg";
|
||||
hash = "sha256-Pdd2/aS2xtZoM9awc0CO4I7wpumJ6OkZZc9kTKZHkE8=";
|
||||
hash = "sha256-FHPru5Byub8DKAmtqr8EYqGiikslEJBS/zV4PVfFiE8=";
|
||||
};
|
||||
|
||||
betterSqlite3 = fetchzip {
|
||||
url = "https://github.com/WiseLibs/better-sqlite3/releases/download/v${better-sqlite3-version}/better-sqlite3-v${better-sqlite3-version}-electron-v${electron-version}-linux-x64.tar.gz";
|
||||
hash = "sha256-6obP+VIJiRxN3Mmy1+A+k9KkoB8iBbbaDJ+cdznjVig=";
|
||||
};
|
||||
|
||||
bufferUtil = fetchzip {
|
||||
url = "https://github.com/websockets/bufferutil/releases/download/v${bufferutil-version}/v${bufferutil-version}-linux-x64.tar";
|
||||
hash = "sha256-uNvLdiXDqtaKYLfCiwcWNTYjPbAvN2mjDlAK7c8WMY0=";
|
||||
hash = "sha256-NMFE8lgXSz5vzHa37/ioaL8iY2SW8vUGA3oEgv/OISk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -39,14 +34,16 @@ let
|
|||
|
||||
unpackPhase = ''
|
||||
7zz x $src || true
|
||||
mv "Notion Installer" Notion
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
ls -lah **/*
|
||||
|
||||
asar e "Notion/Notion.app/Contents/Resources/app.asar" asar_patched
|
||||
|
||||
# replace the native dependencies with linux versions
|
||||
cp "$betterSqlite3/Release/better_sqlite3.node" "asar_patched/node_modules/better-sqlite3/build/Release/"
|
||||
cp "$bufferUtil/node.napi.node" "asar_patched/node_modules/bufferutil/build/Release/bufferutil.node"
|
||||
|
||||
# fully disabling auto updates
|
||||
sed -i 's/if("darwin"===process.platform){const e=s.systemPreferences?.getUserDefault(E,"boolean"),t=_.Store.getState().app.preferences?.isAutoUpdaterDisabled;return Boolean(e||t)}return!1/return!0/g' "asar_patched/.webpack/main/index.js"
|
||||
|
@ -88,12 +85,14 @@ stdenv.mkDerivation rec {
|
|||
runScript = writeScriptBin "notion-app" ''
|
||||
#!${bash}/bin/bash
|
||||
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${libgcc.lib}/lib
|
||||
|
||||
# Enable Wayland when appropriate.
|
||||
[[ $NIXOS_OZONE_WL -eq 1 ]] && WL_ARGS="--enable-features=UseOzonePlatform --ozone-platform=wayland" || WL_ARGS=""
|
||||
|
||||
# Launch
|
||||
cd ${notion-app-unwrapped}/lib/notion-app/app
|
||||
exec ${electron_31}/bin/electron . $WL_ARGS "$@"
|
||||
exec ${electron_33}/bin/electron . $WL_ARGS "$@"
|
||||
'';
|
||||
|
||||
desktopFile = ''
|
||||
|
|
24
secrets.nix
Normal file
24
secrets.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
#
|
||||
# Secret database for agenix.
|
||||
#
|
||||
# vim: et:ts=2:sw=2:
|
||||
#
|
||||
let
|
||||
# Systems we want to target.
|
||||
trailblazer = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDcJM0wcR6I53htsvN3A+2kcoln+N89z8bWt7g1PxjZk root@trailblazer";
|
||||
|
||||
rekey-users = [
|
||||
"age1yubikey1qtgvszdcz3n9a707l3k2mhaql9mdm6sqe69mr2hypl8n0qxs5m52sgu9wdd" # Kate
|
||||
"age1yubikey1qfmkkc57a34f6zd9wh0vm9f20tv85nqkmyh80ygyzwynpaq9nhgkw4wd3zz" # Kate
|
||||
"age1yubikey1qt5cjhklyek73awwaducjgn0g7l93xeuvcnudnac23kdyem2k7v7zlmn6p0" # Kate
|
||||
"age1yubikey1qgkz2s97uzquemxx694vvqp2dj6328zpf4l3rj3mqfcnguvuhxcguw8fgxy" # Kate
|
||||
];
|
||||
|
||||
# Combined pubkeys for use below.
|
||||
all-machine-pubkeys = [
|
||||
trailblazer
|
||||
] ++ rekey-users;
|
||||
in
|
||||
{
|
||||
"nixos/configs/music-server/bandcamp.cfg.age".publicKeys = all-machine-pubkeys;
|
||||
}
|
|
@ -68,8 +68,8 @@ def try_source(filename):
|
|||
#
|
||||
$GCC_COLOR = "auto"
|
||||
$GCC_COLORS = "auto"
|
||||
$EDITOR="kak"
|
||||
$VISUAL="kak"
|
||||
$EDITOR="nvim"
|
||||
$VISUAL=$EDITOR
|
||||
|
||||
|
||||
# Start off with some empty local variables; these will hopefully be populated
|
||||
|
|
Loading…
Add table
Reference in a new issue