Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: nix-darwin #159

Merged
merged 10 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
version: '3'

tasks:
switch:
up:
cmds:
- nix flake update
hmsw: # home-manager switch
cmds:
- nix run nixpkgs#home-manager -- switch --flake .#{{env "NAME"}}
darwin-sw: # nix-darwin switch
cmds:
- nix run nix-darwin -- switch --flake .#marisa
darwin-home-sw:
cmds:
- nix run nixpkgs#home-manager -- switch --flake .#marisa
gc:
cmds:
- nix-collect-garbage --delete-old
18 changes: 9 additions & 9 deletions config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"cmp-git": { "branch": "main", "commit": "ec049036e354ed8ed0215f2427112882e1ea7051" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"conform.nvim": { "branch": "master", "commit": "1a7ff54dcfbe1af139b11829c6d58f5ffab87707" },
"dressing.nvim": { "branch": "master", "commit": "43b8f74e0b1e3f41e51f640f8efa3bcd401cea0d" },
"conform.nvim": { "branch": "master", "commit": "02fd64fb3d4b18ec029c0e0683c3dc3ec6d2c5b8" },
"dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
"fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" },
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
"gitsigns.nvim": { "branch": "main", "commit": "4daf7022f1481edf1e8fb9947df13bb07c18e89a" },
"go.nvim": { "branch": "master", "commit": "6368756601a358b1491ac2ff10d0e2939a76df5e" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"go.nvim": { "branch": "master", "commit": "c6d5ca26377d01c4de1f7bff1cd62c8b43baa6bc" },
"guihua.lua": { "branch": "master", "commit": "d783191eaa75215beae0c80319fcce5e6b3beeda" },
"inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" },
"indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" },
Expand All @@ -38,14 +38,14 @@
"nvim-dap": { "branch": "master", "commit": "8517126e9323e346f6a99b3b594c5a940b914dcd" },
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" },
"nvim-lspconfig": { "branch": "master", "commit": "d2d153a179ed59aa7134d7ebdf4d7dcb156efa22" },
"nvim-lspconfig": { "branch": "master", "commit": "1aa9f36b6d542dafc0b4a38c48969d036003b00a" },
"nvim-metals": { "branch": "main", "commit": "f861db9fda55939797ac1b05238c49b0dcdc3bdb" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" },
"nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" },
"nvim-treesitter": { "branch": "master", "commit": "7646c1c12a3121562aa87fd79aace48c728ac096" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "3e450cd85243da99dc23ebbf14f9c70e9a0c26a4" },
"nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" },
"nvim-treesitter": { "branch": "master", "commit": "b31188671d8a060022dbbeb6905019e69e310108" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
"obscure.nvim": { "branch": "main", "commit": "17cda9c64e3534510668881f6e7637b8d88390cf" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
Expand Down
57 changes: 39 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 28 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@
nixpkgs = {
url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
# Nix modules for darwin
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# Neovim nightly build
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
# Nix wrapper for Rust
fenix = {
url = "github:nix-community/fenix/monthly";
inputs.nixpkgs.follows = "nixpkgs";
Expand All @@ -23,6 +30,7 @@
{
self,
nixpkgs,
nix-darwin,
home-manager,
fenix,
...
Expand All @@ -44,9 +52,19 @@
inputs.neovim-nightly-overlay.overlays.default
];

# nix-darwin
darwinConfigurations = {
marisa = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
modules = [ ./nix-darwin ];
};
};

# home-manager
homeManagerModules = import ./modules/home-manager;

homeConfigurations = {
# youmu: Ubuntu 24.04.1 + WSL2 (Host: Windows 11 23H2)
youmu-wsl = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {
Expand All @@ -58,6 +76,7 @@
];
};

# reimu: Ubuntu 24.04.1 + WSL2 (Host: Windows 11 23H2)
reimu-wsl = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {
Expand All @@ -69,14 +88,15 @@
];
};

# marisa = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.aarch64-darwin;
# extraSpecialArgs = { inherit inputs outputs; };
# modules = [
# ./home-manager/home.nix
# ./home-manager/hosts/marisa
# ];
# };
# marisa: macOS 15(Darwin)
marisa = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home-manager
./home-manager/hosts/marisa
];
};
};
};
}
6 changes: 6 additions & 0 deletions home-manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# home-manager

```txt
hosts/ => host specific settings
programs/ => install & configure packages
```
2 changes: 0 additions & 2 deletions home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@
};

programs.home-manager.enable = true;

home.stateVersion = "24.05";
}
Loading
Loading