summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.nix4
-rw-r--r--hosts/profiles.nix32
-rw-r--r--modules/nixos/base/default.nix1
-rw-r--r--modules/nixos/server/default.nix13
-rw-r--r--modules/shared/base/nix.nix23
5 files changed, 28 insertions, 45 deletions
diff --git a/flake.nix b/flake.nix
index 1c59c2d..873d7a0 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,8 +3,8 @@
nixConfig = {
extra-substituters = [
- "https://getchoo.cachix.org" # personal cache
- "https://nix-community.cachix.org" # nix-community
+ "https://getchoo.cachix.org"
+ "https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="
diff --git a/hosts/profiles.nix b/hosts/profiles.nix
index 21b0be3..ab1122b 100644
--- a/hosts/profiles.nix
+++ b/hosts/profiles.nix
@@ -2,34 +2,6 @@
inputs,
self,
}: let
- common = {
- nixpkgs = {
- overlays = with inputs; [nur.overlay getchoo.overlays.default self.overlays.default];
- config.allowUnfree = true;
- };
-
- nix = {
- registry =
- {
- n.flake = inputs.nixpkgs;
- }
- // (builtins.mapAttrs (_: flake: {inherit flake;})
- (inputs.nixpkgs.lib.filterAttrs (n: _: n != "nixpkgs") inputs));
-
- settings = {
- trusted-substituters = [
- "https://getchoo.cachix.org"
- "https://nix-community.cachix.org"
- ];
-
- trusted-public-keys = [
- "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="
- "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
- ];
- };
- };
- };
-
specialArgs = inputs // {inherit inputs;};
in {
personal = {
@@ -38,7 +10,6 @@ in {
inherit specialArgs;
modules = with inputs; [
- common
ragenix.nixosModules.default
home-manager.nixosModules.home-manager
nur.nixosModules.nur
@@ -67,7 +38,6 @@ in {
builder = inputs.darwin.lib.darwinSystem;
inherit specialArgs;
modules = with inputs; [
- common
home-manager.darwinModules.home-manager
../users/seth
@@ -130,7 +100,7 @@ in {
enabledCollectors = ["systemd"];
};
- nix.registry.nixpkgs.flake = nixpkgs-stable;
+ nix.registry.n.flake = nixpkgs-stable;
system.stateVersion = "23.05";
}
];
diff --git a/modules/nixos/base/default.nix b/modules/nixos/base/default.nix
index 3e6a97e..ed0fb23 100644
--- a/modules/nixos/base/default.nix
+++ b/modules/nixos/base/default.nix
@@ -13,6 +13,7 @@ in {
./documentation.nix
./locale.nix
./network.nix
+ ./nix.nix
./packages.nix
./root.nix
./security.nix
diff --git a/modules/nixos/server/default.nix b/modules/nixos/server/default.nix
index dd8e40b..f1ef1db 100644
--- a/modules/nixos/server/default.nix
+++ b/modules/nixos/server/default.nix
@@ -29,18 +29,7 @@ in {
options = "-d --delete-older-than 2d";
};
- settings = {
- allowed-users = [config.networking.hostName];
- trusted-substituters = [
- "https://getchoo.cachix.org"
- "https://nix-community.cachix.org"
- ];
-
- trusted-public-keys = [
- "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="
- "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
- ];
- };
+ settings.allowed-users = [config.networking.hostName];
};
nixpkgs.overlays = [(_: prev: {unstable = import nixpkgs {inherit (prev) system;};})];
diff --git a/modules/shared/base/nix.nix b/modules/shared/base/nix.nix
index 21af0e0..d1b7e60 100644
--- a/modules/shared/base/nix.nix
+++ b/modules/shared/base/nix.nix
@@ -1,5 +1,6 @@
{
config,
+ inputs,
lib,
pkgs,
...
@@ -12,9 +13,26 @@ in {
config = mkIf cfg.enable {
nix = {
+ registry =
+ {
+ n.flake = mkDefault inputs.nixpkgs;
+ }
+ // (builtins.mapAttrs (_: flake: {inherit flake;})
+ (inputs.nixpkgs.lib.filterAttrs (n: _: n != "nixpkgs") inputs));
+
settings = {
auto-optimise-store = isLinux;
experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"];
+
+ trusted-substituters = [
+ "https://getchoo.cachix.org"
+ "https://nix-community.cachix.org"
+ ];
+
+ trusted-public-keys = [
+ "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="
+ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
+ ];
};
gc = {
@@ -22,5 +40,10 @@ in {
options = mkDefault "--delete-older-than 7d";
};
};
+
+ nixpkgs = {
+ overlays = with inputs; [nur.overlay getchoo.overlays.default self.overlays.default];
+ config.allowUnfree = true;
+ };
};
}