diff --git a/nix/manifest.nix b/nix/manifest.nix index 18d9474..d781698 100644 --- a/nix/manifest.nix +++ b/nix/manifest.nix @@ -33,10 +33,10 @@ }; }; extraCfg = { - services.fwupd.enable = true; # FIXME: remove machine = { bluetooth.enable = true; usb.automount = true; + usb.qmk.enable = true; virtualisation = { podman.enable = true; podman.distrobox.enable = true; diff --git a/nix/modules/machine/default.nix b/nix/modules/machine/default.nix index 8ad3f7a..ce8c615 100644 --- a/nix/modules/machine/default.nix +++ b/nix/modules/machine/default.nix @@ -5,7 +5,12 @@ let in { flake.modules.nixos.default = - { config, modulesPath, ... }: + { + config, + modulesPath, + pkgs, + ... + }: let cfg = config.machine; in @@ -14,6 +19,7 @@ in options.machine = { bluetooth.enable = mkEnableOption ""; usb.automount = mkEnableOption ""; + usb.qmk.enable = mkEnableOption ""; }; config = mkMerge [ (mkIf cfg.usb.automount { @@ -28,6 +34,18 @@ in } ]; }) + (mkIf cfg.usb.qmk.enable { + hardware.keyboard.qmk.enable = true; + services.udev = { + packages = with pkgs; [ + vial + qmk + qmk-udev-rules + qmk_hid + ]; + }; + + }) (mkIf cfg.bluetooth.enable { persistDirs = [ "/var/lib/bluetooth" ]; hardware.bluetooth = { diff --git a/nix/modules/system/secrets.nix b/nix/modules/system/secrets.nix index 7b75ed1..7e5400d 100644 --- a/nix/modules/system/secrets.nix +++ b/nix/modules/system/secrets.nix @@ -13,39 +13,41 @@ let inherit (cfg.paths) secrets; in { - flake.modules.nixos.default = - { config, ... }: - { - imports = [ inputs.sops-nix.nixosModules.sops ]; - config = { - sops = { - age.sshKeyPaths = [ - "/persist${config.users.defaultUserHome}/${username}/.ssh/id_ed25519" - ]; - secrets."keys/gemini".sopsFile = secrets + "/keys.yaml"; + flake.modules = { + nixos.default = + { config, ... }: + { + imports = [ inputs.sops-nix.nixosModules.sops ]; + config = { + sops = { + age.sshKeyPaths = [ + "/persist${config.users.defaultUserHome}/${username}/.ssh/id_ed25519" + ]; + secrets."keys/gemini".sopsFile = secrets + "/keys.yaml"; + }; + environment.shellInit = # sh + '' + export GEMINI_API_KEY=$(sudo cat ${config.sops.secrets."keys/gemini".path}) + ''; }; - environment.shellInit = # sh - '' - export GEMINI_API_KEY=$(sudo cat ${config.sops.secrets."keys/gemini".path}) - ''; }; - }; - flake.modules.darwin.default = - { config, ... }: - { - imports = [ inputs.sops-nix.darwinModules.sops ]; - config = { - sops = { - age.sshKeyPaths = [ "${config.users.users.${username}.home}/.ssh/id_ed25519" ]; - secrets."keys/gemini".sopsFile = secrets + "/keys.yaml"; + darwin.default = + { config, ... }: + { + imports = [ inputs.sops-nix.darwinModules.sops ]; + config = { + sops = { + age.sshKeyPaths = [ "${config.users.users.${username}.home}/.ssh/id_ed25519" ]; + secrets."keys/gemini".sopsFile = secrets + "/keys.yaml"; + }; + environment.shellInit = # sh + '' + export GEMINI_API_KEY=$(sudo cat ${config.sops.secrets."keys/gemini".path}) + ''; }; - environment.shellInit = # sh - '' - export GEMINI_API_KEY=$(sudo cat ${config.sops.secrets."keys/gemini".path}) - ''; }; - }; - flake.modules.homeManager.default.persistDirs = [ ".config/sops/age" ]; + homeManager.default.persistDirs = [ ".config/sops/age" ]; + }; perSystem = { pkgs, ... }: {