config: improve default host and user config

This commit is contained in:
Gabriel Arazas 2023-12-19 13:08:55 +08:00
parent c1e07bd7ac
commit cdc26a9f37
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -141,9 +141,6 @@
# Take note to only set as minimal configuration as possible since we're
# also using this with the stable version of nixpkgs.
hostSharedConfig = { options, config, lib, pkgs, ... }: {
# Some defaults for evaluating modules.
_module.check = true;
# Initialize some of the XDG base directories ourselves since it is
# used by NIX_PROFILES to properly link some of them.
environment.sessionVariables = {
@ -308,31 +305,26 @@
nix.package = lib.mkDefault pkgs.nixUnstable;
# Set the configurations for the package manager.
nix.settings =
let
substituters = [
"https://nix-community.cachix.org"
"https://foo-dogsquared.cachix.org"
];
in
{
# Set several binary caches.
inherit substituters;
trusted-substituters = substituters;
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"foo-dogsquared.cachix.org-1:/2fmqn/gLGvCs5EDeQmqwtus02TUmGy0ZlAEXqRE70E="
];
nix.settings = {
# Set several binary caches.
substituters = [
"https://nix-community.cachix.org"
"https://foo-dogsquared.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"foo-dogsquared.cachix.org-1:/2fmqn/gLGvCs5EDeQmqwtus02TUmGy0ZlAEXqRE70E="
];
# Sane config for the package manager.
# TODO: Remove this after nix-command and flakes has been considered
# stable.
#
# Since we're using flakes to make this possible, we need it. Plus, the
# UX of Nix CLI is becoming closer to Guix's which is a nice bonus.
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
auto-optimise-store = lib.mkDefault true;
};
# Sane config for the package manager.
# TODO: Remove this after nix-command and flakes has been considered
# stable.
#
# Since we're using flakes to make this possible, we need it. Plus, the
# UX of Nix CLI is becoming closer to Guix's which is a nice bonus.
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
auto-optimise-store = lib.mkDefault true;
};
# Stallman-senpai will be disappointed.
nixpkgs.config.allowUnfree = true;
@ -392,7 +384,6 @@
let
name = metadata.username or filename;
pkgs = import inputs.${metadata.nixpkgs-channel or "nixpkgs"} {};
path = ./users/home-manager/${name};
extraModules = [
({ lib, pkgs, config, ... }: {
# Don't create the user directories since they are assumed to
@ -409,7 +400,7 @@
})
userSharedConfig
nixSettingsSharedConfig
path
./users/home-manager/${name}
];
in
mkHome {