-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allowUnfree broken? #99
Comments
@stereomato I've applied fixes from nixpkgs to some extensions in #96 and decided to keep the unfree extensions unfree. nix-vscode-extensions/README.md Lines 22 to 24 in 9420eb1
|
@stereomato how do you use |
UPDATE: Sorry just tried and below suggestions aren't working in latest commit. @stereomato Instead of using When you use |
A quick bisect show that this issue could be introduced by 7576a6a. Repro using pkgs = import <nixpkgs> { config.allowUnfree = true; }
# Last known good commit: 780a1d3
x = builtins.getFlake "github:nix-community/nix-vscode-extensions/780a1d35ccd6158ed2c7d10d87c02825e97b4c89"
# First broken commit: 7576a6a
x' = builtins.getFlake "github:nix-community/nix-vscode-extensions/7576a6a5245fa147d02523fb6968f196cae4aeec"
# Unfree extension with LKG, which evaluates successfully
(x.overlays.default pkgs pkgs).vscode-marketplace.ms-vscode-remote.remote-ssh
# Unfree extension with 7576a6a, which fails evaluation
(x'.overlays.default pkgs pkgs).vscode-marketplace.ms-vscode-remote.remote-ssh |
Yeah, I've had to use NIXPKGS_ALLOW_UNFREE with nixos-rebuild because of that. So, I didn't know that there was another way of using this flake, I just used .extensions because it seemed to make sense. |
I think I got it, the overlay is overriding the user's Please test https://github.com/jcszymansk/nix-vscode-extensions/tree/unfree-fix, seems to work for me, if it's ok I can PR it (or owners just copy it if they want, it's one line anyway...) |
i'll try it ASAP |
@jcszymansk thanks, applied this fix in 7efef14 |
Alright, applying the overlay the way @codgician told me, it works fine now! |
This fails for me again with commit 5b14dfc (but works with d1b0158). nixpkgs.config.allowUnfree = true; Exact error:
|
@codgician @benbridts @stereomato @jcszymansk can you reproduce the problem with c7a72aa? |
I can't reproduce the issue using package overlay in my flake with c7a72aa. |
I still have the same issue with c7a72aa I am not using any overlays, so my flake looks more like ( I trimmed a bunch): {
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
lix-module.url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
lix-module.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs@{
self,
nix-darwin,
nixpkgs,
lix-module,
home-manager,
nix-vscode-extensions,
}:
let
configuration = {
nixpkgs.config.allowUnfree = true;
};
in
{
# $ darwin-rebuild build --flake .#laptop
darwinConfigurations = {
laptop = nix-darwin.lib.darwinSystem {
specialArgs = { inherit inputs; };
modules = [
configuration
./hosts/laptop.nix
];
};
};
};
}
#laptop.nix
{pkgs,inputs, ...}:
let
user = "ben";
marketplace = inputs.nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace;
in
{
home-manager.users.${user} =
{ pkgs, ... }:
{
programs = {
vscode = {
profiles.default.extensions =
(with pkgs.vscode-extensions; [
ms-azuretools.vscode-docker
])
++ (with marketplace; [
ms-vscode-remote.remote-containers
]);
};
};
};
}
|
@benbridts same here - but if you use the overlay it works: { config, pkgs, inputs, lib, ... }:
let
pkgs-ext = import inputs.nixpkgs {
inherit (pkgs) system;
config.allowUnfree = true;
overlays = [ inputs.nix-vscode-extensions.overlays.default ];
};
in
{
programs.vscode = {
extensions =
with pkgs-ext; (
let o = open-vsx; m = vscode-marketplace; in [
o.mhutchie.git-graph
]
);
};
} |
@benbridts the If you want to use unfree extensions, you should apply the default overlay to your nixpkgs. See wiki. |
I can confirm that using let
pkgs-ext = import inputs.nixpkgs {
inherit (pkgs) system;
config.allowUnfree = true;
overlays = [ inputs.nix-vscode-extensions.overlays.default ];
};
marketplace = pkgs-ext.vscode-marketplace;
in
# [...]
{
programs.vscode.profiles.default.extensions = with marketplace; [ms-vscode-remote.remote-containers];
} works for me too |
My setup looks a bit different and I'm a bit lost on how to make it work, was using this: # When applied, the nix-vscode-extensions (declared in the flake inputs) will
# be accessible through 'pkgs.vscode-extensions'
vscode-extensions = final: _prev: {
vscode-extensions = inputs.nix-vscode-extensions.extensions.${final.system}.vscode-marketplace;
} And installing extensions like: { pkgs, ... }:
with pkgs.vscode-extensions;
[
asvetliakov.vscode-neovim I just can't figure out how to |
@donferi you may want to add the default overlay from the nix-vscode-extensions repository to your See https://wiki.nixos.org/wiki/Overlays#Using_overlays Also, check this config: |
@donferi let me know if you figure this out. My nix noob brain is lost, I'm just getting rid of vscode for now 😓 |
All of a sudden I get failures to update my system flake, complaining about how allowUnfree should be turned on to install some extensions. I've checked around and it's not a nixOS or home-manager issue, but it seems to be from this flake.
The text was updated successfully, but these errors were encountered: