mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-15 05:02:10 +00:00
init
This commit is contained in:
commit
2bf50c8969
12 changed files with 784 additions and 0 deletions
62
flake.nix
Normal file
62
flake.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
description = "Rathi's macOS nix-darwin + Home Manager config";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
nix-darwin = {
|
||||
url = "github:LnL7/nix-darwin/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nix-homebrew = {
|
||||
url = "github:zhaofengli-wip/nix-homebrew";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
nix-darwin,
|
||||
home-manager,
|
||||
nix-homebrew,
|
||||
...
|
||||
}: let
|
||||
system = "aarch64-darwin";
|
||||
username = "rathi";
|
||||
hostname = "hari-macbook-pro";
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
in {
|
||||
formatter.${system} = pkgs.alejandra;
|
||||
|
||||
darwinConfigurations.${hostname} = nix-darwin.lib.darwinSystem {
|
||||
inherit system;
|
||||
specialArgs = {inherit inputs self username hostname;};
|
||||
modules = [
|
||||
./hosts/${hostname}
|
||||
home-manager.darwinModules.home-manager
|
||||
nix-homebrew.darwinModules.nix-homebrew
|
||||
{
|
||||
users.users.${username}.home = "/Users/${username}";
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.backupFileExtension = "hm-bak";
|
||||
home-manager.users.${username} = import ./home;
|
||||
|
||||
nix-homebrew = {
|
||||
enable = true;
|
||||
enableRosetta = true;
|
||||
user = username;
|
||||
autoMigrate = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue