Nix fmt rfc style (more or less)

This commit is contained in:
Filippo Berto 2024-08-13 12:22:23 +02:00
parent e7496c447a
commit 515f098644
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
146 changed files with 2607 additions and 906 deletions

View file

@ -1,13 +1,18 @@
{ config, pkgs, lib, ... }:
{ config
, pkgs
, lib
, ...
}:
{
age.secrets = {
ntfy-odin = { file = ../../secrets/ntfy-odin.age; owner = "bertof"; };
ntfy-odin = {
file = ../../secrets/ntfy-odin.age;
owner = "bertof";
};
odin_wg_priv.file = ../../secrets/odin_wg_priv.age;
};
# Use the systemd-boot EFI boot loader.
boot = {
# kernelPackages = pkgs.linuxPackages_latest;
@ -15,11 +20,20 @@
# kernelPackages = pkgs.linuxPackages_6_8;
kernelParams = [ "acpi_osi=Linux-Dell-Video" ];
initrd.checkJournalingFS = true; # Use same ACPI identifier as Dell Ubuntu
loader = { systemd-boot = { enable = true; editor = false; }; efi.canTouchEfiVariables = true; };
loader = {
systemd-boot = {
enable = true;
editor = false;
};
efi.canTouchEfiVariables = true;
};
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
# Cross-build arm
binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
binfmt.emulatedSystems = [
"armv7l-linux"
"aarch64-linux"
];
};
hardware = {
@ -33,15 +47,22 @@
driSupport = true;
driSupport32Bit = true;
extraPackages = builtins.attrValues {
inherit (pkgs) intel-media-driver vaapiIntel vaapiVdpau libvdpau-va-gl;
inherit (pkgs)
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
;
};
};
# Tablet
opentabletdriver = { enable = true; daemon.enable = true; };
opentabletdriver = {
enable = true;
daemon.enable = true;
};
};
networking = {
hostName = "odin";
networkmanager.enable = true;
@ -113,7 +134,10 @@
options = "eurosign:e,terminate:ctrl_alt_bksp,compose:rctrl,grp:menu_toggle";
};
displayManager.gdm = { enable = true; autoSuspend = false; };
displayManager.gdm = {
enable = true;
autoSuspend = false;
};
# displayManager.sddm = {
# enable = true;
# autoNumlock = true;
@ -121,7 +145,10 @@
# "${pkgs.sddm-theme-clairvoyance}/usr/share/sddm/themes/clairvoyance";
# };
};
displayManager = { enable = true; defaultSession = "hyprland"; };
displayManager = {
enable = true;
defaultSession = "hyprland";
};
libinput.enable = true;
keybase.enable = true;
@ -130,7 +157,10 @@
enable = true;
pulse.enable = true;
jack.enable = true;
alsa = { enable = true; support32Bit = true; };
alsa = {
enable = true;
support32Bit = true;
};
# media-session.enable = true;
};
@ -145,7 +175,10 @@
};
# Disable auto handling of power button
logind = { powerKey = "ignore"; lidSwitch = "hibernate"; };
logind = {
powerKey = "ignore";
lidSwitch = "hibernate";
};
};
# Set your time zone.
@ -160,22 +193,43 @@
environment = {
pathsToLink = [ "/share/zsh" ];
sessionVariables.LD_LIBRARY_PATH = lib.mkForce
"${config.services.pipewire.package.jack}/lib"; # Temporary fix for WebKitGTK
systemPackages = builtins.attrValues { inherit (pkgs) tmux helix vim git ntfs3g; };
sessionVariables.LD_LIBRARY_PATH = lib.mkForce "${config.services.pipewire.package.jack}/lib"; # Temporary fix for WebKitGTK
systemPackages = builtins.attrValues {
inherit (pkgs)
tmux
helix
vim
git
ntfs3g
;
};
};
# Define a user account. Don't forget to set a password with passwd.
users.users.bertof = {
isNormalUser = true;
extraGroups = [ "audio" "input" "docker" "flashrom" "libvirtd" "network" "networkmanager" "usb" "video" "wheel" ];
extraGroups = [
"audio"
"input"
"docker"
"flashrom"
"libvirtd"
"network"
"networkmanager"
"usb"
"video"
"wheel"
];
shell = pkgs.zsh;
};
programs = {
dconf.enable = true;
flashrom.enable = true;
gnupg.agent = { enable = true; enableSSHSupport = true; };
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
steam = {
enable = true;
package = pkgs.steam.override {
@ -267,7 +321,10 @@
power-profiles-daemon.enable = true;
fprintd = {
enable = true;
tod = { enable = true; driver = pkgs.libfprint-2-tod1-goodix; };
tod = {
enable = true;
driver = pkgs.libfprint-2-tod1-goodix;
};
};
};
@ -286,7 +343,6 @@
# updater.enable = true;
# };
# services.teamviewer.enable = true;
# Virtualisation
@ -294,12 +350,14 @@
# vswitch.enable = true;
# docker.enable = true;
kvmgt.enable = true;
libvirtd = { enable = true; qemu.swtpm.enable = true; };
libvirtd = {
enable = true;
qemu.swtpm.enable = true;
};
podman.enable = true;
# virtualbox.host.enable = true;
};
security.sudo.extraConfig = ''
Defaults pwfeedback
'';
@ -308,9 +366,7 @@
nixpkgs.config = {
allowUnfree = true;
packageOverrides = pkgs: {
steam = pkgs.steam.override { extraPkgs = pkgs: [ pkgs.icu ]; };
};
packageOverrides = pkgs: { steam = pkgs.steam.override { extraPkgs = pkgs: [ pkgs.icu ]; }; };
};
zramSwap.enable = true;
@ -323,4 +379,3 @@
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
}

View file

@ -5,7 +5,10 @@
{
boot = {
initrd.kernelModules = [ "i915" ];
blacklistedKernelModules = [ "nouveau" "nvidia" ];
blacklistedKernelModules = [
"nouveau"
"nvidia"
];
};
# This runs only Intel and nvidia does not drain power.

View file

@ -1,9 +1,16 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ pkgs, lib, config, ... }: {
{ pkgs
, lib
, config
, ...
}:
{
boot = { initrd.kernelModules = [ "i915" ]; };
boot = {
initrd.kernelModules = [ "i915" ];
};
hardware.nvidia = {
# modesetting.enable = true;

View file

@ -1,14 +1,23 @@
# 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, modulesPath, ... }:
{ config
, lib
, modulesPath
, ...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "nvme" "sd_mod" ];
availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"sd_mod"
];
kernelModules = [ ];
};
kernelModules = [ "kvm-intel" ];
@ -19,52 +28,92 @@
"/" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@root" "x-gvfs-hide" ];
options = [
"space_cache=v2"
"subvol=@root"
"x-gvfs-hide"
];
};
"/nix" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@nix" "x-gvfs-hide" ];
options = [
"space_cache=v2"
"subvol=@nix"
"x-gvfs-hide"
];
};
"/home/bertof" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@home" "x-gvfs-hide" ];
options = [
"space_cache=v2"
"subvol=@bertof/@home"
"x-gvfs-hide"
];
};
"/home/bertof/Giochi/SSD" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@games" "x-gvfs-hide" ];
options = [
"space_cache=v2"
"subvol=@bertof/@games"
"x-gvfs-hide"
];
};
"/home/bertof/Video" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@videos" "x-gvfs-hide" ];
options = [
"space_cache=v2"
"subvol=@bertof/@videos"
"x-gvfs-hide"
];
};
"/home/bertof/Musica" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@music" "x-gvfs-hide" ];
options = [
"space_cache=v2"
"subvol=@bertof/@music"
"x-gvfs-hide"
];
};
"/home/bertof/Immagini" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@images" "x-gvfs-hide" ];
options = [
"space_cache=v2"
"subvol=@bertof/@images"
"x-gvfs-hide"
];
};
"/home/bertof/Scaricati" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@downloads" "x-gvfs-hide" ];
options = [
"space_cache=v2"
"subvol=@bertof/@downloads"
"x-gvfs-hide"
];
};
"/home/bertof/Documenti" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@documents" "x-gvfs-hide" ];
options = [
"space_cache=v2"
"subvol=@bertof/@documents"
"x-gvfs-hide"
];
};
"/home/bertof/Documenti/Git" = {
device = "/dev/disk/by-uuid/c6e3d4df-4861-48a5-8107-d6fd1addad8c";
fsType = "btrfs";
options = [ "space_cache=v2" "subvol=@bertof/@git" "x-gvfs-hide" ];
options = [
"space_cache=v2"
"subvol=@bertof/@git"
"x-gvfs-hide"
];
};
"/boot" = {
device = "/dev/disk/by-uuid/82DB-3444";
@ -72,9 +121,7 @@
};
};
swapDevices = [
{ device = "/dev/disk/by-uuid/5f3cf424-2bd8-4352-a778-1bb067cb5700"; }
];
swapDevices = [{ device = "/dev/disk/by-uuid/5f3cf424-2bd8-4352-a778-1bb067cb5700"; }];
# 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
@ -90,6 +137,5 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
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

@ -1,10 +1,15 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
home = {
language.base = "it_IT.UTF-8";
keyboard = {
layout = "it,us,us";
variant = ",,colemak";
options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" "grp:menu_toggle" ];
options = [
"terminate:ctrl_alt_bksp"
"compose:rctrl"
"grp:menu_toggle"
];
};
packages = builtins.attrValues {
inherit (pkgs)
@ -62,7 +67,9 @@
};
};
services = { gnome-keyring.enable = true; };
services = {
gnome-keyring.enable = true;
};
xsession = {
enable = true;