Add darwin configuration into

This commit is contained in:
Laurent Gueret
2026-02-11 13:15:26 +01:00
parent 80e5d0b8b5
commit e75b09a750
71 changed files with 562 additions and 151 deletions
Generated
+92
View File
@@ -1,5 +1,22 @@
{
"nodes": {
"brew-src": {
"flake": false,
"locked": {
"lastModified": 1769363988,
"narHash": "sha256-BiGPeulrDVetXP+tjxhMcGLUROZAtZIhU5m4MqawCfM=",
"owner": "Homebrew",
"repo": "brew",
"rev": "d01011cac6d72032c75fd2cd9489909e95d9faf2",
"type": "github"
},
"original": {
"owner": "Homebrew",
"ref": "5.0.12",
"repo": "brew",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
@@ -39,6 +56,38 @@
"type": "github"
}
},
"homebrew-cask": {
"flake": false,
"locked": {
"lastModified": 1770811300,
"narHash": "sha256-sSxLj4so0NJYjin13DJqEnZbKyYF5XYblnjDiv1eyfc=",
"owner": "homebrew",
"repo": "homebrew-cask",
"rev": "29406a41146145e7e32c4a5ff4c6c1471c2eda56",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-cask",
"type": "github"
}
},
"homebrew-core": {
"flake": false,
"locked": {
"lastModified": 1770811629,
"narHash": "sha256-qzjYPCYuRo+dbVJArHRbC030OwO5iilVlCG2A02CtrA=",
"owner": "homebrew",
"repo": "homebrew-core",
"rev": "779ff21375317500a9b0089e2fcbb1802abae658",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-core",
"type": "github"
}
},
"import-tree": {
"locked": {
"lastModified": 1763762820,
@@ -54,6 +103,45 @@
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1770736414,
"narHash": "sha256-x5xdJgUxNflO9j2sJHIHnPujDy6eAWJPCMQml5y9XB4=",
"owner": "nix-darwin",
"repo": "nix-darwin",
"rev": "7c952d9a524ffbbd5b5edca38fe6d943499585cc",
"type": "github"
},
"original": {
"owner": "nix-darwin",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"nix-homebrew": {
"inputs": {
"brew-src": "brew-src"
},
"locked": {
"lastModified": 1769437432,
"narHash": "sha256-8d7KnCpT2LweRvSzZYEGd9IM3eFX+A78opcnDM0+ndk=",
"owner": "zhaofengli",
"repo": "nix-homebrew",
"rev": "a5409abd0d5013d79775d3419bcac10eacb9d8c5",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "nix-homebrew",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1769089682,
@@ -105,7 +193,11 @@
"inputs": {
"flake-parts": "flake-parts",
"home-manager": "home-manager",
"homebrew-cask": "homebrew-cask",
"homebrew-core": "homebrew-core",
"import-tree": "import-tree",
"nix-darwin": "nix-darwin",
"nix-homebrew": "nix-homebrew",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
}
+68 -6
View File
@@ -9,36 +9,98 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Nix Darwin
nix-darwin.url = "github:nix-darwin/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
# Home manager
home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# Nix Homebrew
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
};
outputs =
inputs@{
self,
nixpkgs,
nix-darwin,
flake-parts,
import-tree,
home-manager,
nix-homebrew,
homebrew-core,
homebrew-cask,
nixpkgs-unstable,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } (
{ ... }:
{
systems = [ "x86_64-linux" ];
systems = [
"x86_64-linux"
"aarch64-darwin"
];
flake = {
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
specialArgs = {
import-tree = import-tree;
home-manager = home-manager;
};
modules = [
(import-tree ./modules/system)
./modules/hardware-configuration.nix
(import ./modules/overlays.nix { inherit nixpkgs nixpkgs-unstable; })
(import-tree ./hosts/common)
(import ./hosts/nixos/overlays.nix { inherit nixpkgs nixpkgs-unstable; })
(import-tree ./modules/system/common)
(import-tree ./modules/system/nixos)
(import-tree ./hosts/nixos/system)
]
++ [
(import-tree ./hosts/common)
home-manager.nixosModules.home-manager
(import ./modules/overlays.nix { inherit nixpkgs nixpkgs-unstable; })
(import ./modules/users/home.nix { inherit import-tree home-manager; })
(import /hosts/nixos/overlays.nix { inherit nixpkgs nixpkgs-unstable; })
(import-tree ./modules/home/common)
(import-tree ./modules/home/nixos)
(import-tree ./hosts/darwin/home)
];
};
};
darwinConfigurations = {
"MacBook-Air-de-Laurent" = nix-darwin.lib.darwinSystem {
specialArgs = {
self = self;
import-tree = import-tree;
home-manager = home-manager;
homebrew-core = homebrew-core;
homebrew-cask = homebrew-cask;
};
modules = [
(import-tree ./hosts/common)
nix-homebrew.darwinModules.nix-homebrew
(import ./hosts/nixos/overlays.nix { inherit nixpkgs nixpkgs-unstable; })
(import-tree ./modules/system/common)
(import-tree ./hosts/darwin/system)
]
++ [
(import-tree ./hosts/common)
home-manager.darwinModules.home-manager
(import /hosts/nixos/overlays.nix { inherit nixpkgs nixpkgs-unstable; })
(import-tree ./modules/home/common)
(import-tree ./modules/home/darwin)
(import-tree ./hosts/darwin/home)
];
};
};
+7
View File
@@ -0,0 +1,7 @@
{ ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.overwriteBackup = true;
home-manager.backupFileExtension = "bak";
}
+15
View File
@@ -0,0 +1,15 @@
{ ... }:
{
system.primaryUser = "alistreaza";
nix = {
settings = {
experimental-features = "nix-command flakes";
trusted-users = [
# Needed by Devenv
"root"
"alistreaza"
];
};
};
}
+34
View File
@@ -0,0 +1,34 @@
{ ... }:
{
home-manager.users.alistreaza = {
home = {
username = "alistreaza";
homeDirectory = /Users/alistreaza;
};
# No Home Application Folders
targets.darwin.linkApps.enable = false;
targets.darwin.copyApps.enable = false;
# Apps
home.shell.zsh = true;
home.shell.git = true;
# Homebrew apps
home.homebrew.iterm = true;
home.homebrew.zed = true;
home.homebrew.jetbrain = true;
home.homebrew.iina = true;
home.homebrew.zen = true;
home.homebrew.obsidian = true;
home.homebrew.microsoft = true;
home.homebrew.keka = true;
# The state version is required and should stay at the version you
# originally installed.
home.stateVersion = "25.11";
};
}
+9
View File
@@ -0,0 +1,9 @@
{ import-tree, ... }:
{
imports = [
./partials/users.nix
(import-tree ./apps)
];
nixpkgs.hostPlatform = "aarch64-darwin";
}
@@ -0,0 +1,5 @@
{ config, ... }:
{
homebrew.enable = true;
homebrew.taps = builtins.attrNames config.nix-homebrew.taps;
}
@@ -0,0 +1,28 @@
{
homebrew-core,
homebrew-cask,
...
}:
{
nix-homebrew = {
# User owning the Homebrew prefix
user = "alistreaza";
# Install Homebrew under the default prefix
enable = true;
# Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2
enableRosetta = false;
# Optional: Declarative tap management
taps = {
"homebrew/homebrew-core" = homebrew-core;
"homebrew/homebrew-cask" = homebrew-cask;
};
# Optional: Enable fully-declarative tap management
#
# With mutableTaps disabled, taps can no longer be added imperatively with `brew tap`.
mutableTaps = false;
};
}
+30
View File
@@ -0,0 +1,30 @@
{ self, ... }:
{
# Add ability to use TouchID for sudo
security.pam.services.sudo_local.touchIdAuth = true;
system = {
stateVersion = 6;
configurationRevision = self.rev or self.dirtyRev or null;
defaults = {
controlcenter.BatteryShowPercentage = true;
dock = {
show-recents = false;
tilesize = 30;
autohide = false;
orientation = "bottom";
};
finder = {
ShowHardDrivesOnDesktop = false;
ShowMountedServersOnDesktop = false;
ShowExternalHardDrivesOnDesktop = false;
ShowRemovableMediaOnDesktop = false;
FXRemoveOldTrashItems = true;
NewWindowTarget = "Home";
};
loginwindow = {
GuestEnabled = false;
};
};
};
}
+8
View File
@@ -0,0 +1,8 @@
{ ... }:
{
users.users = {
alistreaza = {
home = /Users/alistreaza;
};
};
}

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

+36
View File
@@ -0,0 +1,36 @@
{ import-tree, ... }:
{
home-manager.users.alistreaza = {
imports = [
(import-tree ./options)
(import-tree ./partials)
];
home = {
username = "alistreaza";
homeDirectory = "/home/alistreaza";
};
home.shell.zsh = true;
home.shell.git = true;
# Code editor
home.ide.zed.enable = true;
# IDE Jetbrains
home.ide.jetbrains.idea.enable = false;
home.ide.jetbrains.pycharm.enable = false;
home.ide.jetbrains.phpstorm.enable = false;
home.ide.jetbrains.rustrover.enable = false;
# IDE Data Jetbrains
home.ide.jetbrains.datagrip.enable = false;
home.ide.jetbrains.dataspell.enable = false;
# Markdown Editor
home.editor.obsidian.enable = false;
home.stateVersion = "25.11";
};
}
@@ -1,8 +1,6 @@
{ ... }:
{
nix.settings.experimental-features = "nix-command flakes";
# System services
os.boot.systemd.enable = true;
os.boot.plymouth.enable = true;
@@ -37,6 +35,9 @@
os.shell.dev.enable = true;
os.shell.devenv.enable = true;
# Ssh
programs.ssh.enableAskPassword = false; # No-window git push fix
# System version
system.stateVersion = "25.11";
}
@@ -1,12 +1,6 @@
{ ... }:
{
nix.settings.trusted-users = [
# Needed by Devenv
"root"
"alistreaza"
];
users.users = {
alistreaza = {
isNormalUser = true;
+28
View File
@@ -0,0 +1,28 @@
{
lib,
config,
...
}:
with lib;
let
cfg = config.home.shell.git;
in
{
options.home.shell.git = {
enable = mkEnableOption "Zen Editor options";
};
config = mkIf cfg.enable {
programs.git = {
enable = true;
config.init.defaultBranch = "main";
settings = {
user = {
name = "Laurent Gueret";
email = "gueretlob@pm.me";
};
};
};
};
}
@@ -1,10 +1,10 @@
{ lib, config, ... }:
with lib;
let
cfg = config.os.shell.zsh;
cfg = config.home.shell.zsh;
in
{
options.os.shell.zsh = {
options.home.shell.zsh = {
enable = mkEnableOption "System zsh service";
};
config = mkIf cfg.enable {
@@ -12,13 +12,12 @@ in
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
};
programs.neovim = {
enable = true;
defaultEditor = true;
oh-my-zsh = {
enable = true;
theme = "af-magic";
};
};
};
+17
View File
@@ -0,0 +1,17 @@
{ lib, config, ... }:
with lib;
let
cfg = config.home.homebrew.iina;
in
{
options.home.homebrew.iina = {
enable = mkEnableOption "System iina homebrew service";
};
config = mkIf cfg.enable {
homebrew.casks = [
"iina"
];
};
}
+17
View File
@@ -0,0 +1,17 @@
{ lib, config, ... }:
with lib;
let
cfg = config.home.homebrew.iterm;
in
{
options.home.homebrew.iterm = {
enable = mkEnableOption "System iterm homebrew service";
};
config = mkIf cfg.enable {
homebrew.casks = [
"iterm2"
];
};
}
+24
View File
@@ -0,0 +1,24 @@
{ lib, config, ... }:
with lib;
let
cfg = config.home.homebrew.jetbrain;
in
{
options.home.homebrew.jetbrain = {
enable = mkEnableOption "System jetbrain homebrew service";
};
config = mkIf cfg.enable {
homebrew.casks = [
"intellij-idea"
"pycharm"
"phpstorm"
"rustrover"
"goland"
"datagrip"
"dataspell"
"clion"
];
};
}
+17
View File
@@ -0,0 +1,17 @@
{ lib, config, ... }:
with lib;
let
cfg = config.home.homebrew.keka;
in
{
options.home.homebrew.keka = {
enable = mkEnableOption "System keka homebrew service";
};
config = mkIf cfg.enable {
homebrew.casks = [
"keka"
];
};
}
+20
View File
@@ -0,0 +1,20 @@
{ lib, config, ... }:
with lib;
let
cfg = config.home.homebrew.microsoft;
in
{
options.home.homebrew.microsoft = {
enable = mkEnableOption "System microsoft homebrew service";
};
config = mkIf cfg.enable {
homebrew.casks = [
"microsoft-word"
"microsoft-excel"
"microsoft-powerpoint"
"microsoft-teams"
];
};
}
+17
View File
@@ -0,0 +1,17 @@
{ lib, config, ... }:
with lib;
let
cfg = config.home.homebrew.obsidian;
in
{
options.home.homebrew.obsidian = {
enable = mkEnableOption "System obsidian homebrew service";
};
config = mkIf cfg.enable {
homebrew.casks = [
"obsidian"
];
};
}
+17
View File
@@ -0,0 +1,17 @@
{ lib, config, ... }:
with lib;
let
cfg = config.home.homebrew.zed;
in
{
options.home.homebrew.zed = {
enable = mkEnableOption "System zed homebrew service";
};
config = mkIf cfg.enable {
homebrew.casks = [
"zed"
];
};
}
+17
View File
@@ -0,0 +1,17 @@
{ lib, config, ... }:
with lib;
let
cfg = config.home.homebrew.zen;
in
{
options.home.homebrew.zen = {
enable = mkEnableOption "System zen homebrew service";
};
config = mkIf cfg.enable {
homebrew.casks = [
"zen"
];
};
}
@@ -6,10 +6,10 @@
}:
with lib;
let
cfg = config.os.ide.jetbrains.clion;
cfg = config.home.ide.jetbrains.clion;
in
{
options.os.ide.jetbrains.clion = {
options.home.ide.jetbrains.clion = {
enable = mkEnableOption "JetBrains options";
};
config = mkIf cfg.enable {
@@ -6,10 +6,10 @@
}:
with lib;
let
cfg = config.os.ide.jetbrains.datagrip;
cfg = config.home.ide.jetbrains.datagrip;
in
{
options.os.ide.jetbrains.datagrip = {
options.home.ide.jetbrains.datagrip = {
enable = mkEnableOption "JetBrains options";
};
config = mkIf cfg.enable {
@@ -6,10 +6,10 @@
}:
with lib;
let
cfg = config.os.ide.jetbrains.dataspell;
cfg = config.home.ide.jetbrains.dataspell;
in
{
options.os.ide.jetbrains.dataspell = {
options.home.ide.jetbrains.dataspell = {
enable = mkEnableOption "JetBrains options";
};
config = mkIf cfg.enable {
@@ -6,10 +6,10 @@
}:
with lib;
let
cfg = config.os.ide.jetbrains.goland;
cfg = config.home.ide.jetbrains.goland;
in
{
options.os.ide.jetbrains.goland = {
options.home.ide.jetbrains.goland = {
enable = mkEnableOption "JetBrains options";
};
config = mkIf cfg.enable {
@@ -6,10 +6,10 @@
}:
with lib;
let
cfg = config.os.ide.jetbrains.idea;
cfg = config.home.ide.jetbrains.idea;
in
{
options.os.ide.jetbrains.idea = {
options.home.ide.jetbrains.idea = {
enable = mkEnableOption "JetBrains options";
};
config = mkIf cfg.enable {
@@ -6,10 +6,10 @@
}:
with lib;
let
cfg = config.os.ide.jetbrains.phpstorm;
cfg = config.home.ide.jetbrains.phpstorm;
in
{
options.os.ide.jetbrains.phpstorm = {
options.home.ide.jetbrains.phpstorm = {
enable = mkEnableOption "JetBrains options";
};
config = mkIf cfg.enable {
@@ -6,10 +6,10 @@
}:
with lib;
let
cfg = config.os.ide.jetbrains.pycharm;
cfg = config.home.ide.jetbrains.pycharm;
in
{
options.os.ide.jetbrains.pycharm = {
options.home.ide.jetbrains.pycharm = {
enable = mkEnableOption "JetBrains options";
};
config = mkIf cfg.enable {
@@ -6,10 +6,10 @@
}:
with lib;
let
cfg = config.os.ide.jetbrains.rider;
cfg = config.home.ide.jetbrains.rider;
in
{
options.os.ide.jetbrains.rider = {
options.home.ide.jetbrains.rider = {
enable = mkEnableOption "JetBrains options";
};
config = mkIf cfg.enable {
@@ -6,10 +6,10 @@
}:
with lib;
let
cfg = config.os.ide.jetbrains.rubymine;
cfg = config.home.ide.jetbrains.rubymine;
in
{
options.os.ide.jetbrains.rubymine = {
options.home.ide.jetbrains.rubymine = {
enable = mkEnableOption "JetBrains options";
};
config = mkIf cfg.enable {
@@ -6,10 +6,10 @@
}:
with lib;
let
cfg = config.os.ide.jetbrains.rustrover;
cfg = config.home.ide.jetbrains.rustrover;
in
{
options.os.ide.jetbrains.rustrover = {
options.home.ide.jetbrains.rustrover = {
enable = mkEnableOption "JetBrains options";
};
config = mkIf cfg.enable {
@@ -6,10 +6,10 @@
}:
with lib;
let
cfg = config.os.ide.jetbrains.webstorm;
cfg = config.home.ide.jetbrains.webstorm;
in
{
options.os.ide.jetbrains.webstorm = {
options.home.ide.jetbrains.webstorm = {
enable = mkEnableOption "JetBrains options";
};
config = mkIf cfg.enable {
@@ -6,17 +6,17 @@
}:
with lib;
let
cfg = config.os.editor.obsidian;
cfg = config.home.editor.obsidian;
in
{
options.os.editor.obsidian = {
options.home.editor.obsidian = {
enable = mkEnableOption "Obsidian options";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
obsidian
];
};
}
@@ -6,20 +6,16 @@
}:
with lib;
let
cfg = config.os.ide.zed;
cfg = config.home.ide.zed;
in
{
options.os.ide.zed = {
options.home.ide.zed = {
enable = mkEnableOption "Zen Editor options";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
zed-editor
nil
nixd
];
};
+18
View File
@@ -0,0 +1,18 @@
{ lib, config, ... }:
with lib;
let
cfg = config.os.shell.neovim;
in
{
options.os.shell.neovim = {
enable = mkEnableOption "System neovim service";
};
config = mkIf cfg.enable {
programs.neovim = {
enable = true;
defaultEditor = true;
};
};
}
-21
View File
@@ -1,21 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.os.shell.dev;
in
{
options.os.shell.dev = {
enable = mkEnableOption "System git service";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
gcc
];
};
}
-26
View File
@@ -1,26 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.os.shell.git;
in
{
options.os.shell.git = {
enable = mkEnableOption "System git service";
};
config = mkIf cfg.enable {
programs.git = {
enable = true;
config = {
init.defaultBranch = "main";
};
};
programs.ssh.enableAskPassword = false;
};
}
-50
View File
@@ -1,50 +0,0 @@
{ import-tree, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.overwriteBackup = true;
home-manager.backupFileExtension = "bak";
home-manager.users = {
alistreaza = {
imports = [
(import-tree ./options)
(import-tree ./partials)
];
home = {
username = "alistreaza";
homeDirectory = "/home/alistreaza";
};
# Apps shell
programs.git = {
settings = {
user = {
name = "Laurent Gueret";
email = "gueretlob@pm.me";
};
};
};
# Code editor
os.ide.zed.enable = true;
# IDE Jetbrains
os.ide.jetbrains.idea.enable = false;
os.ide.jetbrains.pycharm.enable = false;
os.ide.jetbrains.phpstorm.enable = false;
os.ide.jetbrains.rustrover.enable = false;
# IDE Data Jetbrains
os.ide.jetbrains.datagrip.enable = false;
os.ide.jetbrains.dataspell.enable = false;
# Markdown Editor
os.editor.obsidian.enable = false;
home.stateVersion = "25.11";
};
};
}