From 2b1106ec94a74d9ff0619b0cf7346bb9cbb3145f Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Mon, 10 Mar 2025 02:40:01 +0000 Subject: [PATCH] move nix settings from home-manager to nixos --- platforms/home-manager/modules/nmasur/profiles/common.nix | 1 - .../modules/nmasur/presets/services/nix.nix | 7 ++++--- platforms/nixos/modules/nmasur/profiles/base.nix | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) rename platforms/{home-manager => nixos}/modules/nmasur/presets/services/nix.nix (88%) diff --git a/platforms/home-manager/modules/nmasur/profiles/common.nix b/platforms/home-manager/modules/nmasur/profiles/common.nix index 1a19e7b..0bd15f5 100644 --- a/platforms/home-manager/modules/nmasur/profiles/common.nix +++ b/platforms/home-manager/modules/nmasur/profiles/common.nix @@ -35,7 +35,6 @@ in nixpkgs.enable = lib.mkDefault true; }; services = { - nix.enable = lib.mkDefault true; loadkey.enable = lib.mkDefault true; }; }; diff --git a/platforms/home-manager/modules/nmasur/presets/services/nix.nix b/platforms/nixos/modules/nmasur/presets/services/nix.nix similarity index 88% rename from platforms/home-manager/modules/nmasur/presets/services/nix.nix rename to platforms/nixos/modules/nmasur/presets/services/nix.nix index 01ead83..b5ac9c4 100644 --- a/platforms/home-manager/modules/nmasur/presets/services/nix.nix +++ b/platforms/nixos/modules/nmasur/presets/services/nix.nix @@ -6,6 +6,7 @@ }: let + inherit (config.nmasur.settings) username; cfg = config.nmasur.presets.services.nix; in @@ -23,7 +24,7 @@ in # For security, only allow specific users settings.allowed-users = [ "@wheel" # Anyone in the wheel group - config.home.username # The current user + username # The current user ]; # Enable features in Nix commands @@ -49,10 +50,10 @@ in # Add community Cachix to binary cache # Don't use at work because blocked by corporate firewall builders-use-substitutes = true; - substituters = lib.mkIf (!config.nmasur.profiles.work.enable) [ + substituters = [ "https://nix-community.cachix.org" ]; - trusted-public-keys = lib.mkIf (!config.nmasur.profiles.work.enable) [ + trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; diff --git a/platforms/nixos/modules/nmasur/profiles/base.nix b/platforms/nixos/modules/nmasur/profiles/base.nix index dbea6c0..3ae85b6 100644 --- a/platforms/nixos/modules/nmasur/profiles/base.nix +++ b/platforms/nixos/modules/nmasur/profiles/base.nix @@ -21,6 +21,9 @@ in programs = { doas.enable = lib.mkDefault true; }; + services = { + nix.enable = lib.mkDefault true; + }; }; programs.fish.enable = lib.mkDefault config.home-manager.users.${username}.programs.fish.enable;