This commit is contained in:
Madeleine Sydney
2025-03-23 23:16:03 -06:00
parent c3c1359b4f
commit ef9943b707
22 changed files with 300 additions and 106 deletions

View File

@@ -14,11 +14,7 @@ in {
};
scrobbling = {
enable = mkOption {
description = "Enable scrobbling for MPD via mpdscribble.";
type = types.bool;
default = cfg.enable;
};
enable = mkEnableOption "Enable scrobbling for MPD via mpdscribble.";
endpoints = mkOption {
type = types.attrsOf (types.submodule ({ ... }: {
@@ -35,16 +31,22 @@ in {
};
discord = {
enable = mkOption {
description = "Enable Discord integration for MPD via mpd-discord-rpc.";
type = types.bool;
default = cfg.enable;
};
enable =
mkEnableOption "Discord integration for MPD via mpd-discord-rpc";
};
};
};
config = mkIf cfg.enable {
sydnix.impermanence.directories =
let xdg-state-dir =
config.home.statehome
or "${config.home.homeDirectory}/.local/state";
in [
(lib.removePrefix
config.home.homeDirectory
"${xdg-state-dir}/mpd")
];
services.mpd = {
enable = true;
musicDirectory = cfg.musicDirectory;

View File

@@ -23,7 +23,7 @@ in {
vesktop = {
state.firstLaunch = false;
settings = {
discordBranch = "stable";
discordBranch = "canary";
minimizeToTray = false;
arRPC = true;
};

View File

@@ -63,8 +63,9 @@
(require 'syd-projects)
(require 'syd-scratch)
(require 'syd-smartparens)
(require 'syd-snippets)
(require 'syd-tabs)
(require 'syd-tooling)
(require 'syd-tramp)
(require 'syd-trust)
(require 'syd-ui)

View File

@@ -24,11 +24,12 @@
;; Managed by Nix: libenchant dependency.
:straight nil
:commands (jinx-mode jinx-correct jinx-correct-word)
:init (defun syd-jinx--jinx-or-ispell ()
(interactive)
(if (bound-and-true-p jinx-mode)
(call-interactively #'jinx-correct-word)
(call-interactively #'ispell-word)))
:init
(defun syd-jinx--jinx-or-ispell ()
(interactive)
(if (bound-and-true-p jinx-mode)
(call-interactively #'jinx-correct-word)
(call-interactively #'ispell-word)))
:general (:states '(normal visual)
"z =" #'syd-jinx--jinx-or-ispell)
:config

View File

@@ -72,7 +72,13 @@
"r r" #'cider-ns-refresh
"r R" #'cider-restart
"r q" #'cider-quit
"d d" #'cider-debug-defun-at-point
"M-:" #'cider-read-and-eval
"h d" #'cider-doc
"h c" #'cider-cheatsheet)
(:keymaps 'cider-repl-mode-map
:states 'insert
"S-<return>" #'cider-repl-newline-and-indent)
:config
(add-hook 'cider-mode-hook #'eldoc-mode)
(add-hook 'cider-repl-mode-hook #'syd-lisp-mode)
@@ -91,7 +97,9 @@
(,(rx bol "*cider-doc*")
:slot 2 :vslot -8 :quit t :select t)))
;; DEPRECATED: Remove once syd-strategies is working.
(syd-add-hook 'clojure-mode-hook
(syd-add-hook '(clojure-mode-hook
clojurescript-mode-hook
cider-repl-mode-hook)
(defun syd-clojure-set-handlers-h ()
(setq-local syd-lookup-documentation-handlers
(list #'cider-doc))))

View File

@@ -0,0 +1,9 @@
;;; syd-snippets.el -*- lexical-binding: t; -*-
(use-package yasnippet
:hook (on-first-input . yas-global-mode))
(use-package yasnippet-snippets
:after yasnippet)
(provide 'syd-snippets)

View File

@@ -0,0 +1,7 @@
;;; syd-trust.el -*- lexical-binding: t; -*-
(setq safe-local-variable-directories
(list "/persist/dots"
(expand-file-name "~/org")))
(provide 'syd-trust)

View File

@@ -0,0 +1,27 @@
;;; .yas-setup.el -*- lexical-binding: t; -*-
(require 'dash)
(require 's)
(defun snippet-bibtex--make-id ()
(let ((surname (--> (or (yas-field-value 2)
"surname")
(s-downcase it)
(string-to-list it)
(-take-while (lambda (x) (/= x ?,)) it)
(-filter (lambda (x) (not (memq x '(?- ?\s)))) it)
(apply #'string it)))
(year (--> (or (yas-field-value 3)
"1234")
(string-to-list it)
(-take-while (lambda (x) (<= ?0 x ?9)) it)
(apply #'string it)))
(keyword (or (-some--> (or (yas-field-value 1)
"keyword")
(s-downcase it)
(s-split-words it)
(-find (lambda (x)
(not (member x '("the" "on" "of" "a" "when"))))
it))
"keyword")))
(concat surname year keyword)))

View File

@@ -0,0 +1,13 @@
# -*- mode: snippet -*-
# name: Article
# uuid:
# key: @art
# condition: t
# --
@article{${1:$(snippet-bibtex--make-id)}
, title = {${1:Principia Mathematica}}
, author = {${2:of Sinope, Diogenes}}
, year = {${3:1992}}
, url = {${4:https://example.com/}}
, urldate = {${5:`(format-time-string "%Y-%m-%d")`}}
}

View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: foreign
# uuid: haskell-foreign
# key: foreign
# condition: t
# --
foreign import ccall unsafe "src/bridge.c $1"
$1 :: $2

View File

@@ -0,0 +1,21 @@
# -*- mode: snippet -*-
# name: Nix module
# uuid:
# key: __module
# condition: t
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil) (this-current-file-name (file-name-base (buffer-file-name (current-buffer)))))
# --
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.${1:`this-current-file-name`};
in {
options.$1 = {
enable = mkEnableOption "$2";
};
config = mkIf cfg.enable {
$3
};
}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: enable
# uuid:
# key: enable
# condition: t
# --
enable = lib.mkEnableOption "$1";

View File

@@ -100,7 +100,22 @@ in {
};
profiles."msyds" = {
bookmarks = [];
bookmarks = {
force = true;
settings = [
{
name = "Nix";
toolbar = true;
bookmarks = [
{
name = "Home-manager options";
tags = [ "nix" "docs" ];
url = "https://nix-community.github.io/home-manager/options.xhtml";
}
];
}
];
};
# Check about:support for extension/add-on ID strings.
extensions = {
@@ -186,9 +201,9 @@ in {
# Override non-declared settings.
force = true;
# Precedence of search engines.
order = [ "Kagi" "DuckDuckGo" ];
order = [ "Kagi" "ddg" ];
default = "Kagi";
privateDefault = "DuckDuckGo";
privateDefault = "ddg";
engines = {
"Kagi" = {
urls = [{
@@ -198,6 +213,18 @@ in {
];
}];
};
"Nixopts" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "channel"; value = "unstable"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon =
"${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "!no" ];
};
"Nixpkgs" = {
urls = [{
template = "https://search.nixos.org/packages";

View File

@@ -14,26 +14,27 @@ in {
sydnix.mpd = {
enable = true;
scrobbling.endpoints = {
"last.fm" = {
passwordFile =
"/home/crumb/.config/sops-nix/secrets/lastfm-password";
username = "crumb1";
};
"libre.fm" = {
passwordFile =
"/home/crumb/.config/sops-nix/secrets/librefm-password";
username = "crumbtoo";
discord.enable = true;
scrobbling = {
enable = true;
endpoints = {
"last.fm" = {
passwordFile =
"/home/crumb/.config/sops-nix/secrets/lastfm-password";
username = "crumb1";
};
"libre.fm" = {
passwordFile =
"/home/crumb/.config/sops-nix/secrets/librefm-password";
username = "crumbtoo";
};
};
};
};
# mpdscribble uses our password files, so it is imperative that the service
# Mpdscribble uses our password files, so it is imperative that the service
# runs only after said password files are brought into existence. }:)
systemd.user.services.mpdscribble.Unit = {
After = [ "sops-nix.service" ];
WantedBy = [ "mpd.service" ];
};
# systemd.user.services.mpdscribble.Unit.After = [ "sops-nix.service" ];
};
}

View File

@@ -21,7 +21,7 @@ in {
config = lib.mkIf cfg.enable {
stylix.targets.swaylock.enable = true;
programs.niri = {
# Activates some Nixpkgs patches to help run Electron applications under
# Wayland.
@@ -57,7 +57,7 @@ in {
layout = {
gaps = 8;
# center-focused-column = "always";
center-focused-column = "on-overflow";
center-focused-column = "never";
preset-column-widths = [
{ proportion = 1.0 / 3.0; }
{ proportion = 1.0 / 2.0; }
@@ -91,6 +91,12 @@ in {
size = 24;
};
window-rules = [
{
matches = [
{ title = "Element.*wishdir"; }
];
block-out-from = "screen-capture";
}
{
# This regular expression is intentionally made as specific as
# possible, since this is the default config, and we want no false

View File

@@ -8,6 +8,24 @@ in {
config = lib.mkIf cfg.enable {
programs.niri.enable = true;
# Necessary for e.g. screensharing.
xdg.portal = {
enable = true;
# See https://github.com/YaLTeR/niri/wiki/Important-Software#portals.
# Niri's NixOS module appears to automatically bring in
# xdg-desktop-portal-gnome and gnome-keyring.
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-wlr
];
xdgOpenUsePortal = true;
config.preferred = {
default = [ "gtk" ];
"org.freedesktop.impl.portal.Screenshot" = [ "wlr" ];
"org.freedesktop.impl.portal.ScreenCast" = [ "wlr" ];
};
};
};
}

29
modules/nixos/qemu.nix Normal file
View File

@@ -0,0 +1,29 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.sydnix.qemu;
in {
options.sydnix.qemu = {
enable = mkEnableOption "Qemu";
};
config = mkIf cfg.enable
(let
# Necessary for UEFI boot with libvirt.
qemu-uefi = pkgs.writeShellScriptBin "qemu-system-x86_64-uefi" ''
qemu-system-x86_64 \
-bios ${pkgs.OVMF.fd}/FV/OVMF.fd \
"$@"
'';
in {
programs.virt-manager.enable = true;
environment.systemPackages = [
pkgs.virtiofsd
qemu-uefi
];
virtualisation.libvirtd.enable = true;
});
}

View File

@@ -1,4 +1,3 @@
{ config, lib, pkgs, ... }:
let