start work on my new laptop's config

This commit is contained in:
jacekpoz 2024-02-19 17:06:47 +01:00
parent 2f8cb29e63
commit 55636e8539
No known key found for this signature in database
GPG key ID: 94E812A8B12AAE3C
7 changed files with 671 additions and 0 deletions

View file

@ -21,6 +21,22 @@ in {
inputs.agenix.nixosModules.default
];
};
del = lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit lib inputs self;
config' = {
hostname = "del";
username = "jacek";
};
};
modules = [
./del
../modules
inputs.home-manager.nixosModules.home-manager
inputs.agenix.nixosModules.default
];
};
#hape = lib.nixosSystem {
# system = "x86_64-linux";
# specialArgs = {

391
hosts/del/configuration.nix Normal file
View file

@ -0,0 +1,391 @@
{
config,
config',
pkgs,
lib,
inputs,
...
}: {
nixpkgs = {
config = {
allowUnfree = true;
};
overlays = [
inputs.nur.overlay
inputs.neovim-nightly-overlay.overlay
];
};
boot = {
loader = {
systemd-boot = {
enable = true;
memtest86.enable = true;
};
efi.canTouchEfiVariables = true;
};
kernelPackages = pkgs.linuxPackages_xanmod_latest;
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
kernelModules = [ "v4l2loopback" ];
kernelParams = [
"video=eDP-1:2560x1440@165"
];
};
networking = {
hostName = config'.hostname;
networkmanager = {
enable = true;
dns = "systemd-resolved";
};
firewall.checkReversePath = "loose";
};
services.resolved.enable = true;
# don't wait for network to boot faster
# https://old.reddit.com/r/NixOS/comments/vdz86j/how_to_remove_boot_dependency_on_network_for_a
systemd = {
targets.network-online.wantedBy = lib.mkForce []; # default is [ "multi-user.target" ]
services.NetworkManager-wait-online.wantedBy = lib.mkForce []; # default is [ "network-online.target" ]
};
time.timeZone = "Europe/Warsaw";
nix = {
settings = {
experimental-features = [
"flakes"
"nix-command"
];
max-jobs = 3;
cores = 4;
auto-optimise-store = true;
keep-outputs = true;
keep-derivations = true;
substituters = [
"https://nix-community.cachix.org"
"https://nixpkgs-wayland.cachix.org"
"https://viperml.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
"viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8="
];
};
};
programs.dconf.enable = true;
security.sudo.package = pkgs.sudo.override { withInsults = true; };
security.polkit.enable = true;
fonts.packages = with pkgs; [
material-design-icons
(nerdfonts.override { fonts = [
"JetBrainsMono"
]; })
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-emoji
];
users.users.${config'.username} = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "libvirtd" ];
};
environment = {
sessionVariables = {
MOZ_ENABLE_WAYLAND = "1";
MOZ_DRM_DEVICE = "/dev/dri/card0";
CHROME_EXECUTABLE = "${pkgs.ungoogled-chromium}/bin/chromium";
#NIXOS_OZONE_WL = "1";
#WLR_DRM_DEVICES = "/dev/dri/card0:/dev/dri/card1";
#DRI_PRIME = "1";
};
};
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
mesa
libdrm
libva
vaapiVdpau
libvdpau-va-gl
];
extraPackages32 = with pkgs; [
driversi686Linux.mesa
driversi686Linux.vaapiVdpau
driversi686Linux.libvdpau-va-gl
];
};
};
services = {
blueman.enable = true;
mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
pcscd.enable = true;
udisks2.enable = true;
dbus.enable = true;
fwupd = {
enable = true;
};
ratbagd.enable = true;
fprintd = {
enable = true;
tod = {
enable = true;
driver = pkgs.libfprint-2-tod1-goodix;
};
};
};
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "qt";
enableSSHSupport = true;
};
services.btrfs = {
autoScrub = {
enable = true;
interval = "weekly";
};
};
services.psd = {
enable = true;
resyncTimer = "30m";
};
services.journald = {
extraConfig = ''
SystemMaxUse=100M
'';
};
services.udev = {
packages = with pkgs; [
yubikey-personalization
];
};
# this makes usb devices autosuspend
#powerManagement.powertop.enable = true;
programs.kdeconnect.enable = true;
programs.noisetorch.enable = true;
myOptions = {
other = {
home-manager = {
enable = true;
enableDirenv = true;
};
};
programs = {
git = {
enable = true;
userName = "jacekpoz";
userEmail = "jacekpoz@cock.li";
signingKey = "0EEE6B0C9A8CC06820E59C3894E812A8B12AAE3C";
defaultBranch = "master";
};
starship.enable = true;
zsh = {
enable = true;
extraAliases = {
#u = "nh os switch \"/home/jacek/niksos\" -H niks -- --use-remote-sudo";
#us = "NIX_SSHOPTS='-t' nh os switch \"/home/jacek/niksos\" -H chmura -- --use-remote-sudo --target-host chmura";
u = "nixos-rebuild switch --flake \"/home/jacek/niksos#del\" -L --use-remote-sudo";
us = "NIX_SSHOPTS='-t' nixos-rebuild switch --flake \"/home/jacek/niksos#chmura\" -L --use-remote-sudo --target-host chmura";
};
profiling = false;
};
anyrun.enable = true;
armcord.enable = true;
vesktop.enable = true;
btop.enable = true;
firefox = {
enable = true;
defaultSearchEngine = "NotASearx";
searchEngines = {
"NotASearx" = {
url = "https://search.notashelf.dev/search?q={searchTerms}";
faviconUrl = "https://search.notashelf.dev/favicon.ico";
aliases = [ "!sx" ];
};
"NixOS Packages" = {
url = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}";
faviconPath = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
aliases = [ "!np" ];
};
"NixOS Options" = {
url = "https://search.nixos.org/options?channel=unstable&query={searchTerms}";
faviconPath = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
aliases = [ "!no" ];
};
"NixOS Wiki" = {
url = "https://nixos.wiki/index.php?search={searchTerms}";
faviconPath = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
aliases = [ "!nw" ];
};
"Home Manger Option Search" = {
url = "https://mipmip.github.io/home-manager-option-search?query={searchTerms}";
faviconPath = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
aliases = [ "!hm" ];
};
"Arch Wiki" = {
url = "https://wiki.archlinux.org/index.php?search={searchTerms}";
faviconUrl = "https://archlinux.org/favicon.ico";
aliases = [ "!aw" ];
};
"Gentoo Wiki" = {
url = "https://wiki.gentoo.org/index.php?search={searchTerms}";
faviconUrl = "https://www.gentoo.org/favicon.ico";
aliases = [ "!gw" ];
};
"Debian Wiki" = {
url = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}";
faviconUrl = "https://www.debian.org/favicon.ico";
aliases = [ "!dw" ];
};
};
};
foot.enable = true;
mpv.enable = true;
osu = {
enable = false;
enableStable = false;
};
neovim.enable = true;
swaylock.enable = true;
waybar.enable = true;
zathura.enable = true;
hyprland = {
enable = true;
startupSound = ./mathis.m4a;
};
helix.enable = false;
newsboat.enable = true;
};
themes = {
cursor = {
enable = true;
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
gtk = {
enable = true;
package = pkgs.catppuccin-gtk;
name = "Catppuccin-Mocha-Standard-Green-Dark";
variant = "mocha";
accentColour = "green";
iconTheme = {
name = "Papirus-Dark";
package = pkgs.catppuccin-papirus-folders;
};
};
qt = {
enable = true;
package = pkgs.catppuccin-kde;
name = "Catppuccin-Mocha-Dark";
variant = "mocha";
accentColour = "green";
};
};
services = {
asusd.enable = true;
dunst.enable = true;
mpd.enable = true;
greetd = {
enable = true;
greeter = "gtkgreet";
launchOptions = [
"Hyprland"
"sway"
"zsh"
"reboot"
"shutdown now"
];
};
ssh = {
daemon.enable = false;
agent = {
enable = true;
hostAliases = {
"github" = {
hostName = "github.com";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/githubkey";
};
"git.dupa.edu.pl" = {
hostName = "git.dupa.edu.pl";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/gitdupaedupl";
};
"codeberg" = {
hostName = "codeberg.org";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/codeberg";
};
"gitlab" = {
hostName = "gitlab.com";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/gitlab";
};
"aur" = {
hostName = "aur.archlinux.org";
user = "aur";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/aur";
};
"jacekpoz" = {
hostName = "git.jacekpoz.pl";
user = "forgejo";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/jacekpoz";
};
"chmura" = {
hostName = "192.168.15.2";
user = "chmura";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/chmura";
};
"chmura2" = {
hostName = "jacekpoz.pl";
user = "chmura";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/chmura";
};
"malina" = {
hostName = "192.168.15.3";
user = "malina";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/malina";
};
"outfoxxed" = {
hostName = "git.outfoxxed.me";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/outfoxxed";
};
};
};
};
pipewire.enable = true;
};
};
system.stateVersion = "23.11";
}

8
hosts/del/default.nix Normal file
View file

@ -0,0 +1,8 @@
_: {
imports = [
./configuration.nix
./hardware-configuration.nix
./profile.nix
./programs.nix
];
}

View file

@ -0,0 +1,39 @@
# 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, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/dd5b411e-c9fb-4b0f-bddf-f690c61eb506";
fsType = "btrfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/D71D-D218";
fsType = "vfat";
};
swapDevices = [ ];
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s13f0u2u4.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
# networking.interfaces.wwp0s20f0u3c2.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

BIN
hosts/del/mathis.m4a Normal file

Binary file not shown.

12
hosts/del/profile.nix Normal file
View file

@ -0,0 +1,12 @@
_: {
imports = [
../../options/common/docs.nix
../../options/common/oomd.nix
../../options/common/pin-registry.nix
../../options/common/preserve-system.nix
../../options/desktop/bluetooth.nix
../../options/desktop/opentabletdriver.nix
../../options/desktop/power-supply.nix
../../options/desktop/suspend.nix
];
}

205
hosts/del/programs.nix Normal file
View file

@ -0,0 +1,205 @@
{
config',
inputs,
pkgs,
...
}: {
home-manager.users.${config'.username} = {
home.packages = let
hyprcontrib = inputs.hyprcontrib.packages.${pkgs.system};
shadower = inputs.shadower.packages.${pkgs.system};
fenix = inputs.fenix.packages.${pkgs.system};
nixpkgs-wayland = inputs.nixpkgs-wayland.packages.${pkgs.system};
agenix = inputs.agenix.packages.${pkgs.system};
nh = inputs.nh.packages.${pkgs.system};
in with pkgs; [
git
librewolf-wayland
keepassxc
eza
ripgrep
libnotify
rofi-wayland
rofi-calc
session-desktop
signal-desktop-beta
element-desktop
obs-studio
heroic
steam
ungoogled-chromium
amdgpu_top
tor-browser-bundle-bin
mullvad-browser
thunderbird
telegram-desktop
livecaptions
gimp
helvum
ddccontrol
ddccontrol-db
bluez
blueman
easyeffects
lbry
libreoffice-fresh
minetest
airshipper
#onionshare-gui
prismlauncher
qbittorrent
ventoy-full
zellij
nodejs
unzip
cmake
gcc
nixpkgs-wayland.sway-unwrapped
caprine-bin
libsForQt5.kdenlive
telegram-desktop
waypipe
trash-cli
bibata-cursors
nixpkgs-wayland.swww
opentabletdriver
networkmanagerapplet
nixpkgs-wayland.wl-clipboard
nixpkgs-wayland.wlsunset
xdg-utils
hyprpicker
hyprcontrib.hyprprop
hyprcontrib.grimblast
shadower.shadower
pamixer
brightnessctl
dig
swappy
nixpkgs-wayland.imv
pcmanfm
xdg-ninja
auto-cpufreq
gnupg
pinentry-qt
age
rage
fd
udisks
ffmpeg_6-full
ghc
ghcid
cabal-install
yt-dlp
filelight
(fenix.complete.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
])
wayland
showmethekey
polkit
libsForQt5.polkit-kde-agent
asciinema
asciinema-agg
du-dust
appimage-run
file
virt-manager
weechat
flowblade
hyfetch
git-annex
gamemode
croc
uutils-coreutils
anki
alsa-utils
speechd
espeak
ezquake
imagemagick
weston
pavucontrol
psmisc
mesa-demos
nnn
#aseprite-unfree
jq
fq
nixpkgs-wayland.eww-wayland
gnumake
gdb
tea
codeberg-cli
progress
parallel
p7zip
xxd
tldr
mpc-cli
playerctl
xdg-user-dirs
meson
wiki-tui
lshw
tree
ydotool
piper
smartmontools
agenix.default
nh.default
nyxt
exiv2
krita
mypaint
logseq
gamescope
vitetris
gtetrinet
linuxKernel.packages.linux_zen.cpupower
usbutils
libsForQt5.dolphin
kiwix
inkscape
gomuks
nushell
twitch-tui
hugo
ytfzf
mat2
simplex-chat-desktop
libsixel
lsix
ollama
qmk
python3
wev
enigma
via
vial
rustdesk
superTuxKart
solaar
glfw-wayland-minecraft
httpie
mangohud
nix-index
xdg-ninja
heaptrack
modemmanager
modem-manager-gui
webcamoid
fswebcam
asciicam
v4l-utils
osu-lazer-bin
pciutils
wvkbd
clickclack
xournalpp
];
};
}