diff --git a/hosts/ext-julia/hardware-configuration.nix b/hosts/ext-julia/hardware-configuration.nix index 165d4c8..1e4a7ab 100644 --- a/hosts/ext-julia/hardware-configuration.nix +++ b/hosts/ext-julia/hardware-configuration.nix @@ -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"; diff --git a/hosts/factorio/hardware-configuration.nix b/hosts/factorio/hardware-configuration.nix index a458278..88e834a 100644 --- a/hosts/factorio/hardware-configuration.nix +++ b/hosts/factorio/hardware-configuration.nix @@ -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 diff --git a/hosts/game-luanti/hardware-configuration.nix b/hosts/game-luanti/hardware-configuration.nix index 165d4c8..6bbf7a7 100644 --- a/hosts/game-luanti/hardware-configuration.nix +++ b/hosts/game-luanti/hardware-configuration.nix @@ -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"; diff --git a/hosts/jitsi/default.nix b/hosts/jitsi/default.nix index 1893723..a13ea41 100644 --- a/hosts/jitsi/default.nix +++ b/hosts/jitsi/default.nix @@ -1,9 +1,4 @@ -{ - pkgs, - lib, - modulesPath, - ... -}: { +{...}: { nixpkgs.config = { # Disable if you don't want unfree packages allowUnfree = true; diff --git a/modules/customisation.nix b/modules/customisation.nix index 65e1092..4a07150 100644 --- a/modules/customisation.nix +++ b/modules/customisation.nix @@ -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!"; + }; }; } diff --git a/modules/environment.nix b/modules/environment.nix index d399d08..44215ab 100644 --- a/modules/environment.nix +++ b/modules/environment.nix @@ -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 - ]; } diff --git a/modules/hardware/bluetooth.nix b/modules/hardware/bluetooth.nix index 900e469..cea96f4 100644 --- a/modules/hardware/bluetooth.nix +++ b/modules/hardware/bluetooth.nix @@ -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 } diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index e24baff..c6ebe66 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -2,8 +2,9 @@ imports = [ ./bluetooth.nix ./fwupd.nix - ./scan_and_print.nix - #./trackpoint.nix ./gpu.nix + ./print.nix + ./scan.nix + #./trackpoint.nix ]; } diff --git a/modules/hardware/gpu.nix b/modules/hardware/gpu.nix index 13c2a0b..577529b 100644 --- a/modules/hardware/gpu.nix +++ b/modules/hardware/gpu.nix @@ -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 + ]; + }; } diff --git a/modules/hardware/print.nix b/modules/hardware/print.nix new file mode 100644 index 0000000..3697cf9 --- /dev/null +++ b/modules/hardware/print.nix @@ -0,0 +1,4 @@ +{ + # Enable CUPS to print documents. + services.printing.enable = true; +} diff --git a/modules/hardware/scan.nix b/modules/hardware/scan.nix new file mode 100644 index 0000000..949137b --- /dev/null +++ b/modules/hardware/scan.nix @@ -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 + ]; +} diff --git a/modules/hardware/scan_and_print.nix b/modules/hardware/scan_and_print.nix deleted file mode 100644 index a83884c..0000000 --- a/modules/hardware/scan_and_print.nix +++ /dev/null @@ -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; -} diff --git a/modules/locale.nix b/modules/locale.nix index f4903ee..fbc9d55 100644 --- a/modules/locale.nix +++ b/modules/locale.nix @@ -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"; } diff --git a/modules/pkg_mgrmnt/default.nix b/modules/pkg_mgrmnt/default.nix index 49732db..6567a47 100644 --- a/modules/pkg_mgrmnt/default.nix +++ b/modules/pkg_mgrmnt/default.nix @@ -1,8 +1,8 @@ { imports = [ ./flatpak.nix + ./garbage-collect.nix ./podman.nix ./store_pkg_file.nix - ./garbage-collect.nix ]; } diff --git a/modules/pkg_mgrmnt/podman.nix b/modules/pkg_mgrmnt/podman.nix index 96379cf..1299590 100644 --- a/modules/pkg_mgrmnt/podman.nix +++ b/modules/pkg_mgrmnt/podman.nix @@ -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 ]; } diff --git a/modules/pkg_mgrmnt/store_pkg_file.nix b/modules/pkg_mgrmnt/store_pkg_file.nix index 4f4e02b..da04794 100644 --- a/modules/pkg_mgrmnt/store_pkg_file.nix +++ b/modules/pkg_mgrmnt/store_pkg_file.nix @@ -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 } diff --git a/modules/sec_auth/apparmor.nix b/modules/sec_auth/apparmor.nix index dad5775..25c70cd 100644 --- a/modules/sec_auth/apparmor.nix +++ b/modules/sec_auth/apparmor.nix @@ -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 ]; } diff --git a/modules/software/fonts.nix b/modules/software/fonts.nix index 1d1c26e..69b264d 100644 --- a/modules/software/fonts.nix +++ b/modules/software/fonts.nix @@ -12,6 +12,7 @@ fira-code fira-code-symbols #droid-sans-mono + (nerdfonts.override { fonts = [ "FiraCode" diff --git a/modules/software/obs-studio.nix b/modules/software/obs-studio.nix index a93ee14..1d6bef4 100644 --- a/modules/software/obs-studio.nix +++ b/modules/software/obs-studio.nix @@ -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 + ''; + }; } diff --git a/modules/software/virt.nix b/modules/software/virt.nix index 29a6c8e..9f512f0 100644 --- a/modules/software/virt.nix +++ b/modules/software/virt.nix @@ -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;