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

5 Commits

9 changed files with 25 additions and 70 deletions

View File

@@ -95,7 +95,7 @@ in {
users.users.me.extraGroups = [ "audio" ];
environment.systemPackages = [ pkgs.pavucontrol pkgs.pamixer pkgs.pulsemixer ];
environment.systemPackages = [ pkgs.pavucontrol pkgs.ncpamixer pkgs.pamixer pkgs.pulsemixer ];
}
{
environment.interactiveShellInit =
@@ -244,7 +244,6 @@ in {
./theming.nix
./tmux.nix
./tor.nix
./todo-txt.nix
./traadfri.nix
./unclutter.nix
./version.nix

View File

@@ -1,5 +1,7 @@
{ config, pkgs, lib, ... }:
let
firewall = (import <niveum/lib>).firewall lib;
streams = import <niveum/lib/streams.nix> {
di-fm-key = lib.strings.fileContents <secrets/di.fm/key>;
};
@@ -18,29 +20,29 @@ in
log_level "default"
auto_update "yes"
password "${password}@read,add,control"
audio_output {
type "pulse"
name "zaatar single room audio system"
}
audio_output {
type "httpd"
name "zaatar multi room audio system"
encoder "vorbis" # optional
port "${toString multi-room-audio-port}"
quality "5.0" # do not define if bitrate is defined
# bitrate "128" # do not define if quality is defined
format "44100:16:2"
always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped.
tags "yes" # httpd supports sending tags to listening streams.
}
'';
};
environment.systemPackages = [ pkgs.mpc_cli ];
networking.firewall =
let
dport = config.services.mpd.network.port;
protocol = "tcp";
rules = [
(firewall.accept { inherit dport protocol; source = "192.168.0.0/16"; })
(firewall.accept { inherit dport protocol; source = "127.0.0.0/8"; })
];
in {
allowedTCPPorts = [ 80 ];
extraCommands = firewall.addRules rules;
extraStopCommands = firewall.removeRules rules;
};
system.activationScripts.mpd-playlists =
let playlistFile = pkgs.writeText "radio.m3u" (lib.concatMapStringsSep "\n" (lib.getAttr "stream") streams);
in ''
@@ -74,7 +76,6 @@ in
'';
};
networking.firewall.allowedTCPPorts = [ 80 config.services.mpd.network.port ];
services.nginx = {
enable = true;

View File

@@ -11,7 +11,6 @@
vim-colors-paramount = pkgs.callPackage <niveum/packages/vimPlugins/vim-colors-paramount.nix> { };
vim-256noir = pkgs.callPackage <niveum/packages/vimPlugins/vim-256noir.nix> { };
icalendar-vim = pkgs.callPackage <niveum/packages/vimPlugins/icalendar-vim.nix> { };
todo-txt-vim = pkgs.callPackage <niveum/packages/vimPlugins/todo-txt-vim.nix> { };
jq-vim = pkgs.callPackage <niveum/packages/vimPlugins/jq-vim.nix> { };
vim-fsharp = pkgs.callPackage <niveum/packages/vimPlugins/vim-fsharp.nix> { };
vim-reason-plus = pkgs.callPackage <niveum/packages/vimPlugins/vim-reason-plus.nix> { };
@@ -65,7 +64,6 @@
jq-vim
purescript-vim
rust-vim
todo-txt-vim
typescript-vim
vim-fsharp
vim-javascript

View File

@@ -160,6 +160,8 @@ in {
shuf ${worldradio} | ${pkgs.findutils}/bin/xargs ${pkgs.mpv}/bin/mpv --no-video
'')
(pkgs.writers.writeDashBin "ncmpcpp-zaatar" ''MPD_HOST=${(import <niveum/lib/local-network.nix>).zaatar} exec ${pkgs.ncmpcpp}/bin/ncmpcpp "$@"'')
spotify
spotify-tui
playerctl

View File

@@ -1,25 +0,0 @@
{ pkgs, ... }:
let
get-todo-dir = pkgs.writers.writeDash "git-toplevel-todo" ''
if GIT_TOPLEVEL=$(${pkgs.git}/bin/git rev-parse --show-toplevel 2>/dev/null); then
echo "$GIT_TOPLEVEL/.todo"
else
echo "$HOME/cloud/Dropbox/todo"
fi
'';
in {
home-manager.users.me.home.file.".todo/config".text = ''
# export TODO_DIR="$(${get-todo-dir})"
export TODO_DIR="$HOME/cloud/Dropbox/todo"
export TODO_FILE="$TODO_DIR/todo.txt"
export DONE_FILE="$TODO_DIR/done.txt"
export REPORT_FILE="$TODO_DIR/report.txt"
'';
environment = {
systemPackages = [ pkgs.todo-txt-cli ];
shellAliases.t = "todo.sh";
variables.TODOTXT_DEFAULT_ACTION = "ls";
};
}

View File

@@ -7,6 +7,12 @@ rec {
tmpfilesConfig = {type, path, mode ? "-", user ? "-", group ? "-", age ? "-", argument ? "-"}: "${type} '${path}' ${mode} ${user} ${group} ${age} ${argument}";
firewall = lib: {
accept = { source, protocol, dport }: "nixos-fw -s ${lib.escapeShellArg source} -p ${lib.escapeShellArg protocol} --dport ${lib.escapeShellArg (toString dport)} -j nixos-fw-accept";
addRules = lib.concatMapStringsSep "\n" (rule: "iptables -A ${rule}");
removeRules = lib.concatMapStringsSep "\n" (rule: "iptables -D ${rule} || true");
};
sshPort = 22022;
colours = import ./colours/mac-os.nix;

View File

@@ -91,21 +91,6 @@ in {
units = "metric";
};
}
{
block = "custom";
interval = 20;
command = pkgs.writers.writeDash "tasks" ''
${pkgs.todo-txt-cli}/bin/todo.sh list '(.)' \
| tail -n 1 \
| ${pkgs.gawk}/bin/awk '{ print " " $2 "/" $4 }'
'';
on_click = let sleepSeconds = 2.5;
in pkgs.writers.writeDash "show-tasks" ''
${pkgs.st}/bin/st -c floating -e ${pkgs.dash}/bin/dash -c "${pkgs.todo-txt-cli}/bin/todo.sh list && sleep ${
toString sleepSeconds
}"
'';
}
{
block = "custom";
interval = 30;

View File

@@ -135,7 +135,6 @@ if has("autocmd")
autocmd bufnewfile,bufread urls,config set filetype=conf
autocmd bufnewfile,bufread *.elm packadd elm-vim | set filetype=elm shiftwidth=4
autocmd bufnewfile,bufread *.dhall packadd dhall-vim | set filetype=dhall
autocmd bufnewfile,bufread *todo.txt packadd todo.txt-vim | set filetype=todo.txt
autocmd filetype haskell packadd haskell-vim | set keywordprg=hoogle\ -i
autocmd filetype javascript packadd vim-javascript
autocmd filetype make setlocal noexpandtab

View File

@@ -1,10 +0,0 @@
{ vimUtils, fetchFromGitHub }:
vimUtils.buildVimPluginFrom2Nix {
name = "todo.txt-vim";
src = fetchFromGitHub {
owner = "freitass";
repo = "todo.txt-vim";
rev = "6845221d45bd62e604c2024bc511a56e79d1118b";
sha256 = "08m9q5f2pz6gjp0vkmm7glfsrbnldxi1j59dm5d7any6y96xxd6v";
};
}