Update with latest changes

This commit is contained in:
Pierre Martin
2022-04-20 08:29:08 +02:00
parent 0581f33017
commit 5f17cbdb45
4 changed files with 176 additions and 67 deletions

164
home.nix
View File

@@ -11,12 +11,12 @@ defaultEntryPoints = ["http", "https"]
[web] [web]
address = ":8080" address = ":8080"
[entryPoints] # [entryPoints]
[entryPoints.http] # [entryPoints.http]
address = ":80" # address = ":80"
[entryPoints.https] # [entryPoints.https]
address = ":443" # address = ":443"
[entryPoints.https.tls] # [entryPoints.https.tls]
[docker] [docker]
domain = "test" domain = "test"
@@ -24,6 +24,15 @@ watch = true
network = "traefik" network = "traefik"
''; '';
# https://github.com/msteen/nixos-vsliveshare
#imports = [
# "${fetchTarball "https://github.com/msteen/nixos-vsliveshare/tarball/master"}/modules/vsliveshare/home.nix"
#];
#services.vsliveshare = {
# enable = true;
# nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/61cc1f0dc07c2f786e0acfd07444548486f4153b";
#};
home.packages = with pkgs; [ home.packages = with pkgs; [
latest.wget latest.wget
latest.curl latest.curl
@@ -32,30 +41,44 @@ network = "traefik"
latest.gcc latest.gcc
latest.openssl.dev latest.openssl.dev
latest.patchelf latest.patchelf
latest.postman # latest.insomnia
latest.k6
latest.hey
latest.ngrok
latest.pavucontrol latest.pavucontrol
latest.bluezFull
latest.niv
latest.sakura
latest.fasd latest.fasd
latest.ripgrep latest.ripgrep
latest.tree latest.tree
latest.ncdu latest.ncdu
latest.pv latest.pv
latest.jq latest.jq
latest.yq
latest.fx
latest.whois latest.whois
latest.gnumake latest.gnumake
latest.file latest.file
latest.bc latest.bc
latest.sc-im latest.ts
latest.mcfly
latest.fzf
latest.bat
latest.bat-extras.prettybat
latest.delta
latest.atool latest.atool
latest.unzip latest.unzip
latest.zip latest.zip
latest.p7zip
latest.pass latest.pass
latest.lastpass-cli latest.lastpass-cli
latest.bitwarden-cli latest.bitwarden-cli
latest._1password
latest._1password-gui
latest.yubico-pam latest.yubico-pam
latest.yubikey-manager latest.yubikey-manager
latest.pam_u2f latest.pam_u2f
@@ -64,48 +87,63 @@ network = "traefik"
latest.feh latest.feh
latest.pcmanfm latest.pcmanfm
latest.udiskie latest.udiskie
latest.tldr
latest.gitAndTools.gitflow
latest.gitAndTools.tig latest.gitAndTools.tig
latest.gnome3.meld latest.sublime-merge
latest.meld
firefox latest.firefox
latest.google-chrome-beta latest.google-chrome-beta
latest.epiphany
latest.thunderbird latest.thunderbird
latest.rambox
latest.slack latest.slack
latest.signal-desktop latest.signal-desktop
latest.mumble
latest.zoom-us latest.zoom-us
latest.libreoffice latest.libreoffice
latest.freemind latest.freemind
latest.filezilla latest.filezilla
latest.shutter latest.vokoscreen
latest.ffmpeg
#latest.shutter
latest.flameshot
latest.gimp latest.gimp
latest.inkscape
latest.copyq latest.copyq
latest.wireshark latest.wireshark
latest.gcalcli
latest.google-play-music-desktop-player latest.spotify
latest.vlc latest.vlc
latest.audacity
latest.obs-studio
latest.shotcut
latest.jetbrains-mono latest.jetbrains-mono
latest.vscode latest.vscode
jetbrains.phpstorm
latest.zeal
latest.apache-directory-studio
unclutter-xfixes unclutter-xfixes
latest.playerctl latest.numlockx latest.playerctl latest.numlockx
python #latest.nodejs-14_x
ruby latest.nodejs-16_x
latest.nodejs-10_x # latest.nodejs-17_x
latest.cypress
latest.docker latest.docker
latest.docker_compose latest.docker-compose
latest.php latest.kube3d
latest.php73Packages.composer latest.kubectl
latest.kubernetes-helm
latest.stern
latest.alacritty latest.php
latest.php74Packages.composer
latest.python
latest.mkcert
latest.goaccess
latest.checkbashisms
latest.shellcheck
# OcciPrint # OcciPrint
latest.hplipWithPlugin latest.hplipWithPlugin
@@ -113,24 +151,31 @@ network = "traefik"
# Perso # Perso
latest.nextcloud-client latest.nextcloud-client
latest.rclone latest.rclone
# latest.calibre
latest.gparted
]; ];
# Doc: https://rycee.gitlab.io/home-manager/options.html # Doc: https://rycee.gitlab.io/home-manager/options.html
# vscode-with-extensions.override { vscodeExtensions = with vscode-extensions; [ ms-vsliveshare.vsliveshare ]; }
programs.vscode = {
enable = true;
extensions = [ latest.vscode-extensions.ms-vsliveshare.vsliveshare ];
};
services.unclutter.enable = true; services.unclutter.enable = true;
# services.parcellite.enable = true;
services.gpg-agent.enable = true; services.gpg-agent.enable = true;
services.blueman-applet.enable = true; services.blueman-applet.enable = true;
programs.home-manager = { programs.home-manager = {
enable = true; enable = true;
path = https://github.com/rycee/home-manager/archive/release-19.09.tar.gz; path = https://github.com/nix-community/home-manager/archive/master.tar.gz;
}; };
programs.alacritty.settings = { programs.rofi = {
font = { enable = true;
size = 11; plugins = [ latest.rofi-calc latest.rofi-emoji ];
}; terminal = "sakura";
}; };
# TODO polybar # TODO polybar
@@ -150,17 +195,17 @@ network = "traefik"
# 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 i3-sensible-terminal"; "${modifier}+Return" = "exec sakura"; #i3-sensible-terminal
"${modifier}+Return" = "exec alacritty";
### BÉPO ### ### BÉPO ###
"${modifier}+b" = "kill"; "${modifier}+b" = "kill";
#Alfred "${modifier}+i" = "exec ${pkgs.dmenu}/bin/dmenu_run"; "${modifier}+d" = "exec rofi -combi-modi 'window#run#ssh#emoji#calc' -modi 'calc#combi' -show combi";
"${modifier}+e" = "fullscreen toggle"; "${modifier}+e" = "fullscreen toggle";
# change container layout (stacked, tabbed, toggle split) # change container layout (stacked, tabbed, toggle split)
"${modifier}+u" = "layout stacking"; "${modifier}+u" = "layout stacking";
"${modifier}+eacute" = "layout tabbed"; "${modifier}+eacute" = "layout tabbed";
"${modifier}+p" = "layout toggle split"; "${modifier}+p" = "layout toggle split";
"${modifier}+Shift+t" = "i3lock --colour=000000";
# switch to workspace # switch to workspace
"${modifier}+quotedbl" = "workspace 1"; "${modifier}+quotedbl" = "workspace 1";
"${modifier}+guillemotleft" = "workspace 2"; "${modifier}+guillemotleft" = "workspace 2";
@@ -210,19 +255,20 @@ network = "traefik"
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 = "alacritty"; notification = false; }
{ command = "udiskie"; notification = false; } { command = "udiskie"; notification = false; }
#{ command = "parcellite -d"; notification = false; }
{ command = "albert"; 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
# docker run -d --net traefik --ip 172.10.0.10 --restart always -v $HOME/.config/traefik/traefik.toml:/etc/traefik/traefik.toml -v /var/run/docker.sock:/var/run/docker.sock:ro --name traefik --label traefik.port=8080 traefik # 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.direnv = {
enable = true;
};
programs.zsh = { programs.zsh = {
enable = true; enable = true;
enableAutosuggestions = true; enableAutosuggestions = true;
@@ -246,6 +292,9 @@ network = "traefik"
"pass" "pass"
"ssh-agent" "ssh-agent"
]; ];
extraConfig = ''
zstyle :omz:plugins:ssh-agent lazy yes
'';
}; };
# `$` must be escaped with `''` :metal: # `$` must be escaped with `''` :metal:
@@ -264,16 +313,34 @@ m2wipe() {
echo " tchak !" echo " tchak !"
} }
dip() { docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$@"; }
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() {
# 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
}
unalias v
# see https://github.com/cantino/mcfly
export MCFLY_FUZZY=true
eval "$(mcfly init zsh)"
eval "$(op completion zsh)"; compdef _op op
# K8s
source <(helm completion zsh)
source <(k3d completion zsh)
source <(kubectl completion zsh)
''; '';
sessionVariables = { sessionVariables = {
EDITOR = "vim"; EDITOR = "vim";
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=7"; ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=7";
TERMINAL = "alacritty"; TERMINAL = "sakura";
PATH = "$PATH:$HOME/.npm/bin";
}; };
shellAliases = { shellAliases = {
@@ -298,7 +365,10 @@ dcrefresh() {
m = "make"; m = "make";
t = "task"; t = "task";
p = "pass"; p = "~/.platformsh/bin/platform";
k = "kubectl";
flyctl = "~/.fly/bin/flyctl";
g = "git";
tg = "tig --all"; tg = "tig --all";
tgs = "tig status"; tgs = "tig status";
tgl = "tig status"; tgl = "tig status";
@@ -334,8 +404,18 @@ dcrefresh() {
]; ];
extraConfig = { extraConfig = {
# see https://github.com/dandavison/delta#get-started
core.pager = "delta";
interactive.diffFilter = "delta --color-only";
delta.navigate = true;
merge.conflictstyle = "diff3";
diff.colorMoved = "default";
merge.tool = "meld"; merge.tool = "meld";
diff.algorithm = "patience"; diff.algorithm = "patience";
pull.ff = "only";
credential.helper = "store";
init.defaultBranch = "main";
}; };
}; };

View File

@@ -27,8 +27,19 @@
networking.hostName = "pierre"; # Define your hostname. networking.hostName = "pierre"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Gnome is forcing us to use networkManager https://nixos.org/nixos/manual/index.html#sec-networkmanager networking.networkmanager.enable = true; # Gnome is forcing us to use networkManager https://nixos.org/nixos/manual/index.html#sec-networkmanager
networking.extraHosts = "
";
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
# see https://nixos.wiki/wiki/Bluetooth#Enabling_A2DP_Sink
hardware.bluetooth.settings = {
General = {
Enable = "Source,Sink,Media,Socket";
MultiProfile = "multiple";
AutoEnable = true;
};
};
hardware.trackpoint.enable = true; hardware.trackpoint.enable = true;
hardware.trackpoint.emulateWheel = true; hardware.trackpoint.emulateWheel = true;
@@ -36,9 +47,7 @@
hardware.trackpoint.sensitivity = 150; hardware.trackpoint.sensitivity = 150;
# Select internationalisation properties. # Select internationalisation properties.
i18n = { console.keyMap = "fr-bepo";
consoleKeyMap = "fr-bepo";
};
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Paris"; time.timeZone = "Europe/Paris";
@@ -48,20 +57,31 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
thunderbolt thunderbolt
wpa_supplicant wpa_supplicant
wpa_supplicant_gui #wpa_supplicant_gui
gitAndTools.gitFull gitAndTools.gitFull
docker docker
firefox firefox
unbound unbound
blueman
# Yubikey # Yubikey
libu2f-host libu2f-host
yubikey-manager yubikey-manager
yubikey-personalization-gui yubikey-personalization-gui
pcsclite pcsclite
# Sound
blueman
pulseaudio-modules-bt
bluez-tools
]; ];
nix.settings.auto-optimise-store = true;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
# Specific configuration # Specific configuration
environment.pathsToLink = [ "/share/zsh" ]; environment.pathsToLink = [ "/share/zsh" ];
@@ -74,32 +94,37 @@
# List services that you want to enable: # List services that you want to enable:
services.nscd.enable = true; services.nscd.enable = true;
services.nixosManual.showManual = true;
services.tlp.enable = true; services.tlp.enable = true;
services.upower.enable = true; # keyboard backlight services.upower.enable = true; # keyboard backlight
services.gnome3.at-spi2-core.enable = true; # see https://github.com/NixOS/nixpkgs/pull/49636/files services.gnome.at-spi2-core.enable = true; # see https://github.com/NixOS/nixpkgs/pull/49636/files
services.gnome.gnome-keyring.enable = true; # see https://nixos.wiki/wiki/Visual_Studio_Code#Error_after_Sign_On
services.blueman.enable = true; services.blueman.enable = true;
# see https://github.com/NixOS/nixpkgs/blob/2380f6a4faa57c6b91fed26c496e1c8ca5d91982/nixos/modules/services/networking/unbound.nix#L52 services.clamav.daemon.enable = true;
services.unbound = { services.clamav.updater.enable = true;
enable = true;
extraConfig = '' # see https://github.com/NixOS/nixpkgs/blob/2380f6a4faa57c6b91fed26c496e1c8ca5d91982/nixos/modules/services/networking/iunbound.nix#L52
cache-max-negative-ttl: 0 # services.unbound = {
local-zone: "test." redirect # enable = true;
local-data: "test. 10800 IN NS localhost." # settings = {
local-data: "test. 10800 IN SOA test. nobody.invalid. 1 3600 1200 604800 10800" # # cache-max-negative-ttl = "0";
local-data: "test. 10800 IN A 172.10.0.10" # local-zone = "test. redirect";
''; # local-data = [
}; # "test. 10800 IN NS localhost."
# "test. 10800 IN SOA test. nobody.invalid. 1 3600 1200 604800 10800"
# "test. 10800 IN A 172.10.0.10"
# ];
# };
# };
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
# Disable the firewall altogether. # Doc: https://nixos.org/manual/nixos/stable/index.html#sec-firewall
networking.firewall.enable = false; networking.firewall.enable = true;
# Enable CUPS to print documents. # Enable CUPS to print documents.
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
services.printing.enable = true; services.printing.enable = true;
services.printing.drivers = [ pkgs.hplip pkgs.gutenprint pkgs.cnijfilter_4_00 ]; services.printing.drivers = [ pkgs.hplip pkgs.gutenprint pkgs.cnijfilter_4_00 pkgs.cnijfilter2];
# Enable sound. # Enable sound.
sound.enable = true; sound.enable = true;
@@ -109,7 +134,11 @@ local-data: "test. 10800 IN A 172.10.0.10"
# NixOS allows either a lightweight build (default) or full build of PulseAudio to be installed. # NixOS allows either a lightweight build (default) or full build of PulseAudio to be installed.
# Only the full build has Bluetooth support, so it must be selected here. # Only the full build has Bluetooth support, so it must be selected here.
package = pkgs.pulseaudioFull; package = pkgs.pulseaudioFull;
# extraModules = [ pkgs.pulseaudio-modules-bt ];
# see https://nixos.wiki/wiki/Bluetooth#Managing_audio_devices
extraConfig = "
load-module module-switch-on-connect
";
}; };
# Enable the X11 windowing system. # Enable the X11 windowing system.

View File

@@ -22,7 +22,7 @@
[ { device = "/dev/disk/by-uuid/1d2acd42-9341-41de-9725-b3b5ece30720"; } [ { device = "/dev/disk/by-uuid/1d2acd42-9341-41de-9725-b3b5ece30720"; }
]; ];
nix.maxJobs = lib.mkDefault 4; nix.settings.max-jobs = lib.mkDefault 4;
# Conflicts with tlp # Conflicts with tlp
# powerManagement.cpuFreqGovernor = "powersave"; # powerManagement.cpuFreqGovernor = "powersave";

View File

@@ -19,6 +19,6 @@
swapDevices = [ ]; swapDevices = [ ];
nix.maxJobs = lib.mkDefault 8; nix.settings.max-jobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
} }