fix: refactor - make it beautiful!

This commit is contained in:
Ranomier 2025-05-15 20:30:26 +02:00
parent 14a58c86d1
commit b76d837472
20 changed files with 138 additions and 130 deletions

View file

@ -2,9 +2,7 @@
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
@ -12,10 +10,12 @@
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
boot = {
initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"];
initrd.kernelModules = [];
kernelModules = [];
extraModulePackages = [];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/d290e12c-d93c-45f6-b737-135b551c1951";

View file

@ -1,13 +1,7 @@
# 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,
...
}: {
{lib, ...}: {
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
# maybe instruct nix to just use available swap partition

View file

@ -2,20 +2,19 @@
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
boot = {
initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"];
initrd.kernelModules = [];
kernelModules = [];
extraModulePackages = [];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/d290e12c-d93c-45f6-b737-135b551c1951";

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
modulesPath,
...
}: {
{...}: {
nixpkgs.config = {
# Disable if you don't want unfree packages
allowUnfree = true;

View file

@ -1,10 +1,13 @@
{pkgs, ...}: {
# install and set neovim as MANPAGER
environment.systemPackages = [pkgs.neovim];
environment.variables = {
"MANPAGER" = "nvim +Man!";
environment = {
systemPackages = [pkgs.neovim];
variables = {
# set neovim as default editor
"EDITOR" = "nvim";
# set neovim as default editor
"EDITOR" = "nvim";
# use neovim as manpager! :3
"MANPAGER" = "nvim +Man!";
};
};
}

View file

@ -1,33 +1,35 @@
{pkgs, ...}: {
environment.etc = {
"xdg/user-dirs.defaults".text = ''
DESKTOP=Desktop
DOWNLOAD=Downloads
TEMPLATES=Documents/Templates
PUBLICSHARE=Public
DOCUMENTS=Documents
MUSIC=Media/Music
PICTURES=Media/Pictures
VIDEOS=Media/Videos
'';
};
# This is using a rec (recursive) expression to set and access XDG_BIN_HOME within the expression
# For more on rec expressions see https://nix.dev/tutorials/first-steps/nix-language#recursive-attribute-set-rec
environment.sessionVariables = rec {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
environment = {
etc = {
"xdg/user-dirs.defaults".text = ''
DESKTOP=Desktop
DOWNLOAD=Downloads
TEMPLATES=Documents/Templates
PUBLICSHARE=Public
DOCUMENTS=Documents
MUSIC=Media/Music
PICTURES=Media/Pictures
VIDEOS=Media/Videos
'';
};
# This is using a rec (recursive) expression to set and access XDG_BIN_HOME within the expression
# For more on rec expressions see https://nix.dev/tutorials/first-steps/nix-language#recursive-attribute-set-rec
sessionVariables = rec {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
# Not officially in the specification
XDG_BIN_HOME = "$HOME/.local/mybin";
PATH = [
"${XDG_BIN_HOME}"
# Not officially in the specification
XDG_BIN_HOME = "$HOME/.local/mybin";
PATH = [
"${XDG_BIN_HOME}"
];
};
# XDG-USER-DIR package and config
systemPackages = with pkgs; [
xdg-user-dirs
];
};
# XDG-USER-DIR package and config
environment.systemPackages = with pkgs; [
xdg-user-dirs
];
}

View file

@ -1,6 +1,8 @@
{
hardware.bluetooth.enable = true; # enables support for Bluetooth
hardware.bluetooth.powerOnBoot = false; # powers up the default Bluetooth controller on boot
hardware = {
bluetooth.enable = true; # enables support for Bluetooth
bluetooth.powerOnBoot = false; # powers up the default Bluetooth controller on boot
};
services.blueman.enable = true; # provides blueman-applet and blueman-manager
}

View file

@ -2,8 +2,9 @@
imports = [
./bluetooth.nix
./fwupd.nix
./scan_and_print.nix
#./trackpoint.nix
./gpu.nix
./print.nix
./scan.nix
#./trackpoint.nix
];
}

View file

@ -1,6 +1,8 @@
{pkgs, ...}: {
hardware.graphics.enable = true;
hardware.graphics.extraPackages = with pkgs; [
libvdpau-va-gl
];
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
libvdpau-va-gl
];
};
}

View file

@ -0,0 +1,4 @@
{
# Enable CUPS to print documents.
services.printing.enable = true;
}

27
modules/hardware/scan.nix Normal file
View file

@ -0,0 +1,27 @@
{pkgs, ...}: {
services.ipp-usb.enable = true; # enable usb support
hardware.sane = {
enable = true; # enables support for SANE scanners
backends-package = pkgs.sane-backends.overrideAttrs (old: {
configureFlags =
(old.configureFlags or [])
++ [
# "--localstatedir=/var" # `sane-backends` puts e.g. lock files in here, must not be in /nix/store
# "--with-lockdir=/var/lock/sane" # `sane-backends` puts e.g. lock files in here, must not be in /nix/store
# Ugly workaround for https://github.com/NixOS/nixpkgs/issues/273280#issuecomment-1848873028
# Really we should make `sane-backends` be able to provide a real lock dir (e.g. `/var/lock/sane`).
"--disable-locking"
];
});
};
users.users.ranomier.extraGroups = ["scanner" "lp"];
# only for the scan and maybe print clients
environment.systemPackages = with pkgs; [
simple-scan
];
}

View file

@ -1,27 +0,0 @@
{pkgs, ...}: {
hardware.sane.enable = true; # enables support for SANE scanners
services.ipp-usb.enable = true; # enable usb support
hardware.sane.backends-package = pkgs.sane-backends.overrideAttrs (old: {
configureFlags =
(old.configureFlags or [])
++ [
# "--localstatedir=/var" # `sane-backends` puts e.g. lock files in here, must not be in /nix/store
# "--with-lockdir=/var/lock/sane" # `sane-backends` puts e.g. lock files in here, must not be in /nix/store
# Ugly workaround for https://github.com/NixOS/nixpkgs/issues/273280#issuecomment-1848873028
# Really we should make `sane-backends` be able to provide a real lock dir (e.g. `/var/lock/sane`).
"--disable-locking"
];
});
users.users.ranomier.extraGroups = ["scanner" "lp"];
# only for the scan and maybe print clients
environment.systemPackages = with pkgs; [
simple-scan
];
# Enable CUPS to print documents.
services.printing.enable = true;
}

View file

@ -1,26 +1,31 @@
{
# Configure console keymap
console.keyMap = "de";
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.UTF-8";
i18n = {
# Select internationalisation properties.
defaultLocale = "en_GB.UTF-8";
#i18n.supportedLocales = [
# "en_GB.UTF-8"
# "en_US.UTF-8"
# "de_DE.UTF-8"
#];
#supportedLocales = [
# "en_GB.UTF-8"
# "en_US.UTF-8"
# "de_DE.UTF-8"
#];
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
};
# Configure keymap in X11
@ -28,7 +33,4 @@
layout = "de";
variant = "";
};
# Configure console keymap
console.keyMap = "de";
}

View file

@ -1,8 +1,8 @@
{
imports = [
./flatpak.nix
./garbage-collect.nix
./podman.nix
./store_pkg_file.nix
./garbage-collect.nix
];
}

View file

@ -19,8 +19,8 @@
# Useful other development tools
environment.systemPackages = with pkgs; [
dive # look into docker image layers
podman-tui # status of containers in the terminal
#docker-compose # start group of containers for dev
podman-compose # start group of containers for dev
podman-tui # status of containers in the terminal
];
}

View file

@ -10,5 +10,5 @@
formatted = builtins.concatStringsSep "\n" sortedUnique;
in
formatted;
# TODO: in the far future: add a little alias that greps throgh that file
# TODO: in the far future: add a little alias that greps through that file
}

View file

@ -4,9 +4,9 @@
# XDG-USER-DIR package and config
environment.systemPackages = with pkgs; [
apparmor-pam
apparmor-utils
apparmor-parser
apparmor-profiles
apparmor-utils
roddhjav-apparmor-rules
];
}

View file

@ -12,6 +12,7 @@
fira-code
fira-code-symbols
#droid-sans-mono
(nerdfonts.override {
fonts = [
"FiraCode"

View file

@ -3,6 +3,9 @@
config,
...
}: {
# The virtual camera requires the v4l2loopback kernel module to be installed, a loopback device configured, and polkit enabled so OBS can access the virtual device.
security.polkit.enable = true;
environment.systemPackages = [
(pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [
@ -12,12 +15,16 @@
];
})
];
boot.extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
];
boot.kernelModules = ["v4l2loopback"];
boot.extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
'';
security.polkit.enable = true;
boot = {
kernelModules = ["v4l2loopback"];
extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
];
extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
'';
};
}

View file

@ -1,8 +1,4 @@
{pkgs, ...}: {
# for running android apps
virtualisation.waydroid.enable =
true; # also starts the systemd service waydroid-container
# virt manager, for running VM's
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;