From 551e9b2cb43d1a9d1877ab53156aba9fc7b55601 Mon Sep 17 00:00:00 2001 From: GarandPLG Date: Tue, 26 May 2026 00:06:07 +0200 Subject: [PATCH] Add Opencode and Ollama modules; update configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable Opencode and Ollama in home modules and import their Nix files. Disable the deprecated system‑module opencode entries and remove it from the core packages list. Add a new GitHub CLI module and a convenient `upf-gh` alias for flake updates using a GitHub token. Update the `stylix` configuration to include Opencode styling. Refresh several flake.lock entries with newer revisions and hashes. --- flake.lock | 30 ++++++++++++------------- hosts/Garand-Desktop/home-modules.nix | 2 ++ hosts/Garand-Desktop/system-modules.nix | 1 - hosts/Garand-Laptop/system-modules.nix | 1 - hosts/default/home-modules.nix | 2 ++ hosts/default/system-modules.nix | 1 - modules/core/packages/packages.nix | 1 - modules/core/packages/programs.nix | 8 +++++++ modules/home/bash/aliases.nix | 1 + modules/home/default.nix | 3 +++ modules/home/fish/aliases.nix | 1 + modules/home/gh.nix | 21 +++++++++++++++++ modules/home/ollama.nix | 20 +++++++++++++++++ modules/home/opencode.nix | 13 +++++++++++ modules/home/stylix.nix | 5 +++++ 15 files changed, 91 insertions(+), 19 deletions(-) create mode 100644 modules/home/gh.nix create mode 100644 modules/home/ollama.nix create mode 100644 modules/home/opencode.nix diff --git a/flake.lock b/flake.lock index 606b976..0dee6eb 100644 --- a/flake.lock +++ b/flake.lock @@ -181,11 +181,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1779508957, - "narHash": "sha256-gNwsa7Hwp+pUNe9pvv2aFphcFnm8BoCUUQRm0HXJHD0=", + "lastModified": 1779681769, + "narHash": "sha256-GJEtd8O8wDePHsTESQ+bk2Z8vnbPdJSyXcWrEd3eQss=", "owner": "rycee", "repo": "nur-expressions", - "rev": "3bd76938b820b6f7cf537fffa206bb6a73094b4f", + "rev": "55e2ec35f212e5740b0e6593fd6a3d859dc923ac", "type": "gitlab" }, "original": { @@ -383,11 +383,11 @@ ] }, "locked": { - "lastModified": 1779507042, - "narHash": "sha256-7wOwi8B6D0BYsieZCnHZZj2sNUzgJhLoIVSfkwB7lxQ=", + "lastModified": 1779726696, + "narHash": "sha256-/p37CB5n6Wpw250b0Lq0CYwNq2D8uGKzDoBulyLcQqA=", "owner": "nix-community", "repo": "home-manager", - "rev": "509ed3c603349a9d43de9e2ae6613baea6bd5b34", + "rev": "1a95e2efb477959b70b4a14c51035975c0481df6", "type": "github" }, "original": { @@ -456,11 +456,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1779508470, - "narHash": "sha256-Ap9KJX+5xHIn3bPIpfNgT6MEXdAECECwo4/rmlQD74M=", + "lastModified": 1779560665, + "narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "29916453413845e54a65b8a1cf996842300cd299", + "rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786", "type": "github" }, "original": { @@ -509,11 +509,11 @@ "noctalia-qs": "noctalia-qs" }, "locked": { - "lastModified": 1779504029, - "narHash": "sha256-f8u9DV9Qk8KJh7DVvk4UgUFTN0NDJeFxgrffTSwPkpA=", + "lastModified": 1779591140, + "narHash": "sha256-G54zkslNueiiYDtg8QbAkPTv0/vfLzdjDsaUljlRQAE=", "owner": "noctalia-dev", "repo": "noctalia-shell", - "rev": "b99b7a7f06ff749df9ac43181ff7889ff90c5599", + "rev": "052f533186e6ad8e60541760cfe3123f14108c1e", "type": "github" }, "original": { @@ -532,11 +532,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1778983195, - "narHash": "sha256-hE3EFK5GoSdbO5WHZ8bZDUVYkofbDLQN/KK25z7IOOI=", + "lastModified": 1779588472, + "narHash": "sha256-CVonDVo41DqdqS/kNeXFatwEuTltyXcppm9zkVOnrsM=", "owner": "noctalia-dev", "repo": "noctalia-qs", - "rev": "4116b41cdc89e186be7cb8b24a9b6022af95d742", + "rev": "70fea8a39a908e395de63024a4dfdb829bff1ffe", "type": "github" }, "original": { diff --git a/hosts/Garand-Desktop/home-modules.nix b/hosts/Garand-Desktop/home-modules.nix index b5b0449..e7d08dc 100644 --- a/hosts/Garand-Desktop/home-modules.nix +++ b/hosts/Garand-Desktop/home-modules.nix @@ -7,6 +7,8 @@ _: { enable = true; # Zed Editor: a modern, high‑performance code editor remote-server.enable = false; # Remote Server: enable remote editing capabilities }; + opencode.enable = true; # OpenCode: terminal coding agent + ollama.enable = true; # Ollama: Local Llms /* Web browsers diff --git a/hosts/Garand-Desktop/system-modules.nix b/hosts/Garand-Desktop/system-modules.nix index 4655dcc..100f4e9 100644 --- a/hosts/Garand-Desktop/system-modules.nix +++ b/hosts/Garand-Desktop/system-modules.nix @@ -68,7 +68,6 @@ _: { */ exercism.enable = false; # Exercism: coding practice platform lazygit.enable = false; # Lazygit: simple TUI for Git - opencode.enable = false; # OpenCode: tools for coding and development jan.enable = true; # Jan: AI chat UI logisim-evolution.enable = false; # Logisim-Evolution: Digital logic designer and simulator diff --git a/hosts/Garand-Laptop/system-modules.nix b/hosts/Garand-Laptop/system-modules.nix index 2759275..a9d6d0e 100644 --- a/hosts/Garand-Laptop/system-modules.nix +++ b/hosts/Garand-Laptop/system-modules.nix @@ -68,7 +68,6 @@ _: { */ exercism.enable = false; # Exercism: coding practice platform lazygit.enable = false; # Lazygit: simple TUI for Git - opencode.enable = false; # OpenCode: tools for coding and development jan.enable = true; # Jan: AI chat UI logisim-evolution.enable = false; # Logisim-Evolution: Digital logic designer and simulator diff --git a/hosts/default/home-modules.nix b/hosts/default/home-modules.nix index 5de4f6c..35eb074 100644 --- a/hosts/default/home-modules.nix +++ b/hosts/default/home-modules.nix @@ -7,6 +7,8 @@ _: { enable = true; # Zed Editor: a modern, high‑performance code editor remote-server.enable = true; # Remote Server: enable remote editing capabilities }; + opencode.enable = true; # OpenCode: terminal coding agent + ollama.enable = false; # Ollama: Local Llms /* Web browsers diff --git a/hosts/default/system-modules.nix b/hosts/default/system-modules.nix index 531a8d3..500c25e 100644 --- a/hosts/default/system-modules.nix +++ b/hosts/default/system-modules.nix @@ -68,7 +68,6 @@ _: { */ exercism.enable = true; # Exercism: coding practice platform lazygit.enable = false; # Lazygit: simple TUI for Git - opencode.enable = false; # OpenCode: tools for coding and development jan.enable = true; # Jan: AI chat UI logisim-evolution.enable = false; # Logisim-Evolution: Digital logic designer and simulator diff --git a/modules/core/packages/packages.nix b/modules/core/packages/packages.nix index efaf29b..2c3caf3 100644 --- a/modules/core/packages/packages.nix +++ b/modules/core/packages/packages.nix @@ -24,7 +24,6 @@ slack = slack; tutanota = tutanota-desktop; exercism = exercism; - opencode = opencode; jan = jan; lazygit = lazygit; prismlauncher = inputs.prismlauncher-cracked.packages.${system}.default; diff --git a/modules/core/packages/programs.nix b/modules/core/packages/programs.nix index 13b9ea6..955453b 100644 --- a/modules/core/packages/programs.nix +++ b/modules/core/packages/programs.nix @@ -1,22 +1,30 @@ {shell, ...}: { programs = { nano.enable = true; + hyprland = { enable = true; withUWSM = false; }; + fish.enable = if shell == "fish" then true else false; + dconf.enable = true; + seahorse.enable = true; + fuse.userAllowOther = true; + mtr.enable = true; + gnupg.agent = { enable = true; enableSSHSupport = true; }; + nix-ld = { enable = true; # libraries = with pkgs; [ diff --git a/modules/home/bash/aliases.nix b/modules/home/bash/aliases.nix index f612a3d..b399358 100644 --- a/modules/home/bash/aliases.nix +++ b/modules/home/bash/aliases.nix @@ -9,6 +9,7 @@ upd = "nh os switch -H ${host} -d always"; upg = "nh os switch -H ${host} --update -d always"; upf = "sudo nix flake update --flake /home/${username}/garandos"; + upf-gh = "nix flake update --option access-tokens \"github.com=$(gh auth token)\" --flake /home/${username}/garandos"; upf-undo = "git -C /home/${username}/garandos restore /home/${username}/garandos/flake.lock"; upd-bt = "nh os boot -H ${host} -d always"; upd-ts = "nh os test -H ${host} -d always"; diff --git a/modules/home/default.nix b/modules/home/default.nix index f0fc065..3f7c34b 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -19,13 +19,16 @@ _: { ./easyeffects.nix ./eza.nix ./fzf.nix + ./gh.nix ./git.nix ./gtk.nix ./kdeConnect.nix ./lutris.nix ./nextcloud.nix ./obs-studio.nix + ./ollama.nix ./onlyoffice.nix + ./opencode.nix ./qt.nix ./ssh.nix ./starship.nix diff --git a/modules/home/fish/aliases.nix b/modules/home/fish/aliases.nix index 8397e39..b19d1c9 100644 --- a/modules/home/fish/aliases.nix +++ b/modules/home/fish/aliases.nix @@ -9,6 +9,7 @@ upd = "nh os switch -H ${host} -d always"; upg = "nh os switch -H ${host} --update -d always"; upf = "sudo nix flake update --flake /home/${username}/garandos"; + upf-gh = "nix flake update --option access-tokens \"github.com=$(gh auth token)\" --flake /home/${username}/garandos"; upf-undo = "git -C /home/${username}/garandos restore /home/${username}/garandos/flake.lock"; upd-bt = "nh os boot -H ${host} -d always"; upd-ts = "nh os test -H ${host} -d always"; diff --git a/modules/home/gh.nix b/modules/home/gh.nix new file mode 100644 index 0000000..0dc01df --- /dev/null +++ b/modules/home/gh.nix @@ -0,0 +1,21 @@ +{ + pkgs, + gitUsername, + ... +}: { + programs.gh = { + enable = true; + package = pkgs.gh; + hosts."github.com" = { + git_protocol = "https"; + users = [ + "${gitUsername}" + ]; + user = "${gitUsername}"; + }; + settings = { + git_protocol = "https"; + version = "1"; + }; + }; +} diff --git a/modules/home/ollama.nix b/modules/home/ollama.nix new file mode 100644 index 0000000..f34d9a7 --- /dev/null +++ b/modules/home/ollama.nix @@ -0,0 +1,20 @@ +{ + pkgs, + lib, + config, + profile, + ... +}: { + options.ollama.enable = lib.mkEnableOption "Ollama"; + + config.services.ollama = lib.mkIf config.ollama.enable { + enable = true; + package = pkgs.ollama; + acceleration = + if profile == "nvidia" + then "cuda" + else if profile == "amd" + then "rocm" + else null; + }; +} diff --git a/modules/home/opencode.nix b/modules/home/opencode.nix new file mode 100644 index 0000000..ae3d839 --- /dev/null +++ b/modules/home/opencode.nix @@ -0,0 +1,13 @@ +{ + pkgs, + lib, + config, + ... +}: { + options.opencode.enable = lib.mkEnableOption "Opencode"; + + config.programs.opencode = lib.mkIf config.opencode.enable { + enable = true; + package = pkgs.opencode; + }; +} diff --git a/modules/home/stylix.nix b/modules/home/stylix.nix index 3481bdd..c87f016 100644 --- a/modules/home/stylix.nix +++ b/modules/home/stylix.nix @@ -73,5 +73,10 @@ opacity.enable = true; variant256Colors = true; }; + + opencode = { + enable = true; + colors.enable = true; + }; }; }