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

@ -7,17 +7,12 @@ let
extIface = "ens3";
ledgerVHost = "ledger.failco.de";
in {
imports = [ # Include the results of the hardware scan.
imports = [
./hardware-configuration.nix
../../modules/upgrade-pg-cluster.nix
../../modules/nix-config.nix
];
nix.package = pkgs.nixUnstable;
nix.extraOptions = ''
experimental-features = nix-command flakes repl-flake ca-derivations
'';
# nix.registry.nixpkgs.flake = nixpkgs;
# Binary Cache for Haskell.nix
nix.settings.trusted-public-keys =
[ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];

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;
};
};
}

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;
};
};
}