Conditional on options as a mechanism for ensuring compatibility across NixOS versions?

This commit is contained in:
Daniel Flanagan 2024-07-31 10:24:55 -05:00
parent dbabc70e2f
commit 594078f84f
2 changed files with 23 additions and 33 deletions

View file

@ -233,32 +233,7 @@
flakeInputs = self.inputs; flakeInputs = self.inputs;
}; };
nixosConfigurations = let nixosConfigurations = {
system = {
nixpkgsInput,
modules ? [],
system ? "x86_64-linux",
}:
nixpkgsInput.lib.nixosSystem {
inherit system;
modules = modules ++ [nixosModules.common];
};
stableSystem = {
modules,
system ? "x86_64-linux",
}:
system {
nixpkgsInput = nixpkgs;
modules = modules ++ [nixosModules.stableCommon];
};
unstableSystem = {
modules,
system ? "x86_64-linux",
}:
nixpkgs-unstable.lib.nixosSystem {
nixosModules.stableCommon
};
in {
beefcake = nixpkgs.lib.nixosSystem { beefcake = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = with nixosModules; [ modules = with nixosModules; [

View file

@ -419,7 +419,13 @@
}; };
}; };
graphical-workstation = {pkgs, ...}: { graphical-workstation = {
pkgs,
lib,
options,
config,
...
}: {
imports = with nixosModules; [ imports = with nixosModules; [
plasma6 plasma6
enable-flatpaks-and-appimages enable-flatpaks-and-appimages
@ -431,13 +437,22 @@
xdg.portal.enable = true; xdg.portal.enable = true;
hardware = { hardware =
graphics = { if builtins.hasAttr "enable" options.hardware.graphics
enable = true; then {
# driSupport32Bit = true; graphics = {
# driSupport = true; enable = true;
# driSupport32Bit = true;
# driSupport = true;
};
}
else {
opengl = {
enable = true;
driSupport32Bit = true;
driSupport = true;
};
}; };
};
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
libnotify libnotify