mudrii / hmtst

16 stars 4 forks source link

allowUnfree not propagated to home.nix or dotfiles? #1

Closed ppenguin closed 2 years ago

ppenguin commented 2 years ago

Finally I'm also trying to transition to flakes, and to make it more challenging: on macos on M1 (my only non-nixos machine with nix/hm).

I'm basically using your home manager flake scaffold (and in flake.nix have only changed the user and system arch, nothing else), but get the following problem when using unstable in home.nix:

home-manager switch --flake ~/Documents/devel/github.com/ppenguin/nixos-configs/flakes/#$USER -v
error: Package ‘vscode-extension-MS-python-vscode-pylance-2020.11.2’ in /nix/store/3c249himjn7sh3cwnapmh5qgrnmd42xg-source/pkgs/misc/vscode-extensions/vscode-utils.nix:24 has an unfree license (‘unfree’), refusing to evaluate.

where

home.nix includes:

{
  imports = [
    ...
    ./dotfiles/vscode-extensions.nix
  ];
  ...
  programs = {
    vscode = {
      enable = true;
      package = pkgs.unstable.vscode;
    };
  ...

and vscode-extensions.nix has:

{
    programs.vscode.extensions = (with pkgs.unstable.vscode-extensions; [
        ...
        ms-python.vscode-pylance
        ...

(there are many more that fail if I comment that one out)

Any idea how to solve that?

mudrii commented 2 years ago

Sorry for late rep0ly I wasn't check my git recently

add vscode-extensions.nix directly to imports in flake.nix

ppenguin commented 2 years ago

@mudrii sorry, completely overlooked that this was still open, thanks for your reply. I've now completely refactored my system/HM flake a bit similar to gvolpe's concept, and learnt a lot along the way. The nice thing is that such structure supports a multi-machine/multi-user config well, while (sort of) minimising boilerplate/repetition.