mirror of
https://github.com/kmein/niveum
synced 2026-03-30 01:01:10 +02:00
Compare commits
3 Commits
4f8f3751f4
...
bd200b655d
| Author | SHA1 | Date | |
|---|---|---|---|
| bd200b655d | |||
| 4adf8fea0a | |||
| 0f0b5658be |
@@ -1,46 +1,45 @@
|
|||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
let
|
{
|
||||||
inherit (import <niveum/lib>) colours;
|
|
||||||
colourNames =
|
|
||||||
[ "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" ];
|
|
||||||
colourPairs = lib.getAttrs colourNames colours;
|
|
||||||
alacrittyConfig = {
|
|
||||||
background_opacity = 0.9;
|
|
||||||
colors = {
|
|
||||||
primary = { inherit (colours) background foreground; };
|
|
||||||
normal = lib.mapAttrs (_: colour: colour.dark) colourPairs;
|
|
||||||
bright = lib.mapAttrs (_: colour: colour.bright) colourPairs;
|
|
||||||
};
|
|
||||||
font = {
|
|
||||||
normal.family = "Monospace";
|
|
||||||
size = 6;
|
|
||||||
};
|
|
||||||
key_bindings = [
|
|
||||||
{
|
|
||||||
key = "Add";
|
|
||||||
mods = "Control";
|
|
||||||
action = "IncreaseFontSize";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "Minus";
|
|
||||||
mods = "Control";
|
|
||||||
action = "DecreaseFontSize";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "Key0";
|
|
||||||
mods = "Control";
|
|
||||||
action = "ResetFontSize";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
environment.variables.TERMINAL = "alacritty";
|
environment.variables.TERMINAL = "alacritty";
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.alacritty
|
pkgs.alacritty
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.me.xdg.configFile = {
|
home-manager.users.me.xdg.configFile =
|
||||||
"alacritty/alacritty.yml".text = builtins.toJSON alacrittyConfig;
|
let
|
||||||
|
inherit (import <niveum/lib>) colours;
|
||||||
|
colourNames = [ "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" ];
|
||||||
|
colourPairs = lib.getAttrs colourNames colours;
|
||||||
|
in {
|
||||||
|
"alacritty/alacritty.yml".source = (pkgs.formats.yaml {}).generate "alacritty.yml" {
|
||||||
|
background_opacity = 0.9;
|
||||||
|
colors = {
|
||||||
|
primary = { inherit (colours) background foreground; };
|
||||||
|
normal = lib.mapAttrs (_: colour: colour.dark) colourPairs;
|
||||||
|
bright = lib.mapAttrs (_: colour: colour.bright) colourPairs;
|
||||||
|
};
|
||||||
|
font = {
|
||||||
|
normal.family = "Monospace";
|
||||||
|
size = 6;
|
||||||
|
};
|
||||||
|
key_bindings = [
|
||||||
|
{
|
||||||
|
key = "Add";
|
||||||
|
mods = "Control";
|
||||||
|
action = "IncreaseFontSize";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "Minus";
|
||||||
|
mods = "Control";
|
||||||
|
action = "DecreaseFontSize";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "Key0";
|
||||||
|
mods = "Control";
|
||||||
|
action = "ResetFontSize";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
{ config, lib, pkgs, ... }: {
|
{ config, lib, pkgs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
<niveum/modules/seafile.nix>
|
|
||||||
<niveum/modules/dropbox.nix>
|
<niveum/modules/dropbox.nix>
|
||||||
];
|
];
|
||||||
|
|
||||||
niveum = {
|
niveum = {
|
||||||
dropbox.enable = true;
|
dropbox.enable = true;
|
||||||
seafile.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
system.activationScripts.home-symlinks = ''
|
system.activationScripts.home-symlinks = ''
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ in {
|
|||||||
(self: super: {
|
(self: super: {
|
||||||
scripts = import <niveum/packages/scripts> { pkgs = super; lib = super.lib; };
|
scripts = import <niveum/packages/scripts> { pkgs = super; lib = super.lib; };
|
||||||
})
|
})
|
||||||
(import <niveum/overlays/toml.nix>)
|
|
||||||
(import <stockholm/krebs/5pkgs/haskell>)
|
(import <stockholm/krebs/5pkgs/haskell>)
|
||||||
(import <stockholm/submodules/nix-writers/pkgs>)
|
(import <stockholm/submodules/nix-writers/pkgs>)
|
||||||
(import <stockholm/krebs/5pkgs/override>)
|
(import <stockholm/krebs/5pkgs/override>)
|
||||||
@@ -237,6 +236,7 @@ in {
|
|||||||
./retiolum.nix
|
./retiolum.nix
|
||||||
./rofi.nix
|
./rofi.nix
|
||||||
./spacetime.nix
|
./spacetime.nix
|
||||||
|
./seafile.nix
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
./sshd.nix
|
./sshd.nix
|
||||||
./sudo.nix
|
./sudo.nix
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${
|
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${
|
||||||
pkgs.writeTOML (import <niveum/lib/i3status-rust.nix> {
|
(pkgs.formats.toml {}).generate "i3status-rust.toml" (import <niveum/lib/i3status-rust.nix> {
|
||||||
inherit (config.niveum) batteryName wirelessInterface;
|
inherit (config.niveum) batteryName wirelessInterface;
|
||||||
inherit colours;
|
inherit colours;
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
|||||||
@@ -1,47 +1,6 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
let
|
|
||||||
bridgeBotToken = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
|
||||||
config = {
|
|
||||||
general = {
|
|
||||||
RemoteNickFormat = "[{NICK}] ";
|
|
||||||
Charset = "utf-8";
|
|
||||||
};
|
|
||||||
telegram.kmein.Token = bridgeBotToken;
|
|
||||||
irc.freenode = {
|
|
||||||
Server = "irc.freenode.net:6667";
|
|
||||||
Nick = "ponte";
|
|
||||||
StripMarkdown = true;
|
|
||||||
};
|
|
||||||
mumble.lassulus = {
|
|
||||||
Server = "lassul.us:64738";
|
|
||||||
Nick = "krebs_bridge";
|
|
||||||
SkipTLSVerify = true;
|
|
||||||
};
|
|
||||||
gateway = [
|
|
||||||
{
|
|
||||||
name = "krebs-bridge";
|
|
||||||
enable = true;
|
|
||||||
inout = [
|
|
||||||
{
|
|
||||||
account = "irc.freenode";
|
|
||||||
channel = "#krebs";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
account = "telegram.kmein";
|
|
||||||
channel = "-330372458";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
account = "mumble.lassulus";
|
|
||||||
channel = 6; # "nixos"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(import <niveum/overlays/toml.nix>)
|
|
||||||
(self: super: {
|
(self: super: {
|
||||||
matterbridge = (import (super.fetchFromGitHub {
|
matterbridge = (import (super.fetchFromGitHub {
|
||||||
owner = "NixOS";
|
owner = "NixOS";
|
||||||
@@ -54,6 +13,44 @@ in
|
|||||||
|
|
||||||
services.matterbridge = {
|
services.matterbridge = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configPath = toString (pkgs.writeTOML config);
|
configPath =
|
||||||
|
let bridgeBotToken = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||||
|
in toString ((pkgs.formats.toml {}).generate "config.toml" {
|
||||||
|
general = {
|
||||||
|
RemoteNickFormat = "[{NICK}] ";
|
||||||
|
Charset = "utf-8";
|
||||||
|
};
|
||||||
|
telegram.kmein.Token = bridgeBotToken;
|
||||||
|
irc.freenode = {
|
||||||
|
Server = "irc.freenode.net:6667";
|
||||||
|
Nick = "ponte";
|
||||||
|
StripMarkdown = true;
|
||||||
|
};
|
||||||
|
mumble.lassulus = {
|
||||||
|
Server = "lassul.us:64738";
|
||||||
|
Nick = "krebs_bridge";
|
||||||
|
SkipTLSVerify = true;
|
||||||
|
};
|
||||||
|
gateway = [
|
||||||
|
{
|
||||||
|
name = "krebs-bridge";
|
||||||
|
enable = true;
|
||||||
|
inout = [
|
||||||
|
{
|
||||||
|
account = "irc.freenode";
|
||||||
|
channel = "#krebs";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
account = "telegram.kmein";
|
||||||
|
channel = "-330372458";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
account = "mumble.lassulus";
|
||||||
|
channel = 6; # "nixos"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ in
|
|||||||
systemd.services.mpd-fm-stations =
|
systemd.services.mpd-fm-stations =
|
||||||
let
|
let
|
||||||
stations = lib.lists.imap0 (id: {desc ? "", logo ? "https://picsum.photos/seed/${builtins.hashString "md5" stream}/300", stream, station}: { inherit id desc logo stream station; }) streams;
|
stations = lib.lists.imap0 (id: {desc ? "", logo ? "https://picsum.photos/seed/${builtins.hashString "md5" stream}/300", stream, station}: { inherit id desc logo stream station; }) streams;
|
||||||
stationsJson = pkgs.writeText "stations.json" (builtins.toJSON stations);
|
stationsJson = (pkgs.formats.json {}).generate "stations.json" stations;
|
||||||
in {
|
in {
|
||||||
wantedBy = [ "mpd-fm.service" ];
|
wantedBy = [ "mpd-fm.service" ];
|
||||||
startAt = "hourly";
|
startAt = "hourly";
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ in {
|
|||||||
scripts.playlist
|
scripts.playlist
|
||||||
scripts.devanagari
|
scripts.devanagari
|
||||||
scripts.betacode # ancient greek betacode to unicode converter
|
scripts.betacode # ancient greek betacode to unicode converter
|
||||||
|
scripts.meteo
|
||||||
nur.repos.kmein.mahlzeit
|
nur.repos.kmein.mahlzeit
|
||||||
# nur.repos.kmein.slide
|
# nur.repos.kmein.slide
|
||||||
nur.repos.kmein.vimv
|
nur.repos.kmein.vimv
|
||||||
|
|||||||
@@ -10,8 +10,9 @@
|
|||||||
'';
|
'';
|
||||||
# :def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\""
|
# :def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\""
|
||||||
# :def pl \x -> return $ ":!${pkgs.haskellPackages.pointfree}/bin/pointfree -v \"" ++ x ++ "\""
|
# :def pl \x -> return $ ":!${pkgs.haskellPackages.pointfree}/bin/pointfree -v \"" ++ x ++ "\""
|
||||||
".stack/config.yaml".text = let inherit (import <niveum/lib>) kieran;
|
".stack/config.yaml".source =
|
||||||
in builtins.toJSON {
|
let inherit (import <niveum/lib>) kieran;
|
||||||
|
in (pkgs.formats.yaml {}).generate "config.yaml" {
|
||||||
templates.params = {
|
templates.params = {
|
||||||
author-name = kieran.name;
|
author-name = kieran.name;
|
||||||
author-email = kieran.email;
|
author-email = kieran.email;
|
||||||
|
|||||||
20
configs/seafile.nix
Normal file
20
configs/seafile.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ pkgs, config, ... }:
|
||||||
|
{
|
||||||
|
services.xserver.displayManager.sessionCommands = "${pkgs.seafile-client}/bin/seafile-applet";
|
||||||
|
|
||||||
|
home-manager.users.me.xdg.configFile = {
|
||||||
|
"Seafile/Seafile Client.conf".source = (pkgs.formats.ini {}).generate "Seafile Client.conf" {
|
||||||
|
Behavior = {
|
||||||
|
hideDockIcon = false;
|
||||||
|
hideMainWindowWhenStarted = true;
|
||||||
|
};
|
||||||
|
Settings = {
|
||||||
|
computerName = config.networking.hostName;
|
||||||
|
lastShiburl = "https://box.hu-berlin.de";
|
||||||
|
};
|
||||||
|
UsedServerAddresses.main = "https://box.hu-berlin.de";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.seafile-client pkgs.seafile-shared ];
|
||||||
|
}
|
||||||
@@ -66,7 +66,7 @@ let
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
configFile = pkgs.writeText "urlwatch.yaml" (builtins.toJSON {
|
configFile = (pkgs.formats.yaml {}).generate "urlwatch.yaml" {
|
||||||
display = {
|
display = {
|
||||||
error = true;
|
error = true;
|
||||||
new = true;
|
new = true;
|
||||||
@@ -100,7 +100,7 @@ let
|
|||||||
# chat_id = [ "18980945" ];
|
# chat_id = [ "18980945" ];
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
});
|
};
|
||||||
urlwatch = pkgs.urlwatch.overrideAttrs (attrs: {
|
urlwatch = pkgs.urlwatch.overrideAttrs (attrs: {
|
||||||
patches = [ <niveum/packages/urlwatch-insecure.patch> ];
|
patches = [ <niveum/packages/urlwatch-insecure.patch> ];
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,5 @@
|
|||||||
./constants.nix
|
./constants.nix
|
||||||
./dropbox.nix
|
./dropbox.nix
|
||||||
./retiolum.nix
|
./retiolum.nix
|
||||||
./seafile.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ in {
|
|||||||
|
|
||||||
stationsFile = mkOption {
|
stationsFile = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = pkgs.writeText "stations.json" (builtins.toJSON cfg.stations);
|
default = (pkgs.formats.json {}).generate "stations.json" cfg.stations;
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
|
||||||
with lib;
|
|
||||||
let cfg = config.niveum.seafile;
|
|
||||||
in {
|
|
||||||
options.niveum.seafile = { enable = mkEnableOption "Seafile"; };
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
systemd.user.services.seafile = {
|
|
||||||
description = "Seafile synchronisation service";
|
|
||||||
after = [ "network.target" ];
|
|
||||||
wantedBy = [ "default.target" ];
|
|
||||||
script = "${pkgs.seafile-client}/bin/seafile-applet";
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.seafile-client pkgs.seafile-shared ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
(self: super: {
|
|
||||||
writeTOML = object: super.runCommand "writeTOML" {} ''
|
|
||||||
echo '${builtins.toJSON object}' | ${super.remarshal}/bin/json2toml > $out
|
|
||||||
'';
|
|
||||||
toTOML = object: builtins.readFile (self.writeTOML object);
|
|
||||||
writeJSON = path: object: super.writeText path (builtins.toJSON object);
|
|
||||||
})
|
|
||||||
@@ -94,6 +94,12 @@ in rec {
|
|||||||
name = "tag";
|
name = "tag";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
meteo = wrapScript {
|
||||||
|
packages = [ pkgs.jq pkgs.curl pkgs.xdotool pkgs.sxiv pkgs.gnused ];
|
||||||
|
script = ./meteo.sh;
|
||||||
|
name = "meteo";
|
||||||
|
};
|
||||||
|
|
||||||
booksplit = wrapScript {
|
booksplit = wrapScript {
|
||||||
packages = [ pkgs.ffmpeg tag ];
|
packages = [ pkgs.ffmpeg tag ];
|
||||||
script = "${voidrice}/.local/bin/booksplit";
|
script = "${voidrice}/.local/bin/booksplit";
|
||||||
|
|||||||
76
packages/scripts/meteo.sh
Executable file
76
packages/scripts/meteo.sh
Executable file
@@ -0,0 +1,76 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# usage: meteo --list
|
||||||
|
# usage: meteo --update
|
||||||
|
# usage: meteo STATION
|
||||||
|
set -efu
|
||||||
|
|
||||||
|
# TODO XDG
|
||||||
|
CONFIG_DIR=$HOME/.config/wetter
|
||||||
|
STATIONS_FILE=$CONFIG_DIR/stations.json
|
||||||
|
|
||||||
|
case ${1-} in
|
||||||
|
--list)
|
||||||
|
sed -n 's/^\s*\(--[^)]\+\))$/\1/p' "$0"
|
||||||
|
jq -r -n \
|
||||||
|
--slurpfile stations_file "$STATIONS_FILE" \
|
||||||
|
'
|
||||||
|
$stations_file[0] as $known_stations |
|
||||||
|
|
||||||
|
$known_stations | keys[]
|
||||||
|
'
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
--update)
|
||||||
|
mkdir -p "$(dirname "$STATIONS_FILE")"
|
||||||
|
exec >"$STATIONS_FILE"
|
||||||
|
|
||||||
|
curl -fsS http://wetterstationen.meteomedia.de/ |
|
||||||
|
jq -Rrs '
|
||||||
|
def decodeHTML:
|
||||||
|
gsub("ä";"ä") |
|
||||||
|
gsub("ö";"ö") |
|
||||||
|
gsub("ü";"ü") |
|
||||||
|
gsub("Ä";"Ä") |
|
||||||
|
gsub("Ö";"Ö") |
|
||||||
|
gsub("Ü";"Ü") |
|
||||||
|
gsub("ß";"ß")
|
||||||
|
;
|
||||||
|
[
|
||||||
|
match(".*<option value=\"/\\?map=Deutschland&station=(?<station>[0-9]+)\">(?<name>[^<]+)</option>";"g")
|
||||||
|
.captures |
|
||||||
|
map({"\(.name)":(.string)}) |
|
||||||
|
add |
|
||||||
|
{"\(.name|decodeHTML)":(.station|tonumber)}
|
||||||
|
] |
|
||||||
|
add
|
||||||
|
'
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# set -x
|
||||||
|
|
||||||
|
station=${1-103840}
|
||||||
|
station=$(jq -e -n \
|
||||||
|
--arg station "$station" \
|
||||||
|
--slurpfile stations_file "$STATIONS_FILE" \
|
||||||
|
'
|
||||||
|
$stations_file[0] as $known_stations |
|
||||||
|
|
||||||
|
$station |
|
||||||
|
if test("^[0-9]+$") then
|
||||||
|
tonumber
|
||||||
|
else
|
||||||
|
$known_stations[.]
|
||||||
|
end
|
||||||
|
')
|
||||||
|
cache="/tmp/${LOGNAME}_wetter_$station.png"
|
||||||
|
curl -sS \
|
||||||
|
"http://wetterstationen.meteomedia.de/messnetz/vorhersagegrafik/$station.png" \
|
||||||
|
-o "$cache"
|
||||||
|
|
||||||
|
if window_id=$(xdotool search --name "^sxiv - $cache$"); then
|
||||||
|
xdotool key --window "$window_id" r
|
||||||
|
else
|
||||||
|
sxiv "$cache" &
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user