[feat] Add darwin configs as well
This commit is contained in:
@@ -1,98 +1,107 @@
|
|||||||
{
|
{pkgs, ...}: {
|
||||||
description = "Example Darwin system flake";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
||||||
# home-manager.url = "github:nix-community/home-manager/master";
|
|
||||||
# home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
nix-darwin.url = "github:LnL7/nix-darwin";
|
|
||||||
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = inputs@{ self, nix-darwin, nixpkgs }:
|
|
||||||
let
|
|
||||||
configuration = { pkgs, ... }: {
|
|
||||||
# List packages installed in system profile. To search by name, run:
|
|
||||||
# $ nix-env -qaP | grep wget
|
|
||||||
environment.systemPackages =
|
|
||||||
with pkgs; [
|
|
||||||
neovim
|
|
||||||
bat
|
|
||||||
ripgrep
|
|
||||||
fd
|
|
||||||
|
|
||||||
fish
|
|
||||||
nushellFull
|
|
||||||
|
|
||||||
tmux
|
|
||||||
wezterm
|
|
||||||
# yabai
|
|
||||||
nerdfonts
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Auto upgrade nix package and the daemon service.
|
|
||||||
services.nix-daemon.enable = true;
|
|
||||||
# nix.package = pkgs.nix;
|
|
||||||
|
|
||||||
# Necessary for using flakes on this system.
|
|
||||||
nix = {
|
nix = {
|
||||||
settings = {
|
settings = {
|
||||||
experimental-features = "nix-command flakes repl-flake";
|
experimental-features = "nix-command flakes repl-flake";
|
||||||
max-jobs = 8;
|
max-jobs = 8;
|
||||||
};
|
};
|
||||||
extraOptions = ''
|
|
||||||
build-users-group = nixbld
|
|
||||||
extra-nix-path = nixpkgs=flake:nixpkgs
|
|
||||||
'';
|
|
||||||
# keep-outputs = true
|
|
||||||
# keep-derivations = true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# Create /etc/zshrc that loads the nix-darwin environment.
|
|
||||||
# programs.zsh.enable = true; # default shell on catalina
|
|
||||||
# programs.fish.enable = true;
|
|
||||||
|
|
||||||
# Set Git commit hash for darwin-version.
|
|
||||||
system.configurationRevision = self.rev or self.dirtyRev or null;
|
|
||||||
system.keyboard.enableKeyMapping = true;
|
system.keyboard.enableKeyMapping = true;
|
||||||
system.keyboard.remapCapsLockToControl = true;
|
system.keyboard.remapCapsLockToControl = true;
|
||||||
system.keyboard.swapLeftCommandAndLeftAlt = true;
|
system.keyboard.swapLeftCommandAndLeftAlt = true;
|
||||||
system.keyboard.userKeyMapping = {
|
system.keyboard.userKeyMapping = [
|
||||||
|
{
|
||||||
# Right Command to Option
|
# Right Command to Option
|
||||||
HIDKeyboardModifierMappingSrc = 30064771303;
|
HIDKeyboardModifierMappingSrc = 30064771303;
|
||||||
HIDKeyboardModifierMappingDst = 30064771302;
|
HIDKeyboardModifierMappingDst = 30064771302;
|
||||||
|
}
|
||||||
|
{
|
||||||
# Right Option to command
|
# Right Option to command
|
||||||
HIDKeyboardModifierMappingSrc = 30064771302;
|
HIDKeyboardModifierMappingSrc = 30064771302;
|
||||||
HIDKeyboardModifierMappingDst = 30064771303;
|
HIDKeyboardModifierMappingDst = 30064771303;
|
||||||
};
|
|
||||||
fonts.fonts = [ (pkgs.nerdfonts.override { fonts = [ "Hasklig" "Hack" ]; }) ];
|
|
||||||
system.defaults.finder.AppleShowAllExtensions = true;
|
|
||||||
system.defaults.dock.autohide = true;
|
|
||||||
|
|
||||||
# Used for backwards compatibility, please read the changelog before changing.
|
|
||||||
# $ darwin-rebuild changelog
|
|
||||||
system.stateVersion = 4;
|
|
||||||
|
|
||||||
# The platform the configuration will be used on.
|
|
||||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
|
||||||
|
|
||||||
nix.package = pkgs.nix;
|
|
||||||
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
# Build darwin flake using:
|
|
||||||
# $ darwin-rebuild build --flake .#simple
|
|
||||||
darwinConfigurations.Uttarayans-MacBook-Pro = nix-darwin.lib.darwinSystem {
|
|
||||||
# system = "aarch64-darwin";
|
|
||||||
pkgs = import nixpkgs { system = "aarch64-darwin"; };
|
|
||||||
modules = [ configuration ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Expose the package set, including overlays, for convenience.
|
|
||||||
darwinPackages = self.darwinConfigurations.Uttarayans-MacBook-Pro.pkgs;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
# {
|
||||||
|
# description = "Example Darwin system flake";
|
||||||
|
# inputs = {
|
||||||
|
# nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
# # home-manager.url = "github:nix-community/home-manager/master";
|
||||||
|
# # home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
# nix-darwin.url = "github:LnL7/nix-darwin";
|
||||||
|
# nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
# };
|
||||||
|
# outputs = inputs @ {
|
||||||
|
# self,
|
||||||
|
# nix-darwin,
|
||||||
|
# nixpkgs,
|
||||||
|
# }: let
|
||||||
|
# configuration = {pkgs, ...}: {
|
||||||
|
# # List packages installed in system profile. To search by name, run:
|
||||||
|
# # $ nix-env -qaP | grep wget
|
||||||
|
# environment.systemPackages = with pkgs; [
|
||||||
|
# neovim
|
||||||
|
# bat
|
||||||
|
# ripgrep
|
||||||
|
# fd
|
||||||
|
# fish
|
||||||
|
# nushellFull
|
||||||
|
# tmux
|
||||||
|
# wezterm
|
||||||
|
# # yabai
|
||||||
|
# nerdfonts
|
||||||
|
# ];
|
||||||
|
# # Auto upgrade nix package and the daemon service.
|
||||||
|
# services.nix-daemon.enable = true;
|
||||||
|
# # nix.package = pkgs.nix;
|
||||||
|
# # Necessary for using flakes on this system.
|
||||||
|
# nix = {
|
||||||
|
# settings = {
|
||||||
|
# experimental-features = "nix-command flakes repl-flake";
|
||||||
|
# max-jobs = 8;
|
||||||
|
# };
|
||||||
|
# extraOptions = ''
|
||||||
|
# build-users-group = nixbld
|
||||||
|
# extra-nix-path = nixpkgs=flake:nixpkgs
|
||||||
|
# '';
|
||||||
|
# # keep-outputs = true
|
||||||
|
# # keep-derivations = true
|
||||||
|
# };
|
||||||
|
# # Create /etc/zshrc that loads the nix-darwin environment.
|
||||||
|
# # programs.zsh.enable = true; # default shell on catalina
|
||||||
|
# # programs.fish.enable = true;
|
||||||
|
# # Set Git commit hash for darwin-version.
|
||||||
|
# system.configurationRevision = self.rev or self.dirtyRev or null;
|
||||||
|
# system.keyboard.enableKeyMapping = true;
|
||||||
|
# system.keyboard.remapCapsLockToControl = true;
|
||||||
|
# system.keyboard.swapLeftCommandAndLeftAlt = true;
|
||||||
|
# system.keyboard.userKeyMapping = {
|
||||||
|
# # Right Command to Option
|
||||||
|
# HIDKeyboardModifierMappingSrc = 30064771303;
|
||||||
|
# HIDKeyboardModifierMappingDst = 30064771302;
|
||||||
|
# # Right Option to command
|
||||||
|
# HIDKeyboardModifierMappingSrc = 30064771302;
|
||||||
|
# HIDKeyboardModifierMappingDst = 30064771303;
|
||||||
|
# };
|
||||||
|
# fonts.fonts = [(pkgs.nerdfonts.override {fonts = ["Hasklig" "Hack"];})];
|
||||||
|
# system.defaults.finder.AppleShowAllExtensions = true;
|
||||||
|
# system.defaults.dock.autohide = true;
|
||||||
|
# # Used for backwards compatibility, please read the changelog before changing.
|
||||||
|
# # $ darwin-rebuild changelog
|
||||||
|
# system.stateVersion = 4;
|
||||||
|
# # The platform the configuration will be used on.
|
||||||
|
# nixpkgs.hostPlatform = "aarch64-darwin";
|
||||||
|
# nix.package = pkgs.nix;
|
||||||
|
# };
|
||||||
|
# in {
|
||||||
|
# # Build darwin flake using:
|
||||||
|
# # $ darwin-rebuild build --flake .#simple
|
||||||
|
# darwinConfigurations.Uttarayans-MacBook-Pro = nix-darwin.lib.darwinSystem {
|
||||||
|
# # system = "aarch64-darwin";
|
||||||
|
# pkgs = import nixpkgs {system = "aarch64-darwin";};
|
||||||
|
# modules = [configuration];
|
||||||
|
# };
|
||||||
|
# # Expose the package set, including overlays, for convenience.
|
||||||
|
# # darwinPackages = self.darwinConfigurations.Uttarayans-MacBook-Pro.pkgs;
|
||||||
|
# };
|
||||||
|
# }
|
||||||
|
|
||||||
|
|||||||
21
config/nix/flake.lock
generated
21
config/nix/flake.lock
generated
@@ -1,5 +1,25 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"darwin": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1707707289,
|
||||||
|
"narHash": "sha256-YuDt/eSTXMEHv8jS8BEZJgqCcG8Tr3cyqaZjJFXZHsw=",
|
||||||
|
"owner": "LnL7",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"rev": "44f50a5ecaab72a61d5fd8e5c5717bc4bf9c25dd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "LnL7",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -198,6 +218,7 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"darwin": "darwin",
|
||||||
"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"
|
||||||
|
|||||||
@@ -8,30 +8,57 @@
|
|||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
darwin = {
|
||||||
|
url = "github:LnL7/nix-darwin";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, home-manager, ... }@inputs:
|
outputs = {
|
||||||
let
|
nixpkgs,
|
||||||
|
home-manager,
|
||||||
|
darwin,
|
||||||
|
...
|
||||||
|
} @ inputs: {
|
||||||
|
homeConfigurations = let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
overlays = [inputs.neovim-nightly-overlay.overlay];
|
overlays = [inputs.neovim-nightly-overlay.overlay];
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
in
|
in {
|
||||||
{
|
"fs0c131y" = home-manager.lib.homeManagerConfiguration {
|
||||||
homeConfigurations."fs0c131y" = home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
|
||||||
# Specify your home configuration modules here, for example,
|
|
||||||
# the path to your home.nix.
|
|
||||||
modules = [
|
modules = [
|
||||||
./home.nix
|
./home.nix
|
||||||
({
|
{
|
||||||
nixpkgs.overlays = overlays;
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
};
|
||||||
# Optionally use extraSpecialArgs
|
|
||||||
# to pass through arguments to home.nix
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
{ config, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
# https://mipmip.github.io/home-manager-option-search/
|
# https://mipmip.github.io/home-manager-option-search/
|
||||||
{
|
{
|
||||||
# Home Manager needs a bit of information about you and the paths it should
|
|
||||||
# manage.
|
|
||||||
home.username = "fs0c131y";
|
|
||||||
home.homeDirectory = "/home/fs0c131y";
|
|
||||||
|
|
||||||
home.stateVersion = "23.11"; # Please read the comment before changing.
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./tmux.nix
|
./tmux.nix
|
||||||
@@ -31,6 +28,7 @@
|
|||||||
${pkgs.macchina.outPath}/bin/macchina
|
${pkgs.macchina.outPath}/bin/macchina
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
nushell = {
|
nushell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
@@ -82,7 +80,7 @@
|
|||||||
enableNushellIntegration = true;
|
enableNushellIntegration = true;
|
||||||
};
|
};
|
||||||
foot = {
|
foot = {
|
||||||
enable = true;
|
enable = pkgs.stdenv.isLinux;
|
||||||
server.enable = true;
|
server.enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
main = {
|
main = {
|
||||||
@@ -114,16 +112,27 @@
|
|||||||
bright5 = "ff92df";
|
bright5 = "ff92df";
|
||||||
bright6 = "a4ffff";
|
bright6 = "a4ffff";
|
||||||
bright7 = "ffffff";
|
bright7 = "ffffff";
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Let Home Manager install and manage itself.
|
||||||
|
home-manager = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = [
|
home = {
|
||||||
|
# Home Manager needs a bit of information about you and the paths it should
|
||||||
|
# manage.
|
||||||
|
username = "fs0c131y";
|
||||||
|
homeDirectory = "/home/fs0c131y";
|
||||||
|
|
||||||
|
stateVersion = "23.11";
|
||||||
|
|
||||||
|
packages = [
|
||||||
pkgs.macchina
|
pkgs.macchina
|
||||||
pkgs.nixpkgs-fmt
|
pkgs.alejandra
|
||||||
pkgs.neovim-nightly
|
pkgs.neovim-nightly
|
||||||
pkgs.cachix
|
pkgs.cachix
|
||||||
# # Adds the 'hello' command to your environment. It prints a friendly
|
# # Adds the 'hello' command to your environment. It prints a friendly
|
||||||
@@ -144,7 +153,7 @@
|
|||||||
# '')
|
# '')
|
||||||
];
|
];
|
||||||
|
|
||||||
home.file = {
|
file = {
|
||||||
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
||||||
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
||||||
# # symlink to the Nix store copy.
|
# # symlink to the Nix store copy.
|
||||||
@@ -157,17 +166,13 @@
|
|||||||
# '';
|
# '';
|
||||||
};
|
};
|
||||||
|
|
||||||
home.sessionVariables = {
|
sessionVariables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
SHELL = "${pkgs.fish.outPath}/bin/fish";
|
SHELL = "${pkgs.fish.outPath}/bin/fish";
|
||||||
};
|
};
|
||||||
home.sessionPath = [
|
sessionPath = [
|
||||||
"${config.home.homeDirectory}/.local/bin"
|
"${config.home.homeDirectory}/.local/bin"
|
||||||
"${config.home.homeDirectory}/.nix-profile/bin"
|
"${config.home.homeDirectory}/.nix-profile/bin"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
|
||||||
programs.home-manager = {
|
|
||||||
enable = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = pkgs.stdenv.isLinux;
|
||||||
settings = {
|
settings = {
|
||||||
monitor = [
|
monitor = [
|
||||||
",preferred,auto,auto"
|
",preferred,auto,auto"
|
||||||
@@ -37,8 +37,6 @@
|
|||||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||||
|
|
||||||
rounding = 10;
|
rounding = 10;
|
||||||
|
|
||||||
|
|
||||||
drop_shadow = true;
|
drop_shadow = true;
|
||||||
shadow_range = 4;
|
shadow_range = 4;
|
||||||
shadow_render_power = 3;
|
shadow_render_power = 3;
|
||||||
@@ -150,7 +148,6 @@
|
|||||||
# "$mainModShift,Print, exec, grim -g "$(slurp)""
|
# "$mainModShift,Print, exec, grim -g "$(slurp)""
|
||||||
"$mainModShift,s, exec, watershot"
|
"$mainModShift,s, exec, watershot"
|
||||||
|
|
||||||
|
|
||||||
# Move focus with mainMod + arrow keys
|
# Move focus with mainMod + arrow keys
|
||||||
"$mainMod, left, movefocus, l"
|
"$mainMod, left, movefocus, l"
|
||||||
"$mainMod, right, movefocus, r"
|
"$mainMod, right, movefocus, r"
|
||||||
@@ -191,13 +188,10 @@
|
|||||||
"$mainMod SHIFT, 9, movetoworkspace, 9"
|
"$mainMod SHIFT, 9, movetoworkspace, 9"
|
||||||
"$mainMod SHIFT, 0, movetoworkspace, 10"
|
"$mainMod SHIFT, 0, movetoworkspace, 10"
|
||||||
|
|
||||||
|
|
||||||
# Scroll through existing workspaces with mainMod + scroll
|
# Scroll through existing workspaces with mainMod + scroll
|
||||||
"$mainMod, mouse_down, workspace, e+1"
|
"$mainMod, mouse_down, workspace, e+1"
|
||||||
"$mainMod, mouse_up, workspace, e-1"
|
"$mainMod, mouse_up, workspace, e-1"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"$mainMod, Tab, cyclenext, bind = ALT, Tab, bringactivetotop,"
|
"$mainMod, Tab, cyclenext, bind = ALT, Tab, bringactivetotop,"
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -220,8 +214,6 @@
|
|||||||
"9, monitor:HDMI-A-2"
|
"9, monitor:HDMI-A-2"
|
||||||
"10, monitor:HDMI-A-2"
|
"10, monitor:HDMI-A-2"
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ require("mason-lspconfig").setup_handlers {
|
|||||||
settings = {
|
settings = {
|
||||||
['nil'] = {
|
['nil'] = {
|
||||||
formatting = {
|
formatting = {
|
||||||
command = { "nixpkgs-fmt" },
|
command = { "alejandra" },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user