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

View file

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