summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorAmir Saeid <amir@glgdgt.com>2026-03-08 20:12:44 +0000
committerAmir Saeid <amir@glgdgt.com>2026-03-08 20:12:44 +0000
commit1b95597c921f7a94e0e7b08871d51f941076c319 (patch)
tree663383bc82412d690cd44927bf8cd289d3a3c4c6 /flake.nix
Initial commit
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix77
1 files changed, 77 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..c0d9f5f
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,77 @@
+{
+ description = "Amir's Home Manager";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
+ home-manager = {
+ url = "github:nix-community/home-manager/release-25.11";
+ };
+ unstable = {
+ url = "github:NixOS/nixpkgs/nixos-unstable";
+ };
+ flake-utils = {
+ url = "github:numtide/flake-utils";
+ };
+ };
+
+ outputs = { self, nixpkgs, home-manager, unstable, flake-utils, ... }:
+ let
+ mkExtraArgs = system: {
+ unstablePkgs = import unstable {
+ inherit system;
+ config.allowUnfree = false;
+ };
+ unfreePkgs = import nixpkgs {
+ inherit system;
+ config.allowUnfree = true;
+ };
+ unstableUnfreePkgs = import unstable {
+ inherit system;
+ config.allowUnfree = true;
+ };
+ };
+
+ mkHostConfig = { hostname, system ? "aarch64-darwin" }: {
+ pkgs = import nixpkgs {
+ inherit system;
+ config = {
+ allowUnfree = false;
+ };
+ };
+ modules = [ ./hosts/${hostname}/home.nix ];
+ extraSpecialArgs = (mkExtraArgs system) // {
+ inherit hostname;
+ hmLib = home-manager.lib;
+ };
+ };
+ in
+ flake-utils.lib.eachDefaultSystem
+ (system:
+ let
+ pkgs = import nixpkgs {
+ inherit system;
+ config = {
+ allowUnfree = false;
+ };
+ };
+ in
+ {
+ packages = {
+ default = home-manager.packages.${system}.home-manager;
+ };
+
+ devShells.default = pkgs.mkShell {
+ buildInputs = with pkgs; [
+ #home-manager
+ home-manager.packages.${system}.home-manager
+ nixpkgs-fmt
+ ];
+ };
+ }
+ ) // {
+ homeConfigurations = {
+ mentat = home-manager.lib.homeManagerConfiguration (mkHostConfig { hostname = "mentat"; });
+ gheshki = home-manager.lib.homeManagerConfiguration (mkHostConfig { hostname = "gheshki"; });
+ };
+ };
+}