flake.nix: format the file

This commit is contained in:
Gabriel Arazas 2022-08-06 14:00:04 +08:00
parent e4d1bf6af6
commit 472af7efd1

View File

@ -2,7 +2,6 @@
description = "foo-dogsquared's NixOS config as a flake"; description = "foo-dogsquared's NixOS config as a flake";
nixConfig = { nixConfig = {
extra-experimental-features = "nix-command flakes";
extra-substituters = extra-substituters =
"https://nix-community.cachix.org https://foo-dogsquared.cachix.org"; "https://nix-community.cachix.org https://foo-dogsquared.cachix.org";
extra-trusted-public-keys = extra-trusted-public-keys =
@ -173,10 +172,10 @@
[ "python3.10-django-3.1.14" ]; [ "python3.10-django-3.1.14" ];
# Set several paths for the traditional channels. # Set several paths for the traditional channels.
nix.nixPath = [ nix.nixPath =
lib'.mapAttrsToList (name: value: "${name}=${value}") inputs
++ [
"nixpkgs=${nixpkgs}" "nixpkgs=${nixpkgs}"
"home-manager=${inputs.home-manager}"
"nur=${inputs.nur}"
"config=${self}" "config=${self}"
"/nix/var/nix/profiles/per-user/root/channels" "/nix/var/nix/profiles/per-user/root/channels"
]; ];
@ -262,22 +261,25 @@
manpages.enable = true; manpages.enable = true;
}; };
}; };
in
in { {
# Exposes only my library with the custom functions to make it easier to # Exposes only my library with the custom functions to make it easier to
# include in other flakes for whatever reason may be. # include in other flakes for whatever reason may be.
lib = import ./lib { lib = nixpkgs.lib; }; lib = import ./lib { lib = nixpkgs.lib; };
# A list of NixOS configurations from the `./hosts` folder. It also has # A list of NixOS configurations from the `./hosts` folder. It also has
# some sensible default configurations. # some sensible default configurations.
nixosConfigurations = lib'.mapAttrsRecursive (host: path: nixosConfigurations = lib'.mapAttrsRecursive
(host: path:
let let
extraModules = [ extraModules = [
{ networking.hostName = builtins.baseNameOf path; } { networking.hostName = builtins.baseNameOf path; }
hostDefaultConfig hostDefaultConfig
path path
]; ];
in mkHost { inherit extraModules; }) (lib'.filesToAttr ./hosts); in
mkHost { inherit extraModules; })
(lib'.filesToAttr ./hosts);
# We're going to make our custom modules available for our flake. Whether # We're going to make our custom modules available for our flake. Whether
# or not this is a good thing is debatable, I just want to test it. # or not this is a good thing is debatable, I just want to test it.