Compare commits

..

11 Commits

Author SHA1 Message Date
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
8 changed files with 435 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"

227
flake.nix
View File

@ -1,187 +1,46 @@
{ {
description = "Louis Darwin system flake"; description = "Louis multi-platform flake";
inputs = {
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew"; inputs = {
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";
outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }: home-manager.url = "github:nix-community/home-manager";
let home-manager.inputs.nixpkgs.follows = "nixpkgs";
configuration = { pkgs, ... }: { };
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget outputs = inputs@{ self, nixpkgs, nix-darwin, nix-homebrew, home-manager, ... }:
environment.systemPackages = let
[ # Modules communs aux deux machines
pkgs.termdown commonModules = [
pkgs.fastfetch ./modules/apps.nix
pkgs.neovim ./modules/config.nix
pkgs.deno ./modules/dotfiles/git.nix
pkgs.pnpm
pkgs.terraform # Ajout du bloc home-manager commun
pkgs.gh-copilot ({ pkgs, ... }: {
pkgs.gh home-manager.users.louisgallet = {
#pkgs.texlab home.stateVersion = "24.05";
#pkgs.texliveFull };
pkgs.rcm })
pkgs.fnm ];
pkgs.universal-ctags in {
pkgs.ripgrep darwinConfigurations."MBP-Louis" = nix-darwin.lib.darwinSystem {
pkgs.pyenv system = "aarch64-darwin";
pkgs.rustup modules = commonModules ++ [
pkgs.ngrok ./hosts/MBP-Louis.nix
pkgs.marp-cli nix-homebrew.darwinModules.nix-homebrew
pkgs.discord home-manager.darwinModules.home-manager
pkgs.yarn ];
pkgs.typescript };
pkgs.firefox
pkgs.warp-terminal nixosConfigurations."PC-Louis" = nixpkgs.lib.nixosSystem {
pkgs.raycast system = "x86_64-linux";
pkgs.bitwarden-desktop modules = commonModules ++ [
pkgs.jetbrains-toolbox ./hosts/PC-Louis.nix
pkgs.jetbrains.datagrip home-manager.nixosModules.home-manager
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;
};
# 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 {
modules = [
configuration
nix-homebrew.darwinModules.nix-homebrew
{
nix-homebrew = {
# Install Homebrew under the default prefix
enable = true;
# Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2
enableRosetta = true;
# User owning the Homebrew prefix
user = "louisgallet";
# Automatically migrate existing Homebrew installations
autoMigrate = true;
};
}
];
};
# Expose the package set, including overlays, for convenience.
darwinPackages = self.darwinConfigurations."MBP-Louis".pkgs;
}; };
} }

187
flake.nix.old Normal file
View File

@ -0,0 +1,187 @@
{
description = "Louis Darwin system flake";
inputs = {
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }:
let
configuration = { pkgs, ... }: {
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages =
[
pkgs.termdown
pkgs.fastfetch
pkgs.neovim
pkgs.deno
pkgs.pnpm
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;
};
# 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 {
modules = [
configuration
nix-homebrew.darwinModules.nix-homebrew
{
nix-homebrew = {
# Install Homebrew under the default prefix
enable = true;
# Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2
enableRosetta = true;
# User owning the Homebrew prefix
user = "louisgallet";
# Automatically migrate existing Homebrew installations
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;
};
};
};
};
}