From 54d97978ef06fe82091730dcfcb07393e3e7e934 Mon Sep 17 00:00:00 2001 From: Pierre Martin Date: Sun, 5 Apr 2020 09:17:20 +0200 Subject: [PATCH] Update with work laptop latest config --- .i3status.conf | 69 +++++++++++++++++++++++++++++++ home.nix | 90 +++++++++++++++++++++++++---------------- nixos/configuration.nix | 34 +++++++++++----- 3 files changed, 148 insertions(+), 45 deletions(-) create mode 100644 .i3status.conf diff --git a/.i3status.conf b/.i3status.conf new file mode 100644 index 0000000..ada8ea1 --- /dev/null +++ b/.i3status.conf @@ -0,0 +1,69 @@ +# i3status configuration file. +# see "man i3status" for documentation. + +# It is important that this file is edited as UTF-8. +# The following line should contain a sharp s: +# ß +# If the above line is not correctly displayed, fix your editor first! + +general { + colors = true + interval = 5 +} + +order += "cpu_usage" +order += "cpu_temperature 0" +order += "disk /" +order += "run_watch DHCP" +order += "wireless _first_" +order += "ethernet _first_" +order += "battery 0" +order += "battery 1" +order += "battery all" +order += "load" +order += "tztime local" + +cpu_usage { + format = "CPU: %usage" +} + +wireless _first_ { + format_up = "W: (%quality at %essid) %ip" + format_down = "W: down" +} + +ethernet _first_ { + # if you use %speed, i3status requires root privileges + format_up = "E: %ip (%speed)" + format_down = "E: down" +} + +battery 0 { + format = "%status %percentage %remaining" +} +battery 1 { + format = "%status %percentage %remaining" +} +battery all { + format = "T: %percentage %remaining" +} + +run_watch DHCP { + pidfile = "/var/run/dhclient*.pid" +} + +tztime local { + format = "%d/%m/%Y %Hh%M" +} + +load { + format = "%1min" +} + +disk "/" { + format = "%avail" +} + +cpu_temperature 0 { + format = "T: %degrees°C" +} diff --git a/home.nix b/home.nix index 5be7282..2396ea1 100644 --- a/home.nix +++ b/home.nix @@ -29,6 +29,11 @@ network = "traefik" latest.curl latest.httpie latest.bind + latest.gcc + latest.openssl.dev + latest.patchelf + latest.postman + latest.cnijfilter_4_00 latest.pavucontrol @@ -50,6 +55,11 @@ network = "traefik" latest.p7zip latest.pass + latest.lastpass-cli + latest.bitwarden-cli + latest.yubico-pam + latest.yubikey-manager + latest.pam_u2f latest.arandr latest.feh @@ -58,24 +68,30 @@ network = "traefik" latest.gitAndTools.gitflow latest.gitAndTools.tig + latest.gnome3.meld firefox - google-chrome-beta + latest.google-chrome-beta latest.thunderbird latest.rambox + latest.slack + latest.signal-desktop + latest.mumble + latest.zoom-us latest.libreoffice latest.freemind latest.filezilla latest.shutter latest.gimp - latest.skypeforlinux - latest.zoom-us + latest.copyq + latest.wireshark latest.google-play-music-desktop-player latest.vlc + latest.jetbrains-mono latest.vscode - latest.jetbrains.phpstorm + jetbrains.phpstorm latest.zeal latest.apache-directory-studio @@ -83,29 +99,27 @@ network = "traefik" latest.playerctl latest.numlockx python - latest.nodejs + ruby + latest.nodejs-10_x latest.docker latest.docker_compose - latest.pandoc - latest.libpng12 - latest.gcc + latest.php + latest.php73Packages.composer - # Peek. See https://github.com/NixOS/nixpkgs/issues/39832 - peek - ffmpeg - glib - gst_all_1.gst-plugins-good - gst_all_1.gst-plugins-ugly - keybinder + latest.alacritty - # urxvt. See https://github.com/rycee/home-manager/blob/master/modules/programs/urxvt.nix - latest.rxvt_unicode-with-plugins + # OcciPrint + latest.hplipWithPlugin + + # Perso + latest.nextcloud-client + latest.rclone ]; # Doc: https://rycee.gitlab.io/home-manager/options.html services.unclutter.enable = true; - services.parcellite.enable = true; +# services.parcellite.enable = true; services.gpg-agent.enable = true; services.blueman-applet.enable = true; @@ -114,12 +128,11 @@ network = "traefik" path = https://github.com/rycee/home-manager/archive/release-18.03.tar.gz; }; - ## TODO Enable when available in this current branch of - ## Home manager, or switch to master - # programs.urxvt = { - # enable = true; - # package = latest.rxvt_unicode-with-plugins; - # }; +# programs.alacritty.settings = { +# font = { +# size = 11; +# }; +# }; # TODO polybar xsession.windowManager.i3 = let @@ -138,11 +151,12 @@ network = "traefik" # see https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.keybindings keybindings = pkgs.lib.mkOptionDefault { - "${modifier}+Return" = "exec urxvtc"; + #"${modifier}+Return" = "exec i3-sensible-terminal"; + "${modifier}+Return" = "exec alacritty"; ### BÉPO ### "${modifier}+b" = "kill"; - "${modifier}+i" = "exec ${pkgs.dmenu}/bin/dmenu_run"; + #Alfred "${modifier}+i" = "exec ${pkgs.dmenu}/bin/dmenu_run"; "${modifier}+e" = "fullscreen toggle"; # change container layout (stacked, tabbed, toggle split) "${modifier}+u" = "layout stacking"; @@ -195,11 +209,13 @@ network = "traefik" }; startup = [ - # { command = "dropbox start"; notification = false; } + { command = "nextcloud"; notification = false; } { command = "setxkbmap -layout fr -variant bepo"; notification = false; } - { command = "urxvtd -q -o -f"; notification = false; } + { command = "alacritty"; notification = false; } { command = "udiskie"; notification = false; } - { command = "parcellite -d"; notification = false; } + #{ command = "parcellite -d"; notification = false; } + { command = "albert"; notification = false; } + { command = "copyq"; notification = false; } { 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 @@ -238,6 +254,8 @@ network = "traefik" initExtra = '' bindkey ' ' forward-word zstyle ':completion:*:hosts' hosts ''${=''${''${''${''${(@M)''${(f)"''$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}} + setopt PROMPT_CR + setopt PROMPT_SP m2wipe() { echo "Pouf pouf pouf…" @@ -256,6 +274,7 @@ dcrefresh() { sessionVariables = { EDITOR = "vim"; ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=7"; + TERMINAL = "alacritty"; }; shellAliases = { @@ -296,11 +315,12 @@ dcrefresh() { enable = true; package = latest.gitAndTools.gitFull; - userEmail = "pierre@occitech.fr"; + userEmail = "pierre@front-commerce.com"; userName = "Pierre Martin"; aliases = { co = "checkout"; + mr = "!sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -"; }; ignores = [ @@ -313,17 +333,17 @@ dcrefresh() { ".idea" ".vscode" ]; + + extraConfig = { + merge.tool = "meld"; + diff.algorithm = "patience"; + }; }; programs.htop = { enable = true; }; - programs.browserpass = { - enable = true; - browsers = [ "firefox" ]; - }; - programs.vim = { enable = true; }; diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 954ce3d..cf7cf3f 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -11,15 +11,16 @@ ]; # Use the GRUB 2 boot loader. - # boot.loader.grub.enable = true; - # boot.loader.grub.version = 2; + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; # boot.loader.grub.efiSupport = true; # boot.loader.grub.efiInstallAsRemovable = true; # boot.loader.efi.efiSysMountPoint = "/boot/efi"; # Define on which hard drive you want to install Grub. - # boot.loader.grub.device = "nodev"; # or "nodev" for efi only - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub.device = "/dev/nvme0n1"; # or "nodev" for efi only + # Perso only ? (and comment grub.enable / version above) + # boot.loader.systemd-boot.enable = true; + # boot.loader.efi.canTouchEfiVariables = true; boot.cleanTmpDir = true; @@ -35,9 +36,9 @@ hardware.trackpoint.sensitivity = 150; # Select internationalisation properties. - # i18n = { - # consoleKeyMap = "fr-bepo"; - # }; + i18n = { + consoleKeyMap = "fr-bepo"; + }; # Set your time zone. time.timeZone = "Europe/Paris"; @@ -53,6 +54,12 @@ firefox unbound blueman + + # Yubikey + libu2f-host + yubikey-manager + yubikey-personalization-gui + pcsclite ]; # Specific configuration @@ -70,6 +77,8 @@ services.nixosManual.showManual = true; services.tlp.enable = true; services.upower.enable = true; # keyboard backlight + services.gnome3.at-spi2-core.enable = true; # see https://github.com/NixOS/nixpkgs/pull/49636/files + services.blueman.enable = true; # see https://github.com/NixOS/nixpkgs/blob/2380f6a4faa57c6b91fed26c496e1c8ca5d91982/nixos/modules/services/networking/unbound.nix#L52 services.unbound = { @@ -89,6 +98,7 @@ local-data: "test. 10800 IN A 172.10.0.10" # Enable CUPS to print documents. services.printing.enable = true; + services.printing.drivers = [ pkgs.hplip ]; # Enable sound. sound.enable = true; @@ -104,7 +114,7 @@ local-data: "test. 10800 IN A 172.10.0.10" # Enable the X11 windowing system. services.xserver.enable = true; services.xserver.layout = "fr"; - # services.xserver.xkbVariant = "bepo"; + services.xserver.xkbVariant = "bepo"; # services.xserver.xkbOptions = "eurosign:e"; # Enable touchpad support. @@ -114,13 +124,17 @@ local-data: "test. 10800 IN A 172.10.0.10" services.xserver.displayManager.gdm.wayland = false; services.xserver.windowManager.i3.enable = true; + # See https://nixos.wiki/wiki/Yubikey + services.udev.packages = [ pkgs.yubikey-personalization pkgs.libu2f-host ]; + services.pcscd.enable = true; + # Define a user account. Don't forget to set a password with ‘passwd’. users.users.pierre = { isNormalUser = true; uid = 1000; home = "/home/pierre"; shell = pkgs.zsh; - extraGroups = [ "audio" "wheel" "networkmanager" "docker" ]; + extraGroups = [ "audio" "wheel" "networkmanager" "docker" "video" ]; }; system.autoUpgrade.enable = true;