Hello,
I’ve been trying to flake-ize my configuration for some days now. The main obstacle I found is to use two different versions of nixpkgs in the same configuration: I tried building an overlay and then use a module to configure nixpkgs but without success until I stumbled into nixpkgs.config.allowUnfreePredicate does not work with flakes · Issue #118115 · NixOS/nixpkgs · GitHub which taught me about extraArgs.
Now I’m struggling with this error:
error: assertion '(((args) ? localSystem) -> (! ((args) ? system)))' failed at /nix/store/scc6czs36gj535cwqgv7l8sb3bn8g1k2-source/pkgs/top-level/impure.nix:80:1:
This is the gist of it: (See files below)
What’s happening here?
EDIT to include source code of the question
flake.nix
{
description = "my config";
inputs = {
vscode-pkgs.url = "nixpkgs/f9e81f7ad8795503a55e8f90836d31c04f282af8";
tantra-nixos.url = "nixpkgs/79c970a7bbc686467e49f707db803703b4d61ecb";
};
outputs = { self, ... }@inputs:
{
nixosConfigurations.tantra = inputs.tantra-nixos.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./nixos/tantra.nix
];
extraArgs = {
inherit (inputs) vscode-pkgs;
};
};
};
}
tantra.nix
{ config, pkgs, ... }:
{
imports = [
# other imports
./modules/vscode.nix
]
# rest of config, no nixpgs.XYZ options
}
vscode.nix
{ config, pkgs, vscode-pkgs, ... }:
let
# import vscode-pkgs and
vscode-channel = import vscode-pkgs config.nixpkgs;
# used to build the vscode with extensions - replaced with comment to prove point
# my-vscode-with-extensions = vscode-channel.callPackage ../packages/vscode.nix {};
my-vscode-with-extensions = vscode-channel.vscode;
in
{
environment.systemPackages = [
my-vscode-with-extensions
pkgs.dhall-lsp-server
];
# needed by liveshare to log in
services.gnome.gnome-keyring.enable = true;
}