diff --git a/.envrc b/.envrc index 9222bda..95ed6fb 100644 --- a/.envrc +++ b/.envrc @@ -1,8 +1,10 @@ -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=" +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=" 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 60de863..cc6a0ad 100644 --- a/home/comma/default.nix +++ b/home/comma/default.nix @@ -5,11 +5,25 @@ 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 af9ec18..3fd8dc9 100644 --- a/home/xdg/default.nix +++ b/home/xdg/default.nix @@ -47,7 +47,6 @@ 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 9096610..f54453b 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,8 +13,6 @@ 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 d73cdc1..b187833 100644 --- a/hosts/nixos/porthos/services.nix +++ b/hosts/nixos/porthos/services.nix @@ -119,13 +119,7 @@ in secretKeyFile = secrets."paperless/secret-key".path; }; # The whole *arr software suite - pirate = { - enable = true; - # ... But not Lidarr because I don't care for music that much - lidarr = { - enable = false; - }; - }; + pirate.enable = true; # Podcast automatic downloader podgrab = { enable = true; diff --git a/modules/services/matrix/default.nix b/modules/services/matrix/default.nix index 8424396..c87b6e4 100644 --- a/modules/services/matrix/default.nix +++ b/modules/services/matrix/default.nix @@ -27,6 +27,8 @@ in }; slidingSync = { + enable = my.mkDisableOption "sliding sync"; + port = mkOption { type = types.port; default = 8009; @@ -105,12 +107,12 @@ in cfg.mailConfigFile ] ++ lib.optional (cfg.secretFile != null) cfg.secretFile; - sliding-sync = { + sliding-sync = lib.mkIf cfg.slidingSync.enable { enable = true; settings = { SYNCV3_SERVER = "https://${matrixDomain}"; - SYNCV3_BINDADDR = "127.0.0.1:${toString cfg.slidingSync.port}"; + SYNCV3_BINDADDR = "127.0.0.1:${cfg.slidingSync.port}"; }; environmentFile = cfg.slidingSync.secretFile; @@ -131,9 +133,6 @@ in "m.identity_server" = { "base_url" = "https://vector.im"; }; - "org.matrix.msc3575.proxy" = { - "url" = "https://matrix-sync.${matrixDomain}"; - }; }; showLabsSettings = true; defaultCountryCode = "FR"; # cocorico @@ -146,20 +145,6 @@ 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... @@ -232,7 +217,6 @@ 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 59f9794..7c341e7 100644 --- a/modules/services/pirate/default.nix +++ b/modules/services/pirate/default.nix @@ -29,7 +29,7 @@ let ]; }; - mkFail2Ban = service: lib.mkIf cfg.${service}.enable { + mkFail2Ban = service: { services.fail2ban.jails = { ${service} = '' enabled = true @@ -47,30 +47,14 @@ let }; }; - mkFullConfig = service: lib.mkIf cfg.${service}.enable (lib.mkMerge [ + mkFullConfig = service: 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 28df477..dcba0aa 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, pkgs, ... }: +{ config, lib, ... }: let cfg = config.my.services.transmission; in @@ -45,7 +45,6 @@ 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 79d3299..b18d075 100644 --- a/modules/services/woodpecker/agent-docker/default.nix +++ b/modules/services/woodpecker/agent-docker/default.nix @@ -27,6 +27,9 @@ 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 4367a26..ba5c6ae 100755 --- a/pkgs/comma/comma +++ b/pkgs/comma/comma @@ -30,4 +30,4 @@ if [ -z "$PROGRAM" ]; then exit 1 fi -nix shell "${COMMA_NIXPKGS_FLAKE:-nixpkgs}#$PROGRAM" -c "$@" +nix shell "${COMMA_PKGS_FLAKE:-nixpkgs}#$PROGRAM" -c "$@" diff --git a/templates/c++-cmake/.envrc b/templates/c++-cmake/.envrc index ccf325e..95ed6fb 100644 --- a/templates/c++-cmake/.envrc +++ b/templates/c++-cmake/.envrc @@ -1,5 +1,10 @@ -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=" +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=" 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 ccf325e..95ed6fb 100644 --- a/templates/c++-meson/.envrc +++ b/templates/c++-meson/.envrc @@ -1,5 +1,10 @@ -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=" +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=" fi use flake + +watch_file ./flake/checks.nix +watch_file ./flake/dev-shells.nix + +eval "$shellHooks"