mirror of
https://github.com/srid/nixos-config.git
synced 2026-02-28 16:12:54 +08:00
factor out common hm config
This commit is contained in:
parent
a568f38cba
commit
ef17d1b04e
1 changed files with 35 additions and 22 deletions
57
flake.nix
57
flake.nix
|
|
@ -82,25 +82,46 @@
|
|||
{
|
||||
# Configuration common to all Linux systems
|
||||
nixosModules = {
|
||||
common = {
|
||||
imports = [
|
||||
./nixos/caches
|
||||
];
|
||||
};
|
||||
default = inputs.nixpkgs.lib.mkMerge [
|
||||
self.nixosModules.common
|
||||
common.imports = [
|
||||
./nixos/caches
|
||||
];
|
||||
home.imports = [
|
||||
home-manager.nixosModules.home-manager
|
||||
({
|
||||
imports = [
|
||||
./nixos/self-ide.nix
|
||||
./nixos/takemessh
|
||||
./nixos/current-location.nix
|
||||
];
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
})
|
||||
];
|
||||
default.imports =
|
||||
self.nixosModules.common.imports ++
|
||||
self.nixosModules.home.imports ++
|
||||
[
|
||||
./nixos/self-ide.nix
|
||||
./nixos/takemessh
|
||||
./nixos/current-location.nix
|
||||
];
|
||||
};
|
||||
# Configuration common to macOS Linux systems
|
||||
# Configuration common to all macOS systems
|
||||
darwinModules = {
|
||||
default = self.nixosModules.common;
|
||||
common = self.nixosConfig.common;
|
||||
home.imports = [
|
||||
home-manager.darwinModules.home-manager
|
||||
({
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
system = "aarch64-darwin";
|
||||
};
|
||||
})
|
||||
];
|
||||
default.imports =
|
||||
self.darwinModules.common ++
|
||||
self.darwinModules.home.imports;
|
||||
};
|
||||
# Configurations for Linux (NixOS) systems
|
||||
nixosConfigurations =
|
||||
|
|
@ -108,11 +129,7 @@
|
|||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
homeModules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit system inputs; };
|
||||
home-manager.users.${userName} = { pkgs, ... }: {
|
||||
imports = platformIndependentHomeModules ++ [
|
||||
(import ./home/git.nix {
|
||||
|
|
@ -174,11 +191,7 @@
|
|||
modules = [
|
||||
self.darwinModules.default
|
||||
./systems/darwin.nix
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit system inputs; };
|
||||
home-manager.users.${userName} = { pkgs, ... }: {
|
||||
imports = platformIndependentHomeModules ++ [
|
||||
(import ./home/git.nix {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue