1
0
mirror of https://github.com/kmein/niveum synced 2026-03-18 19:11:08 +01:00

6 Commits

Author SHA1 Message Date
d06d0a9de4 WIP: mympd 2022-04-15 01:16:50 +02:00
d4e82500ae feat(mpv): limit resolution 2022-04-14 13:40:11 +02:00
6aa9be6f70 feat: more fonts 2022-04-13 09:01:23 +02:00
4e362678ca feat(astrology): pause bot 2022-04-13 09:01:23 +02:00
a2081dece4 feat(weechat): block people 2022-04-11 23:02:02 +02:00
98cf188a17 feat: use more tmpfiles.d 2022-04-10 19:38:47 +02:00
9 changed files with 158 additions and 47 deletions

View File

@@ -3,7 +3,9 @@
lib,
pkgs,
...
}: {
}: let
inherit (import <niveum/lib>) tmpfilesConfig;
in {
imports = [
<niveum/modules/dropbox.nix>
];
@@ -12,11 +14,32 @@
dropbox.enable = false;
};
system.activationScripts.home-symlinks = ''
ln -sfn ${config.users.users.me.home}/cloud/syncthing/common/mahlzeit ${config.users.users.me.home}/mahlzeit
ln -sfn ${config.users.users.me.home}/cloud/Seafile/Wiki ${config.users.users.me.home}/notes
ln -sfn ${config.users.users.me.home}/cloud/Seafile/Uni ${config.users.users.me.home}/uni
'';
systemd.tmpfiles.rules = map tmpfilesConfig [
{
type = "L+";
user = config.users.users.me.name;
group = "users";
mode = "0755";
argument = "${config.users.users.me.home}/cloud/Seafile/Wiki";
path = "${config.users.users.me.home}/notes";
}
{
type = "L+";
user = config.users.users.me.name;
group = "users";
mode = "0755";
argument = "${config.users.users.me.home}/cloud/Seafile/Uni";
path = "${config.users.users.me.home}/uni";
}
{
type = "L+";
user = config.users.users.me.name;
group = "users";
mode = "0755";
argument = "${config.users.users.me.home}/cloud/syncthing/common/mahlzeit";
path = "${config.users.users.me.home}/mahlzeit";
}
];
home-manager.users.me = {
services.gnome-keyring.enable = true;

View File

@@ -1,42 +1,53 @@
{pkgs, ...}: {
nixpkgs.config.joypixels.acceptLicense = true;
fonts = {
enableDefaultFonts = true;
fontDir.enable = true;
fonts = with pkgs; [
alegreya
alegreya-sans
amiri
cantarell-fonts
charis-sil
corefonts
crimson
eb-garamond
etBook
fira
font-awesome-ttf
gentium
gfs-fonts
gyre-fonts
ia-writer-duospace
ibm-plex
inconsolata
iosevka
libertine
jetbrains-mono
joypixels
libertinus
libre-bodoni
lmodern
merriweather
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
ocr-a
roboto
roboto-mono
roboto-slab
scheherazade-new
source-code-pro
source-serif-pro
source-sans-pro
ubuntu_font_family
gfs-fonts
jetbrains-mono
twemoji-color-font
joypixels
source-serif-pro
theano
tocharian-font
];
fontconfig.defaultFonts = {
monospace = ["JetBrains Mono" "JoyPixels"];
serif = ["Roboto Slab"];
sansSerif = ["Roboto" "Noto Sans"];
emoji = ["JoyPixels"];
vistafonts
vollkorn
zilla-slab
]; # google-fonts league-of-moveable-type
fontconfig.defaultFonts = let
emojiFont = "JoyPixels";
in {
monospace = ["JetBrains Mono" emojiFont];
serif = ["Merriweather"];
sansSerif = ["Cantarell" emojiFont];
emoji = [emojiFont];
};
};
}

View File

@@ -18,6 +18,7 @@ in {
programs.mpv = {
enable = true;
config = {
ytdl-format = "bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best";
ytdl-raw-options = lib.concatStringsSep "," [''sub-lang="de,en"'' "write-sub=" "write-auto-sub="];
screenshot-template = "%F-%wH%wM%wS-%#04n";
};

View File

@@ -42,7 +42,7 @@
'';
in {
niveum.telegramBots.transits = {
enable = true;
enable = false;
time = "*:0/1";
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
chatIds = ["-1001796440545"];

View File

@@ -7,9 +7,8 @@
stateLocation = "/var/lib/codimd/state.sqlite";
nixpkgs-unstable = import <nixpkgs-unstable> {};
domain = "pad.kmein.de";
inherit (import <niveum/lib>) tmpfilesConfig;
in {
imports = [<stockholm/krebs/3modules/permown.nix>];
services.nginx.virtualHosts.${domain} = {
enableACME = true;
forceSSL = true;
@@ -49,11 +48,15 @@ in {
};
};
krebs.permown.${backupLocation} = {
owner = "codimd";
group = "codimd";
umask = "0002";
};
systemd.tmpfiles.rules = [
(tmpfilesConfig {
user = "codimd";
group = "codimd";
mode = "0755";
type = "d";
path = backupLocation;
})
];
systemd.services.hedgedoc-backup = {
description = "Hedgedoc backup service";

View File

@@ -143,6 +143,11 @@ in {
tags = ["nick_gitlab"];
regex = "*";
};
people = {
buffer = "irc.*.*";
tags = map (name: "nick_${name}") ["mod_p[matrix-fli"];
regex = "*";
};
};
};
extraCommands = ''/matrix connect nibbana'';

View File

@@ -15,6 +15,7 @@ in {
./pulseaudio.nix
./home-assistant.nix
./tuna.nix
./mympd.nix
./grocy.nix
./spotifyd.nix
<home-manager/nixos>

57
systems/zaatar/mympd.nix Normal file
View File

@@ -0,0 +1,57 @@
{pkgs, ...}: let
inherit (import <niveum/lib>) tmpfilesConfig;
in {
systemd.tmpfiles.rules = [
(tmpfilesConfig {
type = "d";
mode = "0755";
user = "mympd";
group = "mympd";
path = "/var/lib/mympd";
})
(tmpfilesConfig {
type = "d";
mode = "0755";
user = "mympd";
group = "mympd";
age = "1d";
path = "/var/cache/mympd";
})
(tmpfilesConfig {
type = "L+";
mode = "0644";
user = "mympd";
group = "mympd";
path = "/var/lib/mympd/config/http_port";
argument = pkgs.writeText "port" "8764";
})
(tmpfilesConfig {
type = "L+";
mode = "0644";
user = "mympd";
group = "mympd";
path = "/var/lib/mympd/config/ssl";
argument = pkgs.writeText "ssl" "false";
})
];
users.users.mympd = {
isSystemUser = true;
group = "mympd";
};
users.groups.mympd = {};
systemd.services.mympd = {
wantedBy = ["multi-user.target"];
after = ["mpd.service"];
script = "${pkgs.mympd}/bin/mympd";
environment = {
MYMPD_HTTP_PORT = "8764";
};
serviceConfig = {
Restart = "always";
User = "mympd";
Group = "mympd";
};
};
}

View File

@@ -5,6 +5,7 @@
...
}: let
firewall = (import <niveum/lib>).firewall lib;
inherit (import <niveum/lib>) tmpfilesConfig;
streams = import <niveum/lib/streams.nix> {
di-fm-key = lib.strings.fileContents <secrets/di.fm/key>;
@@ -71,22 +72,31 @@ in {
extraStopCommands = firewall.removeRules rules;
};
system.activationScripts.mpd-playlists = let
makePlaylist = name: streams: pkgs.writeText "name.m3u" (lib.concatMapStringsSep "\n" (lib.getAttr "stream") streams);
systemd.tmpfiles.rules = let
tags = lib.lists.unique (lib.concatMap ({tags ? [], ...}: tags) streams);
in ''
rm -rf /var/lib/mpd/playlists
install -d /var/lib/mpd/playlists
ln -sfn "${toString (makePlaylist "all" streams)}" "/var/lib/mpd/playlists/all.m3u"
${lib.concatMapStringsSep "\n" (
tag: let
playlistStreams = lib.filter ({tags ? [], ...}: lib.elem tag tags) streams;
in ''
ln -sfn "${toString (makePlaylist tag playlistStreams)}" "/var/lib/mpd/playlists/${tag}.m3u"
''
)
tags}
'';
tagStreams = tag: lib.filter ({tags ? [], ...}: lib.elem tag tags) streams;
makePlaylist = name: streams: pkgs.writeText "${name}.m3u" (lib.concatMapStringsSep "\n" (lib.getAttr "stream") streams);
in
map (tag:
tmpfilesConfig {
type = "L+";
path = "/var/lib/mpd/playlists/${tag}.m3u";
mode = "0644";
user = "mpd";
group = "mpd";
argument = makePlaylist tag (tagStreams tag);
})
tags
++ [
(tmpfilesConfig {
type = "L+";
mode = "0644";
user = "mpd";
group = "mpd";
path = "/var/lib/mpd/playlist/all.m3u";
argument = makePlaylist "all" streams;
})
];
services.tuna = {
enable = true;