config/flake.nix

115 lines
3.3 KiB
Nix
Raw Permalink Normal View History

2024-09-15 12:56:25 +01:00
{
2024-10-07 17:03:16 +01:00
description = "SpyHoodle's personal nix system configurations";
2024-09-15 12:56:25 +01:00
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";
# Lix Module
lix-module.url = "git+https://git.lix.systems/lix-project/nixos-module?ref=refs/tags/2.91.0";
lix-module.inputs.nixpkgs.follows = "nixpkgs";
# Neovim configuration
editor.url = "github:spyhoodle/editor";
editor.inputs.nixpkgs.follows = "nixpkgs";
2024-09-15 12:56:25 +01:00
};
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
inputs.lix-module.nixosModules.default
2024-09-15 12:56:25 +01:00
];
};
darwinConfigurations."laptop" = nix-darwin.lib.darwinSystem {
pkgs = nixpkgs_aarch64_darwin;
system = "aarch64-darwin";
specialArgs = {
inherit username;
inherit inputs;
2024-09-15 12:56:25 +01:00
};
modules = [
# Home Manager Modules
home-manager.darwinModules.home-manager
{
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit username;
inherit inputs;
2024-09-15 12:56:25 +01:00
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
inputs.lix-module.nixosModules.default
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
};
}