Files
nixos/flake.nix
2026-02-24 07:35:35 -05:00

90 lines
2.7 KiB
Nix

{
description = "Michael's Nix Config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
hyprland.url = "github:hyprwm/Hyprland";
emacs-overlay.url = "github:nix-community/emacs-overlay";
noctalia = {
url = "github:noctalia-dev/noctalia-shell";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, nix-darwin, nixos-wsl, neovim-nightly-overlay, emacs-overlay, ... }@inputs:
let
user = "mthomson";
specialArgs = { inherit inputs user; };
overlays = [
neovim-nightly-overlay.overlays.default
emacs-overlay.overlay
];
mkHome = host: {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = specialArgs;
users.${user} = import ./hosts/${host}/home.nix;
};
};
in
{
nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = specialArgs;
modules = [
./hosts/desktop/configuration.nix
{ nixpkgs.overlays = overlays; }
home-manager.nixosModules.home-manager
(mkHome "desktop")
];
};
thinkpad = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = specialArgs;
modules = [
./hosts/thinkpad/configuration.nix
{ nixpkgs.overlays = overlays; }
home-manager.nixosModules.home-manager
(mkHome "thinkpad")
];
};
wsl = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = specialArgs;
modules = [
nixos-wsl.nixosModules.default
./hosts/wsl/configuration.nix
{ nixpkgs.overlays = overlays; }
home-manager.nixosModules.home-manager
(mkHome "wsl")
];
};
};
darwinConfigurations = {
macbook = nix-darwin.lib.darwinSystem {
specialArgs = specialArgs;
modules = [
./hosts/macbook/configuration.nix
{ nixpkgs.overlays = overlays; }
home-manager.darwinModules.home-manager
(mkHome "macbook")
];
};
};
};
}