From e69ed57ab173b558c3e8bcdb3cbc228fc7ccbc3a Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 5 Apr 2022 17:02:58 -0700 Subject: nix: refactor to a module --- hosts/common/system/default.nix | 1 - hosts/common/system/nix.nix | 18 ------------------ modules/default.nix | 2 +- modules/system/default.nix | 1 + modules/system/nix/default.nix | 16 ++++++++++++++++ 5 files changed, 18 insertions(+), 20 deletions(-) delete mode 100644 hosts/common/system/nix.nix create mode 100644 modules/system/default.nix create mode 100644 modules/system/nix/default.nix diff --git a/hosts/common/system/default.nix b/hosts/common/system/default.nix index f519766..2e34ede 100644 --- a/hosts/common/system/default.nix +++ b/hosts/common/system/default.nix @@ -6,7 +6,6 @@ ./hardware.nix ./locale.nix ./network.nix - ./nix.nix ./security.nix ./software.nix ./ssh.nix diff --git a/hosts/common/system/nix.nix b/hosts/common/system/nix.nix deleted file mode 100644 index 48379a4..0000000 --- a/hosts/common/system/nix.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ lib, pkgs, ... }: - -{ - # Enable flakes and new 'nix' command - nix = { - package = pkgs.nixFlakes; - extraOptions = '' - experimental-features = nix-command flakes - ''; - autoOptimiseStore = true; - trustedUsers = [ "root" "@wheel" ]; - - gc = { - automatic = true; - options = "--delete-older-than 14d"; - }; - }; -} diff --git a/modules/default.nix b/modules/default.nix index 5ec7ef8..189a313 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1 +1 @@ -{ ... }: { imports = [ ./hardware ]; } +{ ... }: { imports = [ ./hardware ./system ]; } diff --git a/modules/system/default.nix b/modules/system/default.nix new file mode 100644 index 0000000..94ac438 --- /dev/null +++ b/modules/system/default.nix @@ -0,0 +1 @@ +{ ... }: { imports = [ ./nix ]; } diff --git a/modules/system/nix/default.nix b/modules/system/nix/default.nix new file mode 100644 index 0000000..2ad20c3 --- /dev/null +++ b/modules/system/nix/default.nix @@ -0,0 +1,16 @@ +# Nix related settings +{ lib, pkgs, ... }: { + nix = { + package = pkgs.nixFlakes; + extraOptions = '' + experimental-features = nix-command flakes + ''; + autoOptimiseStore = true; + trustedUsers = [ "root" "@wheel" ]; + + gc = { + automatic = true; + options = "--delete-older-than 14d"; + }; + }; +} -- cgit 1.4.1