mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
flake-parts/setups: update shared Nix config
At least we've set the right sources for the system's nixpkgs and home-manager branches.
This commit is contained in:
parent
f3462beed8
commit
ec3fdab52c
@ -17,30 +17,6 @@
|
|||||||
_module.args = {
|
_module.args = {
|
||||||
# This will be shared among NixOS and home-manager configurations.
|
# This will be shared among NixOS and home-manager configurations.
|
||||||
defaultNixConf = { config, lib, pkgs, ... }: {
|
defaultNixConf = { config, lib, pkgs, ... }: {
|
||||||
# I want to capture the usual flakes to its exact version so we're
|
|
||||||
# making them available to our system. This will also prevent the
|
|
||||||
# annoying downloads since it always get the latest revision.
|
|
||||||
nix.registry =
|
|
||||||
lib.mapAttrs'
|
|
||||||
(name: flake:
|
|
||||||
let
|
|
||||||
name' = if (name == "self") then "config" else name;
|
|
||||||
in
|
|
||||||
lib.nameValuePair name' { inherit flake; })
|
|
||||||
inputs;
|
|
||||||
|
|
||||||
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
|
# Extend nixpkgs with our overlays except for the NixOS-focused modules
|
||||||
# here.
|
# here.
|
||||||
nixpkgs.overlays = lib.attrValues inputs.self.overlays;
|
nixpkgs.overlays = lib.attrValues inputs.self.overlays;
|
||||||
|
@ -200,6 +200,7 @@ in
|
|||||||
type = with lib.types; attrsOf (submoduleWith {
|
type = with lib.types; attrsOf (submoduleWith {
|
||||||
specialArgs = { inherit (config) systems; };
|
specialArgs = { inherit (config) systems; };
|
||||||
modules = [
|
modules = [
|
||||||
|
(import ./shared/nix-conf.nix { inherit inputs; })
|
||||||
./shared/nixvim-instance-options.nix
|
./shared/nixvim-instance-options.nix
|
||||||
./shared/config-options.nix
|
./shared/config-options.nix
|
||||||
configType
|
configType
|
||||||
|
@ -459,11 +459,6 @@ let
|
|||||||
{
|
{
|
||||||
nixpkgs.overlays = setupConfig.overlays;
|
nixpkgs.overlays = setupConfig.overlays;
|
||||||
networking.hostName = lib.mkDefault setupConfig.hostname;
|
networking.hostName = lib.mkDefault setupConfig.hostname;
|
||||||
|
|
||||||
nix.settings.nix-path = lib.mkBefore [
|
|
||||||
"home-manager=${inputs.${setupConfig.homeManagerBranch}}"
|
|
||||||
"nixpkgs=${inputs.${setupConfig.nixpkgsBranch}}"
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(lib.mkIf (setupConfig.domain != null) {
|
(lib.mkIf (setupConfig.domain != null) {
|
||||||
@ -489,6 +484,7 @@ in
|
|||||||
type = with lib.types; attrsOf (submoduleWith {
|
type = with lib.types; attrsOf (submoduleWith {
|
||||||
specialArgs = { inherit (config) systems; };
|
specialArgs = { inherit (config) systems; };
|
||||||
modules = [
|
modules = [
|
||||||
|
(import ./shared/nix-conf.nix { inherit inputs; })
|
||||||
./shared/config-options.nix
|
./shared/config-options.nix
|
||||||
./shared/nixvim-instance-options.nix
|
./shared/nixvim-instance-options.nix
|
||||||
configType
|
configType
|
||||||
|
39
modules/flake-parts/setups/shared/nix-conf.nix
Normal file
39
modules/flake-parts/setups/shared/nix-conf.nix
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{ inputs }:
|
||||||
|
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inputs' = inputs // {
|
||||||
|
nixpkgs = inputs.${config.nixpkgsBranch};
|
||||||
|
home-manager = inputs.${config.homeManagerBranch};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config.modules = [(
|
||||||
|
{ lib, ... }: {
|
||||||
|
# I want to capture the usual flakes to its exact version so we're
|
||||||
|
# making them available to our system. This will also prevent the
|
||||||
|
# annoying downloads since it always get the latest revision.
|
||||||
|
nix.registry =
|
||||||
|
lib.mapAttrs'
|
||||||
|
(name: flake:
|
||||||
|
let
|
||||||
|
name' = if (name == "self") then "config" else name;
|
||||||
|
in
|
||||||
|
lib.nameValuePair name' { inherit flake; })
|
||||||
|
inputs';
|
||||||
|
|
||||||
|
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"
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
)];
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user