improve flake config formatting a bit

This commit is contained in:
Gabriel Fontes 2022-08-08 20:24:37 -03:00
parent f8b2aed834
commit be00b40c8f
No known key found for this signature in database
GPG key ID: 2E54EA7BFE630916
2 changed files with 24 additions and 35 deletions

View file

@ -22,21 +22,20 @@
# FIXME replace with your hostname # FIXME replace with your hostname
your-hostname = nixpkgs.lib.nixosSystem { your-hostname = nixpkgs.lib.nixosSystem {
pkgs = nixpkgs.legacyPackages.x86_64-linux; pkgs = nixpkgs.legacyPackages.x86_64-linux;
specialArgs = { inherit inputs; }; # Pass flake inputs to our config
# > Our main nixos configuration file <
modules = [ ./nixos/configuration.nix ]; modules = [ ./nixos/configuration.nix ];
# Pass inputs down to our config, so that they can consume flake inputs
specialArgs = { inherit inputs; };
}; };
}; };
homeConfigurations = { homeConfigurations = {
# FIXME replace with your username@hostname # FIXME replace with your username@hostname
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration { "your-username@your-hostname" =
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs; }; # Pass flake inputs to our config
# > Our main home-manager configuration file <
modules = [ ./home-manager/home.nix ]; modules = [ ./home-manager/home.nix ];
# Pass inputs down to our config, so that they can consume flake inputs
extraSpecialArgs = { inherit inputs; };
}; };
}; };
}; };

View file

@ -27,12 +27,9 @@
"aarch64-darwin" "aarch64-darwin"
"x86_64-darwin" "x86_64-darwin"
]; ];
in in rec {
rec {
# Your custom packages and modifications # Your custom packages and modifications
overlays = { overlays = { default = import ./overlay { inherit inputs; }; };
default = import ./overlay { inherit inputs; };
};
# Reusable nixos modules you might want to export # Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs # These are usually stuff you would upstream into nixpkgs
@ -53,37 +50,30 @@
import inputs.nixpkgs { import inputs.nixpkgs {
inherit system; inherit system;
overlays = builtins.attrValues overlays; overlays = builtins.attrValues overlays;
} });
);
nixosConfigurations = { nixosConfigurations = {
# FIXME replace with your hostname # FIXME replace with your hostname
your-hostname = nixpkgs.lib.nixosSystem { your-hostname = nixpkgs.lib.nixosSystem {
pkgs = legacyPackages.x86_64-linux; pkgs = legacyPackages.x86_64-linux;
specialArgs = { inherit inputs; }; # Pass flake inputs to our config
modules = [ modules = (builtins.attrValues nixosModules) ++ [
# > Our main nixos configuration file < # > Our main nixos configuration file <
./nixos/configuration.nix ./nixos/configuration.nix
] ++ (builtins.attrValues nixosModules); # Import our reusable nixos modules ];
# Pass inputs down to our config, so that they can consume flake inputs
specialArgs = { inherit inputs; };
}; };
}; };
homeConfigurations = { homeConfigurations = {
# FIXME replace with your username@hostname # FIXME replace with your username@hostname
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration { "your-username@your-hostname" =
home-manager.lib.homeManagerConfiguration {
pkgs = legacyPackages.x86_64-linux; pkgs = legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs; }; # Pass flake inputs to our config
modules = [ modules = (builtins.attrValues homeManagerModules) ++ [
# > Our main home-manager configuration file < # > Our main home-manager configuration file <
./home-manager/home.nix ./home-manager/home.nix
# Import our reusable home-manager modules ];
] ++ (builtins.attrValues homeManagerModules); # Import our reusable home-manager modules
# Pass inputs down to our config, so that they can consume flake inputs
extraSpecialArgs = { inherit inputs; };
}; };
}; };
}; };