diff --git a/.envrc b/.envrc index 95ed6fb..9222bda 100644 --- a/.envrc +++ b/.envrc @@ -1,10 +1,8 @@ -if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then - source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" +if ! has nix_direnv_version || ! nix_direnv_version 2.4.0; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.4.0/direnvrc" "sha256-XQzUAvL6pysIJnRJyR7uVpmUSZfc7LSgWQwq/4mBr1U=" fi +nix_direnv_watch_file ./flake/checks.nix +nix_direnv_watch_file ./flake/dev-shells.nix + use flake - -watch_file ./flake/checks.nix -watch_file ./flake/dev-shells.nix - -eval "$shellHooks" diff --git a/home/comma/default.nix b/home/comma/default.nix index cc6a0ad..60de863 100644 --- a/home/comma/default.nix +++ b/home/comma/default.nix @@ -5,25 +5,11 @@ in { options.my.home.comma = with lib; { enable = my.mkDisableOption "comma configuration"; - - pkgsFlake = mkOption { - type = types.str; - default = "pkgs"; - example = "nixpkgs"; - description = '' - Which flake from the registry should be used with - nix shell. - ''; - }; }; config = lib.mkIf cfg.enable { home.packages = with pkgs; [ ambroisie.comma ]; - - home.sessionVariables = { - COMMA_PKGS_FLAKE = cfg.pkgsFlake; - }; }; } diff --git a/home/xdg/default.nix b/home/xdg/default.nix index 3fd8dc9..af9ec18 100644 --- a/home/xdg/default.nix +++ b/home/xdg/default.nix @@ -47,6 +47,7 @@ in LESSHISTFILE = "${dataHome}/less/history"; LESSKEY = "${configHome}/less/lesskey"; PSQL_HISTORY = "${dataHome}/psql_history"; + REPO_CONFIG_DIR = "${configHome}/repo"; REDISCLI_HISTFILE = "${dataHome}/redis/rediscli_history"; XCOMPOSECACHE = "${dataHome}/X11/xcompose"; }; diff --git a/hosts/homes/ambroisie@mousqueton/default.nix b/hosts/homes/ambroisie@mousqueton/default.nix index f54453b..9096610 100644 --- a/hosts/homes/ambroisie@mousqueton/default.nix +++ b/hosts/homes/ambroisie@mousqueton/default.nix @@ -1,5 +1,5 @@ # Google Cloudtop configuration -{ ... }: +{ lib, pkgs, ... }: { # Google specific configuration home.homeDirectory = "/usr/local/google/home/ambroisie"; @@ -13,6 +13,8 @@ LD_PRELOAD = "/lib/x86_64-linux-gnu/libnss_cache.so.2\${LD_PRELOAD:+:}$LD_PRELOAD"; }; + programs.git.package = lib.mkForce pkgs.emptyDirectory; + # I use scripts that use the passthrough sequence often on this host my.home.tmux.enablePassthrough = true; } diff --git a/hosts/nixos/porthos/services.nix b/hosts/nixos/porthos/services.nix index b187833..d73cdc1 100644 --- a/hosts/nixos/porthos/services.nix +++ b/hosts/nixos/porthos/services.nix @@ -119,7 +119,13 @@ in secretKeyFile = secrets."paperless/secret-key".path; }; # The whole *arr software suite - pirate.enable = true; + pirate = { + enable = true; + # ... But not Lidarr because I don't care for music that much + lidarr = { + enable = false; + }; + }; # Podcast automatic downloader podgrab = { enable = true; diff --git a/modules/services/matrix/default.nix b/modules/services/matrix/default.nix index c87b6e4..8424396 100644 --- a/modules/services/matrix/default.nix +++ b/modules/services/matrix/default.nix @@ -27,8 +27,6 @@ in }; slidingSync = { - enable = my.mkDisableOption "sliding sync"; - port = mkOption { type = types.port; default = 8009; @@ -107,12 +105,12 @@ in cfg.mailConfigFile ] ++ lib.optional (cfg.secretFile != null) cfg.secretFile; - sliding-sync = lib.mkIf cfg.slidingSync.enable { + sliding-sync = { enable = true; settings = { SYNCV3_SERVER = "https://${matrixDomain}"; - SYNCV3_BINDADDR = "127.0.0.1:${cfg.slidingSync.port}"; + SYNCV3_BINDADDR = "127.0.0.1:${toString cfg.slidingSync.port}"; }; environmentFile = cfg.slidingSync.secretFile; @@ -133,6 +131,9 @@ in "m.identity_server" = { "base_url" = "https://vector.im"; }; + "org.matrix.msc3575.proxy" = { + "url" = "https://matrix-sync.${matrixDomain}"; + }; }; showLabsSettings = true; defaultCountryCode = "FR"; # cocorico @@ -145,6 +146,20 @@ in }; }; } + # Dummy VHosts for port collision detection + { + subdomain = "matrix-federation"; + port = federationPort.private; + } + { + subdomain = "matrix-client"; + port = clientPort.private; + } + # Sliding sync + { + subdomain = "matrix-sync"; + inherit (cfg.slidingSync) port; + } ]; # Those are too complicated to use my wrapper... @@ -217,6 +232,7 @@ in client = { "m.homeserver" = { "base_url" = "https://${matrixDomain}"; }; "m.identity_server" = { "base_url" = "https://vector.im"; }; + "org.matrix.msc3575.proxy" = { "url" = "https://matrix-sync.${matrixDomain}"; }; }; # ACAO required to allow element-web on any URL to request this json file in diff --git a/modules/services/pirate/default.nix b/modules/services/pirate/default.nix index 7c341e7..59f9794 100644 --- a/modules/services/pirate/default.nix +++ b/modules/services/pirate/default.nix @@ -29,7 +29,7 @@ let ]; }; - mkFail2Ban = service: { + mkFail2Ban = service: lib.mkIf cfg.${service}.enable { services.fail2ban.jails = { ${service} = '' enabled = true @@ -47,14 +47,30 @@ let }; }; - mkFullConfig = service: lib.mkMerge [ + mkFullConfig = service: lib.mkIf cfg.${service}.enable (lib.mkMerge [ (mkService service) (mkRedirection service) - ]; + ]); in { options.my.services.pirate = { enable = lib.mkEnableOption "Media automation"; + + bazarr = { + enable = lib.my.mkDisableOption "Bazarr"; + }; + + lidarr = { + enable = lib.my.mkDisableOption "Lidarr"; + }; + + radarr = { + enable = lib.my.mkDisableOption "Radarr"; + }; + + sonarr = { + enable = lib.my.mkDisableOption "Sonarr"; + }; }; config = lib.mkIf cfg.enable (lib.mkMerge [ diff --git a/modules/services/transmission/default.nix b/modules/services/transmission/default.nix index dcba0aa..28df477 100644 --- a/modules/services/transmission/default.nix +++ b/modules/services/transmission/default.nix @@ -3,7 +3,7 @@ # Inspired by [1] # # [1]: https://github.com/delroth/infra.delroth.net/blob/master/roles/seedbox.nix -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let cfg = config.my.services.transmission; in @@ -45,6 +45,7 @@ in config = lib.mkIf cfg.enable { services.transmission = { enable = true; + package = pkgs.transmission_4; group = "media"; downloadDirPermissions = "775"; diff --git a/modules/services/woodpecker/agent-docker/default.nix b/modules/services/woodpecker/agent-docker/default.nix index b18d075..79d3299 100644 --- a/modules/services/woodpecker/agent-docker/default.nix +++ b/modules/services/woodpecker/agent-docker/default.nix @@ -27,9 +27,6 @@ in # Make sure it is activated in that case my.system.docker.enable = true; - # FIXME: figure out the issue - services.unbound.resolveLocalQueries = false; - # Adjust runner service for nix usage systemd.services.woodpecker-agent-docker = { after = [ "docker.socket" ]; # Needs the socket to be available diff --git a/pkgs/comma/comma b/pkgs/comma/comma index ba5c6ae..4367a26 100755 --- a/pkgs/comma/comma +++ b/pkgs/comma/comma @@ -30,4 +30,4 @@ if [ -z "$PROGRAM" ]; then exit 1 fi -nix shell "${COMMA_PKGS_FLAKE:-nixpkgs}#$PROGRAM" -c "$@" +nix shell "${COMMA_NIXPKGS_FLAKE:-nixpkgs}#$PROGRAM" -c "$@" diff --git a/templates/c++-cmake/.envrc b/templates/c++-cmake/.envrc index 95ed6fb..ccf325e 100644 --- a/templates/c++-cmake/.envrc +++ b/templates/c++-cmake/.envrc @@ -1,10 +1,5 @@ -if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then - source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" +if ! has nix_direnv_version || ! nix_direnv_version 2.4.0; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.4.0/direnvrc" "sha256-XQzUAvL6pysIJnRJyR7uVpmUSZfc7LSgWQwq/4mBr1U=" fi use flake - -watch_file ./flake/checks.nix -watch_file ./flake/dev-shells.nix - -eval "$shellHooks" diff --git a/templates/c++-meson/.envrc b/templates/c++-meson/.envrc index 95ed6fb..ccf325e 100644 --- a/templates/c++-meson/.envrc +++ b/templates/c++-meson/.envrc @@ -1,10 +1,5 @@ -if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then - source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" +if ! has nix_direnv_version || ! nix_direnv_version 2.4.0; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.4.0/direnvrc" "sha256-XQzUAvL6pysIJnRJyR7uVpmUSZfc7LSgWQwq/4mBr1U=" fi use flake - -watch_file ./flake/checks.nix -watch_file ./flake/dev-shells.nix - -eval "$shellHooks"