nix-managed-macbook/flake.nix

110 lines
2.9 KiB
Nix
Raw Normal View History

{
2024-01-31 16:00:03 +05:30
description = "Nix Darwin + Home Manager configuration of Abhinav Sarkar";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
2024-10-18 17:41:54 +05:30
nixpkgs-stable.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin";
2023-11-25 16:13:20 +05:30
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-09-14 12:15:52 +05:30
nix-vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-compat.follows = "flake-compat";
flake-utils.follows = "flake-utils";
};
};
nixd = {
url = "github:nix-community/nixd/2.5.1";
2024-09-14 12:15:52 +05:30
inputs.nixpkgs.follows = "nixpkgs";
};
2024-11-25 15:56:47 +05:30
hell = {
url = "github:chrisdone/hell";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
2024-07-12 07:46:14 +05:30
lix-module = {
2024-11-26 20:33:25 +05:30
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz";
2024-07-12 07:46:14 +05:30
inputs.nixpkgs.follows = "nixpkgs";
2024-09-14 12:15:52 +05:30
inputs.flake-utils.follows = "flake-utils";
2024-07-12 07:46:14 +05:30
};
2024-09-14 12:15:52 +05:30
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
dm-mono-font = {
url = "github:googlefonts/dm-mono";
flake = false;
};
};
2024-10-22 18:53:09 +05:30
outputs =
inputs@{
self,
nixpkgs,
nixpkgs-stable,
nix-darwin,
home-manager,
lix-module,
...
}:
let
2024-11-23 22:49:32 +05:30
system = "aarch64-darwin";
pkgs = import nixpkgs {
inherit system;
2024-10-22 18:53:09 +05:30
config = {
allowUnfree = true;
};
};
2024-10-18 17:41:54 +05:30
pkgs-stable = import nixpkgs-stable {
inherit system;
2024-10-22 18:53:09 +05:30
config = {
allowUnfree = true;
};
2024-10-18 17:41:54 +05:30
};
2024-10-22 18:53:09 +05:30
in
{
2024-11-23 22:49:32 +05:30
darwinConfigurations."Abhinavs-M4-MacBook-Pro" = nix-darwin.lib.darwinSystem {
2023-11-25 16:13:20 +05:30
inherit system;
2024-10-22 18:53:09 +05:30
specialArgs = {
inherit inputs pkgs-stable;
};
2023-11-25 16:13:20 +05:30
modules = [
./configuration.nix
2024-01-31 16:00:03 +05:30
./homebrew.nix
2024-07-12 07:46:14 +05:30
lix-module.nixosModules.default
2023-11-25 16:13:20 +05:30
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
2024-05-02 19:05:26 +05:30
home-manager.backupFileExtension = "backup";
2023-11-25 16:13:20 +05:30
home-manager.users.abhinav = import ./home.nix;
2024-10-22 18:53:09 +05:30
home-manager.extraSpecialArgs = {
inherit inputs pkgs-stable;
nixd = inputs.nixd.packages.${system}.nixd;
2024-11-25 15:56:47 +05:30
hell = inputs.hell.packages.${system}.default;
2024-10-22 18:53:09 +05:30
};
2023-11-25 16:13:20 +05:30
}
];
};
devShells.${system}.default = pkgs.mkShell {
2024-10-22 18:53:09 +05:30
buildInputs = with pkgs; [
(import home-manager { inherit pkgs; }).home-manager
just
2024-11-23 22:49:32 +05:30
nix-output-monitor
nvd
2024-10-22 18:53:09 +05:30
];
shellHook = ''
2023-11-25 16:13:20 +05:30
export NIXPKGS_PATH=${pkgs.path};
'';
};
};
}