config/flake.nix

103 lines
2.8 KiB
Nix
Raw Normal View History

2024-09-15 12:56:25 +01:00
{
description = "SpyHoodle Nix Configuration";
inputs = {
# Nixpkgs Unstable
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
# Home Manager
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# Nix Darwin
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
# Hyprland
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
hyprland.inputs.nixpkgs.follows = "nixpkgs";
# Any Run
anyrun.url = "github:Kirottu/anyrun";
anyrun.inputs.nixpkgs.follows = "nixpkgs";
# Woomer
woomer.url = "github:coffeeispower/woomer";
woomer.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, home-manager, nix-darwin, ... } @ inputs:
let
username = "maddie";
nixpkgs_aarch64_darwin = import nixpkgs {
config.allowUnfree = true;
system = "aarch64-darwin";
};
nixpkgs_x86_64_linux = import nixpkgs {
config.allowUnfree = true;
system = "x86_64-linux";
overlays = import ./overlays.nix;
};
in
{
nixosConfigurations."desktop" = nixpkgs.lib.nixosSystem
{
specialArgs = {
inherit username;
inherit inputs;
};
2024-09-15 12:56:25 +01:00
pkgs = nixpkgs_x86_64_linux;
system = "x86_64-linux";
modules = [
# Home Manager Modules
2024-09-15 12:56:25 +01:00
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = {
inherit username;
inherit inputs;
pkgs = nixpkgs_x86_64_linux;
};
2024-09-15 12:56:25 +01:00
home-manager.users.${username}.imports = [
./homes/common
./homes/desktop
2024-09-15 12:56:25 +01:00
inputs.anyrun.homeManagerModules.default
];
}
# NixOS Modules
./systems/desktop
2024-09-15 12:56:25 +01:00
];
};
darwinConfigurations."laptop" = nix-darwin.lib.darwinSystem {
pkgs = nixpkgs_aarch64_darwin;
system = "aarch64-darwin";
specialArgs = {
inherit username;
};
modules = [
# Home Manager Modules
home-manager.darwinModules.home-manager
{
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit username;
pkgs = nixpkgs_aarch64_darwin;
};
home-manager.users.${username}.imports = [
./homes/laptop
./homes/common
2024-09-15 12:56:25 +01:00
];
}
2024-09-15 12:56:25 +01:00
# Nix Darwin Modules
./systems/laptop
2024-09-15 12:56:25 +01:00
];
};
2024-09-15 12:56:25 +01:00
formatter.aarch64-darwin = nixpkgs_aarch64_darwin.legacyPackages.aarch64-darwin.nixpkgs-fmt;
formatter.x86_64-linux = nixpkgs_x86_64_linux.legacyPackages.x86_64-linux.nixpkgs-fmt;
2024-09-15 12:56:25 +01:00
};
}