Hello, so I have an issue very similar to this other issue but its solution does not match my circumstances
I have a laptop and a home computer that both share a file called global.nix. This file contains this:
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
#Doesnt install, just allows
"obsidian"
"spotify"
"steam"
"discord"
];
That will build just fine on my laptop but will give me errors like this on my pc:
error: Package āsteam-unwrapped-1.0.0.85ā in /nix/store/g02rq8ap30x3fp8zrz07ip5v1s0pzidn-source/pkgs/by-name/st/steam-unwrapped/package.nix:47 has an unfree license (āunfreeRedistributableā), refusing to evaluate.
a) To temporarily allow unfree packages, you can use an environment variable
for a single invocation of the nix tools.
$ export NIXPKGS_ALLOW_UNFREE=1
...
(I have tried to add steam-unwrapped-1.0.0.85 but that doesnāt work either)
I wouldnt like to rely on nixpkgs.config.allowUnfree = true; as I want to choose what non-free software goes into my computer
Both flakes are almost identical:
reduced flake.nix (pc)
{
description = "Flake for Home-manager and shi";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs-stable.url = "nixpkgs/nixos-25.05";
home-manager = {
url = "github:nix-community/home-manager/master";
#url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: let
lib = nixpkgs.lib;
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
nixosConfigurations = {
yamask = lib.nixosSystem {
specialArgs = {inherit inputs system;};
modules = [
./configuration.nix
];
};
};
homeConfigurations = {
yamask = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home.nix
];
extraSpecialArgs = {
inputs = builtins.removeAttrs inputs ["self"];
};
};
};
};
}
and
flake.nix (laptop)
{
description = "Flake for Home-manager and shi";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs-stable.url = "nixpkgs/nixos-25.05";
home-manager = {
#url = "github:nix-community/home-manager/release-25.05";
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs"; # Check if the versions are the same
};
};
outputs = {
self,
nixpkgs,
home-manager
...
} @ inputs:
let
lib = nixpkgs.lib;
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
nixosConfigurations = {
dwebble = lib.nixosSystem {
specialArgs = {inherit inputs system;};
modules = [
./configuration.nix
];
};
};
homeConfigurations = {
dwebble = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home.nix
];
extraSpecialArgs = {
inputs = builtins.removeAttrs inputs ["self"];
};
};
};
};
}
Each system then has its own files but as far as I can tell they shoulnāt have any effect on this
Thanks!