mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
nixdirfmt
This commit is contained in:
parent
f39ede8001
commit
a7eb2e7a6f
8 changed files with 59 additions and 46 deletions
|
|
@ -25,11 +25,14 @@
|
||||||
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;
|
||||||
|
|
||||||
system.stateVersion = "20.09";
|
system.stateVersion = "20.09";
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.adb.enable = true;
|
programs.adb.enable = true;
|
||||||
users.users.kat.extraGroups = ["adbusers"];
|
users.users.kat.extraGroups = [ "adbusers" ];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@
|
||||||
hardware.pulseaudio = {
|
hardware.pulseaudio = {
|
||||||
enable = true;
|
enable = true;
|
||||||
daemon.config = {
|
daemon.config = {
|
||||||
exit-idle-time = 5;
|
exit-idle-time = 5;
|
||||||
resample-method = "speex-float-5";
|
resample-method = "speex-float-5";
|
||||||
avoid-resampling = "true";
|
avoid-resampling = "true";
|
||||||
flat-volumes = "no";
|
flat-volumes = "no";
|
||||||
default-sample-format = "s32le";
|
default-sample-format = "s32le";
|
||||||
default-sample-rate = 48000;
|
default-sample-rate = 48000;
|
||||||
alternate-sample-rate = 44100;
|
alternate-sample-rate = 44100;
|
||||||
default-sample-channels = 2;
|
default-sample-channels = 2;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
coc-git
|
coc-git
|
||||||
vim-fugitive
|
vim-fugitive
|
||||||
vim-startify
|
vim-startify
|
||||||
base16-vim
|
base16-vim
|
||||||
];
|
];
|
||||||
#extraPackages = with pkgs;
|
#extraPackages = with pkgs;
|
||||||
# [ (python3.withPackages (ps: with ps; [ black flake8 ])) ];
|
# [ (python3.withPackages (ps: with ps; [ black flake8 ])) ];
|
||||||
|
|
|
||||||
|
|
@ -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}'";
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,21 @@
|
||||||
|
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
|
|
||||||
(mapAttrs (name: hosts:
|
(mapAttrs (name: hosts: ''
|
||||||
''
|
#!${pkgs.runtimeShell}
|
||||||
#!${pkgs.runtimeShell}
|
export PATH=
|
||||||
export PATH=
|
nix build --no-link ${
|
||||||
nix build --no-link ${concatMapStringsSep " " (host: builtins.unsafeDiscardStringContext host.config.system.build.toplevel.drvPath) hosts}
|
concatMapStringsSep " " (host:
|
||||||
${concatMapStrings (host: ''
|
builtins.unsafeDiscardStringContext
|
||||||
echo "deploying ${host.config.networking.hostName}..."
|
host.config.system.build.toplevel.drvPath) hosts
|
||||||
${host.config.system.build.deployScript} $1 &
|
}
|
||||||
PID_LIST+=" $!"
|
${concatMapStrings (host: ''
|
||||||
'') hosts}
|
echo "deploying ${host.config.networking.hostName}..."
|
||||||
# FIXME: remove jobs from PIDLIST once they finish
|
${host.config.system.build.deployScript} $1 &
|
||||||
trap "kill $PID_LIST" SIGINT
|
PID_LIST+=" $!"
|
||||||
wait $PID_LIST
|
'') hosts}
|
||||||
'') groups)
|
# FIXME: remove jobs from PIDLIST once they finish
|
||||||
|
trap "kill $PID_LIST" SIGINT
|
||||||
|
wait $PID_LIST
|
||||||
|
'') groups)
|
||||||
// (mapAttrs (name: host: host.config.system.build.deployScript) hosts)
|
// (mapAttrs (name: host: host.config.system.build.deployScript) hosts)
|
||||||
|
|
|
||||||
|
|
@ -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}"''
|
||||||
|
|
@ -54,17 +56,19 @@ in {
|
||||||
deploy.groups = [ "all" ];
|
deploy.groups = [ "all" ];
|
||||||
|
|
||||||
system.build.deployScript = ''
|
system.build.deployScript = ''
|
||||||
#!${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 ${
|
||||||
nix copy ${
|
builtins.unsafeDiscardStringContext config.system.build.toplevel.drvPath
|
||||||
if cfg.substitute then "-s" else ""
|
} -o result-${config.networking.hostName}
|
||||||
} --no-check-sigs --to ssh://root@${cfg.ssh.host} ${config.system.build.toplevel}
|
nix copy ${
|
||||||
${secretsScript}
|
if cfg.substitute then "-s" else ""
|
||||||
ssh $NIX_SSHOPTS root@${cfg.ssh.host} "nix-env -p /nix/var/nix/profiles/system -i ${config.system.build.toplevel}"
|
} --no-check-sigs --to ssh://root@${cfg.ssh.host} ${config.system.build.toplevel}
|
||||||
ssh $NIX_SSHOPTS root@${cfg.ssh.host} "/nix/var/nix/profiles/system/bin/switch-to-configuration $1"
|
${secretsScript}
|
||||||
'';
|
ssh $NIX_SSHOPTS root@${cfg.ssh.host} "nix-env -p /nix/var/nix/profiles/system -i ${config.system.build.toplevel}"
|
||||||
|
ssh $NIX_SSHOPTS root@${cfg.ssh.host} "/nix/var/nix/profiles/system/bin/switch-to-configuration $1"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue