Compare commits

...

12 Commits

Author SHA1 Message Date
af6dacd139 refactor: 🔥 Remove .old file 2025-08-30 12:36:07 +02:00
2d2cb2b6dc fix: change path 2025-08-30 12:30:28 +02:00
f69c003807 fix: change declaration 2025-08-30 12:25:32 +02:00
28a13b3691 fix: fix typo 2025-08-30 12:24:48 +02:00
30682c4c43 feat: add user info 2025-08-30 12:24:23 +02:00
ddb8cd34f4 fix: remove home manager from MBP-Louis 2025-08-30 12:21:01 +02:00
40394e17ee fix: try to adapt homemanager 2025-08-30 12:20:29 +02:00
0771eab2ff feat: change nix structure 2025-08-30 12:18:41 +02:00
cddb786adf fix: add home-manager declaration 2025-08-30 12:16:02 +02:00
18f0100994 fix: fix typo 2025-08-30 12:14:48 +02:00
272bf73439 fix: add stateVersion 2025-08-30 12:14:07 +02:00
d5193fa2a3 feat: change nix structure 2025-08-30 12:11:32 +02:00
7 changed files with 248 additions and 184 deletions

21
flake.lock generated
View File

@ -17,6 +17,26 @@
"type": "github" "type": "github"
} }
}, },
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1756496801,
"narHash": "sha256-IYIsnPy+cJxe8RbDHBrCtfJY0ry2bG2H7WvMcewiGS8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "77a71380c38fb2a440b4b5881bbc839f6230e1cb",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nix-darwin": { "nix-darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -73,6 +93,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nix-homebrew": "nix-homebrew", "nix-homebrew": "nix-homebrew",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"

205
flake.nix
View File

@ -1,187 +1,46 @@
{ {
description = "Louis Darwin system flake"; description = "Louis multi-platform flake";
inputs = { inputs = {
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin"; nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }:
outputs = inputs@{ self, nixpkgs, nix-darwin, nix-homebrew, home-manager, ... }:
let let
configuration = { pkgs, ... }: { # Modules communs aux deux machines
# List packages installed in system profile. To search by name, run: commonModules = [
# $ nix-env -qaP | grep wget ./modules/apps.nix
environment.systemPackages = ./modules/config.nix
[ ./modules/dotfiles/git.nix
pkgs.termdown
pkgs.fastfetch # Ajout du bloc home-manager commun
pkgs.neovim ({ pkgs, ... }: {
pkgs.deno home-manager.users.louisgallet = {
pkgs.pnpm home.stateVersion = "24.05";
pkgs.terraform
pkgs.gh-copilot
pkgs.gh
#pkgs.texlab
#pkgs.texliveFull
pkgs.rcm
pkgs.fnm
pkgs.universal-ctags
pkgs.ripgrep
pkgs.pyenv
pkgs.rustup
pkgs.ngrok
pkgs.marp-cli
pkgs.discord
pkgs.yarn
pkgs.typescript
pkgs.firefox
pkgs.warp-terminal
pkgs.raycast
pkgs.bitwarden-desktop
pkgs.jetbrains-toolbox
pkgs.jetbrains.datagrip
pkgs.jetbrains.rider
pkgs.jetbrains.webstorm
pkgs.ffmpeg_6
];
# HomeBrew configuration
homebrew = {
enable = true;
casks = [
"cyberduck"
#"gpg-suite-no-mail"
"iina"
"keka"
"maccy"
"nordvpn"
"notion"
"swish"
"termius"
"mattermost"
"aldente"
"logi-options+"
"adobe-creative-cloud"
"qbittorrent"
"zoom"
"zed"
"whisky"
"visual-studio-code"
"vmware-fusion"
"pycharm"
"cleanshot"
"bartender"
"chromedriver"
"epic-games"
"alt-tab"
"busycal"
"privileges"
"jdownloader"
"raspberry-pi-imager"
"tailscale-app"
];
brews = [
"wget"
"bear"
"cmake"
"firebase-cli"
"git"
"git-flow"
"git-lfs"
"gnupg"
"llvm@18"
"gtk+3"
"pinentry-mac"
"sdl2"
"sdl2_image"
"sdl2_ttf"
"tmux"
"tree"
"wget"
"zsh"
"yubikey-agent"
"pkg-config"
"serve"
];
taps = [
"hashicorp/tap"
"eranif/codelite"
"macos-fuse-t/homebrew-cask"
];
onActivation.cleanup = "uninstall";
onActivation.autoUpdate = true;
onActivation.upgrade = true;
}; # System configuration
security.pam.services.sudo_local.touchIdAuth = true;
system.defaults = {
dock = {
autohide = true;
orientation = "bottom";
show-recents = false;
magnification = false;
autohide-time-modifier = 0.0;
persistent-apps = [
"/System/Applications/Launchpad.app"
"/System/Applications/Messages.app"
"/Applications/Nix Apps/Firefox.app"
"/System/Applications/Mail.app"
"/Applications/BusyCal.app"
"/Applications/Things3.app"
"/System/Applications/Music.app"
"/Applications/Nix Apps/Discord.app"
"/Applications/Zed.app"
"/Applications/Visual\ Studio\ Code.app"
"/Applications/Nix Apps/Warp.app"
"/System/Applications/System\ Settings.app"
"/Applications/Privileges.app"
];
}; };
finder.FXPreferredViewStyle = "Nlsv"; })
SoftwareUpdate.AutomaticallyInstallMacOSUpdates = true; ];
}; in {
# Allow broken packages
nixpkgs.config.allowBroken = true;
# allow unfree packages
nixpkgs.config.allowUnfree = true;
# 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";
# 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;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 5;
system.primaryUser = "louisgallet";
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
};
in
{
# Build darwin flake using:
# $ darwin-rebuild build --flake .#simple
darwinConfigurations."MBP-Louis" = nix-darwin.lib.darwinSystem { darwinConfigurations."MBP-Louis" = nix-darwin.lib.darwinSystem {
modules = [ system = "aarch64-darwin";
configuration modules = commonModules ++ [
./hosts/MBP-Louis.nix
nix-homebrew.darwinModules.nix-homebrew nix-homebrew.darwinModules.nix-homebrew
{ home-manager.darwinModules.home-manager
nix-homebrew = { ];
# Install Homebrew under the default prefix };
enable = true;
# Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2 nixosConfigurations."PC-Louis" = nixpkgs.lib.nixosSystem {
enableRosetta = true; system = "x86_64-linux";
# User owning the Homebrew prefix modules = commonModules ++ [
user = "louisgallet"; ./hosts/PC-Louis.nix
# Automatically migrate existing Homebrew installations home-manager.nixosModules.home-manager
autoMigrate = true;
};
}
]; ];
}; };
# Expose the package set, including overlays, for convenience.
darwinPackages = self.darwinConfigurations."MBP-Louis".pkgs;
}; };
} }

116
hosts/MBP-Louis.nix Normal file
View File

@ -0,0 +1,116 @@
{ pkgs, ... }:
{
# Définition de l'utilisateur
users.users.louisgallet = {
description = "Louis Gallet";
home = "/Users/louisgallet";
shell = pkgs.zsh;
};
# Homebrew configuration
homebrew = {
enable = true;
casks = [
"cyberduck"
"iina"
"keka"
"maccy"
"nordvpn"
"notion"
"swish"
"termius"
"mattermost"
"aldente"
"logi-options+"
"adobe-creative-cloud"
"qbittorrent"
"zoom"
"zed"
"whisky"
"visual-studio-code"
"vmware-fusion"
"pycharm"
"cleanshot"
"bartender"
"chromedriver"
"epic-games"
"alt-tab"
"busycal"
"privileges"
"jdownloader"
"raspberry-pi-imager"
"tailscale-app"
];
brews = [
"wget"
"bear"
"cmake"
"firebase-cli"
"git"
"git-flow"
"git-lfs"
"gnupg"
"llvm@18"
"gtk+3"
"pinentry-mac"
"sdl2"
"sdl2_image"
"sdl2_ttf"
"tmux"
"tree"
"zsh"
"yubikey-agent"
"pkg-config"
"serve"
];
taps = [
"hashicorp/tap"
"eranif/codelite"
"macos-fuse-t/homebrew-cask"
];
onActivation.cleanup = "uninstall";
onActivation.autoUpdate = true;
onActivation.upgrade = true;
};
# macOS system configuration
security.pam.services.sudo_local.touchIdAuth = true;
system.defaults = {
dock = {
autohide = true;
orientation = "bottom";
show-recents = false;
magnification = false;
autohide-time-modifier = 0.0;
persistent-apps = [
"/System/Applications/Launchpad.app"
"/System/Applications/Messages.app"
"/Applications/Nix Apps/Firefox.app"
"/System/Applications/Mail.app"
"/Applications/BusyCal.app"
"/Applications/Things3.app"
"/System/Applications/Music.app"
"/Applications/Nix Apps/Discord.app"
"/Applications/Zed.app"
"/Applications/Visual Studio Code.app"
"/Applications/Nix Apps/Warp.app"
"/System/Applications/System Settings.app"
"/Applications/Privileges.app"
];
};
finder.FXPreferredViewStyle = "Nlsv";
SoftwareUpdate.AutomaticallyInstallMacOSUpdates = true;
};
programs.zsh.enable = true;
nixpkgs.config.allowUnfree = true;
system.stateVersion = 5;
system.primaryUser = "louisgallet";
}

5
hosts/PC-Louis.nix Normal file
View File

@ -0,0 +1,5 @@
{ pkgs, ... }: {
services.openssh.enable = true;
programs.zsh.enable = true;
system.stateVersion = "25.05";
}

32
modules/apps.nix Normal file
View File

@ -0,0 +1,32 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
termdown
fastfetch
neovim
deno
pnpm
terraform
gh-copilot
gh
rcm
fnm
universal-ctags
ripgrep
pyenv
rustup
ngrok
marp-cli
discord
yarn
typescript
firefox
ffmpeg_6
warp-terminal
raycast
bitwarden-desktop
jetbrains-toolbox
jetbrains.datagrip
jetbrains.rider
jetbrains.webstorm
];
}

5
modules/config.nix Normal file
View File

@ -0,0 +1,5 @@
{
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config.allowBroken = true;
nixpkgs.config.allowUnfree = true;
}

26
modules/dotfiles/git.nix Normal file
View File

@ -0,0 +1,26 @@
{ pkgs, ... }: {
home-manager.users.louisgallet = { pkgs, ... }: {
programs.git = {
enable = true;
userName = "Louis Gallet";
userEmail = "me@louisgallet.fr";
signing = {
key = "9AD287ECD257A6B61ECD592CD4C61677B9CC4C9B";
signByDefault = true;
};
extraConfig = {
init.defaultBranch = "master";
gpg.format = "openpgp";
gpg.program =
if pkgs.stdenv.isDarwin then "/opt/homebrew/bin/gpg"
else "${pkgs.gnupg}/bin/gpg";
filter.lfs = {
clean = "git-lfs clean -- %f";
smudge = "git-lfs smudge -- %f";
process = "git-lfs filter-process";
required = true;
};
};
};
};
}