summaryrefslogtreecommitdiff
path: root/modules/sys/features
diff options
context:
space:
mode:
Diffstat (limited to 'modules/sys/features')
-rw-r--r--modules/sys/features/default.nix8
-rw-r--r--modules/sys/features/nh.nix26
-rw-r--r--modules/sys/features/ollama.nix21
-rw-r--r--modules/sys/features/virtualization.nix41
4 files changed, 96 insertions, 0 deletions
diff --git a/modules/sys/features/default.nix b/modules/sys/features/default.nix
new file mode 100644
index 0000000..790dc25
--- /dev/null
+++ b/modules/sys/features/default.nix
@@ -0,0 +1,8 @@
+{ ... }:
+{
+ imports = [
+ ./nh.nix
+ ./ollama.nix
+ ./virtualization.nix
+ ];
+}
diff --git a/modules/sys/features/nh.nix b/modules/sys/features/nh.nix
new file mode 100644
index 0000000..d24d88b
--- /dev/null
+++ b/modules/sys/features/nh.nix
@@ -0,0 +1,26 @@
+{ config, lib, pkgs, ... }:
+{
+ options.szpont.nh = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ default = true;
+ };
+ };
+
+ config = lib.mkIf config.szpont.nh.enable {
+ nix.settings = {
+ trusted-users = [ "root" "adam" ];
+ experimental-features = [ "nix-command" "flakes" ];
+ };
+
+ programs.nh = {
+ enable = true;
+ flake = "/etc/nixos";
+ };
+
+ environment.systemPackages = with pkgs; [
+ nix-output-monitor
+ nvd
+ ];
+ };
+}
diff --git a/modules/sys/features/ollama.nix b/modules/sys/features/ollama.nix
new file mode 100644
index 0000000..0989419
--- /dev/null
+++ b/modules/sys/features/ollama.nix
@@ -0,0 +1,21 @@
+{ pkgs, ... }:
+{
+ fileSystems."/models" = {
+ device = "/home/ollama";
+ fsType = "none";
+ options = [ "bind" ];
+ };
+
+ services.ollama = {
+ enable = true;
+ package = pkgs.ollama-rocm;
+ loadModels = [
+ "deepseek-r1:14b"
+ "qwen3:14b"
+ "qwen3-coder:30b"
+ ];
+ syncModels = true;
+ user = "ollama";
+ models = "/models";
+ };
+}
diff --git a/modules/sys/features/virtualization.nix b/modules/sys/features/virtualization.nix
new file mode 100644
index 0000000..bb3e6cb
--- /dev/null
+++ b/modules/sys/features/virtualization.nix
@@ -0,0 +1,41 @@
+{ config, lib, pkgs, ... }:
+{
+ options.szpont.virtualization = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ default = false;
+ };
+
+ kvm = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ default = true;
+ };
+ };
+ docker = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ default = false;
+ };
+ };
+ };
+
+ config = lib.mkIf config.szpont.virtualization.enable (lib.mkMerge [
+ (lib.mkIf config.szpont.virtualization.kvm.enable {
+ virtualisation.libvirtd = {
+ enable = true;
+ qemu.package = pkgs.qemu_kvm;
+ qemu.swtpm.enable = true;
+ };
+ programs.virt-manager.enable = true;
+ users.users.adam.extraGroups = [ "libvirtd" ];
+ boot.initrd.kernelModules = [ "kvm-amd" ];
+ })
+
+ (lib.mkIf config.szpont.virtualization.docker.enable {
+ virtualisation.docker.enable = true;
+ environment.systemPackages = [ pkgs.docker-compose ];
+ users.users.adam.extraGroups = [ "docker" ];
+ })
+ ]);
+}