adhere to nixos systems

This commit is contained in:
2024-09-03 22:24:20 -04:00
parent fac5e52f36
commit 9350ff271f
12 changed files with 108 additions and 97 deletions

View File

@ -1,11 +1,11 @@
{
description = "Wyatt's nix configuration";
description = "Wyatt's nix configuration suite";
inputs = {
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-24.05";
# nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin";
@ -13,11 +13,6 @@
};
};
# The `outputs` function will return all the build results of the flake.
# A flake can have many use cases and different types of outputs,
# parameters in `outputs` are defined in `inputs` and can be referenced by their names.
# However, `self` is an exception, this special parameter points to the `outputs` itself (self-reference)
# The `@` syntax here is used to alias the attribute set of the inputs's parameter, making it convenient to use inside the function.
outputs = inputs @ {
self,
nixpkgs,
@ -25,37 +20,56 @@
home-manager,
...
}: let
username = "wyatt";
useremail = "wyatt@wyattjmiller.com";
system = "aarch64-darwin"; # aarch64-darwin or x86_64-darwin
hostname = "sephiroth";
userName = "wyatt";
userEmail = "wyatt@wyattjmiller.com";
# supportedSystems = ["x86_64-linux" "aarch64-darwin"];
# system = "aarch64-darwin"; # aarch64-darwin or x86_64-darwin
# hostname = "sephiroth";
# forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
specialArgs =
inputs
// {
inherit username useremail hostname;
inherit userName userEmail;
};
in {
darwinConfigurations."${hostname}" = darwin.lib.darwinSystem {
inherit system specialArgs;
# Primary laptop - MacBook Pro (2023, M3)
darwinConfigurations."sephiroth" = darwin.lib.darwinSystem {
inherit specialArgs;
system = "aarch64-darwin";
modules = [
./modules/nix-core.nix
./modules/system.nix
./modules/darwinSystem.nix
./modules/apps.nix
./modules/host-users.nix
# home manager
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = specialArgs;
home-manager.users.${username} = import ./home;
home-manager.users.${userName} = import ./home;
}
];
};
# nix code formatter
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra;
# Primary desktop computer
nixosConfiguration."cloud" = nixpkgs.lib.nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
/etc/nixos/configuration.nix
./modules/nix-core.nix
# ./modules/linuxSystem.nix
./modules/host-users.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${userName} = import ./home;
}
];
};
};
}