From 05245ea56b5f59f9d1dc1fd1c2454f6307ae4ef8 Mon Sep 17 00:00:00 2001 From: aaron Date: Wed, 31 Dec 2025 11:07:37 +0100 Subject: [PATCH 1/4] refactor(niri): rename the module to niri.nix for clarity --- hosts/neon/configuration.nix | 2 +- modules/nixos/niri.nix | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 modules/nixos/niri.nix diff --git a/hosts/neon/configuration.nix b/hosts/neon/configuration.nix index eb174de..8a3a870 100644 --- a/hosts/neon/configuration.nix +++ b/hosts/neon/configuration.nix @@ -4,10 +4,10 @@ imports = [ ../../modules/nixos/audio.nix ../../modules/nixos/bootloader.nix - ../../modules/nixos/compositor.nix ../../modules/nixos/gnupg.nix ../../modules/nixos/locales.nix ../../modules/nixos/networking.nix + ../../modules/nixos/niri.nix ../../modules/nixos/noctalia.nix ../../modules/nixos/openssh.nix ../../modules/nixos/packages.nix diff --git a/modules/nixos/niri.nix b/modules/nixos/niri.nix new file mode 100644 index 0000000..844c002 --- /dev/null +++ b/modules/nixos/niri.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, ... }: + +{ + # just enable and install niri + programs.niri.enable = true; + + # Add compositor-related packages + environment.systemPackages = with pkgs; [ + xwayland-satellite + ]; +} From 382cb2b0969618091060ee8fe69fd12ca116c47a Mon Sep 17 00:00:00 2001 From: aaron Date: Wed, 31 Dec 2025 11:08:26 +0100 Subject: [PATCH 2/4] refactor(flake): remove home-manager options from flake, since they are already defined in settings --- flake.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index abe0e6e..43a080d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "0x29a ecosystem NixOS flake"; + description = "0x29a NixOS flake"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; @@ -28,8 +28,6 @@ ./hosts/default/configuration.nix home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.users.aaron.imports = [ nixvim.homeModules.nixvim @@ -47,8 +45,6 @@ ./hosts/neon/configuration.nix home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.users.aaron.imports = [ nixvim.homeModules.nixvim From 3a6b6091d6422b921a042eff310a79b3d6ca564e Mon Sep 17 00:00:00 2001 From: aaron Date: Wed, 31 Dec 2025 11:09:09 +0100 Subject: [PATCH 3/4] feature(settings): add cache, use more cores, auto optimize the nix store --- modules/nixos/compositor.nix | 11 ----------- modules/nixos/settings.nix | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 13 deletions(-) delete mode 100644 modules/nixos/compositor.nix diff --git a/modules/nixos/compositor.nix b/modules/nixos/compositor.nix deleted file mode 100644 index 844c002..0000000 --- a/modules/nixos/compositor.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - # just enable and install niri - programs.niri.enable = true; - - # Add compositor-related packages - environment.systemPackages = with pkgs; [ - xwayland-satellite - ]; -} diff --git a/modules/nixos/settings.nix b/modules/nixos/settings.nix index b7b6102..075ce7c 100644 --- a/modules/nixos/settings.nix +++ b/modules/nixos/settings.nix @@ -1,8 +1,36 @@ { config, lib, pkgs, ... }: { - # use flakes and nix command - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix = { + # nix settings + settings = { + # enable flakes, nix-command and eval-cache + experimental-features = [ "nix-command" "flakes" "eval-cache" ]; + # auto-optimize my nix-store + auto-optimise-store = true; + # use all cores + max-jobs = "auto"; + # use all available cores per job + cores = 0; + # add trusted substituters (binary caches) + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" + ]; + # add keys + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + + # enable automatic garbage collection + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + }; # links /libexec from derivations to /run/current-system/sw environment.pathsToLink = [ "/libexec" ]; From 5111de5278a72e6f57a6cab7d8e68be0d16b55aa Mon Sep 17 00:00:00 2001 From: aaron Date: Wed, 31 Dec 2025 11:17:31 +0100 Subject: [PATCH 4/4] refactor(settings): remove redundant options --- modules/nixos/settings.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nixos/settings.nix b/modules/nixos/settings.nix index 075ce7c..88cc0b4 100644 --- a/modules/nixos/settings.nix +++ b/modules/nixos/settings.nix @@ -4,8 +4,8 @@ nix = { # nix settings settings = { - # enable flakes, nix-command and eval-cache - experimental-features = [ "nix-command" "flakes" "eval-cache" ]; + # enable flakes and nix-command + experimental-features = [ "nix-command" "flakes" ]; # auto-optimize my nix-store auto-optimise-store = true; # use all cores