dotfiles/modules/common/nix.nix
Christopher Mühl 0fa23fdd05
Create nushell application wrapper
Also move elements to `/nix/elements`.
2025-11-19 00:21:17 +01:00

41 lines
971 B
Nix

{
self,
pkgs,
config,
...
}: {
nix = {
# Automatic cleanup
gc.automatic = true;
gc.dates = "weekly";
gc.options = "--delete-older-than 21d";
settings = {
# builders-use-substitutes = true;
experimental-features = ["nix-command" "flakes"];
flake-registry = "/etc/nix/registry.json";
keep-derivations = true;
keep-outputs = true;
trusted-users = ["root" "@wheel"];
substituters = ["https://cache.nixos.org/"];
};
};
nixpkgs = {
config.allowUnfree = true;
config.permittedInsecurePackages = [
"nixos-config"
"electron-27.3.11"
"dotnet-sdk-6.0.428"
];
};
environment.etc."current-system-packages".text = let
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages);
formatted = builtins.concatStringsSep "\n" sortedUnique;
in
formatted;
}