Enable compatibility with NixOS < 24.15

This commit is contained in:
Mikael 2024-07-30 18:20:48 +02:00
parent 710cdfc130
commit 5cd9d98ac5
4 changed files with 21 additions and 7 deletions

View file

@ -7,7 +7,12 @@ let
sparseCheckout = [ "!/*" "/chrome" "/content" ];
hash = lib.fakeHash;
};
in lib.mkIf osConfig.hardware.graphics.enable {
graphical =
if lib.versionAtLeast osConfig.system.stateVersion "24.11"
then osConfig.hardware.graphics.enable
else osConfig.hardware.opengl.enable;
in lib.mkIf graphical {
programs.firefox = {
enable = true;
package = pkgs.firefox;

View file

@ -306,7 +306,7 @@ inputs: { config, lib, pkgs, osConfig, ... }: {
enable = osConfig.hardware.gpgSmartcards.enable;
enableSshSupport = true;
pinentryPackage =
if osConfig.hardware.graphics.enable
if osConfig.hardware.graphics.enable or osConfig.hardware.opengl.enable
then pkgs.pinentry-gtk2
else pkgs.pinentry-curses;
};

View file

@ -1,10 +1,14 @@
inputs: user: { config, lib, pkgs, ... }: {
inputs: user: { config, lib, pkgs, ... }:
let
graphical =
if lib.versionAtLeast config.system.stateVersion "24.11"
then config.hardware.graphics.enable
else config.hardware.opengl.enable;
in {
imports = [ inputs.home-manager.nixosModules.home-manager ];
environment.etc."xkb/symbols/greedy" =
lib.mkIf config.hardware.graphics.enable {
source = ./greedy.xkb;
};
lib.mkIf graphical { source = ./greedy.xkb; };
home-manager = {
useUserPackages = lib.mkDefault true;

View file

@ -19,7 +19,12 @@ let
wpctl = "${osConfig.services.pipewire.wireplumber.package}/bin/wpctl";
xdg-open = "${pkgs.xdg-utils}/bin/xdg-open";
};
in lib.mkIf osConfig.hardware.graphics.enable {
graphical =
if lib.versionAtLeast osConfig.system.stateVersion "24.11"
then osConfig.hardware.graphics.enable
else osConfig.hardware.opengl.enable;
in lib.mkIf graphical {
home.packages = with pkgs; [
# Image processing
oxipng