aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/bo/boot/module.nix12
-rw-r--r--pkgs/by-name/mp/mpdpopm/.envrc7
-rw-r--r--pkgs/by-name/mp/mpdpopm/flake.nix56
-rw-r--r--pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs12
-rw-r--r--pkgs/by-name/mp/mpdpopm/src/playcounts.rs3
5 files changed, 18 insertions, 72 deletions
diff --git a/modules/by-name/bo/boot/module.nix b/modules/by-name/bo/boot/module.nix
index 80a47420..86ad58da 100644
--- a/modules/by-name/bo/boot/module.nix
+++ b/modules/by-name/bo/boot/module.nix
@@ -22,7 +22,7 @@
tails = let
tailsPrefix = "/EFI/tails";
in {
- root = "${tailsPrefix}/tails.iso";
+ iso = "${tailsPrefix}/tails.iso";
initrd = "${tailsPrefix}/initrd.img";
vmlinuz = "${tailsPrefix}/vmlinuz-linux";
};
@@ -85,7 +85,7 @@
# Don't store things persistently
"nopersistence"
- "fromiso=/dev/nvme0n1p1/${tails.root}"
+ "fromiso=/dev/nvme0n1p1/${tails.iso}"
];
in {
options.soispha.boot = {
@@ -154,10 +154,10 @@ in {
};
install = pkgs.writeShellScript "wrapped-install-tails-iso-marker" ''
- echo "[Wrapped bootloader install] Copying tails iso..."
+ echo "Wrapped bootloader install> Copying tails iso..."
${copyExtraFiles}
- echo "[Wrapped bootloader install] Running original lanzaboote install..."
+ echo "Wrapped bootloader install> Running original lanzaboote install..."
${lanzabooteInstallHook.config.boot.loader.external.installHook}
'';
@@ -203,14 +203,14 @@ in {
title Tails ${iso.passthru.version} Live ISO
linux ${tails.vmlinuz}
initrd ${tails.initrd}
- options ${builtins.concatStringsSep " " iso_options}
+ options boot=casper iso-scan/filename=${tails.iso} noeject noprompt
'';
};
extraFiles = {
# TODO: Check that the ISO we use for booting is _actually_ still the one we
# copied there (someone might exchange it in between) <2026-06-09>
- "${tails.root}" = "${iso}/tails.iso";
+ "${tails.iso}" = "${iso}/tails.iso";
"${tails.vmlinuz}" = "${iso}/live/vmlinuz-linux";
"${tails.initrd}" = "${iso}/live/initrd.img";
};
diff --git a/pkgs/by-name/mp/mpdpopm/.envrc b/pkgs/by-name/mp/mpdpopm/.envrc
index 9f477e71..40e13e1c 100644
--- a/pkgs/by-name/mp/mpdpopm/.envrc
+++ b/pkgs/by-name/mp/mpdpopm/.envrc
@@ -10,13 +10,8 @@
# You should have received a copy of the License along with this program.
# If not, see <https://www.gnu.org/licenses/agpl.txt>.
-use flake || use nix
-watch_file flake.nix
+pre_cache_load rust
PATH_add ./scripts
PATH_add ./target/debug/
PATH_add ./target/release/
-
-if on_git_branch; then
- echo && git status --short --branch
-fi
diff --git a/pkgs/by-name/mp/mpdpopm/flake.nix b/pkgs/by-name/mp/mpdpopm/flake.nix
deleted file mode 100644
index d2e37260..00000000
--- a/pkgs/by-name/mp/mpdpopm/flake.nix
+++ /dev/null
@@ -1,56 +0,0 @@
-# Mpdpopm - A mpd rating tracker
-#
-# Copyright (C) 2026 Benedikt Peetz, Michael Herstine <sp1ff@pobox.com> <benedikt.peetz@b-peetz.de, sp1ff@pobox.com>
-# SPDX-License-Identifier: AGPL-3.0-or-later
-#
-# This file is part of Mpdpopm.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/agpl.txt>.
-{
- description = "A mpd rating tracker";
-
- inputs = {
- };
-
- outputs = {self, ...}: let
- system = "x86_64-linux";
- sources = import ../../../../unflake.nix;
-
- pkgs = sources.nixpkgs.legacyPackages."${system}";
- inherit (sources) treefmt-nix;
-
- treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;};
- in {
- checks."${system}" = {
- formatting = treefmtEval.config.build.check self;
- };
-
- formatter."${system}" = treefmtEval.config.build.wrapper;
-
- devShells."${system}".default = pkgs.mkShell {
- packages = [
- # rust stuff
- pkgs.cargo
- pkgs.clippy
- pkgs.rustc
- pkgs.rustfmt
- pkgs.mold
-
- pkgs.cargo-edit
- pkgs.cargo-expand
- pkgs.cargo-flamegraph
-
- # Releng
- pkgs.git-bug
- pkgs.reuse
- pkgs.cocogitto
-
- # Perf
- pkgs.hyperfine
- ];
- };
- };
-}
-# vim: ts=2
-
diff --git a/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs b/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs
index 3587df93..0004fd17 100644
--- a/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs
+++ b/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs
@@ -4,7 +4,7 @@ use std::{
};
use anyhow::{Context, Result};
-use rand::{RngExt, distr};
+use rand::{RngExt, distr, seq::SliceRandom};
use tracing::info;
use crate::{clients::Client, storage};
@@ -115,9 +115,13 @@ impl Algorithm for Discovery {
// We split the tracks into three thirds, so that we can also force a pick from e.g.
// the lower third (the negative ones).
- let negative = sorted_tracks.drain(..len).collect::<Vec<_>>();
- let neutral = sorted_tracks.drain(..len).collect::<Vec<_>>();
- let positive = sorted_tracks;
+ let mut negative = sorted_tracks.drain(..len).collect::<Vec<_>>();
+ let mut neutral = sorted_tracks.drain(..len).collect::<Vec<_>>();
+ let mut positive = sorted_tracks;
+
+ negative.shuffle(&mut rng);
+ neutral.shuffle(&mut rng);
+ positive.shuffle(&mut rng);
assert_eq!(negative.len(), neutral.len());
diff --git a/pkgs/by-name/mp/mpdpopm/src/playcounts.rs b/pkgs/by-name/mp/mpdpopm/src/playcounts.rs
index 8fbee133..eac71948 100644
--- a/pkgs/by-name/mp/mpdpopm/src/playcounts.rs
+++ b/pkgs/by-name/mp/mpdpopm/src/playcounts.rs
@@ -172,6 +172,9 @@ impl PlayState {
play_count::set(client, file, curr_pc + 1).await?;
} else if self.last_song_was_skipped {
+ // TODO(@bpeetz): This should also record _when_ the skip was (e.g. a
+ // skip at 80% is not as important as one at 2%) <2026-09-05>
+
self.last_song_was_skipped = false;
let last = self
.last_server_stat