chore: reindent + install pi.dev

This commit is contained in:
Pierre Martin
2026-08-03 10:57:45 +02:00
parent afd74551fc
commit 047ff192f5
8 changed files with 231 additions and 165 deletions

View File

@@ -6,7 +6,8 @@
# Temporary overlays for patches
nixpkgs.overlays = [ ];
home.file.".docker/cli-plugins/docker-buildx".source = "${pkgs.docker-buildx}/libexec/docker/cli-plugins/docker-buildx";
home.file.".docker/cli-plugins/docker-buildx".source =
"${pkgs.docker-buildx}/libexec/docker/cli-plugins/docker-buildx";
home.file.".config/traefik/traefik.toml".source = ./files/traefik.toml;
home.file.".npmrc".source = ./files/.npmrc;
@@ -25,6 +26,7 @@
./programs/git.nix
./programs/i3.nix
./programs/pi.nix
./programs/zsh.nix
];
@@ -33,17 +35,26 @@
programs.vscode = {
enable = true;
package = pkgs.vscode.fhs;
profiles = { default = { extensions = [ ]; }; };
profiles = {
default = {
extensions = [ ];
};
};
};
programs.rofi = {
enable = true;
plugins = [ pkgs.rofi-calc pkgs.rofi-emoji ];
plugins = [
pkgs.rofi-calc
pkgs.rofi-emoji
];
terminal = "sakura";
};
programs.autorandr = {
enable = true;
hooks = {
postswitch = { "notify-i3" = "${pkgs.i3}/bin/i3-msg restart"; };
postswitch = {
"notify-i3" = "${pkgs.i3}/bin/i3-msg restart";
};
};
};
@@ -65,8 +76,7 @@
# Tout ajout home-manager génère un drop-in conflictuel (double ExecStart=).
services.dunst.enable = true; # notification daemon
services.udiskie.enable =
true; # require "services.udisks2.enable = true" in system configuration
services.udiskie.enable = true; # require "services.udisks2.enable = true" in system configuration
# Workaround for Failed to restart syncthingtray.service: Unit tray.target not found.
# - https://github.com/nix-community/home-manager/issues/2064

View File

@@ -59,9 +59,15 @@
variant = "bepo";
};
windowManager = { i3 = { enable = true; }; };
windowManager = {
i3 = {
enable = true;
};
};
};
services.displayManager = {
defaultSession = "none+i3";
};
services.displayManager = { defaultSession = "none+i3"; };
# Configure console keymap
console.keyMap = "fr";
@@ -70,8 +76,14 @@
users.users.pierre = {
isNormalUser = true;
description = "Pierre";
extraGroups =
[ "networkmanager" "wheel" "audio" "docker" "video" "lpadmin" ];
extraGroups = [
"networkmanager"
"wheel"
"audio"
"docker"
"video"
"lpadmin"
];
shell = pkgs.zsh;
packages = with pkgs; [ ];
};
@@ -103,14 +115,16 @@
# enable = true;
# enableSSHSupport = true;
# };
programs.zsh.enable =
true; # see https://github.com/NixOS/nixpkgs/issues/20548#issuecomment-261965667
programs.zsh.enable = true; # see https://github.com/NixOS/nixpkgs/issues/20548#issuecomment-261965667
hardware.acpilight.enable = true;
hardware.i2c.enable = true;
programs.nix-ld = {
enable = true;
libraries = with pkgs; [ fnm stdenv.cc.cc.lib ];
libraries = with pkgs; [
fnm
stdenv.cc.cc.lib
];
};
# Printing
@@ -139,15 +153,12 @@
services.nscd.enable = true;
services.tlp.enable = true;
services.upower.enable = true; # keyboard backlight
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.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.udisks2.enable = true;
services.resolved.enable = true;
services.gvfs.enable =
true; # to view MTP devices in file manager - https://www.perplexity.ai/search/how-to-browse-files-from-bus-0-QWBoYG1gRLu3uMRqFSzw9A
services.gvfs.enable = true; # to view MTP devices in file manager - https://www.perplexity.ai/search/how-to-browse-files-from-bus-0-QWBoYG1gRLu3uMRqFSzw9A
# Prevent coredump issues with Antigravity - https://www.perplexity.ai/search/systemd-coredump-high-cpu-on-n-LUnRQViaRuiDn1LR06hU8w#2
systemd.coredump = {
@@ -186,7 +197,16 @@
keep-outputs = true
keep-derivations = true
'';
nix.settings.extra-experimental-features = [ "nix-command" "flakes" ];
nix.settings.extra-experimental-features = [
"nix-command"
"flakes"
];
# Cache binaire de https://github.com/lukasl-dev/pi.nix (cf. programs/pi.nix)
nix.settings.extra-substituters = [ "https://pi.cachix.org" ];
nix.settings.extra-trusted-public-keys = [
"pi.cachix.org-1:lGeoGJaZ5ZDabuRzkcD5EBTNnDM4HJ1vqeOxlWk1Flk="
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions

View File

@@ -5,7 +5,13 @@
# Doc: https://wiki.archlinux.org/title/Framework_Laptop
#
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
boot.kernelParams = [

View File

@@ -1,13 +1,24 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ (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"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
@@ -22,8 +33,7 @@
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/da431bdf-cec4-4928-b44b-e6d2c3419063"; }];
swapDevices = [ { device = "/dev/disk/by-uuid/da431bdf-cec4-4928-b44b-e6d2c3419063"; } ];
# 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
@@ -33,6 +43,5 @@
# networking.interfaces.wlp166s0.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -15,10 +15,12 @@ in
let
crab = pkgs.callPackage ./pkgs/crab.nix { };
rtk = pkgs.callPackage ./pkgs/rtk.nix { };
in {
in
{
nixpkgs.overlays = [ pythonOverlay ];
nixpkgs.config.allowUnfreePredicate = pkg:
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"1password"
"1password-cli"

View File

@@ -1,4 +1,10 @@
{ rustPlatform, fetchFromGitHub, pkg-config, sqlite, lib }:
{
rustPlatform,
fetchFromGitHub,
pkg-config,
sqlite,
lib,
}:
rustPlatform.buildRustPackage {
pname = "rtk";
version = "0.22.2";

View File

@@ -3,140 +3,138 @@
{
home.file.".i3status.conf".source = ../files/.i3status.conf;
xsession.windowManager.i3 = let modifier = "Mod4";
in {
enable = true;
config = {
assigns = {
# https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.assigns
xsession.windowManager.i3 =
let
modifier = "Mod4";
in
{
enable = true;
config = {
assigns = {
# https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.assigns
};
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;
# see https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.keybindings
keybindings = pkgs.lib.mkOptionDefault {
"${modifier}+Return" = "exec ~/.local/bin/workspace-run sakura --working-directory";
"${modifier}+Shift+Return" = "exec ~/.local/bin/workspace-run code";
### BÉPO ###
"${modifier}+b" = "kill";
"${modifier}+d" =
"exec rofi -combi-modi 'window#run#ssh#emoji#calc' -modi 'calc#combi' -show combi";
"${modifier}+e" = "fullscreen toggle";
# change container layout (stacked, tabbed, toggle split)
"${modifier}+u" = "layout stacking";
"${modifier}+eacute" = "layout tabbed";
"${modifier}+p" = "layout toggle split";
"${modifier}+Shift+t" = "i3lock --colour=000000";
# switch to workspace
"${modifier}+quotedbl" = "workspace 1";
"${modifier}+guillemotleft" = "workspace 2";
"${modifier}+guillemotright" = "workspace 3";
"${modifier}+parenleft" = "workspace 4";
"${modifier}+parenright" = "workspace 5";
"${modifier}+at" = "workspace 6";
"${modifier}+plus" = "workspace 7";
"${modifier}+minus" = "workspace 8";
"${modifier}+slash" = "workspace 9";
"${modifier}+asterisk" = "workspace 10";
# move workspaces between outputs
"${modifier}+Control+Left" = "move workspace to output left";
"${modifier}+Control+Right" = "move workspace to output right";
"${modifier}+Control+Up" = "move workspace to output up";
"${modifier}+Control+Down" = "move workspace to output down";
# move focused container to workspace
"${modifier}+Shift+quotedbl" = "move container to workspace 1";
"${modifier}+Shift+guillemotleft" = "move container to workspace 2";
"${modifier}+Shift+guillemotright" = "move container to workspace 3";
"${modifier}+Shift+4" = "move container to workspace 4";
"${modifier}+Shift+5" = "move container to workspace 5";
"${modifier}+Shift+at" = "move container to workspace 6";
"${modifier}+Shift+plus" = "move container to workspace 7";
"${modifier}+Shift+minus" = "move container to workspace 8";
"${modifier}+Shift+slash" = "move container to workspace 9";
"${modifier}+Shift+asterisk" = "move container to workspace 10";
### /BÉPO ###
# See https://faq.i3wm.org/question/3747/enabling-multimedia-keys.1.html
# Pulse Audio controls
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume 0 +5%"; # increase sound volume
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume 0 -5%"; # decrease sound volume
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute 0 toggle"; # mute sound
# Media player controls
"XF86AudioPlay" = "exec playerctl play";
"XF86AudioPause" = "exec playerctl pause";
"XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous";
# Sreen brightness controls
"XF86MonBrightnessUp" = "exec xbacklight -inc 5";
"XF86MonBrightnessDown" = "exec xbacklight -dec 5";
# Speech-to-text (toggle: press to start/stop)
"${modifier}+space" = "exec ~/.local/bin/stt-dictate toggle";
};
bars = [
{
statusCommand = "i3status";
}
{
id = "vmux";
position = "top";
statusCommand = "/home/pierre/Code/vibe/vmux/vmux i3bar";
workspaceButtons = false;
trayOutput = "none";
colors = {
background = "#0d0d0d";
};
}
];
startup = [
{
command = "nextcloud";
notification = false;
}
{
command = "setxkbmap -layout fr -variant bepo";
notification = false;
}
{
command = "copyq";
notification = false;
}
{
command = "numlockx on";
notification = false;
} # turn verr num on
{
command = "autorandr -c";
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
# { command = "docker start traefik"; notification = false; }
# Désactive l'extinction automatique de l'écran (DPMS) et l'économiseur d'écran X11
{
command = "xset s off -dpms";
notification = false;
}
];
};
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;
# see https://rycee.gitlab.io/home-manager/options.html#opt-xsession.windowManager.i3.config.keybindings
keybindings = pkgs.lib.mkOptionDefault {
"${modifier}+Return" = "exec ~/.local/bin/workspace-run sakura --working-directory";
"${modifier}+Shift+Return" = "exec ~/.local/bin/workspace-run code";
### BÉPO ###
"${modifier}+b" = "kill";
"${modifier}+d" =
"exec rofi -combi-modi 'window#run#ssh#emoji#calc' -modi 'calc#combi' -show combi";
"${modifier}+e" = "fullscreen toggle";
# change container layout (stacked, tabbed, toggle split)
"${modifier}+u" = "layout stacking";
"${modifier}+eacute" = "layout tabbed";
"${modifier}+p" = "layout toggle split";
"${modifier}+Shift+t" = "i3lock --colour=000000";
# switch to workspace
"${modifier}+quotedbl" = "workspace 1";
"${modifier}+guillemotleft" = "workspace 2";
"${modifier}+guillemotright" = "workspace 3";
"${modifier}+parenleft" = "workspace 4";
"${modifier}+parenright" = "workspace 5";
"${modifier}+at" = "workspace 6";
"${modifier}+plus" = "workspace 7";
"${modifier}+minus" = "workspace 8";
"${modifier}+slash" = "workspace 9";
"${modifier}+asterisk" = "workspace 10";
# move workspaces between outputs
"${modifier}+Control+Left" = "move workspace to output left";
"${modifier}+Control+Right" = "move workspace to output right";
"${modifier}+Control+Up" = "move workspace to output up";
"${modifier}+Control+Down" = "move workspace to output down";
# move focused container to workspace
"${modifier}+Shift+quotedbl" = "move container to workspace 1";
"${modifier}+Shift+guillemotleft" = "move container to workspace 2";
"${modifier}+Shift+guillemotright" = "move container to workspace 3";
"${modifier}+Shift+4" = "move container to workspace 4";
"${modifier}+Shift+5" = "move container to workspace 5";
"${modifier}+Shift+at" = "move container to workspace 6";
"${modifier}+Shift+plus" = "move container to workspace 7";
"${modifier}+Shift+minus" = "move container to workspace 8";
"${modifier}+Shift+slash" = "move container to workspace 9";
"${modifier}+Shift+asterisk" = "move container to workspace 10";
### /BÉPO ###
# See https://faq.i3wm.org/question/3747/enabling-multimedia-keys.1.html
# Pulse Audio controls
"XF86AudioRaiseVolume" =
"exec --no-startup-id pactl set-sink-volume 0 +5%"; # increase sound volume
"XF86AudioLowerVolume" =
"exec --no-startup-id pactl set-sink-volume 0 -5%"; # decrease sound volume
"XF86AudioMute" =
"exec --no-startup-id pactl set-sink-mute 0 toggle"; # mute sound
# Media player controls
"XF86AudioPlay" = "exec playerctl play";
"XF86AudioPause" = "exec playerctl pause";
"XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous";
# Sreen brightness controls
"XF86MonBrightnessUp" = "exec xbacklight -inc 5";
"XF86MonBrightnessDown" = "exec xbacklight -dec 5";
# Speech-to-text (toggle: press to start/stop)
"${modifier}+space" = "exec ~/.local/bin/stt-dictate toggle";
};
bars = [
{
statusCommand = "i3status";
}
{
id = "vmux";
position = "top";
statusCommand = "/home/pierre/Code/vibe/vmux/vmux i3bar";
workspaceButtons = false;
trayOutput = "none";
colors = {
background = "#0d0d0d";
};
}
];
startup = [
{
command = "nextcloud";
notification = false;
}
{
command = "setxkbmap -layout fr -variant bepo";
notification = false;
}
{
command = "copyq";
notification = false;
}
{
command = "numlockx on";
notification = false;
} # turn verr num on
{
command = "autorandr -c";
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
# { command = "docker start traefik"; notification = false; }
# Désactive l'extinction automatique de l'écran (DPMS) et l'économiseur d'écran X11
{
command = "xset s off -dpms";
notification = false;
}
];
};
};
}

15
programs/pi.nix Normal file
View File

@@ -0,0 +1,15 @@
{ ... }:
let
# Ces dotfiles ne sont pas un flake (config par channels) : on résout donc
# les sorties du flake pi.nix à la main, en épinglant le rev.
# Mise à jour : remplacer le rev par le dernier de https://github.com/lukasl-dev/pi.nix
pi = builtins.getFlake "github:lukasl-dev/pi.nix/1d37b58675b763ae6c9dc05d62321109066a4126";
in
{
imports = [ pi.homeModules.default ];
programs.pi.coding-agent = {
enable = true;
};
}