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 # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ {
config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: { }: {
@ -12,10 +10,12 @@
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"]; boot = {
boot.initrd.kernelModules = []; initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"];
boot.kernelModules = []; initrd.kernelModules = [];
boot.extraModulePackages = []; kernelModules = [];
extraModulePackages = [];
};
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/d290e12c-d93c-45f6-b737-135b551c1951"; 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 # 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.
{ {lib, ...}: {
config,
lib,
pkgs,
modulesPath,
...
}: {
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
# maybe instruct nix to just use available swap partition # 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 # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ {
config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: { }: {
imports = [ imports = [
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot = {
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"]; initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"];
boot.initrd.kernelModules = []; initrd.kernelModules = [];
boot.kernelModules = []; kernelModules = [];
boot.extraModulePackages = []; extraModulePackages = [];
};
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/d290e12c-d93c-45f6-b737-135b551c1951"; device = "/dev/disk/by-uuid/d290e12c-d93c-45f6-b737-135b551c1951";

View file

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

View file

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

View file

@ -1,33 +1,35 @@
{pkgs, ...}: { {pkgs, ...}: {
environment.etc = { environment = {
"xdg/user-dirs.defaults".text = '' etc = {
DESKTOP=Desktop "xdg/user-dirs.defaults".text = ''
DOWNLOAD=Downloads DESKTOP=Desktop
TEMPLATES=Documents/Templates DOWNLOAD=Downloads
PUBLICSHARE=Public TEMPLATES=Documents/Templates
DOCUMENTS=Documents PUBLICSHARE=Public
MUSIC=Media/Music DOCUMENTS=Documents
PICTURES=Media/Pictures MUSIC=Media/Music
VIDEOS=Media/Videos 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 # This is using a rec (recursive) expression to set and access XDG_BIN_HOME within the expression
environment.sessionVariables = rec { # For more on rec expressions see https://nix.dev/tutorials/first-steps/nix-language#recursive-attribute-set-rec
XDG_CACHE_HOME = "$HOME/.cache"; sessionVariables = rec {
XDG_CONFIG_HOME = "$HOME/.config"; XDG_CACHE_HOME = "$HOME/.cache";
XDG_DATA_HOME = "$HOME/.local/share"; XDG_CONFIG_HOME = "$HOME/.config";
XDG_STATE_HOME = "$HOME/.local/state"; XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
# Not officially in the specification # Not officially in the specification
XDG_BIN_HOME = "$HOME/.local/mybin"; XDG_BIN_HOME = "$HOME/.local/mybin";
PATH = [ PATH = [
"${XDG_BIN_HOME}" "${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 = {
hardware.bluetooth.powerOnBoot = false; # powers up the default Bluetooth controller on boot 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 services.blueman.enable = true; # provides blueman-applet and blueman-manager
} }

View file

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

View file

@ -1,6 +1,8 @@
{pkgs, ...}: { {pkgs, ...}: {
hardware.graphics.enable = true; hardware.graphics = {
hardware.graphics.extraPackages = with pkgs; [ enable = true;
libvdpau-va-gl 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. # Set your time zone.
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
# Select internationalisation properties. i18n = {
i18n.defaultLocale = "en_GB.UTF-8"; # Select internationalisation properties.
defaultLocale = "en_GB.UTF-8";
#i18n.supportedLocales = [ #supportedLocales = [
# "en_GB.UTF-8" # "en_GB.UTF-8"
# "en_US.UTF-8" # "en_US.UTF-8"
# "de_DE.UTF-8" # "de_DE.UTF-8"
#]; #];
i18n.extraLocaleSettings = { extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8"; LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8"; LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8"; LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8"; LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8"; LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8"; LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8"; LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8"; LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8"; LC_TIME = "de_DE.UTF-8";
};
}; };
# Configure keymap in X11 # Configure keymap in X11
@ -28,7 +33,4 @@
layout = "de"; layout = "de";
variant = ""; variant = "";
}; };
# Configure console keymap
console.keyMap = "de";
} }

View file

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

View file

@ -19,8 +19,8 @@
# Useful other development tools # Useful other development tools
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
dive # look into docker image layers dive # look into docker image layers
podman-tui # status of containers in the terminal
#docker-compose # start group of containers for dev #docker-compose # start group of containers for dev
podman-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; formatted = builtins.concatStringsSep "\n" sortedUnique;
in in
formatted; 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 # XDG-USER-DIR package and config
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
apparmor-pam apparmor-pam
apparmor-utils
apparmor-parser apparmor-parser
apparmor-profiles apparmor-profiles
apparmor-utils
roddhjav-apparmor-rules roddhjav-apparmor-rules
]; ];
} }

View file

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

View file

@ -3,6 +3,9 @@
config, 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 = [ environment.systemPackages = [
(pkgs.wrapOBS { (pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [ plugins = with pkgs.obs-studio-plugins; [
@ -12,12 +15,16 @@
]; ];
}) })
]; ];
boot.extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback boot = {
]; kernelModules = ["v4l2loopback"];
boot.kernelModules = ["v4l2loopback"];
boot.extraModprobeConfig = '' extraModulePackages = with config.boot.kernelPackages; [
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 v4l2loopback
''; ];
security.polkit.enable = true;
extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
'';
};
} }

View file

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