2024-01-15 14:06:12 +00:00
|
|
|
{ inputs, lib, ... }: {
|
|
|
|
imports = [
|
|
|
|
./dev.nix
|
|
|
|
./packages.nix
|
|
|
|
./templates.nix
|
|
|
|
|
|
|
|
# The environment configurations.
|
|
|
|
./home-manager.nix
|
|
|
|
./nixos.nix
|
2024-01-25 14:51:05 +00:00
|
|
|
./nixvim.nix
|
2024-02-22 07:14:19 +00:00
|
|
|
|
|
|
|
# Subprojects.
|
|
|
|
./bahaghari.nix
|
2024-01-15 14:06:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
_module.args = {
|
|
|
|
# This will be shared among NixOS and home-manager configurations.
|
|
|
|
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;
|
|
|
|
|
2024-01-27 08:51:10 +00:00
|
|
|
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"
|
|
|
|
]);
|
2024-01-15 14:06:12 +00:00
|
|
|
|
|
|
|
# Extend nixpkgs with our overlays except for the NixOS-focused modules
|
|
|
|
# here.
|
|
|
|
nixpkgs.overlays = lib.attrValues inputs.self.overlays;
|
|
|
|
};
|
|
|
|
|
|
|
|
defaultOverlays = lib.attrValues inputs.self.overlays;
|
|
|
|
};
|
|
|
|
|
|
|
|
perSystem = { lib, system, ... }: {
|
|
|
|
_module.args = {
|
2024-01-16 06:54:50 +00:00
|
|
|
# nixpkgs for this module should be used as less as possible especially
|
|
|
|
# for building NixOS and home-manager systems.
|
2024-01-15 14:06:12 +00:00
|
|
|
pkgs = import inputs.nixpkgs {
|
|
|
|
inherit system;
|
2024-01-20 09:23:13 +00:00
|
|
|
config.allowUnfree = true;
|
2024-01-15 14:06:12 +00:00
|
|
|
overlays = lib.attrValues inputs.self.overlays ++ [
|
|
|
|
inputs.nur.overlay
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|