mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
modules: create dedicated default Nix config profile
This commit is contained in:
parent
ecad96688c
commit
1b4d91c67b
@ -25,33 +25,17 @@
|
||||
lib.nameValuePair name' { inherit flake; })
|
||||
inputs;
|
||||
|
||||
# Set the package for generating the configuration.
|
||||
nix.package = lib.mkDefault pkgs.nixStable;
|
||||
|
||||
# Set the configurations for the package manager.
|
||||
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;
|
||||
};
|
||||
|
||||
# Stallman-senpai will be disappointed.
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.settings.nix-path =
|
||||
(lib.mapAttrsToList
|
||||
(name: source:
|
||||
let
|
||||
name' = if (name == "self") then "config" else name;
|
||||
in
|
||||
"${name'}=${source}")
|
||||
inputs
|
||||
++ [
|
||||
"/nix/var/nix/profiles/per-user/root/channels"
|
||||
]);
|
||||
|
||||
# Extend nixpkgs with our overlays except for the NixOS-focused modules
|
||||
# here.
|
||||
|
@ -69,6 +69,7 @@
|
||||
|
||||
standaloneConfigModules = [
|
||||
defaultNixConf
|
||||
../../modules/home-manager/profiles/nix-conf.nix
|
||||
|
||||
({ config, lib, ... }: {
|
||||
# Don't create the user directories since they are assumed to
|
||||
|
@ -93,23 +93,11 @@
|
||||
# Bring our own teeny-tiny snippets of configurations.
|
||||
defaultNixConf
|
||||
../../modules/nixos/profiles/generic.nix
|
||||
../../modules/nixos/profiles/nix-conf.nix
|
||||
|
||||
# The NixOS module that came from flake-parts.
|
||||
({ config, lib, ... }: {
|
||||
_module.args = defaultExtraArgs;
|
||||
|
||||
# Set several paths for the traditional channels.
|
||||
nix.nixPath = lib.mkIf config.nix.channel.enable
|
||||
(lib.mapAttrsToList
|
||||
(name: source:
|
||||
let
|
||||
name' = if (name == "self") then "config" else name;
|
||||
in
|
||||
"${name'}=${source}")
|
||||
inputs
|
||||
++ [
|
||||
"/nix/var/nix/profiles/per-user/root/channels"
|
||||
]);
|
||||
})
|
||||
];
|
||||
};
|
||||
|
30
modules/home-manager/profiles/nix-conf.nix
Normal file
30
modules/home-manager/profiles/nix-conf.nix
Normal file
@ -0,0 +1,30 @@
|
||||
{ lib, pkgs, ... }: {
|
||||
|
||||
# Set the package for generating the configuration.
|
||||
nix.package = lib.mkDefault pkgs.nixStable;
|
||||
|
||||
# Set the configurations for the package manager.
|
||||
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;
|
||||
};
|
||||
|
||||
# Stallman-senpai will be disappointed.
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
}
|
30
modules/nixos/profiles/nix-conf.nix
Normal file
30
modules/nixos/profiles/nix-conf.nix
Normal file
@ -0,0 +1,30 @@
|
||||
{ lib, pkgs, ... }: {
|
||||
|
||||
# Set the package for generating the configuration.
|
||||
nix.package = lib.mkDefault pkgs.nixStable;
|
||||
|
||||
# Set the configurations for the package manager.
|
||||
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;
|
||||
};
|
||||
|
||||
# Stallman-senpai will be disappointed.
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
}
|
Loading…
Reference in New Issue
Block a user