diff --git a/flake.lock b/flake.lock index e6cb2dd..3534b21 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1652079807, - "narHash": "sha256-aCs1EwO9K2yJ1DcT4+4g7BMlJBWP7Xjs4k5i8ueR8PU=", + "lastModified": 1653594315, + "narHash": "sha256-kJ0ENmnQJ4qL2FeYKZba9kvv1KmIuB3NVpBwMeI7AJQ=", "owner": "serokell", "repo": "deploy-rs", - "rev": "690f698b18345d894784752b5fa93b9b8f3cc29f", + "rev": "184349d8149436748986d1bdba087e4149e9c160", "type": "github" }, "original": { @@ -61,11 +61,11 @@ ] }, "locked": { - "lastModified": 1652167840, - "narHash": "sha256-Qx//y33FkhUun+en60SakO9iQPPLu18fUpr3kKTkif8=", + "lastModified": 1653943687, + "narHash": "sha256-xXW9t24HLf89+n/92kOqRRfOBE3KDna+9rAOefs5WSQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "4293902b64990d43847fe90e50ef7908f7dc1e30", + "rev": "8f3e26705178cc8c1d982d37d881fc0d5b5b1837", "type": "github" }, "original": { @@ -119,11 +119,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1652020977, - "narHash": "sha256-9hDlNbrxzD/pLlXmoQ6gzxbYiSAKrj7uHYUWNByLFlI=", + "lastModified": 1653996475, + "narHash": "sha256-r/UA7h3Dfgf4dlOCkakpqejf1Tagfb+6T+9OdT0qBgU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3c5ae9be1f18c790ea890ef8decbd0946c0b4c04", + "rev": "ec6eaba9dfcfdd11547d75a193e91e26701bf7e3", "type": "github" }, "original": { @@ -135,11 +135,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1652082323, - "narHash": "sha256-7GSVLvfCJtH9dJ3om9Lg4fsi9UKvoxxR69gUTcx0ol8=", + "lastModified": 1653931853, + "narHash": "sha256-O3wncIouj9x7gBPntzHeK/Hkmm9M1SGlYq7JI7saTAE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2a3aac479caeba0a65b2ad755fe5f284f1fde74d", + "rev": "f1c167688a6f81f4a51ab542e5f476c8c595e457", "type": "github" }, "original": { diff --git a/home/apps/vivaldi.nix b/home/apps/vivaldi.nix index 9ab2280..ed271da 100644 --- a/home/apps/vivaldi.nix +++ b/home/apps/vivaldi.nix @@ -1,3 +1,7 @@ { config, pkgs, ... }: { - home.packages = with pkgs; [ vivaldi vivaldi-ffmpeg-codecs vivaldi-widevine ]; + home.packages = with pkgs; [ + vivaldi + vivaldi-ffmpeg-codecs + #vivaldi-widevine + ]; } diff --git a/home/programming/editors/vscode.nix b/home/programming/editors/vscode.nix index d693f8b..9757301 100644 --- a/home/programming/editors/vscode.nix +++ b/home/programming/editors/vscode.nix @@ -22,18 +22,18 @@ in { }; }; # make config changeable - home = { - activation = { - afterWriteBoundary = { - after = [ "writeBoundary" ]; - before = [ ]; - data = '' - vscodeDir="${userDir}" - $DRY_RUN_CMD cat "$vscodeDir/settings.json" > "$vscodeDir/settings_whatever.json" - $DRY_RUN_CMD rm -f "$vscodeDir/settings.json" - $DRY_RUN_CMD cp "$vscodeDir/settings_whatever.json" "$vscodeDir/settings.json" - ''; - }; - }; - }; + #home = { + # activation = { + # afterWriteBoundary = { + # after = [ "writeBoundary" ]; + # before = [ ]; + # data = '' + # vscodeDir="${userDir}" + # $DRY_RUN_CMD cat "$vscodeDir/settings.json" > "$vscodeDir/settings_whatever.json" + # $DRY_RUN_CMD rm -f "$vscodeDir/settings.json" + # $DRY_RUN_CMD cp "$vscodeDir/settings_whatever.json" "$vscodeDir/settings.json" + # ''; + # }; + # }; + #}; } diff --git a/hosts/hetzner-vm/hetzner-vm.nix b/hosts/hetzner-vm/hetzner-vm.nix index 77c4158..1993318 100644 --- a/hosts/hetzner-vm/hetzner-vm.nix +++ b/hosts/hetzner-vm/hetzner-vm.nix @@ -16,7 +16,7 @@ hosts.hetzner-vm.services.quassel hosts.hetzner-vm.services.mpd hosts.hetzner-vm.services.storage-sftp - hosts.hetzner-vm.services.misskey + #hosts.hetzner-vm.services.misskey (modulesPath + "/profiles/qemu-guest.nix") @@ -40,6 +40,8 @@ networking.hostName = "hetzner-vm"; time.timeZone = "Europe/London"; + systemd.services.systemd-networkd-wait-online.enable = false; + networking.firewall.enable = true; networking.firewall.allowPing = true; networking.firewall.allowedTCPPorts = [ 22 ]; diff --git a/hosts/hetzner-vm/services/invidious.nix b/hosts/hetzner-vm/services/invidious.nix index 0ce25a3..3044f78 100644 --- a/hosts/hetzner-vm/services/invidious.nix +++ b/hosts/hetzner-vm/services/invidious.nix @@ -1,8 +1,8 @@ { inputs, pkgs, ... }: { services.invidious = { enable = true; - package = - inputs.nixpkgs-stable.outputs.legacyPackages.${pkgs.system}.invidious; + #package = + # inputs.nixpkgs-stable.outputs.legacyPackages.${pkgs.system}.invidious; port = 3000; settings = { full_refresh = true; diff --git a/hosts/hetzner-vm/services/misskey.nix b/hosts/hetzner-vm/services/misskey.nix index ac47427..bc33a71 100644 --- a/hosts/hetzner-vm/services/misskey.nix +++ b/hosts/hetzner-vm/services/misskey.nix @@ -3,51 +3,35 @@ let misskeyDomain = "social.owo.monster"; misskeyPort = 3020; redisPort = 3019; - - # USE NPX YARN - - misskeyBuildDeps = with pkgs; [ - gccStdenv - nodePackages.node-gyp-build - python3 - pkg-config - vips - nodePackages.npm - ]; - - misskeyPackages = with pkgs; [ - git - jq - - - nodejs - nodePackages.npm - - ffmpeg - ] ++ misskeyBuildDeps; in { users.users."misskey" = { isNormalUser = true; createHome = true; + extraGroups = [ "docker" ]; }; - home-manager.users."misskey".home.packages = misskeyPackages; + home-manager.users."misskey".home.packages = with pkgs; [ + git + docker-compose + ]; + + virtualisation.docker.enable = true; # make .config/default.yml a symlink to /etc/misskey.yml - environment.etc."misskey.yml".text = pkgs.lib.generators.toYAML {} { + environment.etc."misskey.yml".text = pkgs.lib.generators.toYAML { } { url = "https://${misskeyDomain}/"; port = misskeyPort; db = { - host = "localhost"; - port = "5432"; - db = "misskey"; - user = "misskey"; - pass = "a"; + host = "localhost"; + port = "5432"; + db = "misskey"; + user = "misskey"; + pass = "a"; }; redis = { - host = "127.0.0.1"; - port = redisPort; + host = "127.0.0.1"; + port = redisPort; }; }; diff --git a/hosts/hetzner-vm/services/vault.nix b/hosts/hetzner-vm/services/vault.nix index f7cd6d4..4a2a972 100644 --- a/hosts/hetzner-vm/services/vault.nix +++ b/hosts/hetzner-vm/services/vault.nix @@ -13,5 +13,21 @@ enableACME = true; locations = { "/" = { proxyPass = "http://127.0.0.1:8200"; }; }; }; + + services.nginx.logError = "/var/log/nginx/debug.log debug"; + + services.nginx.upstreams.chaos-github-vaultui = { + servers = { "chaoticryptidz.gitlab.io" = {}; }; + }; + + services.nginx.virtualHosts."vaultui.owo.monster" = { + forceSSL = true; + enableACME = true; + locations = { + "~ ^/(.*)" = { + proxyPass = "http://chaos-github-vaultui/VaultUI/$1"; + }; + }; + }; #networking.firewall.allowedTCPPorts = [ 8200 ]; } diff --git a/hosts/lappy/lappy.nix b/hosts/lappy/lappy.nix index 2dffa2a..42c283f 100644 --- a/hosts/lappy/lappy.nix +++ b/hosts/lappy/lappy.nix @@ -100,7 +100,7 @@ in { networking.firewall.allowPing = true; # Allow Soulseek - networking.firewall.allowedTCPPorts = [ 22 2235 ]; + networking.firewall.allowedTCPPorts = [ 8080 2235 ]; networking.firewall.allowedTCPPortRanges = [ # Allow aria2 to work { @@ -124,6 +124,8 @@ in { } ]; + systemd.services.NetworkManager-wait-online.enable = false; + # let vscode, vivaldi, etc work. security.unprivilegedUsernsClone = true; diff --git a/outputs.nix b/outputs.nix index 1e9e523..3060c2e 100644 --- a/outputs.nix +++ b/outputs.nix @@ -20,7 +20,7 @@ in { nano bat exa - deploy-rs.packages."x86_64-linux".deploy-rs + #inputs.deploy-rs.packages."x86_64-linux".deploy-rs (pkgs-x86_64-linux.callPackage ./extras/mk-enc-usb.nix { }) (pkgs-x86_64-linux.callPackage ./extras/mk-lappy-ssd.nix { }) ]; diff --git a/overlay/alsa-lib/alsa-plugin-conf-multilib.patch b/overlay/alsa-lib/alsa-plugin-conf-multilib.patch deleted file mode 100644 index b17df9a..0000000 --- a/overlay/alsa-lib/alsa-plugin-conf-multilib.patch +++ /dev/null @@ -1,232 +0,0 @@ -diff --git a/src/control/control.c b/src/control/control.c -index d66ed75..42cecad 100644 ---- a/src/control/control.c -+++ b/src/control/control.c -@@ -838,6 +838,10 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name, - #ifndef PIC - extern void *snd_control_open_symbols(void); - #endif -+ -+ snd_config_t *libs = NULL; -+ const char *libs_lib = NULL; -+ - if (snd_config_get_type(ctl_conf) != SND_CONFIG_TYPE_COMPOUND) { - if (name) - SNDERR("Invalid type for CTL %s definition", name); -@@ -879,6 +883,19 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name, - SNDERR("Invalid type for %s", id); - goto _err; - } -+ -+ continue; -+ } -+ // Handle an array of extra libs. -+ if (strcmp(id, "libs") == 0) { -+ if (snd_config_get_type(n) != SND_CONFIG_TYPE_COMPOUND) { -+ SNDERR("Invalid type for libs definition in CTL %s definition", -+ str); -+ goto _err; -+ } -+ -+ libs = n; -+ - continue; - } - if (strcmp(id, "open") == 0) { -@@ -903,7 +920,62 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name, - open_name = buf; - sprintf(buf, "_snd_ctl_%s_open", str); - } -- if (!lib) { -+ -+#ifndef PIC -+ snd_control_open_symbols(); -+#endif -+ -+ // Normal alsa behaviour when there is no libs array. -+ if (!libs) { -+ if (lib) { -+ open_func = snd_dlobj_cache_get(lib, open_name, -+ SND_DLSYM_VERSION(SND_CONTROL_DLSYM_VERSION), 1); -+ } -+ } -+ // Handle libs array. -+ // Suppresses error messages if any function is loaded successfully. -+ else { -+ if (lib) { -+ open_func = snd_dlobj_cache_get(lib, open_name, -+ SND_DLSYM_VERSION(SND_CONTROL_DLSYM_VERSION), 0); -+ } -+ -+ if (!open_func) { -+ snd_config_for_each(i, next, libs) { -+ snd_config_t *n = snd_config_iterator_entry(i); -+ -+ err = snd_config_get_string(n, &libs_lib); -+ if (err < 0) { -+ SNDERR("Invalid entry in CTL %s libs definition", str); -+ goto _err; -+ } -+ -+ if (!open_func) { -+ open_func = snd_dlobj_cache_get(libs_lib, open_name, -+ SND_DLSYM_VERSION(SND_CONTROL_DLSYM_VERSION), 0); -+ } -+ } -+ } -+ -+ // Print error messages. -+ if (!open_func) { -+ if (lib) { -+ SNDERR("Either %s cannot be opened or %s was not defined inside", -+ lib, open_name); -+ } -+ -+ snd_config_for_each(i, next, libs) { -+ snd_config_t *n = snd_config_iterator_entry(i); -+ -+ snd_config_get_string(n, &libs_lib); -+ SNDERR("Either %s cannot be opened or %s was not defined inside", -+ libs_lib, open_name); -+ } -+ } -+ } -+ -+ // Look in ALSA_PLUGIN_DIR iff we found nowhere else to look. -+ if (!lib && (!libs || !libs_lib)) { - const char *const *build_in = build_in_ctls; - while (*build_in) { - if (!strcmp(*build_in, str)) -@@ -919,12 +991,11 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name, - lib = buf1; - sprintf(buf1, "%s/libasound_module_ctl_%s.so", ALSA_PLUGIN_DIR, str); - } -- } --#ifndef PIC -- snd_control_open_symbols(); --#endif -- open_func = snd_dlobj_cache_get(lib, open_name, -+ -+ open_func = snd_dlobj_cache_get(lib, open_name, - SND_DLSYM_VERSION(SND_CONTROL_DLSYM_VERSION), 1); -+ } -+ - if (open_func) { - err = open_func(ctlp, name, ctl_root, ctl_conf, mode); - if (err >= 0) { -diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c -index 2e24338..7f489f4 100644 ---- a/src/pcm/pcm.c -+++ b/src/pcm/pcm.c -@@ -2116,6 +2116,10 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name, - #ifndef PIC - extern void *snd_pcm_open_symbols(void); - #endif -+ -+ snd_config_t *libs = NULL; -+ const char *libs_lib = NULL; -+ - if (snd_config_get_type(pcm_conf) != SND_CONFIG_TYPE_COMPOUND) { - char *val; - id = NULL; -@@ -2160,6 +2164,19 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name, - SNDERR("Invalid type for %s", id); - goto _err; - } -+ -+ continue; -+ } -+ // Handle an array of extra libs. -+ if (strcmp(id, "libs") == 0) { -+ if (snd_config_get_type(n) != SND_CONFIG_TYPE_COMPOUND) { -+ SNDERR("Invalid type for libs definition in PCM %s definition", -+ str); -+ goto _err; -+ } -+ -+ libs = n; -+ - continue; - } - if (strcmp(id, "open") == 0) { -@@ -2184,7 +2201,62 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name, - open_name = buf; - sprintf(buf, "_snd_pcm_%s_open", str); - } -- if (!lib) { -+ -+#ifndef PIC -+ snd_pcm_open_symbols(); /* this call is for static linking only */ -+#endif -+ -+ // Normal alsa behaviour when there is no libs array. -+ if (!libs) { -+ if (lib) { -+ open_func = snd_dlobj_cache_get(lib, open_name, -+ SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION), 1); -+ } -+ } -+ // Handle libs array. -+ // Suppresses error messages if any function is loaded successfully. -+ else { -+ if (lib) { -+ open_func = snd_dlobj_cache_get(lib, open_name, -+ SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION), 0); -+ } -+ -+ if (!open_func) { -+ snd_config_for_each(i, next, libs) { -+ snd_config_t *n = snd_config_iterator_entry(i); -+ -+ err = snd_config_get_string(n, &libs_lib); -+ if (err < 0) { -+ SNDERR("Invalid entry in PCM %s libs definition", str); -+ goto _err; -+ } -+ -+ if (!open_func) { -+ open_func = snd_dlobj_cache_get(libs_lib, open_name, -+ SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION), 0); -+ } -+ } -+ } -+ -+ // Print error messages. -+ if (!open_func) { -+ if (lib) { -+ SNDERR("Either %s cannot be opened or %s was not defined inside", -+ lib, open_name); -+ } -+ -+ snd_config_for_each(i, next, libs) { -+ snd_config_t *n = snd_config_iterator_entry(i); -+ -+ snd_config_get_string(n, &libs_lib); -+ SNDERR("Either %s cannot be opened or %s was not defined inside", -+ libs_lib, open_name); -+ } -+ } -+ } -+ -+ // Look in ALSA_PLUGIN_DIR iff we found nowhere else to look. -+ if (!lib && (!libs || !libs_lib)) { - const char *const *build_in = build_in_pcms; - while (*build_in) { - if (!strcmp(*build_in, str)) -@@ -2200,12 +2272,11 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name, - lib = buf1; - sprintf(buf1, "%s/libasound_module_pcm_%s.so", ALSA_PLUGIN_DIR, str); - } -- } --#ifndef PIC -- snd_pcm_open_symbols(); /* this call is for static linking only */ --#endif -- open_func = snd_dlobj_cache_get(lib, open_name, -+ -+ open_func = snd_dlobj_cache_get(lib, open_name, - SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION), 1); -+ } -+ - if (open_func) { - err = open_func(pcmp, name, pcm_root, pcm_conf, stream, mode); - if (err >= 0) { diff --git a/overlay/alsa-lib/default.nix b/overlay/alsa-lib/default.nix deleted file mode 100644 index 99477c2..0000000 --- a/overlay/alsa-lib/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ lib, stdenv, fetchurl, alsa-topology-conf, alsa-ucm-conf }: - -stdenv.mkDerivation rec { - pname = "alsa-lib"; - version = "1.2.6.1"; - - src = fetchurl { - url = "mirror://alsa/lib/${pname}-${version}.tar.bz2"; - hash = "sha256-rVgpk9Us21+xWaC+q2CmrFfqsMwb34XcTbbWGX8CMz8="; - }; - - patches = [ - # Add a "libs" field to the syntax recognized in the /etc/asound.conf file. - # The nixos modules for pulseaudio, jack, and pipewire are leveraging this - # "libs" field to declare locations for both native and 32bit plugins, in - # order to support apps with 32bit sound running on x86_64 architecture. - ./alsa-plugin-conf-multilib.patch - ]; - - enableParallelBuilding = true; - - postInstall = '' - ln -s ${alsa-ucm-conf}/share/alsa/{ucm,ucm2} $out/share/alsa - ln -s ${alsa-topology-conf}/share/alsa/topology $out/share/alsa - ''; - - outputs = [ "out" "dev" ]; - - meta = with lib; { - homepage = "http://www.alsa-project.org/"; - description = "ALSA, the Advanced Linux Sound Architecture libraries"; - - longDescription = '' - The Advanced Linux Sound Architecture (ALSA) provides audio and - MIDI functionality to the Linux-based operating system. - ''; - - license = licenses.lgpl21Plus; - platforms = platforms.linux; - maintainers = with maintainers; [ l-as ]; - }; -} diff --git a/overlay/default.nix b/overlay/default.nix index 2ea5c1c..f4221f8 100644 --- a/overlay/default.nix +++ b/overlay/default.nix @@ -7,11 +7,7 @@ final: prev: { # needs a specific version of lsquic lsquic = final.callPackage ./invidious-latest/lsquic.nix { }; }; - multimc = prev.polymc.override { - msaClientID = "499546d9-bbfe-4b9b-a086-eb3d75afb78f"; - }; + roc-toolkit-patched = final.callPackage ./roc-toolkit-patched { }; roc-send-pcm = final.callPackage ./roc-send-pcm { }; - vivaldi = - prev.vivaldi.override { alsa-lib = final.callPackage ./alsa-lib { }; }; } diff --git a/profiles/sound/pipewire/default.nix b/profiles/sound/pipewire/default.nix index 4224d0a..ae27238 100644 --- a/profiles/sound/pipewire/default.nix +++ b/profiles/sound/pipewire/default.nix @@ -1,4 +1,5 @@ _: { + sound.enable = true; security.rtkit.enable = true; services.pipewire = { enable = true; @@ -15,27 +16,5 @@ _: { }; wireplumber.enable = false; media-session.enable = true; - media-session.config.bluez-monitor.rules = [ - { - matches = [{ "device.name" = "~bluez_card.*"; }]; - actions = { - "update-props" = { - "bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ]; - "bluez5.sbc-xq-support" = true; - }; - }; - } - { - matches = [ - # Matches all sources - { - "node.name" = "~bluez_input.*"; - } - # Matches all outputs - { "node.name" = "~bluez_output.*"; } - ]; - actions = { "node.pause-on-idle" = false; }; - } - ]; }; } diff --git a/users/chaos.nix b/users/chaos.nix index 7ffc6bc..88f40cb 100644 --- a/users/chaos.nix +++ b/users/chaos.nix @@ -12,6 +12,7 @@ "input" "uinput" "audio" + "rtkit" ]; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAeN3T1aZkTm5xS0b66cRDyKUbdEQCFyzVWXeW+eIbsa chaos@chaos"