diff options
| author | adikro <adikro@disroot.org> | 2025-12-20 03:14:45 +0100 |
|---|---|---|
| committer | adikro <adikro@disroot.org> | 2025-12-20 03:14:45 +0100 |
| commit | 791bc419b6dac7c70951981ef6b34cdf85828470 (patch) | |
| tree | 56d0962fdf829ae942feb1344763e54dbc3c89a3 /modules/sys | |
| parent | e60410393cea222b16743a1a87f29c06b9b3543b (diff) | |
absolutely massive rewrite, made (almost) everything modular with changes to come
Diffstat (limited to 'modules/sys')
| -rw-r--r-- | modules/sys/core/audio.nix | 28 | ||||
| -rw-r--r-- | modules/sys/core/bootloader.nix | 36 | ||||
| -rw-r--r-- | modules/sys/core/default.nix | 14 | ||||
| -rw-r--r-- | modules/sys/core/drivers.nix | 56 | ||||
| -rw-r--r-- | modules/sys/core/fonts.nix | 21 | ||||
| -rw-r--r-- | modules/sys/core/greet.nix | 27 | ||||
| -rw-r--r-- | modules/sys/core/home-manager.nix | 30 | ||||
| -rw-r--r-- | modules/sys/core/localization.nix | 39 | ||||
| -rw-r--r-- | modules/sys/core/networking.nix | 29 | ||||
| -rw-r--r-- | modules/sys/core/security.nix | 27 | ||||
| -rw-r--r-- | modules/sys/default.nix | 8 | ||||
| -rw-r--r-- | modules/sys/features/default.nix | 8 | ||||
| -rw-r--r-- | modules/sys/features/nh.nix | 26 | ||||
| -rw-r--r-- | modules/sys/features/ollama.nix | 21 | ||||
| -rw-r--r-- | modules/sys/features/virtualization.nix | 41 | ||||
| -rw-r--r-- | modules/sys/wayland/default.nix | 6 | ||||
| -rw-r--r-- | modules/sys/wayland/niri.nix | 20 |
17 files changed, 0 insertions, 437 deletions
diff --git a/modules/sys/core/audio.nix b/modules/sys/core/audio.nix deleted file mode 100644 index 0769f8d..0000000 --- a/modules/sys/core/audio.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - options.szpont.audio.enable = lib.mkEnableOption "audio support"; - - config = lib.mkIf config.szpont.audio.enable { - services = { - pipewire = { - enable = true; - audio.enable = true; - pulse.enable = true; - alsa.enable = true; - alsa.support32Bit = true; - jack.enable = true; - wireplumber.enable = true; - }; - - playerctld.enable = true; - spotifyd.enable = true; - }; - - security.rtkit.enable = true; - hardware.enableAllFirmware = true; - - environment.systemPackages = with pkgs; [ - alsa-utils - ]; - }; -} diff --git a/modules/sys/core/bootloader.nix b/modules/sys/core/bootloader.nix deleted file mode 100644 index dabea20..0000000 --- a/modules/sys/core/bootloader.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ config, lib, ... }: -{ - options.szpont.bootloader = lib.mkOption { - type = lib.types.enum [ "systemd-boot" "grub" "none" ]; - description = "which bootloader to use"; - }; - - config = lib.mkMerge [ - { - boot.loader.efi.canTouchEfiVariables = true; - boot.supportedFilesystems = [ "ntfs" ]; - } - - (lib.mkIf (config.szpont.bootloader == "systemd-boot") { - boot = { - kernelParams = [ "quiet" ]; - - loader = { - systemd-boot = { - enable = true; - editor = false; - }; - timeout = 0; - }; - }; - }) - - (lib.mkIf (config.szpont.bootloader == "grub") { - boot.loader.grub = { - enable = true; - device = "nodev"; - efiSupport = true; - }; - }) - ]; -} diff --git a/modules/sys/core/default.nix b/modules/sys/core/default.nix deleted file mode 100644 index da8f277..0000000 --- a/modules/sys/core/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ ... }: -{ - imports = [ - ./audio.nix - ./bootloader.nix - ./drivers.nix - ./fonts.nix - ./greet.nix - ./home-manager.nix - ./localization.nix - ./networking.nix - ./security.nix - ]; -} diff --git a/modules/sys/core/drivers.nix b/modules/sys/core/drivers.nix deleted file mode 100644 index f12f6ab..0000000 --- a/modules/sys/core/drivers.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - options.szpont.drivers = { - enable = lib.mkEnableOption "enables hardware drivers"; - - amd.enable = lib.mkEnableOption "AMD specific drivers and microcode"; - - stability = lib.mkOption { - type = lib.types.enum [ "stable" "unstable" ]; - default = "stable"; - }; - }; - - config = lib.mkMerge [ - { - services.smartd.enable = true; - hardware = { - sensor.iio.enable = true; - - enableRedistributableFirmware = true; - graphics = { - enable = true; - enable32Bit = true; - }; - }; - } - - (lib.mkIf config.szpont.drivers.amd.enable (lib.mkMerge [ - { - services.xserver.videoDrivers = [ "amdgpu" ]; - hardware = { - cpu.amd.updateMicrocode = true; - amdgpu = { - initrd.enable = true; - overdrive.enable = true; - }; - }; - } - - (lib.mkIf (config.szpont.drivers.stability == "unstable") { - services.lact.enable = true; - - boot.kernelPackages = pkgs.linuxPackages_cachyos-lto-znver4; - chaotic.mesa-git = { - enable = true; - fallbackSpecialisation = false; - extraPackages = [ pkgs.mesa_git.opencl ]; - }; - }) - - (lib.mkIf (config.szpont.drivers.stability == "stable") { - boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; - }) - ])) - ]; -} diff --git a/modules/sys/core/fonts.nix b/modules/sys/core/fonts.nix deleted file mode 100644 index af2c78d..0000000 --- a/modules/sys/core/fonts.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - options.szpont.fonts = { - enable = lib.mkEnableOption "system-wide fonts and console configuration"; - }; - - config = lib.mkIf config.szpont.fonts.enable { - console = { - keyMap = "pl"; - earlySetup = true; - font = "ter-v32n"; - packages = with pkgs; [ terminus_font ]; - }; - - fonts.packages = with pkgs; [ - nerd-fonts.jetbrains-mono - nerd-fonts.fira-mono - nerd-fonts.fira-code - ]; - }; -} diff --git a/modules/sys/core/greet.nix b/modules/sys/core/greet.nix deleted file mode 100644 index 4f4abf9..0000000 --- a/modules/sys/core/greet.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - options.szpont.greet.enable = lib.mkEnableOption "enables greetd daemon with tuigreet"; - - config = lib.mkIf config.szpont.greet.enable { - services.greetd = { - enable = true; - settings = { - default_session = { - user = "greeter"; - command = '' - ${pkgs.tuigreet}/bin/tuigreet \ - --sessions ${config.services.displayManager.sessionData.desktops}/share/xsessions:${config.services.displayManager.sessionData.desktops}/share/wayland-sessions \ - --remember \ - --remember-user-session \ - --asterisks \ - --greeting 'Welcome to NixOS!' \ - --time - ''; - }; - }; - }; - security.pam.services.greetd.enableGnomeKeyring = true; - - environment.systemPackages = with pkgs; [ tuigreet ]; - }; -} diff --git a/modules/sys/core/home-manager.nix b/modules/sys/core/home-manager.nix deleted file mode 100644 index 06f909f..0000000 --- a/modules/sys/core/home-manager.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ config, lib, inputs, ... }: -{ - options.szpont.home-manager = { - enable = lib.mkEnableOption "Home Manager configuration manager"; - - users = lib.mkOption { - default = {}; - description = "Attribute set of users and their home-manager configurations"; - type = lib.types.attrsOf (lib.types.submodule { - options = { - path = lib.mkOption { - type = lib.types.path; - description = "Path to the user's home.nix file"; - }; - }; - }); - }; - }; - - config = lib.mkIf config.szpont.home-manager.enable { - home-manager = { - extraSpecialArgs = { inherit inputs; }; - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "bak"; - - users = lib.mapAttrs (name: user: import user.path) config.szpont.home-manager.users; - }; - }; -} diff --git a/modules/sys/core/localization.nix b/modules/sys/core/localization.nix deleted file mode 100644 index 232133d..0000000 --- a/modules/sys/core/localization.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, lib, ... }: -{ - options.szpont.locale = { - enable = lib.mkEnableOption "system localization (timezone and language)"; - - timeZone = lib.mkOption { - type = lib.types.str; - default = "Europe/Warsaw"; - description = "the system timezone."; - }; - - format = lib.mkOption { - type = lib.types.str; - default = "pl_PL.UTF-8"; - description = "the locale used for numbers, time, and measurements."; - }; - }; - - config = lib.mkIf config.szpont.locale.enable { - time.timeZone = config.szpont.locale.timeZone; - - i18n = { - defaultLocale = "en_US.UTF-8"; - - extraLocaleSettings = { - LC_TIME = config.szpont.locale.format; - LC_NUMERIC = config.szpont.locale.format; - LC_MONETARY = config.szpont.locale.format; - LC_PAPER = config.szpont.locale.format; - LC_MEASUREMENT = config.szpont.locale.format; - LC_COLLATE = config.szpont.locale.format; - LC_NAME = config.szpont.locale.format; - LC_ADDRESS = config.szpont.locale.format; - LC_TELEPHONE = config.szpont.locale.format; - LC_IDENTIFICATION = config.szpont.locale.format; - }; - }; - }; -} diff --git a/modules/sys/core/networking.nix b/modules/sys/core/networking.nix deleted file mode 100644 index 7964e8b..0000000 --- a/modules/sys/core/networking.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, lib, ... }: -{ - options.szpont.network = { - enable = lib.mkEnableOption "system-wide networking setup"; - - hostName = lib.mkOption { - type = lib.types.str; - default = "nixos"; - description = "The hostname for this specific machine."; - }; - }; - - config = lib.mkIf config.szpont.network.enable { - networking = { - hostName = config.szpont.network.hostName; - - networkmanager = { - enable = true; - wifi.macAddress = "stable-ssid"; - ethernet.macAddress = "stable-ssid"; - }; - - firewall = { - enable = true; - }; - }; - systemd.services."NetworkManager-wait-online".enable = false; - }; -} diff --git a/modules/sys/core/security.nix b/modules/sys/core/security.nix deleted file mode 100644 index b2b7827..0000000 --- a/modules/sys/core/security.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - options.szpont.security = { - enable = lib.mkEnableOption "core security services"; - }; - - config = lib.mkIf config.szpont.security.enable { - services.gnome.gnome-keyring.enable = true; - - security = { - polkit.enable = true; - rtkit.enable = true; - }; - - systemd.user.services.polkit-gnome-authentication-agent-1 = { - description = "gnome-polkit-authentication-agent-1"; - wantedBy = [ "graphical-session.target" ]; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; - Restart = "on-failure"; - RestartSec = 1; - TimeoutStopSec = 10; - }; - }; - }; -} diff --git a/modules/sys/default.nix b/modules/sys/default.nix deleted file mode 100644 index 72c9ffc..0000000 --- a/modules/sys/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: -{ - imports = [ - ./core/default.nix - ./features/default.nix - ./wayland/default.nix - ]; -} diff --git a/modules/sys/features/default.nix b/modules/sys/features/default.nix deleted file mode 100644 index 790dc25..0000000 --- a/modules/sys/features/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: -{ - imports = [ - ./nh.nix - ./ollama.nix - ./virtualization.nix - ]; -} diff --git a/modules/sys/features/nh.nix b/modules/sys/features/nh.nix deleted file mode 100644 index d24d88b..0000000 --- a/modules/sys/features/nh.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - options.szpont.nh = { - enable = lib.mkOption { - type = lib.types.bool; - default = true; - }; - }; - - config = lib.mkIf config.szpont.nh.enable { - nix.settings = { - trusted-users = [ "root" "adam" ]; - experimental-features = [ "nix-command" "flakes" ]; - }; - - programs.nh = { - enable = true; - flake = "/etc/nixos"; - }; - - environment.systemPackages = with pkgs; [ - nix-output-monitor - nvd - ]; - }; -} diff --git a/modules/sys/features/ollama.nix b/modules/sys/features/ollama.nix deleted file mode 100644 index 0989419..0000000 --- a/modules/sys/features/ollama.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, ... }: -{ - fileSystems."/models" = { - device = "/home/ollama"; - fsType = "none"; - options = [ "bind" ]; - }; - - services.ollama = { - enable = true; - package = pkgs.ollama-rocm; - loadModels = [ - "deepseek-r1:14b" - "qwen3:14b" - "qwen3-coder:30b" - ]; - syncModels = true; - user = "ollama"; - models = "/models"; - }; -} diff --git a/modules/sys/features/virtualization.nix b/modules/sys/features/virtualization.nix deleted file mode 100644 index bb3e6cb..0000000 --- a/modules/sys/features/virtualization.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - options.szpont.virtualization = { - enable = lib.mkOption { - type = lib.types.bool; - default = false; - }; - - kvm = { - enable = lib.mkOption { - type = lib.types.bool; - default = true; - }; - }; - docker = { - enable = lib.mkOption { - type = lib.types.bool; - default = false; - }; - }; - }; - - config = lib.mkIf config.szpont.virtualization.enable (lib.mkMerge [ - (lib.mkIf config.szpont.virtualization.kvm.enable { - virtualisation.libvirtd = { - enable = true; - qemu.package = pkgs.qemu_kvm; - qemu.swtpm.enable = true; - }; - programs.virt-manager.enable = true; - users.users.adam.extraGroups = [ "libvirtd" ]; - boot.initrd.kernelModules = [ "kvm-amd" ]; - }) - - (lib.mkIf config.szpont.virtualization.docker.enable { - virtualisation.docker.enable = true; - environment.systemPackages = [ pkgs.docker-compose ]; - users.users.adam.extraGroups = [ "docker" ]; - }) - ]); -} diff --git a/modules/sys/wayland/default.nix b/modules/sys/wayland/default.nix deleted file mode 100644 index 48df857..0000000 --- a/modules/sys/wayland/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./niri.nix - ]; -} diff --git a/modules/sys/wayland/niri.nix b/modules/sys/wayland/niri.nix deleted file mode 100644 index 2054d9d..0000000 --- a/modules/sys/wayland/niri.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ inputs, config, lib, pkgs, ... }: -{ - imports = [ inputs.niri.nixosModules.niri ]; - - options.szpont.niri = { - enable = lib.mkOption { - type = lib.types.bool; - default = false; - }; - }; - - config = lib.mkIf config.szpont.niri.enable { - nixpkgs.overlays = [ inputs.niri.overlays.niri ]; - - programs.niri = { - enable = true; - package = pkgs.niri-unstable; - }; - }; -} |
