Compare commits

...

2 commits

Author SHA1 Message Date
mrflos
f1589a8d15 macos custom tweaks 2024-08-09 12:34:10 +03:00
mrflos
86b9b25e10 wip macos config 2024-05-30 13:16:42 +03:00
11 changed files with 306 additions and 249 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
.DS_Store
configuration.nix configuration.nix

8
darwin-configuration.nix Normal file
View file

@ -0,0 +1,8 @@
# NixOS config entry point
# import the hardware and configuration files specific to your machine
{
imports =
[
./machines/MacMiniM2-darwin-configuration.nix
];
}

2
dotfiles/init_yeswiki_repos.sh Normal file → Executable file
View file

@ -14,7 +14,7 @@
corebranch="doryphore-dev" corebranch="doryphore-dev"
curdir="$HOME/Developpements" #${PWD} curdir="$HOME/Developpements" #${PWD}
repos=$(curl --request GET --url "https://api.github.com/orgs/yeswiki/repos" | jq '.[].full_name' | tr -d "\"" | sort) repos=$(curl --request GET --url "https://api.github.com/orgs/yeswiki/repos?per_page=100" | jq '.[].full_name' | tr -d "\"" | sort)
# core # core
printf "\n================ Install YesWiki core ================\n" printf "\n================ Install YesWiki core ================\n"

View file

@ -91,3 +91,5 @@ background_opacity 1
#background_tint 0.99 #background_tint 0.99
modify_font cell_height 130% modify_font cell_height 130%
startup_session ~/.config/kitty/session.conf startup_session ~/.config/kitty/session.conf
hide_window_decorations titlebar-only

View file

@ -0,0 +1,21 @@
return {
{
-- Install markdown preview, use npx if available.
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
build = function(plugin)
if vim.fn.executable("npx") then
vim.cmd("!cd " .. plugin.dir .. " && cd app && npx --yes yarn install")
else
vim.cmd([[Lazy load markdown-preview.nvim]])
vim.fn["mkdp#util#install"]()
end
end,
init = function()
if vim.fn.executable("npx") then
vim.g.mkdp_filetypes = { "markdown" }
end
end,
},
}

View file

@ -0,0 +1,34 @@
{ config, pkgs, ... }:
{
imports = [
../modules/console.nix
../modules/local-dev.nix
../modules/home-config.nix
];
fonts = {
fontDir.enable = true;
fonts = with pkgs; [
inter
(nerdfonts.override { fonts = [ "Iosevka" ]; })
];
};
# Use a custom configuration.nix location.
# $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
# environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix";
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nix.package = pkgs.nix;
networking.hostName = "ace";
# Create /etc/zshrc that loads the nix-darwin environment.
programs.zsh.enable = true; # default shell on catalina
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
}

View file

@ -3,24 +3,24 @@
{ {
programs.zsh.enable = true; programs.zsh.enable = true;
programs.fzf = { # programs.fzf = {
fuzzyCompletion = true; # fuzzyCompletion = true;
keybindings = true; # keybindings = true;
}; # };
services = { # services = {
mpd.enable = true; # mpd.enable = true;
mpd.musicDirectory = "/home/mrflos/Musique"; # mpd.musicDirectory = "/home/mrflos/Musique";
mpd.user = "mrflos"; # mpd.user = "mrflos";
mpd.group = "users"; # mpd.group = "users";
mpd.startWhenNeeded = true; # mpd.startWhenNeeded = true;
mpd.extraConfig = '' # mpd.extraConfig = ''
audio_output { # audio_output {
type "pulse" # type "pulse"
name "mpd" # name "mpd"
} # }
''; # '';
}; # };
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
@ -55,11 +55,12 @@
mpc-cli mpc-cli
mpd mpd
neofetch neofetch
neovim
ollama ollama
pandoc pandoc
pass pass
pciutils pciutils
pinentry #pinentry
ripgrep ripgrep
rustc rustc
slides slides
@ -69,11 +70,11 @@
tokei tokei
tree tree
unzip unzip
usbutils #usbutils
wget wget
whois whois
wl-clipboard wl-clipboard
wirelesstools #wirelesstools
yt-dlp yt-dlp
zellij zellij
zsh-autosuggestions zsh-autosuggestions

View file

@ -1,72 +1,33 @@
# Inject the right home-manager config for the machine.
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
plasma-manager = pkgs.fetchFromGitHub { #startupScript = pkgs.pkgs.writeShellScriptBin "hyprland-start" ''
owner = "pjones"; # ${pkgs.waybar}/bin/waybar &
repo = "plasma-manager"; # ${pkgs.swww}/bin/swww init &
rev = "4e56cfeb95081a43cb49487d0996dc936d6201e5"; #
sha256 = "sha256-LJ/lFEupLSi7xtUps234hhMk7ZdVLRoYeU7KiCFaoGw="; # sleep 1
};
treesitterWithGrammars = (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [
p.bash
p.comment
p.css
p.dockerfile
p.fish
p.gitattributes
p.gitignore
p.go
p.gomod
p.gowork
p.hcl
p.html
p.php
p.javascript
p.jq
p.json5
p.json
p.lua
p.make
p.markdown
p.nix
p.python
p.rust
p.twig
p.toml
p.typescript
p.vue
p.yaml
]));
startupScript = pkgs.pkgs.writeShellScriptBin "hyprland-start" ''
${pkgs.waybar}/bin/waybar &
${pkgs.swww}/bin/swww init &
sleep 1 # ${pkgs.swww}/bin/swww img /home/mrflos/Nextcloud/Images/Wallpapers/chihiro014.jpg &
# '';
${pkgs.swww}/bin/swww img /home/mrflos/Nextcloud/Images/Wallpapers/chihiro014.jpg &
'';
in { in {
# TODO can we automate the installation of home-manager ?
# sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager # sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager
imports = [ imports = [
<home-manager/nixos> #<home-manager/nixos>
<home-manager/nix-darwin>
]; ];
# Let Home Manager install and manage itself.
#programs.home-manager.enable = true;
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
users.users.mrflos = { users.users.mrflos = {
isNormalUser = true; #isNormalUser = true;
description = "mrflos"; description = "mrflos";
createHome = true; createHome = true;
extraGroups = ["users" "docker" "libvirtd" "lxd" "networkmanager" "wheel" ]; #extraGroups = ["users" "docker" "libvirtd" "lxd" "networkmanager" "wheel" ];
uid = 1000; uid = 1000;
shell = pkgs.zsh; shell = pkgs.zsh;
home = "/Users/mrflos";
}; };
nix.settings.trusted-users = [ "mrflos" ]; nix.settings.trusted-users = [ "mrflos" ];
home-manager.backupFileExtension = "backup";
home-manager.users.mrflos = { pkgs, ... }: { home-manager.users.mrflos = { pkgs, ... }: {
home.stateVersion = "23.05"; home.stateVersion = "23.05";
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -78,17 +39,17 @@ in {
rust-analyzer-unwrapped rust-analyzer-unwrapped
php83Packages.composer php83Packages.composer
nodejs_20 nodejs_20
swww # swww
grimblast # grimblast
swaylock #swaylock
waybar #waybar
yarn yarn
]; ];
imports = [ #imports = [
(plasma-manager + "/modules") # (plasma-manager + "/modules")
./home-plasma.nix # ./home-plasma.nix
]; #];
home.file = { home.file = {
"./.config/kitty/" = { "./.config/kitty/" = {
source = ../dotfiles/kitty; source = ../dotfiles/kitty;
@ -107,10 +68,10 @@ in {
# Treesitter is configured as a locally developed module in lazy.nvim # Treesitter is configured as a locally developed module in lazy.nvim
# we hardcode a symlink here so that we can refer to it in our lazy config # we hardcode a symlink here so that we can refer to it in our lazy config
"./.local/share/nvim/nix/nvim-treesitter/" = { #"./.local/share/nvim/nix/nvim-treesitter/" = {
recursive = true; # recursive = true;
source = treesitterWithGrammars; # source = treesitterWithGrammars;
}; #};
}; };
home.sessionVariables = { home.sessionVariables = {
EDITOR = "nvim"; EDITOR = "nvim";
@ -149,23 +110,23 @@ in {
port = 465; port = 465;
}; };
}; };
"mrflos@saint-ex.deuxfleurs.org" = { #"mrflos@saint-ex.deuxfleurs.org" = {
realName = "Florian Schmitt"; # realName = "Florian Schmitt";
userName = "mrflos"; # userName = "mrflos";
address = "mrflos@saint-ex.deuxfleurs.org"; # address = "mrflos@saint-ex.deuxfleurs.org";
primary = false; #primary = false;
thunderbird = { enable = true; }; #thunderbird = { enable = true; };
imap = { #imap = {
host = "imap.saint-ex.deuxfleurs.org"; # host = "imap.saint-ex.deuxfleurs.org";
port = 993; # port = 993;
}; #};
smtp = { #smtp = {
host = "smtp.saint-ex.deuxfleurs.org"; # host = "smtp.saint-ex.deuxfleurs.org";
port = 465; # port = 465;
}; #};
}; #};
"mrflos@mrflos.pw" = { "mrflos@mrflos.pw" = {
realName = "Florian Schmitt"; realName = "Florian Schmitt";
userName = "mrflos"; userName = "mrflos";
@ -250,7 +211,7 @@ in {
vimAlias = true; vimAlias = true;
coc.enable = false; coc.enable = false;
plugins = [ treesitterWithGrammars ]; #plugins = [ treesitterWithGrammars ];
}; };
password-store = { password-store = {
@ -263,10 +224,10 @@ in {
}; };
}; };
thunderbird = { #thunderbird = {
enable = true; # enable = true;
profiles.default = { isDefault = true; }; # profiles.default = { isDefault = true; };
}; #};
starship = { starship = {
enable = true; enable = true;
@ -275,7 +236,7 @@ in {
zsh = { zsh = {
enable = true; enable = true;
enableAutosuggestions = true; autosuggestion.enable = true;
enableCompletion = true; enableCompletion = true;
shellAliases = { shellAliases = {
#tmux = "tmux -f ~/.config/tmux/tmux.conf attach || tmux -f ~/.config/tmux/tmux.conf new"; #tmux = "tmux -f ~/.config/tmux/tmux.conf attach || tmux -f ~/.config/tmux/tmux.conf new";
@ -305,105 +266,105 @@ in {
}; };
}; };
services.ssh-agent.enable = true; #services.ssh-agent.enable = true;
wayland.windowManager.hyprland.enable = true; #wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.settings = { #wayland.windowManager.hyprland.settings = {
exec-once = ''${startupScript}/bin/hyprland-start''; # exec-once = ''${startupScript}/bin/hyprland-start'';
"$mod" = "SUPER"; # "$mod" = "SUPER";
# assign apps # assign apps
"$term" = "kitty"; # "$term" = "kitty";
"$editor" = "nvim"; # "$editor" = "nvim";
"$file" = "dolphin"; # "$file" = "dolphin";
"$browser" = "firefox"; # "$browser" = "firefox";
bind = [ # bind = [
", Print, exec, grimblast copy area" # ", Print, exec, grimblast copy area"
# Window/Session actions # Window/Session actions
"$mod, Q, killactive" # "$mod, Q, killactive"
"ALT, F4, killactive" # "ALT, F4, killactive"
"$mod, delete, exit" # kill hyperland session # "$mod, delete, exit" # kill hyperland session
"$mod, W, togglefloating" # toggle the window on focus to float # "$mod, W, togglefloating" # toggle the window on focus to float
"$mod, G, togglegroup" # toggle the window on focus to float # "$mod, G, togglegroup" # toggle the window on focus to float
"ALT, return, fullscreen" # toggle the window on focus to fullscreen # "ALT, return, fullscreen" # toggle the window on focus to fullscreen
"$mod, L, exec, swaylock" # lock screen # "$mod, L, exec, swaylock" # lock screen
# "$mod, backspace, exec, wlogout-launcher-hyprland 1" # logout menu # "$mod, backspace, exec, wlogout-launcher-hyprland 1" # logout menu
"$CONTROL, ESCAPE, exec, systemctl-toggle --user waybar.service" # "$CONTROL, ESCAPE, exec, systemctl-toggle --user waybar.service"
# Application shortcuts # Application shortcuts
"$mod, T, exec, $term" # open terminal # "$mod, T, exec, $term" # open terminal
"$mod, E, exec, $file" # open file manager # "$mod, E, exec, $file" # open file manager
"$mod, C, exec, $editor" # open vscode # "$mod, C, exec, $editor" # open vscode
"$mod, F, exec, $browser" # open browser # "$mod, F, exec, $browser" # open browser
# Move focus with mainMod + arrow keys # Move focus with mainMod + arrow keys
"$mod, left, movefocus, l" # "$mod, left, movefocus, l"
"$mod, right, movefocus, r" # "$mod, right, movefocus, r"
"$mod, up, movefocus, u" # "$mod, up, movefocus, u"
"$mod, down, movefocus, d" # "$mod, down, movefocus, d"
"ALT, Tab, movefocus, d" # "ALT, Tab, movefocus, d"
# Switch workspaces relative to the active workspace with mainMod + CTRL + [←→] # Switch workspaces relative to the active workspace with mainMod + CTRL + [←→]
"$mod CTRL, right, workspace, r+1" # "$mod CTRL, right, workspace, r+1"
"$mod CTRL, left, workspace, r-1" # "$mod CTRL, left, workspace, r-1"
# move to the first empty workspace instantly with mainMod + CTRL + [↓] # move to the first empty workspace instantly with mainMod + CTRL + [↓]
"$mod CTRL, down, workspace, empty" # "$mod CTRL, down, workspace, empty"
# Move active window to a relative workspace with mainMod + CTRL + ALT + [←→] # Move active window to a relative workspace with mainMod + CTRL + ALT + [←→]
"$mod CTRL ALT, right, movetoworkspace, r+1" # "$mod CTRL ALT, right, movetoworkspace, r+1"
"$mod CTRL ALT, left, movetoworkspace, r-1" # "$mod CTRL ALT, left, movetoworkspace, r-1"
# Move active window around current workspace with mainMod + SHIFT + CTRL [←→↑↓] # Move active window around current workspace with mainMod + SHIFT + CTRL [←→↑↓]
"$mod SHIFT $CONTROL, left, movewindow, l" # "$mod SHIFT $CONTROL, left, movewindow, l"
"$mod SHIFT $CONTROL, right, movewindow, r" # "$mod SHIFT $CONTROL, right, movewindow, r"
"$mod SHIFT $CONTROL, up, movewindow, u" # "$mod SHIFT $CONTROL, up, movewindow, u"
"$mod SHIFT $CONTROL, down, movewindow, d" # "$mod SHIFT $CONTROL, down, movewindow, d"
# Scroll through existing workspaces with mainMod + scroll # Scroll through existing workspaces with mainMod + scroll
"$mod, mouse_down, workspace, e+1" # "$mod, mouse_down, workspace, e+1"
"$mod, mouse_up, workspace, e-1" # "$mod, mouse_up, workspace, e-1"
# Special workspaces (scratchpad) # Special workspaces (scratchpad)
"$mod ALT, S, movetoworkspacesilent, special" # "$mod ALT, S, movetoworkspacesilent, special"
"$mod, S, togglespecialworkspace," # "$mod, S, togglespecialworkspace,"
# Toggle Layout # Toggle Layout
"$mod, J, togglesplit," # dwindle # "$mod, J, togglesplit," # dwindle
] # ]
++ ( # ++ (
# workspaces # workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10} # binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
builtins.concatLists (builtins.genList ( # builtins.concatLists (builtins.genList (
x: let # x: let
ws = let # ws = let
c = (x + 1) / 10; # c = (x + 1) / 10;
in # in
builtins.toString (x + 1 - (c * 10)); # builtins.toString (x + 1 - (c * 10));
in [ # in [
"$mod, ${ws}, workspace, ${toString (x + 1)}" # "$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" # "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
"$mod ALT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}" # Move window silently to workspace Super + Alt + [0-9] # "$mod ALT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}" # Move window silently to workspace Super + Alt + [0-9]
] # ]
) # )
10) # 10)
); # );
#
# # Move/Resize windows with mainMod + LMB/RMB and dragging
# bindm = [
# "$mod, mouse:272, movewindow"
# "$mod, mouse:273, resizewindow"
# ];
# Move/Resize windows with mainMod + LMB/RMB and dragging # # Resize windows
bindm = [ # binde = [
"$mod, mouse:272, movewindow" # "$mod SHIFT, right, resizeactive, 30 0"
"$mod, mouse:273, resizewindow" # "$mod SHIFT, left, resizeactive, -30 0"
]; # "$mod SHIFT, up, resizeactive, 0 -30"
# "$mod SHIFT, down, resizeactive, 0 30"
# Resize windows # ];
binde = [ # };
"$mod SHIFT, right, resizeactive, 30 0"
"$mod SHIFT, left, resizeactive, -30 0"
"$mod SHIFT, up, resizeactive, 0 -30"
"$mod SHIFT, down, resizeactive, 0 30"
];
};
}; };
} }

View file

@ -1,4 +1,12 @@
{ { config, pkgs, lib, ... }:
let
plasma-manager = pkgs.fetchFromGitHub {
owner = "pjones";
repo = "plasma-manager";
rev = "4e56cfeb95081a43cb49487d0996dc936d6201e5";
sha256 = "sha256-LJ/lFEupLSi7xtUps234hhMk7ZdVLRoYeU7KiCFaoGw=";
};
in {
programs.plasma = { programs.plasma = {
enable = true; enable = true;
shortcuts = { shortcuts = {

View file

@ -1,84 +1,104 @@
# Local developpement # Local developpement
{ pkgs, config, lib, ... }: { { pkgs, config, lib, ... }: {
virtualisation = { # virtualisation = {
docker.enable = true; # docker.enable = true;
#docker.rootless = { # #docker.rootless = {
# enable = true; # # enable = true;
# setSocketVariable = true; # # setSocketVariable = true;
#}; # #};
#libvirtd.enable = true; # #libvirtd.enable = true;
#lxd.enable = true; # #lxd.enable = true;
#waydroid.enable = true; # #waydroid.enable = true;
}; # };
systemd.services.yeswikidev = { # systemd.services.yeswikidev = {
enable = true; # enable = true;
script = '' # script = ''
${pkgs.systemd}/bin/systemctl start mysql # ${pkgs.systemd}/bin/systemctl start mysql
# etc # # etc
''; # '';
serviceConfig = let # serviceConfig = let
startstop = command: # startstop = command:
(pkgs.writeShellApplication { # (pkgs.writeShellApplication {
name = "yeswikidev"; # name = "yeswikidev";
runtimeInputs = with pkgs; [ systemd ]; # runtimeInputs = with pkgs; [ systemd ];
text = '' # text = ''
systemctl ${command} mysql.service # systemctl ${command} mysql.service
''; # '';
}); # });
#startstopFullShell = pkgs.writeShellApplication { # #startstopFullShell = pkgs.writeShellApplication {
# name = "yeswikidev"; # # name = "yeswikidev";
# runtimeInputs = with pkgs; [ systemd ]; # # runtimeInputs = with pkgs; [ systemd ];
# text = '' # # text = ''
# systemctl "$1" mysql.service # # systemctl "$1" mysql.service
# ''; # # '';
#}); # #});
#commands = [ "start" "stop" ]; # #commands = [ "start" "stop" ];
#scripts = map (command: (pkgs.writeShellApplication { # #scripts = map (command: (pkgs.writeShellApplication {
# name = "yeswikidev"; # # name = "yeswikidev";
# runtimeInputs = with pkgs; [ systemd ]; # # runtimeInputs = with pkgs; [ systemd ];
# text = '' # # text = ''
# systemctl ${command} mysql.service # # systemctl ${command} mysql.service
# ''; # # '';
#})) commands; # #})) commands;
#execs = { # #execs = {
# ExecStart = "start"; # # ExecStart = "start";
# ExecStop = "stop"; # # ExecStop = "stop";
#}; # #};
# https://nixos.org/manual/nix/stable/language/builtins # # https://nixos.org/manual/nix/stable/language/builtins
# https://nixos.org/manual/nix/stable/language/builtins#builtins-mapAttrs # # https://nixos.org/manual/nix/stable/language/builtins#builtins-mapAttrs
#execAttrs = attrNames execs; # ["Start" "Stop"]; # #execAttrs = attrNames execs; # ["Start" "Stop"];
#execs2 = mapAttrs (k: v: ()) execs; # #execs2 = mapAttrs (k: v: ()) execs;
in { # in {
# pkgs.writeScript, pkgs.writeScriptBin # # pkgs.writeScript, pkgs.writeScriptBin
#ExecStart = startstop "start"; # #ExecStart = startstop "start";
#ExecStop = startstop "stop"; # #ExecStop = startstop "stop";
# OR # # OR
# ExecStart = "${startstopFullShell} start"; # # ExecStart = "${startstopFullShell} start";
# ExecStop = "${startstopFullShell} stop"; # # ExecStop = "${startstopFullShell} stop";
# OR # # OR
# ExecStart = "${scripts[0]}"; # # ExecStart = "${scripts[0]}";
# ExecStop = "${scripts[1]}"; # # ExecStop = "${scripts[1]}";
}; # };
}; # };
services.mysql = { # services.mysql = {
enable = true; # enable = true;
package = pkgs.mariadb; # package = pkgs.mariadb;
}; # };
homebrew.enable = true;
homebrew.brews = [
# `brew install`
#"imagemagick"
# `brew install`, always `brew services restart`, `brew link`, `brew unlink mysql` (if it is installed)
{
name = "mariadb";
restart_service = true;
link = true;
conflicts_with = [ "mysql" ];
}
];
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs;
#clang let
php83 = pkgs.php83.buildEnv { extraConfig = ''
max_upload_size = 2G
memory_limit = 1G
''; };
in [
cmake
dart-sass dart-sass
dbeaver
docker-compose docker-compose
fd
fzf
gcc gcc
gitkraken
go go
nixfmt lua-language-server
nixfmt-classic
nixpkgs-fmt nixpkgs-fmt
nodejs nodejs
nodePackages.eslint nodePackages.eslint
@ -88,7 +108,8 @@
php83Packages.php-cs-fixer php83Packages.php-cs-fixer
python3 python3
python311Packages.virtualenv python311Packages.virtualenv
rpi-imager ripgrep
rust-analyzer-unwrapped
ruff-lsp ruff-lsp
stylelint stylelint
symfony-cli symfony-cli