nix-config/flake.nix
2023-10-14 18:53:32 +02:00

76 lines
2.1 KiB
Nix

#
# flake.nix *
# ├─ ./hosts
# │ └─ default.nix
# ├─ ./darwin
# │ └─ default.nix
# └─ ./nix
# └─ default.nix
#
{
description = "Nix, NixOS and Nix Darwin System Flake Configuration";
inputs =
# References Used by Flake
{
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; # Stable Nix Packages (Default)
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # Unstable Nix Packages
home-manager = {
# User Environment Manager
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
# NUR Community Packages
url = "github:nix-community/NUR"; # Requires "nur.nixosModules.nur" to be added to the host modules
};
hyprland = {
# Official Hyprland Flake
url = "github:hyprwm/Hyprland"; # Requires "hyprland.nixosModules.default" to be added the host modules
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
split-monitor-workspaces = {
url = "github:Duckonaut/split-monitor-workspaces";
inputs.hyprland.follows = "hyprland"; # <- make sure this line is present for the plugin to work as intended
};
};
outputs = inputs @ {
self,
nixpkgs,
nixpkgs-unstable,
home-manager,
nur,
hyprland,
split-monitor-workspaces,
...
}:
# Function telling flake which inputs to use
let
vars = {
# Variables Used In Flake
user = "ghoscht";
location = "$HOME/.setup";
terminal = "alacritty";
editor = "nvim";
};
in {
nixosConfigurations = ( # NixOS Configurations
import ./hosts {
inherit (nixpkgs) lib;
inherit inputs nixpkgs nixpkgs-unstable home-manager nur hyprland split-monitor-workspaces vars; # Inherit inputs
}
);
homeConfigurations = ( # Nix Configurations
import ./nix/home.nix {
inherit (nixpkgs) lib;
inherit inputs nixpkgs nixpkgs-unstable home-manager vars hyprland split-monitor-workspaces;
}
);
};
}