Compare commits

...

5 commits
main ... macos

Author SHA1 Message Date
mrflos
9d69a35a79 feat(nvim): version 0.10 2024-08-19 17:41:19 +03:00
mrflos
3673a7ea06 feat(nvim): avoid popups 2024-08-12 17:15:52 +03:00
mrflos
9a2a4f68ca fix(macos): new font syntax and typo in php conf 2024-08-09 13:24:48 +03:00
mrflos
6891dbfaf2 macos custom tweaks 2024-08-09 12:42:09 +03:00
mrflos
232b3546e1 wip macos config 2024-08-09 12:41:40 +03:00
12 changed files with 244 additions and 188 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
.DS_Store
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"
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
printf "\n================ Install YesWiki core ================\n"

View file

@ -91,3 +91,5 @@ background_opacity 1
#background_tint 0.99
modify_font cell_height 130%
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

@ -83,7 +83,7 @@ return {
},
},
window = {
position = "float",
position = "current",
},
},
},
@ -99,11 +99,24 @@ return {
},
},
},
{
"folke/noice.nvim",
event = "VeryLazy",
opts = {
cmdline = {
view = "cmdline",
},
presets = {
bottom_search = true,
command_palette = false,
},
},
},
{
"nvim-telescope/telescope.nvim",
opts = {
defaults = {
layout_strategy = "center",
layout_strategy = "bottom_pane",
layout_config = {
prompt_position = "top",
preview_cutoff = 5, -- Preview should always show (unless previewer = false)
@ -117,9 +130,9 @@ return {
sorting_strategy = "ascending",
border = true,
borderchars = {
prompt = { "", "", " ", "", "", "", "", "" },
results = { "", "", "", "", "", "", "", "" },
preview = { "", "", "", "", "", "", "", "" },
prompt = { "", "", "", "", "", "", "", "" },
results = { "", "", "", "", "", "", "", "" },
preview = { "", "", "", "", "", "", "", "" },
},
},
},

View file

@ -0,0 +1,33 @@
{ config, pkgs, ... }:
{
imports = [
../modules/console.nix
../modules/local-dev.nix
../modules/home-config.nix
];
fonts = {
packages = 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

@ -1,12 +1,25 @@
# cli programs should be available on servers and desktop
{ pkgs, ... }:
{ config, pkgs, ... }:
let
unstable = import
(builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/7afa2c97ebb0585d00c64c112344483e89e00545)
# reuse the current configuration
{ config = config.nixpkgs.config; };
in
{
programs.zsh.enable = true;
programs.fzf = {
fuzzyCompletion = true;
keybindings = true;
};
# programs.fzf = {
# fuzzyCompletion = true;
# keybindings = true;
# };
# programs.neovim = {
# enable = true;
# defaultEditor = true;
# package = unstable.neovim;
# viAlias = true;
# vimAlias = true;
# };
# List packages installed in system profile. To search, run:
# $ nix search wget
@ -41,11 +54,12 @@
mpc-cli
mpd
neofetch
unstable.neovim
ollama
pandoc
pass
pciutils
pinentry
#pinentry
ripgrep
rustc
slides
@ -55,12 +69,12 @@
tokei
tree
unzip
usbutils
#usbutils
wget
whois
wl-clipboard
wirelesstools
yazi
#wirelesstools
yt-dlp
zellij
zoxide

View file

@ -1,41 +1,38 @@
# Inject the right home-manager config for the machine.
{ config, pkgs, lib, ... }:
let
plasma-manager = pkgs.fetchFromGitHub {
owner = "pjones";
repo = "plasma-manager";
rev = "4e56cfeb95081a43cb49487d0996dc936d6201e5";
sha256 = "sha256-LJ/lFEupLSi7xtUps234hhMk7ZdVLRoYeU7KiCFaoGw=";
};
startupScript = pkgs.pkgs.writeShellScriptBin "hyprland-start" ''
${pkgs.waybar}/bin/waybar &
${pkgs.swww}/bin/swww init &
# unstable = import
# (builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/7afa2c97ebb0585d00c64c112344483e89e00545)
# # reuse the current configuration
# { config = config.nixpkgs.config; };
#
#startupScript = pkgs.pkgs.writeShellScriptBin "hyprland-start" ''
# ${pkgs.waybar}/bin/waybar &
# ${pkgs.swww}/bin/swww init &
#
# sleep 1
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 {
# TODO can we automate the installation of home-manager ?
# sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager
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;
users.users.mrflos = {
isNormalUser = true;
#isNormalUser = true;
description = "mrflos";
createHome = true;
extraGroups = ["users" "docker" "libvirtd" "lxd" "networkmanager" "wheel" ];
#extraGroups = ["users" "docker" "libvirtd" "lxd" "networkmanager" "wheel" ];
uid = 1000;
shell = pkgs.zsh;
home = "/Users/mrflos";
};
nix.settings.trusted-users = [ "mrflos" ];
home-manager.backupFileExtension = "backup";
home-manager.users.mrflos = { pkgs, ... }: {
home.stateVersion = "23.05";
home.packages = with pkgs; [
@ -47,17 +44,17 @@ in {
rust-analyzer-unwrapped
php83Packages.composer
nodejs_20
swww
grimblast
swaylock
waybar
# swww
# grimblast
#swaylock
#waybar
yarn
];
imports = [
(plasma-manager + "/modules")
./home-plasma.nix
];
#imports = [
# (plasma-manager + "/modules")
# ./home-plasma.nix
#];
home.file = {
"./.config/kitty/" = {
source = ../dotfiles/kitty;
@ -192,8 +189,8 @@ in {
core.fileMode = false;
};
};
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
@ -217,10 +214,14 @@ in {
nixedit = "vi /etc/nixos";
nixupdate = "sudo nix-channel --update && sudo nixos-rebuild switch";
nixclean = "sudo nix-env --delete-generations old --profile /nix/var/nix/profiles/system && sudo /nix/var/nix/profiles/system/bin/switch-to-configuration switch && sudo nix-store --gc";
socks = "ssh -N -f -C -D 9090 mrflos@yunohost.yeswiki.net -p 6742";
vi = "/run/current-system/sw/bin/nvim";
vim = "/run/current-system/sw/bin/nvim";
yeswiki-updater = "cd /home/mrflos/Developpements/yeswiki-installer/ && sudo php yeswiki-updater.php";
};
initExtra = ''
export BUN_INSTALL="$HOME/.bun"
export PHP_CS_FIXER_IGNORE_ENV=1
export PATH="$HOME/.local/bin:$BUN_INSTALL/bin:$PATH"
eval "$(atuin init zsh)"
eval "$(zoxide init zsh)"
@ -238,105 +239,105 @@ in {
};
};
services.ssh-agent.enable = true;
wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.settings = {
exec-once = ''${startupScript}/bin/hyprland-start'';
"$mod" = "SUPER";
#services.ssh-agent.enable = true;
#wayland.windowManager.hyprland.enable = true;
#wayland.windowManager.hyprland.settings = {
# exec-once = ''${startupScript}/bin/hyprland-start'';
# "$mod" = "SUPER";
# assign apps
"$term" = "kitty";
"$editor" = "nvim";
"$file" = "dolphin";
"$browser" = "firefox";
# "$term" = "kitty";
# "$editor" = "nvim";
# "$file" = "dolphin";
# "$browser" = "firefox";
bind = [
", Print, exec, grimblast copy area"
# bind = [
# ", Print, exec, grimblast copy area"
# Window/Session actions
"$mod, Q, killactive"
"ALT, F4, killactive"
"$mod, delete, exit" # kill hyperland session
"$mod, W, togglefloating" # 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
"$mod, L, exec, swaylock" # lock screen
# "$mod, Q, killactive"
# "ALT, F4, killactive"
# "$mod, delete, exit" # kill hyperland session
# "$mod, W, togglefloating" # 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
# "$mod, L, exec, swaylock" # lock screen
# "$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
"$mod, T, exec, $term" # open terminal
"$mod, E, exec, $file" # open file manager
"$mod, C, exec, $editor" # open vscode
"$mod, F, exec, $browser" # open browser
# "$mod, T, exec, $term" # open terminal
# "$mod, E, exec, $file" # open file manager
# "$mod, C, exec, $editor" # open vscode
# "$mod, F, exec, $browser" # open browser
# Move focus with mainMod + arrow keys
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
"ALT, Tab, movefocus, d"
# "$mod, left, movefocus, l"
# "$mod, right, movefocus, r"
# "$mod, up, movefocus, u"
# "$mod, down, movefocus, d"
# "ALT, Tab, movefocus, d"
# Switch workspaces relative to the active workspace with mainMod + CTRL + [←→]
"$mod CTRL, right, workspace, r+1"
"$mod CTRL, left, workspace, r-1"
# "$mod CTRL, right, workspace, r+1"
# "$mod CTRL, left, workspace, r-1"
# 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 + [←→]
"$mod CTRL ALT, right, movetoworkspace, r+1"
"$mod CTRL ALT, left, movetoworkspace, r-1"
# "$mod CTRL ALT, right, movetoworkspace, r+1"
# "$mod CTRL ALT, left, movetoworkspace, r-1"
# Move active window around current workspace with mainMod + SHIFT + CTRL [←→↑↓]
"$mod SHIFT $CONTROL, left, movewindow, l"
"$mod SHIFT $CONTROL, right, movewindow, r"
"$mod SHIFT $CONTROL, up, movewindow, u"
"$mod SHIFT $CONTROL, down, movewindow, d"
# "$mod SHIFT $CONTROL, left, movewindow, l"
# "$mod SHIFT $CONTROL, right, movewindow, r"
# "$mod SHIFT $CONTROL, up, movewindow, u"
# "$mod SHIFT $CONTROL, down, movewindow, d"
# Scroll through existing workspaces with mainMod + scroll
"$mod, mouse_down, workspace, e+1"
"$mod, mouse_up, workspace, e-1"
# "$mod, mouse_down, workspace, e+1"
# "$mod, mouse_up, workspace, e-1"
# Special workspaces (scratchpad)
"$mod ALT, S, movetoworkspacesilent, special"
"$mod, S, togglespecialworkspace,"
# "$mod ALT, S, movetoworkspacesilent, special"
# "$mod, S, togglespecialworkspace,"
# Toggle Layout
"$mod, J, togglesplit," # dwindle
]
++ (
# "$mod, J, togglesplit," # dwindle
# ]
# ++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
builtins.concatLists (builtins.genList (
x: let
ws = let
c = (x + 1) / 10;
in
builtins.toString (x + 1 - (c * 10));
in [
"$mod, ${ws}, workspace, ${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]
]
)
10)
);
# builtins.concatLists (builtins.genList (
# x: let
# ws = let
# c = (x + 1) / 10;
# in
# builtins.toString (x + 1 - (c * 10));
# in [
# "$mod, ${ws}, workspace, ${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]
# ]
# )
# 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
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
# 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"
];
};
# # 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 = {
enable = true;
shortcuts = {

View file

@ -1,86 +1,40 @@
# Local developpement
{ pkgs, config, lib, ... }: {
virtualisation = {
docker.enable = true;
#docker.rootless = {
# enable = true;
# setSocketVariable = true;
#};
#libvirtd.enable = true;
#lxd.enable = true;
#waydroid.enable = true;
};
homebrew.enable = true;
homebrew.brews = [
# `brew install`
#"imagemagick"
systemd.services.yeswikidev = {
enable = true;
script = ''
${pkgs.systemd}/bin/systemctl start mysql
# etc
'';
serviceConfig = let
startstop = command:
(pkgs.writeShellApplication {
name = "yeswikidev";
runtimeInputs = with pkgs; [ systemd ];
text = ''
systemctl ${command} mysql.service
'';
});
#startstopFullShell = pkgs.writeShellApplication {
# name = "yeswikidev";
# runtimeInputs = with pkgs; [ systemd ];
# text = ''
# systemctl "$1" mysql.service
# '';
#});
#commands = [ "start" "stop" ];
#scripts = map (command: (pkgs.writeShellApplication {
# name = "yeswikidev";
# runtimeInputs = with pkgs; [ systemd ];
# text = ''
# systemctl ${command} mysql.service
# '';
#})) commands;
#execs = {
# ExecStart = "start";
# ExecStop = "stop";
#};
# https://nixos.org/manual/nix/stable/language/builtins
# https://nixos.org/manual/nix/stable/language/builtins#builtins-mapAttrs
#execAttrs = attrNames execs; # ["Start" "Stop"];
#execs2 = mapAttrs (k: v: ()) execs;
in {
# pkgs.writeScript, pkgs.writeScriptBin
#ExecStart = startstop "start";
#ExecStop = startstop "stop";
# OR
# ExecStart = "${startstopFullShell} start";
# ExecStop = "${startstopFullShell} stop";
# OR
# ExecStart = "${scripts[0]}";
# ExecStop = "${scripts[1]}";
};
};
services.mysql = {
enable = true;
package = pkgs.mariadb;
};
# `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:
# $ nix search wget
environment.systemPackages = with pkgs;
let
php83 = pkgs.php83.buildEnv { extraConfig = "memory_limit = 2G"; };
php83 = pkgs.php83.buildEnv { extraConfig = ''
memory_limit = 2G
max_upload_size = 2G
''; };
in [
#clang
dart-sass
dbeaver-bin
cmake
dart-sass
docker-compose
fd
fzf
gcc
go
nixfmt-rfc-style
lua
lua-language-server
luarocks
nixpkgs-fmt
nodejs
nodePackages.eslint
@ -90,7 +44,8 @@
php83Packages.php-cs-fixer
python3
python311Packages.virtualenv
rpi-imager
ripgrep
rust-analyzer-unwrapped
ruff-lsp
stylelint
symfony-cli