Running sudo nixos-rebuild switch
takes around 15 seconds. Using flakes and home manager.
Wondering how to reduce the time and if you all have workflows to work around this? Especially for home manager where fast iteration times are important.
My flake.nix
:
{
description = "NixOS System";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable/";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
stylix.url = "github:danth/stylix";
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
stylix,
...
} @ inputs: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
system = "x86_64-linux";
modules = [
stylix.nixosModules.stylix
inputs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.tarik = import ./home.nix;
}
{
nix.settings = {
substituters = ["https://cosmic.cachix.org/"];
trusted-public-keys = ["cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="];
};
}
inputs.nixos-cosmic.nixosModules.default
./configuration.nix
];
};
};
}
Thank you!