commit 8b45999ef3f3161df80d33e478c923a1e405b624
parent d86fd0cc7d38316986d080504149fe7a6ecf2fdb
Author: Vincent Demeester <vincent@sbr.pm>
Date: Mon, 13 May 2024 17:26:41 +0200
systems: make sure we can build 23.11 and 24.05 (unstable) at the same time
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
5 files changed, 44 insertions(+), 37 deletions(-)
diff --git a/systems/modules/hardware/audio.nix b/systems/modules/hardware/audio.nix
@@ -1,7 +1,8 @@
{ config, lib, pkgs, ... }:
let
- inherit (lib) mkEnableOption mkIf mkMerge mkOption types;
+ inherit (lib) mkEnableOption mkIf mkMerge mkOption types versionOlder;
cfg = config.modules.hardware.audio;
+ stable = versionOlder config.system.nixos.release "24.05";
in
{
options.modules.hardware.audio = {
@@ -38,6 +39,7 @@ in
pulse.enable = true;
wireplumber = {
enable = true;
+ } // (if stable then { } else {
configPackages = [
(pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" ''
bluez_monitor.properties = {
@@ -48,7 +50,8 @@ in
}
'')
];
- };
+ });
+ } // (if stable then { } else {
extraConfig = {
pipewire-pulse = {
"50-network-party.conf" = {
@@ -66,7 +69,7 @@ in
};
};
};
- };
+ });
networking.firewall = {
allowedTCPPorts = [ 6001 6002 ];
};
diff --git a/systems/modules/hardware/bluetooth.nix b/systems/modules/hardware/bluetooth.nix
@@ -1,8 +1,7 @@
{ config, lib, pkgs, ... }:
let
- inherit (lib) mkEnableOption mkIf mkMerge versionOlder;
+ inherit (lib) mkEnableOption mkIf mkMerge;
cfg = config.modules.hardware.bluetooth;
- stable = versionOlder config.system.nixos.release "21.05";
in
{
options.modules.hardware.bluetooth = {
@@ -21,20 +20,11 @@ in
# support, so it must be selected here.
package = pkgs.pulseaudioFull;
};
- })
- (mkIf (stable && config.modules.hardware.audio.enable) {
- hardware.bluetooth.extraConfig = ''
- [General]
- Enable=Source,Sink,Media,Socket
- '';
- })
- (mkIf ((!stable) && config.modules.hardware.audio.enable)
- {
- hardware.bluetooth.settings = {
- General = {
- Enable = "Source,Sink,Media,Socket";
- };
+ hardware.bluetooth.settings = {
+ General = {
+ Enable = "Source,Sink,Media,Socket";
};
- })
+ };
+ })
]);
}
diff --git a/systems/modules/services/avahi.nix b/systems/modules/services/avahi.nix
@@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }:
-with lib;
let
+ inherit (lib) mkEnableOption mkIf versionOlder;
cfg = config.modules.services.avahi;
+ stable = versionOlder config.system.nixos.release "24.05";
in
{
options = {
@@ -10,18 +11,24 @@ in
enable = mkEnableOption "Enable avahi profile";
};
};
- config = mkIf cfg.enable {
- services = {
- avahi = {
- enable = true;
- ipv4 = true;
- ipv6 = true;
- nssmdns4 = true;
- publish = {
+
+ config = mkIf cfg.enable
+ {
+ services = {
+ avahi = {
enable = true;
- userServices = true;
- };
+ ipv4 = true;
+ ipv6 = true;
+ publish = {
+ enable = true;
+ userServices = true;
+ };
+ } // (if stable
+ then {
+ nssmdns = true;
+ } else {
+ nssmdns4 = true;
+ });
};
};
- };
}
diff --git a/users/vincent/core/gpg.nix b/users/vincent/core/gpg.nix
@@ -1,7 +1,7 @@
{ pkgs, lib, nixosConfig, ... }:
let
- pinentry = if (nixosConfig.modules.desktop.enable) then pkgs.pinentry-gnome3 else pkgs.pinentry-tty;
+ stable = lib.versionOlder nixosConfig.system.nixos.release "24.05";
in
{
home.packages = with pkgs; [ gnupg ];
@@ -11,8 +11,11 @@ in
enableSshSupport = true;
enableExtraSocket = true;
defaultCacheTtlSsh = 7200;
- pinentryPackage = pinentry;
- };
+ } // (if stable then {
+ pinentryFlavor = if (nixosConfig.modules.desktop.enable) then "gnome3" else "tty";
+ } else {
+ pinentryPackage = if (nixosConfig.modules.desktop.enable) then pkgs.pinentry-gnome3 else pkgs.pinentry-tty;
+ });
};
}
diff --git a/users/vincent/core/zsh.nix b/users/vincent/core/zsh.nix
@@ -1,6 +1,7 @@
-{ config, lib, pkgs, ... }:
+{ config, lib, nixosConfig, pkgs, ... }:
let
shellConfig = import ./shell.nix { inherit config lib pkgs; };
+ stable = lib.versionOlder nixosConfig.system.nixos.release "24.05";
in
{
home.packages = with pkgs; [
@@ -18,7 +19,6 @@ in
programs.zsh = {
enable = true;
- autosuggestion.enable = true;
enableCompletion = true;
autocd = true;
dotDir = ".config/zsh";
@@ -163,5 +163,9 @@ in
}
];
shellAliases = shellConfig.aliases;
- };
+ } // (if stable then {
+ enableAutosuggestions = true;
+ } else {
+ autosuggestion.enable = true;
+ });
}