Extract configuration to own module

This commit is contained in:
Alexander Kobjolke 2024-01-20 17:41:14 +01:00
parent 9ce6478c7b
commit fbb85bc1da
3 changed files with 31 additions and 29 deletions

View file

@ -1,5 +1,6 @@
{config, pkgs, inputs, ...}:
{
{ config, pkgs, inputs, ... }: {
imports = [ ./nix-config.nix ];
i18n.defaultLocale = "en_US.UTF-8";
time.timeZone = "Europe/Berlin";
@ -21,25 +22,9 @@
networking.firewall.enable = true;
nix = {
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
registry = {
nixpkgs.flake = inputs.nixpkgs;
nixpkgs-unstable.flake = inputs.nixpkgs-unstable;
};
settings = {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
warn-dirty = false;
# avoid unwanted garbage collection when using direnv
keep-outputs = true;
keep-derivations = true;
};
registry = {
nixpkgs.flake = inputs.nixpkgs;
nixpkgs-unstable.flake = inputs.nixpkgs-unstable;
};
};
}

22
modules/nix-config.nix Normal file
View file

@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
{
nix = {
package = pkgs.nixUnstable;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
settings = {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
warn-dirty = false;
# avoid unwanted garbage collection when using direnv
keep-outputs = true;
keep-derivations = true;
};
};
}