refactor: format config with nixpkgs-fmt

for consistency
This commit is contained in:
Pierre Martin
2022-09-03 07:26:40 +02:00
parent 6d13cc66bc
commit e39666ee76
5 changed files with 79 additions and 73 deletions

130
home.nix
View File

@@ -13,7 +13,7 @@
programs.vscode = { programs.vscode = {
enable = true; enable = true;
extensions = []; extensions = [ ];
}; };
services.unclutter.enable = true; services.unclutter.enable = true;
@@ -26,22 +26,24 @@
terminal = "sakura"; terminal = "sakura";
}; };
xsession.windowManager.i3 = let xsession.windowManager.i3 =
modifier = "Mod4"; let
in { modifier = "Mod4";
enable = true; in
config = { {
assigns = { enable = true;
# https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.assigns config = {
}; assigns = {
focus = { # https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.assigns
mouseWarping = false; # Whether mouse cursor should be warped to the center of the window when switching focus to a window on a different output. };
}; focus = {
mouseWarping = false; # Whether mouse cursor should be warped to the center of the window when switching focus to a window on a different output.
};
modifier = modifier; modifier = modifier;
# see https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.keybindings # see https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.keybindings
keybindings = pkgs.lib.mkOptionDefault { keybindings = pkgs.lib.mkOptionDefault {
"${modifier}+Return" = "exec sakura"; #i3-sensible-terminal "${modifier}+Return" = "exec sakura"; #i3-sensible-terminal
### BÉPO ### ### BÉPO ###
@@ -99,21 +101,21 @@
"XF86MonBrightnessDown" = "exec light -U 2"; # decrease screen brightness "XF86MonBrightnessDown" = "exec light -U 2"; # decrease screen brightness
}; };
startup = [ startup = [
{ command = "nextcloud"; notification = false; } { command = "nextcloud"; notification = false; }
{ command = "setxkbmap -layout fr -variant bepo"; notification = false; } { command = "setxkbmap -layout fr -variant bepo"; notification = false; }
{ command = "udiskie"; notification = false; } { command = "udiskie"; notification = false; }
{ command = "copyq"; notification = false; } { command = "copyq"; notification = false; }
{ command = "numlockx on"; notification = false; } # turn verr num on { command = "numlockx on"; notification = false; } # turn verr num on
{ command = "autorandr -c"; notification = false; } { command = "autorandr -c"; notification = false; }
{ command = "feh --bg-scale /home/pierre/Documents/Graphisme/fc-bg-light-black.png"; notification = false; } { command = "feh --bg-scale /home/pierre/Documents/Graphisme/fc-bg-light-black.png"; notification = false; }
# docker run -d --net traefik --ip 172.10.0.10 --restart always -v /var/run/docker.sock:/var/run/docker.sock:ro --name traefik -p 80:80 -p 8080:8080 traefik:2.4.9 --api.insecure=true --providers.docker # docker run -d --net traefik --ip 172.10.0.10 --restart always -v /var/run/docker.sock:/var/run/docker.sock:ro --name traefik -p 80:80 -p 8080:8080 traefik:2.4.9 --api.insecure=true --providers.docker
{ command = "docker start traefik"; notification = false; } { command = "docker start traefik"; notification = false; }
]; ];
};
}; };
};
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@@ -145,43 +147,43 @@
# `$` must be escaped with `''` :metal: # `$` must be escaped with `''` :metal:
# source: https://nixos.org/nix-dev/2015-December/019018.html # source: https://nixos.org/nix-dev/2015-December/019018.html
initExtra = '' initExtra = ''
bindkey ' ' forward-word bindkey ' ' forward-word
zstyle ':completion:*:hosts' hosts ''${=''${''${''${''${(@M)''${(f)"''$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}} zstyle ':completion:*:hosts' hosts ''${=''${''${''${''${(@M)''${(f)"''$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}}
setopt PROMPT_CR setopt PROMPT_CR
setopt PROMPT_SP setopt PROMPT_SP
m2wipe() { m2wipe() {
echo "Pouf pouf pouf" echo "Pouf pouf pouf"
sudo rm -rf $1/generated $1/var/cache/**/* $1/pub/static/* $1/var/page_cache $1/var/view_preprocessed sudo rm -rf $1/generated $1/var/cache/**/* $1/pub/static/* $1/var/page_cache $1/var/view_preprocessed
mkdir $1/generated mkdir $1/generated
sudo chmod -R 777 $1/{var,pub,generated,app/etc} sudo chmod -R 777 $1/{var,pub,generated,app/etc}
echo " tchak !" echo " tchak !"
} }
dcrefresh() { dcrefresh() {
dc stop -t0 $1 && dc rm -vf $1 && dc up -d $1 dc stop -t0 $1 && dc rm -vf $1 && dc up -d $1
} }
akamai() { akamai() {
# see https://gist.github.com/saml/4758360 # see https://gist.github.com/saml/4758360
curl -v -s -H "Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-ser" "$1" 2>&1 > /dev/null curl -v -s -H "Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-ser" "$1" 2>&1 > /dev/null
} }
unalias v unalias v
# see https://github.com/cantino/mcfly # see https://github.com/cantino/mcfly
export MCFLY_FUZZY=true export MCFLY_FUZZY=true
eval "$(mcfly init zsh)" eval "$(mcfly init zsh)"
eval "$(op completion zsh)"; compdef _op op eval "$(op completion zsh)"; compdef _op op
eval "$(glab completion -s zsh)" eval "$(glab completion -s zsh)"
# K8s # K8s
source <(helm completion zsh) source <(helm completion zsh)
source <(k3d completion zsh) source <(k3d completion zsh)
source <(kubectl completion zsh) source <(kubectl completion zsh)
''; '';
sessionVariables = { sessionVariables = {
EDITOR = "vim"; EDITOR = "vim";
@@ -191,14 +193,14 @@ source <(kubectl completion zsh)
}; };
shellAliases = { shellAliases = {
a = "fasd -a"; # any a = "fasd -a"; # any
s = "fasd -si"; # show / search / select s = "fasd -si"; # show / search / select
d = "fasd -d"; # directory d = "fasd -d"; # directory
f = "fasd -f"; # file f = "fasd -f"; # file
sd = "fasd -sid"; # interactive directory selection sd = "fasd -sid"; # interactive directory selection
sf = "fasd -sif"; # interactive file selection sf = "fasd -sif"; # interactive file selection
z = "fasd_cd -d"; # cd, same functionality as j in autojump z = "fasd_cd -d"; # cd, same functionality as j in autojump
j = "fasd_cd -d"; # cd, same functionality as j in autojump j = "fasd_cd -d"; # cd, same functionality as j in autojump
zz = "fasd_cd -d -i"; # cd with interactive selection zz = "fasd_cd -d -i"; # cd with interactive selection
dc = "docker-compose"; dc = "docker-compose";

View File

@@ -6,7 +6,8 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./framework.nix ./framework.nix
<home-manager/nixos> <home-manager/nixos>
@@ -70,9 +71,9 @@
users.users.pierre = { users.users.pierre = {
isNormalUser = true; isNormalUser = true;
description = "Pierre"; description = "Pierre";
extraGroups = [ "networkmanager" "wheel" "audio" "docker" "video" ]; extraGroups = [ "networkmanager" "wheel" "audio" "docker" "video" ];
shell = pkgs.zsh; shell = pkgs.zsh;
packages = with pkgs; []; packages = with pkgs; [ ];
}; };
home-manager.users.pierre = import /home/pierre/dotfiles/home.nix; home-manager.users.pierre = import /home/pierre/dotfiles/home.nix;

View File

@@ -5,7 +5,8 @@
{ {
imports = imports =
[ (modulesPath + "/installer/scan/not-detected.nix") [
(modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
@@ -14,18 +15,19 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/db660732-f520-4e68-9141-b0899f221e82"; {
device = "/dev/disk/by-uuid/db660732-f520-4e68-9141-b0899f221e82";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot/efi" = fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/D7D6-B4C6"; {
device = "/dev/disk/by-uuid/D7D6-B4C6";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = swapDevices =
[ { device = "/dev/disk/by-uuid/da431bdf-cec4-4928-b44b-e6d2c3419063"; } [{ device = "/dev/disk/by-uuid/da431bdf-cec4-4928-b44b-e6d2c3419063"; }];
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -109,6 +109,7 @@
playerctl playerctl
numlockx numlockx
nixpkgs-fmt
nodejs-16_x nodejs-16_x
cypress cypress
docker docker