From 7c542364a2196bd32356900a1fa9ed398a6d7dc6 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Tue, 14 Jan 2025 21:54:21 -0500 Subject: [PATCH] Add firmware updating through fwupd via the Linux Vendor firmware Service (LVFS). --- nix/configuration/configuration.nix | 1 + nix/configuration/roles/lvfs/default.nix | 33 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 nix/configuration/roles/lvfs/default.nix diff --git a/nix/configuration/configuration.nix b/nix/configuration/configuration.nix index 638a728..a2d6aec 100644 --- a/nix/configuration/configuration.nix +++ b/nix/configuration/configuration.nix @@ -49,6 +49,7 @@ ./roles/steam ./roles/latex ./roles/launch_keyboard + ./roles/lvfs ./roles/nvme ]; diff --git a/nix/configuration/roles/lvfs/default.nix b/nix/configuration/roles/lvfs/default.nix new file mode 100644 index 0000000..9514b3d --- /dev/null +++ b/nix/configuration/roles/lvfs/default.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ ]; + + config = lib.mkMerge [ + { + services.fwupd.enable = true; + + environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) { + hideMounts = true; + directories = [ + { + directory = "/var/lib/fwupd"; + user = "root"; + group = "root"; + mode = "0755"; + } + ]; + }; + } + (lib.mkIf config.me.graphical { + environment.systemPackages = with pkgs; [ + gnome-firmware + ]; + }) + ]; +}