From 58886e54b5088a3b9f970abe9f3eec3e1d6d61cd Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Sat, 1 Feb 2025 22:13:35 +0100 Subject: [PATCH] Install VSCode from unstable for extension compatibility --- flake.lock | 17 +++++++++++++++++ flake.nix | 2 ++ flake/hosts.nix | 19 +++++++------------ hosts/common.nix | 13 ++++++++++++- modules/home/vscode.nix | 5 +++-- users/home-manager.nix | 9 +++++++-- 6 files changed, 48 insertions(+), 17 deletions(-) diff --git a/flake.lock b/flake.lock index 8fbfa7f..d61075d 100644 --- a/flake.lock +++ b/flake.lock @@ -261,6 +261,22 @@ "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1738021509, + "narHash": "sha256-JNUiceGsr7cVBUQxLBF1ILCe99E0qLxsVuet6GsZUuw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "9db269672dbdbb519e0bd3ea24f01506c135e46f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "betterfox": "betterfox", @@ -273,6 +289,7 @@ "nextcloud-twofactor-totp": "nextcloud-twofactor-totp", "nix-vscode-extensions": "nix-vscode-extensions", "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", "sops-nix": "sops-nix", "treefmt-nix": "treefmt-nix", "wrapper-manager": "wrapper-manager" diff --git a/flake.nix b/flake.nix index a8fef75..be4f4a7 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,8 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; deploy-rs = { diff --git a/flake/hosts.nix b/flake/hosts.nix index 7255202..10c75ae 100644 --- a/flake/hosts.nix +++ b/flake/hosts.nix @@ -5,14 +5,9 @@ ... }: let - stable = inputs.nixpkgs; - # unstable = inputs.nixpkgs-unstable; - - mkHost = hostname: nixpkgs: { - ${hostname} = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs self; - }; + mkHost = hostname: { + ${hostname} = inputs.nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs self; }; modules = [ { networking.hostName = hostname; } @@ -29,10 +24,10 @@ in { flake = { nixosConfigurations = lib.mkMerge [ - (mkHost "north" stable) - (mkHost "inspiron" stable) - (mkHost "stratus" stable) - (mkHost "installer" stable) + (mkHost "north") + (mkHost "inspiron") + (mkHost "stratus") + (mkHost "installer") ]; deploy.nodes.stratus = { diff --git a/hosts/common.nix b/hosts/common.nix index 4e57850..18f3e42 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -1,4 +1,10 @@ -{ self, pkgs, ... }: +{ + config, + inputs, + self, + pkgs, + ... +}: { imports = [ self.nixosModules.default @@ -68,4 +74,9 @@ ]; nixpkgs.config.allowUnfree = true; + + _module.args.pkgs-unstable = import inputs.nixpkgs-unstable { + inherit (pkgs.stdenv.hostPlatform) system; + inherit (config.nixpkgs) config; + }; } diff --git a/modules/home/vscode.nix b/modules/home/vscode.nix index 49a96a1..8127a4d 100644 --- a/modules/home/vscode.nix +++ b/modules/home/vscode.nix @@ -2,6 +2,7 @@ config, inputs, pkgs, + pkgs-unstable, lib, ... }: @@ -11,8 +12,8 @@ config = lib.mkIf config.myConfig.vscode.enable { programs.vscode = { enable = true; - package = pkgs.vscode-with-extensions.override { - vscode = pkgs.vscodium; + package = pkgs-unstable.vscode-with-extensions.override { + vscode = pkgs-unstable.vscodium; vscodeExtensions = let inherit (inputs.nix-vscode-extensions.extensions.${pkgs.system}) open-vsx; diff --git a/users/home-manager.nix b/users/home-manager.nix index 4668c41..8a5bbe5 100644 --- a/users/home-manager.nix +++ b/users/home-manager.nix @@ -1,4 +1,9 @@ -{ inputs, self, ... }: +{ + inputs, + self, + pkgs-unstable, + ... +}: { imports = [ inputs.home-manager.nixosModules.home-manager ]; @@ -6,7 +11,7 @@ useGlobalPkgs = true; useUserPackages = true; extraSpecialArgs = { - inherit inputs self; + inherit inputs self pkgs-unstable; }; }; }