168 lines
4.3 KiB
Nix
168 lines
4.3 KiB
Nix
{
|
|
description = "Michael Thomas's NixOS configuration";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "nixpkgs/nixos-22.11";
|
|
unstable.url = "nixpkgs/nixos-unstable";
|
|
nur.url = "github:nix-community/NUR";
|
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
nixos-wsl = {
|
|
url = "github:nix-community/NixOS-WSL";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
darwin = {
|
|
url = "github:lnl7/nix-darwin/master";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
home-manager = {
|
|
url = "github:rycee/home-manager/release-22.05";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, unstable, nur, utils, nixos-wsl, darwin, home-manager, ... }@inputs: {
|
|
|
|
# This repo's overlay plus any other overlays you use
|
|
# If you want to use packages from flakes that are not nixpkgs (such as NUR), add their overlays here.\
|
|
overlays = {
|
|
default = import ./overlays inputs;
|
|
};
|
|
|
|
overlaysModule = {
|
|
nixpkgs.overlays = [ self.overlays.default ];
|
|
};
|
|
|
|
nixosConfigurations = {
|
|
|
|
loft = nixpkgs.lib.nixosSystem {
|
|
system = utils.lib.system.x86_64-linux;
|
|
modules = [
|
|
self.overlaysModule
|
|
home-manager.nixosModules.home-manager
|
|
./modules/common.nix
|
|
./modules/containers.nix
|
|
|
|
./machines/loft/configuration.nix
|
|
];
|
|
specialArgs = { inherit inputs; };
|
|
};
|
|
|
|
kitchen = nixpkgs.lib.nixosSystem {
|
|
system = utils.lib.system.x86_64-linux;
|
|
modules = [
|
|
self.overlaysModule
|
|
home-manager.nixosModules.home-manager
|
|
./modules/common.nix
|
|
./modules/containers.nix
|
|
|
|
./machines/kitchen/configuration.nix
|
|
];
|
|
specialArgs = { inherit inputs; };
|
|
};
|
|
|
|
# WSL environment
|
|
work = inputs.nixpkgs.lib.nixosSystem {
|
|
system = utils.lib.system.x86_64-linux;
|
|
modules = [
|
|
self.overlaysModule
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
nixpkgs.overlays = [
|
|
(import ./overlays/iptables)
|
|
];
|
|
}
|
|
./modules/containers.nix
|
|
./modules/nix.nix
|
|
./modules/vscode-server.nix
|
|
|
|
./machines/work/configuration.nix
|
|
];
|
|
specialArgs = { inherit inputs; };
|
|
};
|
|
|
|
};
|
|
|
|
darwinConfigurations = {
|
|
mac = darwin.lib.darwinSystem {
|
|
system = "aarch64-darwin";
|
|
specialArgs = { inherit inputs; };
|
|
modules = [
|
|
home-manager.darwinModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users.michael = import ./user/environments/mac/home.nix;
|
|
}
|
|
|
|
./machines/mac/configuration.nix
|
|
];
|
|
};
|
|
};
|
|
|
|
homeConfigurations = {
|
|
nixos = inputs.home-manager.lib.homeManagerConfiguration {
|
|
system = "x86_64-linux";
|
|
homeDirectory = "/home/michael";
|
|
username = "michael";
|
|
stateVersion = "21.05";
|
|
configuration = { config, pkgs, ... }:
|
|
{
|
|
programs.home-manager.enable = true;
|
|
|
|
imports = [
|
|
./user/environments/nixos/home.nix
|
|
];
|
|
};
|
|
};
|
|
|
|
wsl = inputs.home-manager.lib.homeManagerConfiguration {
|
|
system = "x86_64-linux";
|
|
homeDirectory = "/home/michael";
|
|
username = "michael";
|
|
stateVersion = "21.05";
|
|
configuration = { config, pkgs, ... }:
|
|
{
|
|
programs.home-manager.enable = true;
|
|
|
|
imports = [
|
|
./user/environments/wsl/home.nix
|
|
];
|
|
};
|
|
};
|
|
|
|
mac = inputs.home-manager.lib.homeManagerConfiguration {
|
|
system = "aarch64-darwin";
|
|
homeDirectory = "/Users/michael";
|
|
username = "michael";
|
|
stateVersion = "22.05";
|
|
configuration = { config, pkgs, ... }:
|
|
{
|
|
programs.home-manager.enable = true;
|
|
|
|
imports = [
|
|
./user/environments/mac/home.nix
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
};
|
|
# // utils.lib.eachSystem [ "aarch64-linux" "x86_64-darwin" "x86_64-linux" ] (system: {
|
|
# nixpkgs = import nixpkgs {
|
|
# inherit system;
|
|
# overlays = [
|
|
# self.overlays.default
|
|
# ];
|
|
# config.allowUnfree = true;
|
|
# };
|
|
# });
|
|
}
|