I’ve moved my home.nix
and configuration.nix
to a Git repo with a Flake to build my NixOS setup. I want to use permittedInsecurePackages
, but that’s restricted to either the ~/.config/nixpkgs/config.nix
directory or in the configuration.nix
(a file I want to use only for system-level changes). Is there a way to move config.nix
to a different location or use permittedInsecurePackages
inside home.nix
?
If you want to move your system config, use -I nixos-config=/path/to/new/config.nix
, or symlink /etc/nixos/configuration.nix
to wherever your new file is.
It should work. More details needed.
I think you’re misunderstanding. This has nothing to do with moving my system configuration.
Known issues:
- Electron version 27.3.11 is EOL
You can install it anyway by allowing this package, using the
following methods:
a) To temporarily allow all insecure packages, you can use an environment
variable for a single invocation of the nix tools:
$ export NIXPKGS_ALLOW_INSECURE=1
Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
then pass `--impure` in order to allow use of environment variables.
b) for `nixos-rebuild` you can add ‘electron-27.3.11’ to
`nixpkgs.config.permittedInsecurePackages` in the configuration.nix,
like so:
{
nixpkgs.config.permittedInsecurePackages = [
"electron-27.3.11"
];
}
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
‘electron-27.3.11’ to `permittedInsecurePackages` in
~/.config/nixpkgs/config.nix, like so:
{
permittedInsecurePackages = [
"electron-27.3.11"
];
}
I want to move the ~/.config/nixpkgs/config.nix
into another location.
You can not, and it doesn’t have any effects on flakes anyway, unless using --impure
.
And if your HM needs an insecure package allowed, then you can use the nixpkgs.*
option hirarchy there as well, it is used the same way as in the system configuration.
https://nix-community.github.io/home-manager/options.xhtml#opt-nixpkgs.config
I’ve added it to home.nix, with no effect. Same error as mentioned earlier.
nixpkgs.config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-27.3.11"
];
};
Are you using standalone HM or HM as a NixOS module? If the latter, did you disable home-manager.useGlobalPkgs
?
PS you might consider moving off of logseq or micropad, since an internet-connected application that can run arbitrary code in a full-fledged (chromium, in this case) browser is not a great idea.
Thank you, that solved it.