Files
dotfiles/nixos/nix.nix
Ivan Malison 7a1a612397 Use home-manager.sharedModules for shared user config
Replace manual forEachUser pattern with built-in sharedModules for
applying config to all home-manager users. Add automatic garbage
collection of old generations (weekly, older than 7 days) and remove
the now-unnecessary expire-home-manager-generations justfile recipe.

Also update codex PR patch hash (upstream patch was modified).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:48:50 -08:00

60 lines
1.6 KiB
Nix

{ inputs, specialArgs, config, lib, ... }:
{
imports = [
inputs.home-manager.nixosModules.home-manager
];
options = {
imalison.nixOverlay.enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
};
config = {
home-manager.extraSpecialArgs = {
nixos = {
inherit specialArgs config;
};
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.sharedModules = [ ./home-manager.nix ];
nix = rec {
extraOptions = ''
experimental-features = nix-command flakes
'';
registry.nixpkgs.flake = inputs.nixpkgs;
settings = {
keep-outputs = true;
keep-derivations = true;
substituters = [
"https://cache.nixos.org"
"https://cuda-maintainers.cachix.org"
"https://ai.cachix.org"
];
trusted-public-keys = [
"cache.railbird.ai:KhnvcouxtIU2zxUcjJsm4bUK3o1S3p8xMf9qfZGF7/A="
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
"ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="
];
nix-path = nixPath;
};
channel.enable = false;
nixPath = [
"nixpkgs=${inputs.nixpkgs.outPath}"
];
};
nixpkgs.overlays = [
# (import ./nvidia-container-toolkit-overlay.nix)
(import ./runc-overlay.nix)
(import ./overlay.nix)
] ++ (if config.imalison.nixOverlay.enable then [ inputs.nix.overlays.default ] else []);
# Allow all the things
nixpkgs.config.allowUnfree = true;
};
}