mirror of
https://github.com/kmein/niveum
synced 2026-03-22 21:01:07 +01:00
Compare commits
5 Commits
ebbbb537c3
...
4cba5a0b8a
| Author | SHA1 | Date | |
|---|---|---|---|
| 4cba5a0b8a | |||
| 71b5a8cb24 | |||
| 200bff8386 | |||
| 79fd340f82 | |||
| 69ed97a4ab |
@@ -95,7 +95,7 @@ in {
|
|||||||
|
|
||||||
users.users.me.extraGroups = [ "audio" ];
|
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 =
|
environment.interactiveShellInit =
|
||||||
@@ -244,7 +244,6 @@ in {
|
|||||||
./theming.nix
|
./theming.nix
|
||||||
./tmux.nix
|
./tmux.nix
|
||||||
./tor.nix
|
./tor.nix
|
||||||
./todo-txt.nix
|
|
||||||
./traadfri.nix
|
./traadfri.nix
|
||||||
./unclutter.nix
|
./unclutter.nix
|
||||||
./version.nix
|
./version.nix
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
|
firewall = (import <niveum/lib>).firewall lib;
|
||||||
|
|
||||||
streams = import <niveum/lib/streams.nix> {
|
streams = import <niveum/lib/streams.nix> {
|
||||||
di-fm-key = lib.strings.fileContents <secrets/di.fm/key>;
|
di-fm-key = lib.strings.fileContents <secrets/di.fm/key>;
|
||||||
};
|
};
|
||||||
@@ -18,29 +20,29 @@ in
|
|||||||
log_level "default"
|
log_level "default"
|
||||||
auto_update "yes"
|
auto_update "yes"
|
||||||
|
|
||||||
password "${password}@read,add,control"
|
|
||||||
|
|
||||||
audio_output {
|
audio_output {
|
||||||
type "pulse"
|
type "pulse"
|
||||||
name "zaatar single room audio system"
|
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 ];
|
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 =
|
system.activationScripts.mpd-playlists =
|
||||||
let playlistFile = pkgs.writeText "radio.m3u" (lib.concatMapStringsSep "\n" (lib.getAttr "stream") streams);
|
let playlistFile = pkgs.writeText "radio.m3u" (lib.concatMapStringsSep "\n" (lib.getAttr "stream") streams);
|
||||||
in ''
|
in ''
|
||||||
@@ -74,7 +76,6 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 80 config.services.mpd.network.port ];
|
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
vim-colors-paramount = pkgs.callPackage <niveum/packages/vimPlugins/vim-colors-paramount.nix> { };
|
vim-colors-paramount = pkgs.callPackage <niveum/packages/vimPlugins/vim-colors-paramount.nix> { };
|
||||||
vim-256noir = pkgs.callPackage <niveum/packages/vimPlugins/vim-256noir.nix> { };
|
vim-256noir = pkgs.callPackage <niveum/packages/vimPlugins/vim-256noir.nix> { };
|
||||||
icalendar-vim = pkgs.callPackage <niveum/packages/vimPlugins/icalendar-vim.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> { };
|
jq-vim = pkgs.callPackage <niveum/packages/vimPlugins/jq-vim.nix> { };
|
||||||
vim-fsharp = pkgs.callPackage <niveum/packages/vimPlugins/vim-fsharp.nix> { };
|
vim-fsharp = pkgs.callPackage <niveum/packages/vimPlugins/vim-fsharp.nix> { };
|
||||||
vim-reason-plus = pkgs.callPackage <niveum/packages/vimPlugins/vim-reason-plus.nix> { };
|
vim-reason-plus = pkgs.callPackage <niveum/packages/vimPlugins/vim-reason-plus.nix> { };
|
||||||
@@ -65,7 +64,6 @@
|
|||||||
jq-vim
|
jq-vim
|
||||||
purescript-vim
|
purescript-vim
|
||||||
rust-vim
|
rust-vim
|
||||||
todo-txt-vim
|
|
||||||
typescript-vim
|
typescript-vim
|
||||||
vim-fsharp
|
vim-fsharp
|
||||||
vim-javascript
|
vim-javascript
|
||||||
|
|||||||
@@ -160,6 +160,8 @@ in {
|
|||||||
shuf ${worldradio} | ${pkgs.findutils}/bin/xargs ${pkgs.mpv}/bin/mpv --no-video
|
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
|
||||||
spotify-tui
|
spotify-tui
|
||||||
playerctl
|
playerctl
|
||||||
|
|||||||
@@ -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";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -7,6 +7,12 @@ rec {
|
|||||||
|
|
||||||
tmpfilesConfig = {type, path, mode ? "-", user ? "-", group ? "-", age ? "-", argument ? "-"}: "${type} '${path}' ${mode} ${user} ${group} ${age} ${argument}";
|
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;
|
sshPort = 22022;
|
||||||
|
|
||||||
colours = import ./colours/mac-os.nix;
|
colours = import ./colours/mac-os.nix;
|
||||||
|
|||||||
@@ -91,21 +91,6 @@ in {
|
|||||||
units = "metric";
|
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";
|
block = "custom";
|
||||||
interval = 30;
|
interval = 30;
|
||||||
|
|||||||
@@ -135,7 +135,6 @@ if has("autocmd")
|
|||||||
autocmd bufnewfile,bufread urls,config set filetype=conf
|
autocmd bufnewfile,bufread urls,config set filetype=conf
|
||||||
autocmd bufnewfile,bufread *.elm packadd elm-vim | set filetype=elm shiftwidth=4
|
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 *.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 haskell packadd haskell-vim | set keywordprg=hoogle\ -i
|
||||||
autocmd filetype javascript packadd vim-javascript
|
autocmd filetype javascript packadd vim-javascript
|
||||||
autocmd filetype make setlocal noexpandtab
|
autocmd filetype make setlocal noexpandtab
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
{ vimUtils, fetchFromGitHub }:
|
|
||||||
vimUtils.buildVimPluginFrom2Nix {
|
|
||||||
name = "todo.txt-vim";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "freitass";
|
|
||||||
repo = "todo.txt-vim";
|
|
||||||
rev = "6845221d45bd62e604c2024bc511a56e79d1118b";
|
|
||||||
sha256 = "08m9q5f2pz6gjp0vkmm7glfsrbnldxi1j59dm5d7any6y96xxd6v";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user