From 5247bbda031902455fd6b7fdf7ca66ab4ab8b708 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 6 Feb 2026 22:36:37 -0300 Subject: [PATCH] add single-file NixOS aspects Standalone NixOS modules: ai, bluetooth, dev, fwupd, libvirtd, networkmanager, podman Co-Authored-By: Claude Opus 4.5 --- aspects/ai.nix | 12 ++++++++++++ aspects/bluetooth.nix | 6 ++++++ aspects/dev.nix | 19 +++++++++++++++++++ aspects/fwupd.nix | 6 ++++++ aspects/libvirtd.nix | 18 ++++++++++++++++++ aspects/networkmanager.nix | 11 +++++++++++ aspects/podman.nix | 15 +++++++++++++++ 7 files changed, 87 insertions(+) create mode 100644 aspects/ai.nix create mode 100644 aspects/bluetooth.nix create mode 100644 aspects/dev.nix create mode 100644 aspects/fwupd.nix create mode 100644 aspects/libvirtd.nix create mode 100644 aspects/networkmanager.nix create mode 100644 aspects/podman.nix diff --git a/aspects/ai.nix b/aspects/ai.nix new file mode 100644 index 0000000..6befeae --- /dev/null +++ b/aspects/ai.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + flake.modules.nixos.ai = { inputs, pkgs, ... }: { + environment.systemPackages = + (with pkgs; [claude-desktop]) ++ + (with inputs.nix-ai-tools.packages.${pkgs.system}; [ + claude-code + claudebox + opencode + ]); + }; +} diff --git a/aspects/bluetooth.nix b/aspects/bluetooth.nix new file mode 100644 index 0000000..222bdf2 --- /dev/null +++ b/aspects/bluetooth.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + flake.modules.nixos.bluetooth = { config, lib, pkgs, ... }: { + hardware.bluetooth.enable = true; + }; +} diff --git a/aspects/dev.nix b/aspects/dev.nix new file mode 100644 index 0000000..cc84646 --- /dev/null +++ b/aspects/dev.nix @@ -0,0 +1,19 @@ +{ ... }: +{ + flake.modules.nixos.dev = { config, lib, pkgs, ... }: { + environment.systemPackages = with pkgs; [ + android-tools + bat + lazygit + fd + fzf + glow + nixfmt + nix-init + nix-output-monitor + ripgrep + ]; + + users.users.user.extraGroups = [ "adbusers" ]; + }; +} diff --git a/aspects/fwupd.nix b/aspects/fwupd.nix new file mode 100644 index 0000000..746f1d0 --- /dev/null +++ b/aspects/fwupd.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + flake.modules.nixos.fwupd = { config, lib, pkgs, ... }: { + services.fwupd.enable = true; + }; +} diff --git a/aspects/libvirtd.nix b/aspects/libvirtd.nix new file mode 100644 index 0000000..6487999 --- /dev/null +++ b/aspects/libvirtd.nix @@ -0,0 +1,18 @@ +{ ... }: +{ + flake.modules.nixos.libvirtd = { config, lib, pkgs, ... }: { + virtualisation = { + libvirtd.enable = true; + spiceUSBRedirection.enable = true; + }; + + programs.virt-manager.enable = true; + + networking.firewall.trustedInterfaces = [ "virbr0" ]; + + users.users.user.extraGroups = [ + "libvirt" + "libvirtd" + ]; + }; +} diff --git a/aspects/networkmanager.nix b/aspects/networkmanager.nix new file mode 100644 index 0000000..74c9260 --- /dev/null +++ b/aspects/networkmanager.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + flake.modules.nixos.networkmanager = { config, lib, pkgs, ... }: { + networking.networkmanager = { + enable = true; + wifi.backend = "iwd"; + }; + + users.users.user.extraGroups = [ "networkmanager" ]; + }; +} diff --git a/aspects/podman.nix b/aspects/podman.nix new file mode 100644 index 0000000..04e7e04 --- /dev/null +++ b/aspects/podman.nix @@ -0,0 +1,15 @@ +{ ... }: +{ + flake.modules.nixos.podman = { config, lib, pkgs, ... }: { + virtualisation.podman = { + enable = true; + autoPrune.enable = true; + extraPackages = [ pkgs.podman-compose ]; + }; + + systemd = { + services.podman-auto-update.enable = true; + timers.podman-auto-update.enable = true; + }; + }; +}