From 96065924c7503b146984ed099b6356c2ca26c96a Mon Sep 17 00:00:00 2001 From: xenia Date: Sat, 30 Mar 2024 21:49:03 +0100 Subject: [PATCH] Update nixos configuration to enable periodic GC, nixpkgs in registry and NIX_PATH --- flake.nix | 2 +- nixos/base.nix | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index ccd6b301..1d750ba0 100644 --- a/flake.nix +++ b/flake.nix @@ -65,7 +65,7 @@ nixpkgs-flake = nixpkgs; }; - mkNixOsBase = opts: import ./nixos/base.nix opts; + mkNixOsBase = opts: import ./nixos/base.nix (opts // { nixpkgs-flake = nixpkgs; }); mkNixOsGraphical = opts: import ./nixos/graphical.nix (opts // { fox-layout = rachel.keyboardLayouts.fox; }); mkNixOsNetworking = opts: import ./nixos/networking.nix opts; in { diff --git a/nixos/base.nix b/nixos/base.nix index 490f5669..8fface2d 100644 --- a/nixos/base.nix +++ b/nixos/base.nix @@ -1,11 +1,25 @@ { - system, pkgs, hostname, + system, pkgs, nixpkgs-flake, hostname, use-efi ? false, efi-mountpoint ? "/boot", use-grub ? false, grub-device ? "/dev/sda", }: { nixpkgs.config.allowUnfree = true; # lol + nix.gc = { + automatic = true; + dates = "03:00"; + }; + + nix.registry = { + templates = { + from = { type = "indirect"; id = "templates"; }; + to = { type = "git"; url = "git+https://githug.xyz/xenchel/templates"; }; + }; + nixpkgs.flake = nixpkgs-flake; + }; + nix.nixPath = [ "nixpkgs=${pkgs.path}" ]; + networking.hostName = hostname; boot.loader = if use-efi