From 5eadff9ccd05bc11e81dbfb0acd9be3079c63fba Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Tue, 1 Jul 2025 16:15:08 -0500 Subject: [PATCH] update opencode to more recent version with overlay --- common/flake.lock | 29 +++++++++++--- common/flake.nix | 14 +++++++ common/programs/default.nix | 1 + common/programs/opencode.nix | 32 +++++++++++++++ hosts/lio/flake.lock | 78 +++++++++++++++++------------------- hosts/lio/flake.nix | 12 ++++-- result | 1 + 7 files changed, 117 insertions(+), 50 deletions(-) create mode 100644 common/programs/opencode.nix create mode 120000 result diff --git a/common/flake.lock b/common/flake.lock index f079961..714250f 100644 --- a/common/flake.lock +++ b/common/flake.lock @@ -85,11 +85,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1749154018, - "narHash": "sha256-gjN3j7joRvT3a8Zgcylnd4NFsnXeDBumqiu4HmY1RIg=", + "lastModified": 1750792728, + "narHash": "sha256-Lh3dopA8DdY+ZoaAJPrtkZOZaFEJGSYjOdAYYgOPgE4=", "owner": "rycee", "repo": "home-manager", - "rev": "7aae0ee71a17b19708b93b3ed448a1a0952bf111", + "rev": "366f00797b1efb70f2882d3da485e3c10fd3d557", "type": "github" }, "original": { @@ -139,11 +139,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1749024892, - "narHash": "sha256-OGcDEz60TXQC+gVz5sdtgGJdKVYr6rwdzQKuZAJQpCA=", + "lastModified": 1750622754, + "narHash": "sha256-kMhs+YzV4vPGfuTpD3mwzibWUE6jotw5Al2wczI0Pv8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8f1b52b04f2cb6e5ead50bd28d76528a2f0380ef", + "rev": "c7ab75210cb8cb16ddd8f290755d9558edde7ee1", "type": "github" }, "original": { @@ -169,6 +169,22 @@ "type": "github" } }, + "nixpkgs_opencode": { + "locked": { + "lastModified": 1751351490, + "narHash": "sha256-ctx8/MHA43rXv7R7aLIi2K/yQDusChswqTm1ngHis0A=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "7aeaddc3ad9186427b3ffea49dd36b5893993e2d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "pull/419604/head", + "repo": "nixpkgs", + "type": "github" + } + }, "ragenix": { "inputs": { "agenix": "agenix", @@ -195,6 +211,7 @@ "inputs": { "home-manager": "home-manager", "nix-flatpak": "nix-flatpak", + "nixpkgs_opencode": "nixpkgs_opencode", "ragenix": "ragenix" } }, diff --git a/common/flake.nix b/common/flake.nix index f95574c..db0bc17 100644 --- a/common/flake.nix +++ b/common/flake.nix @@ -4,6 +4,8 @@ home-manager.url = "github:rycee/home-manager/release-25.05"; ragenix.url = "github:yaxitech/ragenix"; nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=latest"; + + nixpkgs_opencode.url = "github:nixos/nixpkgs/pull/419604/head"; }; outputs = @@ -11,6 +13,7 @@ home-manager, ragenix, nix-flatpak, + nixpkgs_opencode, ... }: { @@ -23,6 +26,16 @@ }: { imports = [ + ( + { ... }: + { + nixpkgs.overlays = [ + (final: prev: { + opencode = nixpkgs_opencode.legacyPackages.${prev.system}.opencode; + }) + ]; + } + ) home-manager.nixosModules.home-manager ragenix.nixosModules.age nix-flatpak.nixosModules.nix-flatpak @@ -36,6 +49,7 @@ ./secrets ]; config = { + _module.args = { inherit ragenix; }; diff --git a/common/programs/default.nix b/common/programs/default.nix index ff08a58..009e6e8 100644 --- a/common/programs/default.nix +++ b/common/programs/default.nix @@ -14,6 +14,7 @@ in ./podman.nix ./incus.nix ./flatpaks.nix + ./opencode.nix ]; config = { assertions = [ diff --git a/common/programs/opencode.nix b/common/programs/opencode.nix new file mode 100644 index 0000000..62397f7 --- /dev/null +++ b/common/programs/opencode.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + pkgs, + ... +}: +let + ccfg = import ../config.nix; + cfg_path = [ + ccfg.custom_config_key + "programs" + "opencode" + ]; + cfg = lib.attrsets.getAttrFromPath cfg_path config; +in +{ + options = + { } + // lib.attrsets.setAttrByPath cfg_path { + enable = lib.mkEnableOption "opencode"; + }; + + config = lib.mkIf cfg.enable ({ + environment.systemPackages = with pkgs; [ + opencode + ]; + + environment.shellAliases = { + "oc" = "all_proxy='' http_proxy='' https_proxy='' opencode"; + }; + }); +} diff --git a/hosts/lio/flake.lock b/hosts/lio/flake.lock index 6a5181b..b6adae8 100644 --- a/hosts/lio/flake.lock +++ b/hosts/lio/flake.lock @@ -29,22 +29,18 @@ "inputs": { "home-manager": "home-manager", "nix-flatpak": "nix-flatpak", - "nixpkgs": "nixpkgs_2", + "nixpkgs_opencode": "nixpkgs_opencode", "ragenix": "ragenix" }, "locked": { - "lastModified": 1750780721, - "narHash": "sha256-EgWdBolm8wPXY9iuTHPXykJiQRzSnfXzkCXpNooxEB8=", - "ref": "refs/heads/master", - "rev": "2004734c7b7d77638874b63e147970199830c3fd", - "revCount": 500, - "type": "git", - "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" + "path": "../../common", + "type": "path" }, "original": { - "type": "git", - "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" - } + "path": "../../common", + "type": "path" + }, + "parent": [] }, "crane": { "locked": { @@ -108,11 +104,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1749154018, - "narHash": "sha256-gjN3j7joRvT3a8Zgcylnd4NFsnXeDBumqiu4HmY1RIg=", + "lastModified": 1750792728, + "narHash": "sha256-Lh3dopA8DdY+ZoaAJPrtkZOZaFEJGSYjOdAYYgOPgE4=", "owner": "rycee", "repo": "home-manager", - "rev": "7aae0ee71a17b19708b93b3ed448a1a0952bf111", + "rev": "366f00797b1efb70f2882d3da485e3c10fd3d557", "type": "github" }, "original": { @@ -163,11 +159,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1749024892, - "narHash": "sha256-OGcDEz60TXQC+gVz5sdtgGJdKVYr6rwdzQKuZAJQpCA=", + "lastModified": 1750622754, + "narHash": "sha256-kMhs+YzV4vPGfuTpD3mwzibWUE6jotw5Al2wczI0Pv8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8f1b52b04f2cb6e5ead50bd28d76528a2f0380ef", + "rev": "c7ab75210cb8cb16ddd8f290755d9558edde7ee1", "type": "github" }, "original": { @@ -178,22 +174,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1749794982, - "narHash": "sha256-Kh9K4taXbVuaLC0IL+9HcfvxsSUx8dPB5s5weJcc9pc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "ee930f9755f58096ac6e8ca94a1887e0534e2d81", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1741379970, "narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=", @@ -209,13 +189,13 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { - "lastModified": 1750622754, - "narHash": "sha256-kMhs+YzV4vPGfuTpD3mwzibWUE6jotw5Al2wczI0Pv8=", + "lastModified": 1751211869, + "narHash": "sha256-1Cu92i1KSPbhPCKxoiVG5qnoRiKTgR5CcGSRyLpOd7Y=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c7ab75210cb8cb16ddd8f290755d9558edde7ee1", + "rev": "b43c397f6c213918d6cfe6e3550abfe79b5d1c51", "type": "github" }, "original": { @@ -225,7 +205,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1750188666, "narHash": "sha256-yAfLvtbCzSigTfbsJeOrvljS7VYLAwi2RZ6F+qd+A5E=", @@ -240,6 +220,22 @@ "type": "github" } }, + "nixpkgs_opencode": { + "locked": { + "lastModified": 1751351490, + "narHash": "sha256-ctx8/MHA43rXv7R7aLIi2K/yQDusChswqTm1ngHis0A=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "7aeaddc3ad9186427b3ffea49dd36b5893993e2d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "pull/419604/head", + "repo": "nixpkgs", + "type": "github" + } + }, "nvim_plugin-Almo7aya/openingh.nvim": { "flake": false, "locked": { @@ -1141,7 +1137,7 @@ "agenix": "agenix", "crane": "crane", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "rust-overlay": "rust-overlay" }, "locked": { @@ -1161,13 +1157,13 @@ "root": { "inputs": { "common": "common", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_3", "ros_neovim": "ros_neovim" } }, "ros_neovim": { "inputs": { - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "nvim_plugin-Almo7aya/openingh.nvim": "nvim_plugin-Almo7aya/openingh.nvim", "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim", "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring": "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring", diff --git a/hosts/lio/flake.nix b/hosts/lio/flake.nix index bd71054..35c5e66 100644 --- a/hosts/lio/flake.nix +++ b/hosts/lio/flake.nix @@ -3,8 +3,8 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; # Use relative to get current version for testing - # common.url = "path:../../common"; - common.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles"; + common.url = "path:../../common"; + # common.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles"; ros_neovim.url = "git+https://git.joshuabell.xyz/ringofstorms/nvim"; }; @@ -32,7 +32,12 @@ ./hardware-configuration.nix (import ./containers.nix { inherit inputs; }) ( - { config, pkgs, ... }: + { + config, + pkgs, + lib, + ... + }: { programs = { steam.enable = true; @@ -70,6 +75,7 @@ tailnet.enableExitNode = true; ssh.enable = true; docker.enable = true; + opencode.enable = true; flatpaks = { enable = true; packages = [ diff --git a/result b/result new file mode 120000 index 0000000..3d8cd3b --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/p31bhpq4gsvxn2h0lmjr8mym587d19gc-nixos-system-lio-25.05.20250629.b43c397 \ No newline at end of file