Pin opencode on WSL; Update

This commit is contained in:
Martin Pander
2026-05-19 12:18:33 +02:00
parent 15c019b4df
commit 850fc48981
4 changed files with 58 additions and 22 deletions

55
flake.lock generated
View File

@@ -59,11 +59,11 @@
]
},
"locked": {
"lastModified": 1777851538,
"narHash": "sha256-Gp8qwTEYNoy2yvmErVGlvLOQvrtEECCAKbonW7VJef8=",
"lastModified": 1778905220,
"narHash": "sha256-ox/5IHc8uwy6UTw6N7Shp6uCHIgu/S2PsWeuXsOHSo8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "cc09c0f9b7eaa95c2d9827338a5eb03d32505ca5",
"rev": "d1686dc7d36cbd1234cb226ad6ef97e882716acb",
"type": "github"
},
"original": {
@@ -80,11 +80,11 @@
]
},
"locked": {
"lastModified": 1777851538,
"narHash": "sha256-Gp8qwTEYNoy2yvmErVGlvLOQvrtEECCAKbonW7VJef8=",
"lastModified": 1778905220,
"narHash": "sha256-ox/5IHc8uwy6UTw6N7Shp6uCHIgu/S2PsWeuXsOHSo8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "cc09c0f9b7eaa95c2d9827338a5eb03d32505ca5",
"rev": "d1686dc7d36cbd1234cb226ad6ef97e882716acb",
"type": "github"
},
"original": {
@@ -101,11 +101,11 @@
]
},
"locked": {
"lastModified": 1777780666,
"narHash": "sha256-8wURyQMdDkGUarSTKOGdCuFfYiwa3HbzwscUfn3STDE=",
"lastModified": 1779036909,
"narHash": "sha256-zXcwYQGCT6pzinK+1dBB2ekTVtfxGZAapb3Evdcu4fY=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "8c62fba0854ba15c8917aed18894dbccb48a3777",
"rev": "56c666e108467d87d13508936aade6d567f2a501",
"type": "github"
},
"original": {
@@ -159,11 +159,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1777954456,
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
"lastModified": 1778869304,
"narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
"rev": "d233902339c02a9c334e7e593de68855ad26c4cb",
"type": "github"
},
"original": {
@@ -188,13 +188,29 @@
"type": "github"
}
},
"nixpkgs-stable": {
"nixpkgs-opencode": {
"locked": {
"lastModified": 1778003029,
"narHash": "sha256-q/nkKLDtHIyLjZpKhWk3cSK5IYsFqtMd6UtXF3ddjgA=",
"lastModified": 1777270315,
"narHash": "sha256-yKB4G6cKsQsWN7M6rZGk6gkJPDNPIzT05y4qzRyCDlI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0c88e1f2bdb93d5999019e99cb0e61e1fe2af4c5",
"rev": "6368eda62c9775c38ef7f714b2555a741c20c72d",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6368eda62c9775c38ef7f714b2555a741c20c72d",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1778737229,
"narHash": "sha256-6xWoytx8jFW4PF1GjRm/i/53trbpKGfz6zjzQGBr4cI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d7a713c0b7e47c908258e71cba7a2d77cc8d71d5",
"type": "github"
},
"original": {
@@ -206,11 +222,11 @@
},
"nixpkgs-wsl-stable": {
"locked": {
"lastModified": 1778003029,
"narHash": "sha256-q/nkKLDtHIyLjZpKhWk3cSK5IYsFqtMd6UtXF3ddjgA=",
"lastModified": 1778737229,
"narHash": "sha256-6xWoytx8jFW4PF1GjRm/i/53trbpKGfz6zjzQGBr4cI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0c88e1f2bdb93d5999019e99cb0e61e1fe2af4c5",
"rev": "d7a713c0b7e47c908258e71cba7a2d77cc8d71d5",
"type": "github"
},
"original": {
@@ -244,6 +260,7 @@
"nixos-vscode-server": "nixos-vscode-server",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs",
"nixpkgs-opencode": "nixpkgs-opencode",
"nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-wsl-stable": "nixpkgs-wsl-stable",
"sops-nix": "sops-nix",

View File

@@ -9,6 +9,9 @@
nixpkgs-wsl-stable.url = "github:nixos/nixpkgs/nixos-25.11";
# Pinned nixpkgs for opencode 1.14.25 (latest unstable segfaults)
nixpkgs-opencode.url = "github:nixos/nixpkgs/6368eda62c9775c38ef7f714b2555a741c20c72d";
nixos-wsl = {
url = "github:nix-community/nixos-wsl/release-25.11";
inputs.nixpkgs.follows = "nixpkgs-wsl-stable";
@@ -45,7 +48,7 @@
};
};
outputs = { self, nixpkgs, nixpkgs-stable, nixpkgs-wsl-stable, nixos-wsl, home-manager, home-manager-wsl, nix-darwin, ... }@inputs:
outputs = { self, nixpkgs, nixpkgs-stable, nixpkgs-wsl-stable, nixpkgs-opencode, nixos-wsl, home-manager, home-manager-wsl, nix-darwin, ... }@inputs:
let
linuxSystem = "x86_64-linux";
linuxAarchSystem = "aarch64-linux";
@@ -70,7 +73,10 @@
{
nixpkgs.hostPlatform = linuxSystem;
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ];
nixpkgs.overlays = [
(import ./modules/overlays/unstable.nix nixpkgs)
(import ./modules/overlays/opencode.nix nixpkgs-opencode)
];
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {

View File

@@ -46,7 +46,7 @@ in
(lib.mkIf cfg.enable {
home.packages =
(lib.optional cfg.claude-code.enable pkgs.unstable.claude-code) ++
(lib.optional cfg.opencode.enable pkgs.unstable.opencode) ++
(lib.optional cfg.opencode.enable (pkgs.opencode-pinned or pkgs.unstable.opencode)) ++
(lib.optional cfg.gemini-cli.enable pkgs.unstable.gemini-cli) ++
(lib.optional (cfg.bubblewrap.enable && pkgs.stdenv.isLinux) pkgs.unstable.bubblewrap);
})

View File

@@ -0,0 +1,13 @@
# Overlay to provide a pinned version of opencode
# This pins opencode to a specific nixpkgs commit to avoid issues
# with the latest unstable version (e.g., segfaults).
#
# Usage: Pass nixpkgs-opencode input when applying overlay:
# overlays = [ (import ./modules/overlays/opencode.nix nixpkgs-opencode) ];
nixpkgs-opencode: final: prev: {
opencode-pinned = (import nixpkgs-opencode {
inherit (prev) system;
config.allowUnfree = true;
}).opencode;
}