[feat] Add darwin

This commit is contained in:
Uttarayan
2024-02-15 03:21:07 +05:30
parent 58084329f5
commit 504af4026f
3 changed files with 136 additions and 46 deletions

View File

@@ -1,5 +1,11 @@
.PHONY: run build .PHONY: run build genzai
default: build
switch: switch:
nix run home-manager/master -- switch --flake ~/.local/share/dotfiles/config/nix nix run home-manager/master -- switch --flake ~/.local/share/dotfiles/config/nix
init: build:
nix run home-manager/master -- init --switch ~/.local/share/dotfiles/config/nix nix run home-manager/master -- build --flake ~/.local/share/dotfiles/config/nix
genzai:
nix build .#homeConfigurations.genzai

36
config/nix/flake.lock generated
View File

@@ -82,6 +82,24 @@
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": { "locked": {
"lastModified": 1701680307, "lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
@@ -140,7 +158,7 @@
}, },
"neovim-flake": { "neovim-flake": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"neovim-nightly-overlay", "neovim-nightly-overlay",
"nixpkgs" "nixpkgs"
@@ -219,6 +237,7 @@
"root": { "root": {
"inputs": { "inputs": {
"darwin": "darwin", "darwin": "darwin",
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
@@ -238,6 +257,21 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@@ -13,71 +13,121 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { outputs = {
nixpkgs, nixpkgs,
home-manager, home-manager,
darwin, darwin,
flake-utils,
... ...
} @ inputs: let } @ inputs: let
devices = [ devices = [
{ {
device = "mirai"; name = "mirai";
system = "x86_64-linux"; system = "x86_64-linux";
user = "fs0c131y";
} }
{ {
device = "genzai"; name = "genzai";
system = "x86_64-linux"; system = "x86_64-linux";
user = "fs0c131y";
} }
{ {
device = "Uttarayans-MacBook-Pro"; name = "Uttarayans-MacBook-Pro";
system = "aarch64-darwin"; system = "aarch64-darwin";
user = "fs0c131y";
} }
{ {
device = "deck"; name = "SteamDeck";
system = "x86_64-linux"; system = "x86_64-linux";
user = "deck";
} }
]; ];
linux = builtins.filter (x: x.system == "x86_64-linux") devices;
darwin = builtins.filter (x: x.system == "aarch64-darwin") devices;
in { in {
homeConfigurations = let homeConfigurations = builtins.listToAttrs (builtins.map (device: {
system = "x86_64-linux"; name = device.user;
overlays = [inputs.neovim-nightly-overlay.overlay]; value = let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${device.system};
in { overlays = [inputs.neovim-nightly-overlay.overlay];
"fs0c131y" = home-manager.lib.homeManagerConfiguration { in
inherit pkgs; home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home.nix
{
nixpkgs.overlays = overlays;
}
];
};
})
linux);
modules = [ darwinConfigurations = builtins.listToAttrs (builtins.map (device: {
./home.nix name = device.name;
{ value = let
nixpkgs.overlays = overlays; pkgs = nixpkgs.legacyPackages.${device.system};
} in {
]; "Uttarayans-MacBook-Pro" = darwin.lib.darwinSystem {
}; modules = [
}; home-manager.darwinModules.home-manager
./darwin.nix
# darwinConfigurations = let ({config, ...}: {
# system = "aarch64-darwin"; home-manager = {
# pkgs = nixpkgs.legacyPackages.${system}; users = {
# in { fs0c131y = {
# "Uttarayans-MacBook-Pro" = darwin.lib.darwinSystem { home = "/Users/${device.user}";
# modules = [ stateVersion = "21.05";
# home-manager.darwinModules.home-manager configuration = home-manager.configurations.fs0c131y;
# ./darwin.nix };
# ({config, ...}: { };
# home-manager = { };
# users = { })
# fs0c131y = { ];
# home = "/Users/fs0c131y"; };
# stateVersion = "21.05"; };
# configuration = home-manager.configurations.fs0c131y; })
# }; darwin);
# };
# };
# })
# ];
# };
# };
}; };
} }
# "fs0c131y" = let
# system = "x86_64-linux";
# overlays = [inputs.neovim-nightly-overlay.overlay];
# pkgs = nixpkgs.legacyPackages.${system};
# in
# home-manager.lib.homeManagerConfiguration
# {
# inherit pkgs;
# modules = [
# ./home.nix
# {
# nixpkgs.overlays = overlays;
# }
# ];
# };
# darwinConfigurations = let
# system = "aarch64-darwin";
# pkgs = nixpkgs.legacyPackages.${system};
# in {
# "Uttarayans-MacBook-Pro" = darwin.lib.darwinSystem {
# modules = [
# home-manager.darwinModules.home-manager
# ./darwin.nix
# ({config, ...}: {
# home-manager = {
# users = {
# fs0c131y = {
# home = "/Users/fs0c131y";
# stateVersion = "21.05";
# configuration = home-manager.configurations.fs0c131y;
# };
# };
# };
# })
# ];
# };
# };