From 9f301190bedc3c3237e7749796367659f1f1ad33 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 17 Jan 2022 05:08:17 +0000 Subject: [PATCH] Finish modularizing nix config --- machines/kitchen/configuration.nix | 18 ------------------ machines/loft/configuration.nix | 18 ------------------ modules/nix.nix | 23 ++++++++++++++++++----- 3 files changed, 18 insertions(+), 41 deletions(-) diff --git a/machines/kitchen/configuration.nix b/machines/kitchen/configuration.nix index c27d5f4..b185314 100644 --- a/machines/kitchen/configuration.nix +++ b/machines/kitchen/configuration.nix @@ -10,24 +10,6 @@ ./hardware-configuration.nix ]; - # Auto cleanup - nix = { - package = pkgs.nixUnstable; - extraOptions = '' - experimental-features = nix-command flakes - ''; - autoOptimiseStore = true; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - }; - - nixpkgs.config = { - allowUnfree = true; - }; - networking.hostName = "nixos"; # Define your hostname. # The global useDHCP flag is deprecated, therefore explicitly set to false here. diff --git a/machines/loft/configuration.nix b/machines/loft/configuration.nix index 90ee687..a0b5c89 100644 --- a/machines/loft/configuration.nix +++ b/machines/loft/configuration.nix @@ -10,24 +10,6 @@ ./hardware-configuration.nix ]; - # Auto cleanup - nix = { - package = pkgs.nixUnstable; - extraOptions = '' - experimental-features = nix-command flakes - ''; - autoOptimiseStore = true; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - }; - - nixpkgs.config = { - allowUnfree = true; - }; - # Set your time zone. time.timeZone = "America/New_York"; diff --git a/modules/nix.nix b/modules/nix.nix index b40a5bd..233b2ba 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,8 +1,21 @@ { pkgs, ... }: { - nix.extraOptions = '' - experimental-features = flakes nix-command - ''; - # this is required until nix 2.4 is released - nix.package = pkgs.nixUnstable; + nix = { + extraOptions = '' + experimental-features = flakes nix-command + ''; + # this is required until nix 2.4 is released + package = pkgs.nixUnstable; + + autoOptimiseStore = true; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + }; + + nixpkgs.config = { + allowUnfree = true; + }; }