refactor: move nix settings to system module, remove unused modules

This commit is contained in:
Michael Thomas 2024-06-27 19:02:43 -04:00
parent 573020d857
commit 8a9b7280c6
4 changed files with 27 additions and 32 deletions

27
common/system/default.nix Normal file
View File

@ -0,0 +1,27 @@
{
config,
pkgs,
...
}: {
nix.gc = {
automatic = true;
options = "--delete-older-than 30d";
};
nix.optimise.automatic = true;
nix.settings = {
extra-experimental-features = [
"flakes"
"nix-command"
];
keep-outputs = true;
log-lines = 25;
tarball-ttl = 43200;
trusted-users = [
"root"
config.my.user
];
};
nix.package = pkgs.nix;
programs.zsh.enable = true;
time.timeZone = "America/New_York";
}

View File

@ -51,15 +51,9 @@ in {
}
];
baseHomeModule = {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {inherit inputs;};
};
fullNixOSModules =
defaultModules
++ [
baseHomeModule
{
home-manager.users.michael = import ../user/environments/nixos/home.nix;
}
@ -102,8 +96,6 @@ in {
modules =
defaultModules
++ [
../modules/nix.nix
baseHomeModule
{
home-manager.users.michael = import ../user/environments/nixos-server/home.nix;
}

View File

@ -7,7 +7,6 @@
./flatpak.nix
./fonts.nix
./hosts.nix
./nix.nix
./sound.nix
];
}

View File

@ -1,23 +0,0 @@
{pkgs, ...}: {
nix = {
extraOptions = ''
experimental-features = flakes nix-command
'';
# this is required until nix 2.4 is released
package = pkgs.nixFlakes;
settings = {
auto-optimise-store = true;
trusted-users = ["root" "michael"];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
nixpkgs.config = {
allowUnfree = true;
};
}