nixdirfmt

This commit is contained in:
kat witch 2021-03-16 18:42:10 +00:00
parent f39ede8001
commit a7eb2e7a6f
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
8 changed files with 59 additions and 46 deletions

View file

@ -25,10 +25,13 @@
networking.useDHCP = false; networking.useDHCP = false;
networking.interfaces.enp34s0.useDHCP = true; networking.interfaces.enp34s0.useDHCP = true;
networking.firewall.allowPing = true; networking.firewall.allowPing = true;
networking.firewall.allowedTCPPorts = [ 80 445 139 9091 5000 32101 ]; # smb transmission mkchromecast networking.firewall.allowedTCPPorts =
[ 80 445 139 9091 5000 32101 ]; # smb transmission mkchromecast
networking.firewall.allowedUDPPorts = [ 137 138 4010 ]; # smb scream networking.firewall.allowedUDPPorts = [ 137 138 4010 ]; # smb scream
networking.firewall.allowedUDPPortRanges = [ networking.firewall.allowedUDPPortRanges = [{
{ from = 32768; to = 60999; } # dnla from = 32768;
to = 60999;
} # dnla
]; ];
services.avahi.enable = true; services.avahi.enable = true;

View file

@ -27,7 +27,8 @@
song_columns_list_format = song_columns_list_format =
"(3f)[cyan]{n} (40)[default]{t|f} (25)[red]{a} (30)[blue]{b} (4f)[cyan]{l}"; "(3f)[cyan]{n} (40)[default]{t|f} (25)[red]{a} (30)[blue]{b} (4f)[cyan]{l}";
now_playing_prefix = "$b"; now_playing_prefix = "$b";
song_list_format = " $6%a$9 $8-$9 $5%b$9 $R $7%n:$8 $8%t$9 ($4%l$9) "; song_list_format =
" $7%n$9 $8-$9 $6%a$9 $8-$9 $5%b$9 $R $8%t$9 ($4%l$9) ";
song_library_format = "{%n > }{%t}|{%f}"; song_library_format = "{%n > }{%t}|{%f}";
song_status_format = "{%a - }{%t - }{%b}"; song_status_format = "{%a - }{%t - }{%b}";
titles_visibility = "no"; titles_visibility = "no";
@ -35,6 +36,8 @@
statusbar_visibility = "no"; statusbar_visibility = "no";
now_playing_suffix = "$/b"; now_playing_suffix = "$/b";
progressbar_look = " "; progressbar_look = " ";
media_library_primary_tag = "album_artist";
search_engine_display_mode = "columns";
}; };
}; };
programs.beets = { programs.beets = {
@ -56,6 +59,8 @@
network.startWhenNeeded = true; network.startWhenNeeded = true;
musicDirectory = "/home/kat/media-share/music"; musicDirectory = "/home/kat/media-share/music";
extraConfig = '' extraConfig = ''
max_output_buffer_size "32768"
audio_output { audio_output {
type "fifo" type "fifo"
name "my_fifo" name "my_fifo"
@ -66,7 +71,7 @@
audio_output { audio_output {
type "pulse" type "pulse"
name "speaker" name "speaker"
}
audio_output { audio_output {

View file

@ -75,9 +75,7 @@
command = "systemctl --user restart mako"; command = "systemctl --user restart mako";
always = true; always = true;
} }
{ { command = "mkchromecast -t"; }
command = "mkchromecast -t";
}
{ {
command = command =
"${pkgs.swayidle}/bin/swayidle -w before-sleep '${lockCommand}'"; "${pkgs.swayidle}/bin/swayidle -w before-sleep '${lockCommand}'";

View file

@ -2,11 +2,14 @@
with pkgs.lib; with pkgs.lib;
(mapAttrs (name: hosts: (mapAttrs (name: hosts: ''
''
#!${pkgs.runtimeShell} #!${pkgs.runtimeShell}
export PATH= export PATH=
nix build --no-link ${concatMapStringsSep " " (host: builtins.unsafeDiscardStringContext host.config.system.build.toplevel.drvPath) hosts} nix build --no-link ${
concatMapStringsSep " " (host:
builtins.unsafeDiscardStringContext
host.config.system.build.toplevel.drvPath) hosts
}
${concatMapStrings (host: '' ${concatMapStrings (host: ''
echo "deploying ${host.config.networking.hostName}..." echo "deploying ${host.config.networking.hostName}..."
${host.config.system.build.deployScript} $1 & ${host.config.system.build.deployScript} $1 &

View file

@ -6,7 +6,9 @@ let
cfg = config.deploy; cfg = config.deploy;
secretsScript = concatMapStrings (file: secretsScript = concatMapStrings (file:
'' ''
ssh $NIX_SSHOPTS root@${cfg.ssh.host} "mkdir -p ${toString file.out.dir} ssh $NIX_SSHOPTS -T root@${cfg.ssh.host} "mkdir -p ${
toString file.out.dir
}
cat > ${file.path} cat > ${file.path}
chmod ${file.mode} ${file.path} chmod ${file.mode} ${file.path}
chown ${file.owner}:${file.group} ${file.path}"'' chown ${file.owner}:${file.group} ${file.path}"''
@ -57,8 +59,10 @@ in {
#!${pkgs.runtimeShell} #!${pkgs.runtimeShell}
set -xeo pipefail set -xeo pipefail
export PATH=${with pkgs; lib.makeBinPath [ coreutils openssh nix ]} export PATH=${with pkgs; lib.makeBinPath [ coreutils openssh nix ]}
export NIX_SSHOPTS="$NIX_SSHOPTS -p${toString cfg.ssh.port} -T" export NIX_SSHOPTS="$NIX_SSHOPTS -p${toString cfg.ssh.port}"
nix build ${ builtins.unsafeDiscardStringContext config.system.build.toplevel.drvPath} -o result-${config.networking.hostName} nix build ${
builtins.unsafeDiscardStringContext config.system.build.toplevel.drvPath
} -o result-${config.networking.hostName}
nix copy ${ nix copy ${
if cfg.substitute then "-s" else "" if cfg.substitute then "-s" else ""
} --no-check-sigs --to ssh://root@${cfg.ssh.host} ${config.system.build.toplevel} } --no-check-sigs --to ssh://root@${cfg.ssh.host} ${config.system.build.toplevel}