chore: format code with alejandra

This commit is contained in:
Khaïs COLIN 2024-09-18 12:03:23 +02:00
parent 5576fba883
commit 144c46a984
13 changed files with 164 additions and 131 deletions

View file

@ -1,5 +1,8 @@
{ pkgs, pkgs-unstable, ... }:
{ {
pkgs,
pkgs-unstable,
...
}: {
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
@ -8,8 +11,8 @@
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
# setup magicdns for tailscale # setup magicdns for tailscale
networking.nameservers = [ "100.100.100.100" "1.1.1.1" "8.8.8.8" ]; networking.nameservers = ["100.100.100.100" "1.1.1.1" "8.8.8.8"];
networking.search = [ "hummingbird-stork.ts.net" ]; networking.search = ["hummingbird-stork.ts.net"];
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Paris"; time.timeZone = "Europe/Paris";
@ -81,7 +84,7 @@
initialPassword = "asunarovow"; initialPassword = "asunarovow";
isNormalUser = true; isNormalUser = true;
description = "Khaïs COLIN"; description = "Khaïs COLIN";
extraGroups = [ "networkmanager" "wheel" "podman" "libvirtd" "music" ]; extraGroups = ["networkmanager" "wheel" "podman" "libvirtd" "music"];
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
# access to /pile/Music # access to /pile/Music
@ -91,7 +94,7 @@
createHome = true; createHome = true;
isNormalUser = true; isNormalUser = true;
description = "Guest Account"; description = "Guest Account";
extraGroups = [ "networkmanager" ]; extraGroups = ["networkmanager"];
shell = pkgs.zsh; shell = pkgs.zsh;
packages = with pkgs; [ packages = with pkgs; [
mpv mpv
@ -129,14 +132,18 @@
tailscale tailscale
wluma wluma
# man pages # man pages
man-pages man-pages-posix man-pages
man-pages-posix
# kde # kde
kdePackages.kate kdePackages.plasma-workspace kdePackages.dolphin kdePackages.kate
kdePackages.plasma-workspace
kdePackages.dolphin
# fix kde apps having no icons # fix kde apps having no icons
kdePackages.qtsvg kdePackages.qtsvg
thunderbird-128 thunderbird-128
# for screen sharing # for screen sharing
xdg-desktop-portal xdg-desktop-portal-kde xdg-desktop-portal
xdg-desktop-portal-kde
]; ];
# set user environment variables # set user environment variables
@ -169,9 +176,9 @@
]; ];
fontconfig = { fontconfig = {
defaultFonts = { defaultFonts = {
monospace = [ "VictorMono NF Medium" ]; monospace = ["VictorMono NF Medium"];
sansSerif = [ "IBM Plex Sans" ]; sansSerif = ["IBM Plex Sans"];
serif = [ "CMU Serif" ]; serif = ["CMU Serif"];
}; };
}; };
}; };
@ -179,20 +186,20 @@
services.tailscale = { services.tailscale = {
enable = true; enable = true;
useRoutingFeatures = "both"; useRoutingFeatures = "both";
extraUpFlags = [ "--ssh" ]; extraUpFlags = ["--ssh"];
}; };
# enable wluma for automatic brightness adjustment # enable wluma for automatic brightness adjustment
systemd.user.services.wluma = { systemd.user.services.wluma = {
enable = true; enable = true;
description = "Adjusting screen brightness based on screen contents and amount of ambient light"; description = "Adjusting screen brightness based on screen contents and amount of ambient light";
after = [ "graphical-session.target" ]; after = ["graphical-session.target"];
partOf = [ "graphical-session.target" ]; partOf = ["graphical-session.target"];
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.wluma}/bin/wluma"; ExecStart = "${pkgs.wluma}/bin/wluma";
Restart = "always"; Restart = "always";
}; };
wantedBy = [ "graphical-session.target" ]; wantedBy = ["graphical-session.target"];
}; };
programs.gnupg.agent = { programs.gnupg.agent = {
@ -224,9 +231,10 @@
# enable VAAPI and intel QSV # enable VAAPI and intel QSV
# enable vaapi # enable vaapi
nixpkgs.config.packageOverrides = pkgs: { nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
}; };
hardware.opengl = { # hardware.graphics in unstable hardware.opengl = {
# hardware.graphics in unstable
enable = true; enable = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
intel-media-driver intel-media-driver
@ -257,7 +265,7 @@
system.stateVersion = "24.05"; # Did you read the comment? system.stateVersion = "24.05"; # Did you read the comment?
# flakes # flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = ["nix-command" "flakes"];
# automatically collect garbage # automatically collect garbage
nix.gc = { nix.gc = {

View file

@ -36,17 +36,14 @@
outputs = { outputs = {
nixpkgs, nixpkgs,
nixpkgs-unstable, nixpkgs-unstable,
home-manager, home-manager,
stylix, stylix,
nixvim, nixvim,
river-shifttags, river-shifttags,
breezex-cursor, breezex-cursor,
nixos-06cb-009a-fingerprint-sensor, nixos-06cb-009a-fingerprint-sensor,
... }: ...
let }: let
system = "x86_64-linux"; system = "x86_64-linux";
home-manager-args = { home-manager-args = {
nixvim = nixvim.packages.${system}.default; nixvim = nixvim.packages.${system}.default;
@ -54,14 +51,14 @@
breezex-cursor = breezex-cursor.packages.${system}.default; breezex-cursor = breezex-cursor.packages.${system}.default;
kitty-unstable = nixpkgs-unstable.legacyPackages.${system}.kitty; kitty-unstable = nixpkgs-unstable.legacyPackages.${system}.kitty;
}; };
in in {
{
nixosConfigurations.void = nixpkgs.lib.nixosSystem { nixosConfigurations.void = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
./void.nix ./void.nix
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager
{
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
@ -82,7 +79,8 @@
modules = [ modules = [
./t470.nix ./t470.nix
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager
{
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;

View file

@ -1,30 +1,33 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/installer/scan/not-detected.nix") lib,
]; modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/25f87dfd-b7bb-475a-ab05-732a5e2026d9"; device = "/dev/disk/by-uuid/25f87dfd-b7bb-475a-ab05-732a5e2026d9";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/929D-FA32"; device = "/dev/disk/by-uuid/929D-FA32";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = ["fmask=0022" "dmask=0022"];
}; };
swapDevices = [ ]; swapDevices = [];
# 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

@ -1,35 +1,39 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/installer/scan/not-detected.nix") lib,
]; pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "sr_mod"];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/29ecd09f-8852-4582-a78a-ec1aa1e7b2b9"; device = "/dev/disk/by-uuid/29ecd09f-8852-4582-a78a-ec1aa1e7b2b9";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/pile" = fileSystems."/pile" = {
{ device = "/dev/disk/by-uuid/51ff5791-f197-4dfd-850a-00a8726ddb31"; device = "/dev/disk/by-uuid/51ff5791-f197-4dfd-850a-00a8726ddb31";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/E135-9F42"; device = "/dev/disk/by-uuid/E135-9F42";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = ["fmask=0022" "dmask=0022"];
}; };
swapDevices = [ ]; swapDevices = [];
# 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

@ -1,4 +1,10 @@
{ pkgs, nixvim, river-shifttags, kitty-unstable, ... }: let {
pkgs,
nixvim,
river-shifttags,
kitty-unstable,
...
}: let
username = "khais"; username = "khais";
in { in {
imports = [ imports = [
@ -9,7 +15,15 @@ in {
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
# system tools & bragging # system tools & bragging
htop neofetch ripgrep usbutils wget curl ncdu trashy unzip htop
neofetch
ripgrep
usbutils
wget
curl
ncdu
trashy
unzip
# remote working # remote working
remmina remmina
# communication # communication
@ -22,13 +36,18 @@ in {
# https://superuser.com/a/1803183 # https://superuser.com/a/1803183
wl-clipboard wl-clipboard
# wm river utils # wm river utils
playerctl brightnessctl river-shifttags wlr-randr playerctl
brightnessctl
river-shifttags
wlr-randr
# dev tools # dev tools
gitu lnav gitu
lnav
# music # music
cmus cmus
# music collection tools # music collection tools
picard kid3 picard
kid3
# audio # audio
audacity audacity
# video # video
@ -36,14 +55,16 @@ in {
# file sending # file sending
magic-wormhole magic-wormhole
# drawing apps # drawing apps
krita inkscape krita
inkscape
# office apps # office apps
libreoffice-fresh libreoffice-fresh
hunspellDicts.fr-moderne hunspellDicts.fr-moderne
hunspellDicts.de-de hunspellDicts.de-de
hunspellDicts.en-us hunspellDicts.en-us
# nixos tools # nixos tools
nh nix-output-monitor nh
nix-output-monitor
]; ];
file = { file = {
@ -87,8 +108,8 @@ in {
}; };
ui = { ui = {
editor = "nvim"; editor = "nvim";
diff-editor = [ "nvim" "-c" "DiffEditor $left $right $output" ]; diff-editor = ["nvim" "-c" "DiffEditor $left $right $output"];
merge-editor = [ "nvim" "-c" "DiffEditor $left $right $output" ]; merge-editor = ["nvim" "-c" "DiffEditor $left $right $output"];
}; };
}; };
}; };
@ -163,7 +184,7 @@ in {
incremental = false; incremental = false;
write = true; write = true;
}; };
plugins = [ "lyrics" "web" "info" "edit" ]; plugins = ["lyrics" "web" "info" "edit"];
}; };
}; };

View file

@ -1,6 +1,5 @@
self: super: self: super: {
{
cacert = super.cacert.override { cacert = super.cacert.override {
extraCertificateFiles = [ ../certs/myCA.pem ]; extraCertificateFiles = [../certs/myCA.pem];
}; };
} }

View file

@ -1,34 +1,33 @@
let let
snipeit-fqdn = "snipe-it.nixos.local"; snipeit-fqdn = "snipe-it.nixos.local";
in in
{ pkgs, ... }: {pkgs, ...}: {
{ services.snipe-it = {
services.snipe-it = { enable = true;
enable = true; appKeyFile = "/etc/nixos/secrets/snipe-it/appkey";
appKeyFile = "/etc/nixos/secrets/snipe-it/appkey"; appURL = "https://${snipeit-fqdn}";
appURL = "https://${snipeit-fqdn}"; hostName = snipeit-fqdn;
hostName = snipeit-fqdn; database = {
database = { user = "snipeit";
user = "snipeit"; };
nginx = {
sslCertificate = "/etc/nixos/secrets/certs/snipe-it.nixos.local.crt";
sslCertificateKey = "/etc/nixos/secrets/certs/snipe-it.nixos.local.key";
forceSSL = true;
kTLS = true;
};
}; };
nginx = { services.mysql = {
sslCertificate = "/etc/nixos/secrets/certs/snipe-it.nixos.local.crt"; enable = true;
sslCertificateKey = "/etc/nixos/secrets/certs/snipe-it.nixos.local.key"; package = pkgs.mariadb;
forceSSL = true; ensureUsers = [
kTLS = true; {
name = "snipeit";
ensurePermissions = {
"snipeit.*" = "ALL PRIVILEGES";
};
}
];
ensureDatabases = ["snipeit"];
}; };
}; }
services.mysql = {
enable = true;
package = pkgs.mariadb;
ensureUsers = [
{
name = "snipeit";
ensurePermissions = {
"snipeit.*" = "ALL PRIVILEGES";
};
}
];
ensureDatabases = [ "snipeit" ];
};
}

View file

@ -1,8 +1,6 @@
{ pkgs, ... }: {pkgs, ...}: let
let
sourcehut-fqdn = "sourcehut.nixos.local"; sourcehut-fqdn = "sourcehut.nixos.local";
in in {
{
systemd.services.gitsrht = { systemd.services.gitsrht = {
environment = { environment = {
# make python's requests package use the global ca-certificates store, which will contain my own CA cert # make python's requests package use the global ca-certificates store, which will contain my own CA cert

View file

@ -1,5 +1,8 @@
{ breezex-cursor, pkgs, ... }:
{ {
breezex-cursor,
pkgs,
...
}: {
stylix = { stylix = {
enable = true; enable = true;
image = ./wallpapers/nixos_inspector_tan.png; image = ./wallpapers/nixos_inspector_tan.png;

View file

@ -1,9 +1,11 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ pkgs, lib, ... }:
{ {
pkgs,
lib,
...
}: {
imports = [ imports = [
./hardware-configuration-t470.nix ./hardware-configuration-t470.nix
./common.nix ./common.nix
@ -16,10 +18,10 @@
fileSystems."/home/khais/Books" = { fileSystems."/home/khais/Books" = {
device = "//void/Books"; device = "//void/Books";
fsType = "cifs"; fsType = "cifs";
options = let options = let
# prevent hanging when network is not reachable # prevent hanging when network is not reachable
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
in [ "${automount_opts},credentials=/etc/nixos/secrets/books.smb" ]; in ["${automount_opts},credentials=/etc/nixos/secrets/books.smb"];
}; };
# scanner drop point # scanner drop point
@ -30,7 +32,7 @@
writeEnable = true; writeEnable = true;
chrootlocalUser = true; chrootlocalUser = true;
userlistEnable = true; userlistEnable = true;
userlist = [ "paperless-upload" ]; userlist = ["paperless-upload"];
userlistDeny = false; userlistDeny = false;
extraConfig = '' extraConfig = ''
log_ftp_protocol=YES log_ftp_protocol=YES
@ -44,7 +46,7 @@
allow_writeable_chroot=YES allow_writeable_chroot=YES
''; '';
}; };
networking.firewall.allowedTCPPorts = [ 21 ]; networking.firewall.allowedTCPPorts = [21];
networking.firewall.allowedTCPPortRanges = [ networking.firewall.allowedTCPPortRanges = [
{ {
from = 51000; from = 51000;
@ -56,14 +58,14 @@
isNormalUser = true; isNormalUser = true;
group = "paperless-upload"; group = "paperless-upload";
}; };
system.activationScripts.makeFtpDirectory = lib.stringAfter [ "var" ] '' system.activationScripts.makeFtpDirectory = lib.stringAfter ["var"] ''
mkdir -m 775 -p /var/lib/ftp mkdir -m 775 -p /var/lib/ftp
chown root:root /var/lib/ftp chown root:root /var/lib/ftp
mkdir -m 700 -p /var/lib/ftp/paperless-upload mkdir -m 700 -p /var/lib/ftp/paperless-upload
chown paperless-upload:paperless-upload /var/lib/ftp/paperless-upload chown paperless-upload:paperless-upload /var/lib/ftp/paperless-upload
''; '';
systemd.services.uploadPaperlessDocuments = { systemd.services.uploadPaperlessDocuments = {
path = [ pkgs.openssh pkgs.inotify-tools ]; path = [pkgs.openssh pkgs.inotify-tools];
serviceConfig = { serviceConfig = {
User = "paperless-upload"; User = "paperless-upload";
StandardOutput = "journal+console"; StandardOutput = "journal+console";
@ -80,7 +82,7 @@
pathConfig = { pathConfig = {
PathChanged = "/var/lib/ftp/paperless-upload/"; PathChanged = "/var/lib/ftp/paperless-upload/";
}; };
wantedBy = [ "multi-user.target" ]; wantedBy = ["multi-user.target"];
}; };
# fingerprint sensor setup # fingerprint sensor setup

View file

@ -1,7 +1,6 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ {
imports = [ imports = [
./hardware-configuration-void.nix ./hardware-configuration-void.nix

View file

@ -1,7 +1,6 @@
let let
lock-command = "swaylock"; lock-command = "swaylock";
in in {
{
wayland.windowManager.river = { wayland.windowManager.river = {
enable = true; enable = true;
extraConfig = '' extraConfig = ''

View file

@ -56,9 +56,9 @@
]; ];
"river/tags" = { "river/tags" = {
num-tags = 10; num-tags = 10;
tag-labels = [ "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" ]; tag-labels = ["1" "2" "3" "4" "5" "6" "7" "8" "9" "0"];
set-tags = [ 1 2 4 8 16 32 64 128 256 512 ]; set-tags = [1 2 4 8 16 32 64 128 256 512];
toogle-tags = [ 1 2 4 8 16 32 64 128 256 512 ]; toogle-tags = [1 2 4 8 16 32 64 128 256 512];
}; };
"mpris" = { "mpris" = {
interval = 1; interval = 1;