From 915bb9ec0dcf9b00cef3ad0b2619380cb35d7fb7 Mon Sep 17 00:00:00 2001 From: uku Date: Tue, 7 Nov 2023 19:01:37 +0100 Subject: [PATCH] add auto gc and alias nixpkgs to n --- common.nix | 27 +++++++++++++++++++++++---- flake.nix | 10 +++++----- kilimandjaro.nix | 7 +------ 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/common.nix b/common.nix index 2bf86d5..fbbb36b 100644 --- a/common.nix +++ b/common.nix @@ -1,7 +1,7 @@ { - config, pkgs, - inputs, + nixpkgs, + getchvim, ... }: { boot = { @@ -120,7 +120,7 @@ vesktop grimblast playerctl - inputs.getchvim.packages.${pkgs.stdenv.hostPlatform.system}.default + getchvim.packages.${pkgs.stdenv.hostPlatform.system}.default mate.eom osu-lazer-bin ]; @@ -165,7 +165,26 @@ ]; nixpkgs.config.allowUnfree = true; - nix.settings.experimental-features = ["nix-command" "flakes"]; + + nix = { + gc = { + automatic = true; + dates = "3d"; + options = "-d"; + }; + + settings = { + auto-optimise-store = true; + experimental-features = ["nix-command" "flakes"]; + }; + }; + + nix.registry = let + nixpkgsRegistry.flake = nixpkgs; + in { + nixpkgs = nixpkgsRegistry; + n = nixpkgsRegistry; + }; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/flake.nix b/flake.nix index 8cdfc3c..51da9c3 100644 --- a/flake.nix +++ b/flake.nix @@ -10,19 +10,19 @@ }; }; - outputs = inputs: { - nixosConfigurations.fuji = inputs.nixpkgs.lib.nixosSystem { + outputs = {nixpkgs, ...} @ inputs: { + nixosConfigurations.fuji = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [./fuji.nix]; - specialArgs = {inherit inputs;}; + specialArgs = inputs; }; nixosConfigurations.kilimandjaro = inputs.nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [./kilimandjaro.nix]; - specialArgs = {inherit inputs;}; + specialArgs = inputs; }; - formatter.x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.alejandra; + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra; }; } diff --git a/kilimandjaro.nix b/kilimandjaro.nix index 3c26624..1df0a47 100644 --- a/kilimandjaro.nix +++ b/kilimandjaro.nix @@ -1,9 +1,4 @@ -{ - config, - pkgs, - inputs, - ... -}: { +{...}: { imports = [ ./common.nix ./hardware/kilimandjaro.nix