cleanup, statix fixes
Some checks failed
use nix / build (push) Failing after 3m27s

This commit is contained in:
Cyryl Płotnicki 2024-04-21 19:16:41 +01:00
parent 83c99fde4b
commit 02b5b07993
12 changed files with 182 additions and 298 deletions

View file

@ -11,8 +11,10 @@
]; ];
home = "/data/shares/"; home = "/data/shares/";
}; };
networking.firewall.enable = true; networking.firewall = {
networking.firewall.allowPing = true; enable = true;
allowPing = true;
};
services.samba = { services.samba = {
enable = true; enable = true;
nsswins = true; nsswins = true;

View file

@ -13,9 +13,11 @@
availableKernelModules = ["xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod"]; availableKernelModules = ["xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod"];
}; };
loader.systemd-boot.enable = true; loader = {
loader.efi.canTouchEfiVariables = true; systemd-boot.enable = true;
loader.efi.efiSysMountPoint = "/boot/efi"; efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = "/boot/efi";
};
}; };
boot.initrd.secrets = {"/crypto_keyfile.bin" = null;}; boot.initrd.secrets = {"/crypto_keyfile.bin" = null;};

View file

@ -1,30 +0,0 @@
{pkgs, ...}: let
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec -a "$0" "$@"
'';
whichgpu = pkgs.writeShellScriptBin "whichgpu" "glxinfo | grep vendor";
nvidiaon = pkgs.writeShellScriptBin "nvidiaon" ''
export __NV_PRIME_RENDER_OFFLOAD=1;
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0;
export __GLX_VENDOR_LIBRARY_NAME=nvidia;
export __VK_LAYER_NV_optimus=NVIDIA_only;
glxinfo | grep vendor; echo OK!;
'';
in {
environment.systemPackages = [nvidia-offload whichgpu nvidiaon];
hardware.opengl.enable = true;
hardware.opengl.driSupport32Bit = true;
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [libva];
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia.prime = {
offload.enable = true;
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
intelBusId = "PCI:0:2:0";
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
nvidiaBusId = "PCI:1:0:0";
};
}

View file

@ -29,9 +29,11 @@
services.xserver = { services.xserver = {
enable = true; enable = true;
displayManager.lightdm.enable = true; displayManager = {
displayManager.autoLogin.enable = true; lightdm.enable = true;
displayManager.autoLogin.user = "kiosk"; autoLogin.enable = true;
autoLogin.user = "kiosk";
};
desktopManager.gnome.enable = true; desktopManager.gnome.enable = true;
libinput.enable = true; libinput.enable = true;
}; };

View file

@ -7,19 +7,17 @@
}: { }: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")]; imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod"]; boot = {
boot.initrd.kernelModules = []; initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod"];
boot.kernelModules = ["kvm-intel"]; kernelModules = ["kvm-intel"];
boot.extraModulePackages = []; initrd.luks.devices."crypt".device = "/dev/disk/by-uuid/0c192a18-178f-4598-a1ed-5295ef2abdc4";
};
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/9dba116f-c9fe-403a-a8e2-f9fdab23f1f1"; device = "/dev/disk/by-uuid/9dba116f-c9fe-403a-a8e2-f9fdab23f1f1";
fsType = "btrfs"; fsType = "btrfs";
options = ["compress=zstd"]; options = ["compress=zstd"];
}; };
boot.initrd.luks.devices."crypt".device = "/dev/disk/by-uuid/0c192a18-178f-4598-a1ed-5295ef2abdc4";
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/0A6A-AAFC"; device = "/dev/disk/by-uuid/0A6A-AAFC";
fsType = "vfat"; fsType = "vfat";

View file

@ -1,64 +0,0 @@
{ config, pkgs, inputs, lib, system, nixpkgs-nixos-unstable-and-unfree, ... }: {
networking.hostName = "yoga";
imports = [
./hardware-configuration.nix
../../boot.nix
../../git
../../gui
../../vim
];
boot.kernelPackages = pkgs.linuxPackages_latest;
hardware.trackpoint.enable = true;
services.hardware.bolt.enable = true;
services.fprintd = { enable = true; };
home-manager.users.cyryl = { lib, ... }: { home.packages = with pkgs; [ ]; };
networking.networkmanager.enable = true;
time.timeZone = "Europe/London";
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.printing.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
users.users.cyryl = {
isNormalUser = true;
description = "cyryl";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [ ];
};
services.fwupd.enable = true;
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = "cyryl";
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
}

View file

@ -1,41 +0,0 @@
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Setup keyfile
boot.initrd.secrets = {"/crypto_keyfile.bin" = null;};
fileSystems."/" = {
device = "/dev/disk/by-uuid/a43a1c42-9166-47dc-9e78-20e0975c75c5";
fsType = "btrfs";
options = ["subvol=@"];
};
boot.initrd.luks.devices."luks-99498047-118a-484a-8c2a-987ca68d4943".device = "/dev/disk/by-uuid/99498047-118a-484a-8c2a-987ca68d4943";
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/F179-A4EA";
fsType = "vfat";
};
swapDevices = [];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault true;
}

View file

@ -1,5 +1,11 @@
{ config, pkgs, lib, inputs, nixpkgs-nixos-unstable-and-unfree, ... }: {
let config,
pkgs,
lib,
inputs,
nixpkgs-nixos-unstable-and-unfree,
...
}: let
stateVersion = "23.11"; stateVersion = "23.11";
username = "cyryl"; username = "cyryl";
in { in {
@ -11,7 +17,7 @@ in {
]; ];
security.allowUserNamespaces = true; security.allowUserNamespaces = true;
boot.supportedFilesystems = [ "ntfs" ]; boot.supportedFilesystems = ["ntfs"];
environment.enableDebugInfo = true; environment.enableDebugInfo = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -54,39 +60,36 @@ in {
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
networking.nameservers = networking.nameservers = ["9.9.9.9" "2620:fe::fe" "149.112.112.112" "2620:fe::9"];
[ "9.9.9.9" "2620:fe::fe" "149.112.112.112" "2620:fe::9" ];
networking.hosts = { "10.11.99.1" = [ "remarkable" ]; }; networking.hosts = {"10.11.99.1" = ["remarkable"];};
programs.light.enable = true; programs = {
programs.adb.enable = true; light.enable = true;
programs.wireshark.enable = true; adb.enable = true;
wireshark.enable = true;
programs.ssh.extraConfig = ''
Host vpsfree1 vpsfree1.cyplo.dev vpsfree1.raptor-carp.ts.net
HostName vpsfree1
Port 2222
Host cupsnet.cyplo.dev
HostName cupsnet.cyplo.dev
Port 2222
Host cupsnet cupsnet.raptor-carp.ts.net
HostName cupsnet.raptor-carp.ts.net
Port 2222
StrictHostKeyChecking=accept-new
'';
ssh.extraConfig = ''
Host cupsnet.cyplo.dev
HostName cupsnet.cyplo.dev
Port 2222
Host cupsnet cupsnet.raptor-carp.ts.net
HostName cupsnet.raptor-carp.ts.net
Port 2222
StrictHostKeyChecking=accept-new
'';
};
virtualisation.docker = { virtualisation.docker = {
enable = true; enable = true;
autoPrune.enable = true; autoPrune.enable = true;
daemon.settings = { daemon.settings = {
"insecure-registries" = [ "vpsfree1.raptor-carp.ts.net:5000" ]; "insecure-registries" = ["vpsfree1.raptor-carp.ts.net:5000"];
}; };
}; };
fonts.fontconfig = { fonts.fontconfig = {
enable = true; enable = true;
defaultFonts.monospace = [ "BerkeleyMono Nerd Font" ]; defaultFonts.monospace = ["BerkeleyMono Nerd Font"];
}; };
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
@ -112,7 +115,7 @@ in {
''; '';
}; };
system = { inherit stateVersion; }; system = {inherit stateVersion;};
system.activationScripts.diff = '' system.activationScripts.diff = ''
${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig" ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
''; '';

View file

@ -55,16 +55,17 @@ in {
}; };
}; };
programs.mbsync.enable = true; programs = {
programs.msmtp.enable = true; mbsync.enable = true;
programs.neomutt = {enable = true;}; msmtp.enable = true;
programs.notmuch = { neomutt = {enable = true;};
enable = true; notmuch = {
hooks.preNew = "${pkgs.isync}/bin/mbsync -a"; enable = true;
hooks.preNew = "${pkgs.isync}/bin/mbsync -a";
};
alot = {enable = true;};
}; };
programs.alot = {enable = true;}; home.packages = [unstable.protonmail-bridge];
home.packages = with pkgs; [unstable.protonmail-bridge];
services.mbsync.enable = true; services.mbsync.enable = true;

View file

@ -1,24 +1,30 @@
{ config, pkgs, inputs, system, ... }: {
let config,
pkgs,
inputs,
system,
...
}: let
master = inputs.nixpkgs-master; master = inputs.nixpkgs-master;
pkgs = master.legacyPackages."${system}"; pkgs = master.legacyPackages."${system}";
in { in {
disabledModules = [ ]; disabledModules = [];
imports = [ ]; imports = [];
services.flatpak.enable = true; services = {
flatpak.enable = true;
services.desktopManager.plasma6.enable = true; desktopManager.plasma6.enable = true;
services.xserver = { xserver = {
enable = true;
displayManager.sddm = {
enable = true; enable = true;
enableHidpi = true; displayManager.sddm = {
wayland.enable = true; enable = true;
enableHidpi = true;
wayland.enable = true;
};
}; };
}; };
users.users.cyryl.packages = with pkgs; [ ]; users.users.cyryl.packages = with pkgs; [];
programs.kdeconnect.enable = true; programs.kdeconnect.enable = true;
} }

View file

@ -22,43 +22,44 @@ in {
imports = [./keybindings.nix ../home-manager/programs/alacritty.nix]; imports = [./keybindings.nix ../home-manager/programs/alacritty.nix];
home.pointerCursor = { home = {
name = "Adwaita"; pointerCursor = {
package = pkgs.gnome.adwaita-icon-theme; name = "Adwaita";
size = 24; package = pkgs.gnome.adwaita-icon-theme;
x11 = { size = 24;
enable = true; x11 = {
defaultCursor = "Adwaita"; enable = true;
defaultCursor = "Adwaita";
};
}; };
sessionVariables = {
XDG_CURRENT_DESKTOP = "Unity";
SDL_VIDEODRIVER = "wayland";
QT_QPA_PLATFORM = "wayland-egl";
QT_WAYLAND_FORCE_DPI = "physical";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
};
packages = with pkgs; [
firefox-wayland
wl-clipboard
clipman
wofi
libappindicator-gtk3
gtk-engine-murrine
gtk_engines
gsettings-desktop-schemas
lxappearance
];
file.".config/wofi/style.css".source = ../../.config/wofi/style.css;
file.".config/waybar/config".source = ../../.config/waybar/config;
file.".config/waybar/style.css".source =
../../.config/waybar/style.css;
}; };
home.sessionVariables = {
XDG_CURRENT_DESKTOP = "Unity";
SDL_VIDEODRIVER = "wayland";
QT_QPA_PLATFORM = "wayland-egl";
QT_WAYLAND_FORCE_DPI = "physical";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
};
home.packages = with pkgs; [
firefox-wayland
wl-clipboard
clipman
wofi
libappindicator-gtk3
gtk-engine-murrine
gtk_engines
gsettings-desktop-schemas
lxappearance
];
services.udiskie.enable = true; services.udiskie.enable = true;
xsession.preferStatusNotifierItems = true; xsession.preferStatusNotifierItems = true;
home.file.".config/wofi/style.css".source = ../../.config/wofi/style.css;
home.file.".config/waybar/config".source = ../../.config/waybar/config;
home.file.".config/waybar/style.css".source =
../../.config/waybar/style.css;
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
wrapperFeatures.base = true; wrapperFeatures.base = true;

View file

@ -1,73 +1,82 @@
{ config, pkgs, ... }: { {
programs.atuin.enableZshIntegration = true; config,
programs.zsh = { pkgs,
enable = true; ...
history = { }: {
size = 102400; programs = {
save = 102400; atuin.enableZshIntegration = true;
ignoreDups = true; zsh = {
expireDuplicatesFirst = true;
share = true;
};
autosuggestion.enable = true;
enableCompletion = true;
oh-my-zsh = {
enable = true; enable = true;
plugins = [ "vi-mode" "git" "python" "history-substring-search" "tmux" ]; history = {
size = 102400;
save = 102400;
ignoreDups = true;
expireDuplicatesFirst = true;
share = true;
};
autosuggestion.enable = true;
enableCompletion = true;
oh-my-zsh = {
enable = true;
plugins = ["vi-mode" "git" "python" "history-substring-search" "tmux"];
};
initExtra = ''
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=238'
setopt HIST_IGNORE_ALL_DUPS
'';
profileExtra = ''
export PATH="$HOME/programs:$PATH";
export PATH="$HOME/tools:$PATH";
export PATH="$HOME/bin:$PATH";
export PATH="$HOME/.local/bin:$PATH";
export PATH="$GOPATH/bin:$PATH";
export PATH="$HOME/.rvm/bin:$PATH";
export PATH="$HOME/.cargo/bin:$PATH";
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH";
'';
envExtra = ''
[ -s "/home/cyryl/.jabba/jabba.sh" ] && source "/home/cyryl/.jabba/jabba.sh"
tmux source-file ~/.config/tmux/tmux.conf
local nixos_version=`which nixos-version`
if [[ ! -x "$nixos_version" && ! `uname` == "Darwin" ]]; then
source /home/cyryl/.nix-profile/etc/profile.d/nix.sh
export NIX_PATH="$HOME/.nix-defexpr/channels:$NIX_PATH"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
echo "non-nixos patches loaded"
fi
'';
sessionVariables = {
TERM = "xterm-256color";
PAGER = "less";
ZSH_TMUX_AUTOSTART = true;
GOPATH = "$HOME/go";
};
shellAliases = {
tmate = "tmux detach-client -E 'tmate;tmux'";
cat = "bat -p";
rg = "rga";
bc = ''BC_ENV_ARGS=<(echo "scale=2") \bc'';
};
}; };
initExtra = '' direnv = {
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=238' enable = true;
setopt HIST_IGNORE_ALL_DUPS enableZshIntegration = true;
''; nix-direnv = {enable = true;};
profileExtra = ''
export PATH="$HOME/programs:$PATH";
export PATH="$HOME/tools:$PATH";
export PATH="$HOME/bin:$PATH";
export PATH="$HOME/.local/bin:$PATH";
export PATH="$GOPATH/bin:$PATH";
export PATH="$HOME/.rvm/bin:$PATH";
export PATH="$HOME/.cargo/bin:$PATH";
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH";
'';
envExtra = ''
[ -s "/home/cyryl/.jabba/jabba.sh" ] && source "/home/cyryl/.jabba/jabba.sh"
tmux source-file ~/.config/tmux/tmux.conf
local nixos_version=`which nixos-version`
if [[ ! -x "$nixos_version" && ! `uname` == "Darwin" ]]; then
source /home/cyryl/.nix-profile/etc/profile.d/nix.sh
export NIX_PATH="$HOME/.nix-defexpr/channels:$NIX_PATH"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
echo "non-nixos patches loaded"
fi
'';
sessionVariables = {
TERM = "xterm-256color";
PAGER = "less";
ZSH_TMUX_AUTOSTART = true;
GOPATH = "$HOME/go";
}; };
starship = {
shellAliases = { enable = true;
tmate = "tmux detach-client -E 'tmate;tmux'"; enableZshIntegration = true;
cat = "bat -p";
rg = "rga";
bc = ''BC_ENV_ARGS=<(echo "scale=2") \bc'';
}; };
}; };
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv = { enable = true; };
};
home.file.".config/starship.toml".text = '' home.file.".config/starship.toml".text = ''
command_timeout = 8192 command_timeout = 8192
[aws] [aws]
@ -98,9 +107,4 @@
[nix_shell] [nix_shell]
symbol = "nix-shell " symbol = "nix-shell "
''; '';
programs.starship = {
enable = true;
enableZshIntegration = true;
};
} }