diff options
Diffstat (limited to 'sys/core')
| -rw-r--r-- | sys/core/audio.nix | 32 | ||||
| -rw-r--r-- | sys/core/bootloader.nix | 42 | ||||
| -rw-r--r-- | sys/core/core.nix | 46 | ||||
| -rw-r--r-- | sys/core/drivers.nix | 47 | ||||
| -rw-r--r-- | sys/core/fonts.nix | 22 | ||||
| -rw-r--r-- | sys/core/greet.nix | 29 | ||||
| -rw-r--r-- | sys/core/home-manager.nix | 36 | ||||
| -rw-r--r-- | sys/core/localization.nix | 41 | ||||
| -rw-r--r-- | sys/core/memory.nix | 41 | ||||
| -rw-r--r-- | sys/core/networking.nix | 20 | ||||
| -rw-r--r-- | sys/core/power.nix | 18 | ||||
| -rw-r--r-- | sys/core/security.nix | 39 | ||||
| -rw-r--r-- | sys/core/storage.nix | 36 | ||||
| -rw-r--r-- | sys/core/users.nix | 23 |
14 files changed, 0 insertions, 472 deletions
diff --git a/sys/core/audio.nix b/sys/core/audio.nix deleted file mode 100644 index 234b6bd..0000000 --- a/sys/core/audio.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ config, lib, pkgs, username, ... }: -let - cfg = config.sys.core.audio; -in -{ - options.sys.core.audio.enable = lib.mkEnableOption "audio support"; - config = lib.mkIf cfg.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; [ - helvum - alsa-utils - ]; - - home-manager.users.${username}.hm.soft.easyeffects.enable = true; - }; -} diff --git a/sys/core/bootloader.nix b/sys/core/bootloader.nix deleted file mode 100644 index ff0aad5..0000000 --- a/sys/core/bootloader.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ config, lib, ... }: -let - cfg = config.sys.core.bootloader; -in -{ - options.sys.core.bootloader = lib.mkOption { - type = lib.types.enum [ "systemd-boot" "grub" "none" ]; - default = "systemd-boot"; - description = "which bootloader to use"; - }; - config = lib.mkMerge [ - { - boot.loader.efi.canTouchEfiVariables = true; - boot.supportedFilesystems = [ "ntfs" ]; - boot.kernelParams = [ "quiet" "splash" ]; - } - - (lib.mkIf (cfg == "systemd-boot") { - boot.consoleLogLevel = 0; - boot.loader = { - systemd-boot.enable = true; - systemd-boot.editor = false; - timeout = 0; - }; - }) - - (lib.mkIf (cfg == "grub") { - boot.loader = { - timeout = 3; - efi.efiSysMountPoint = "/boot"; - grub = { - enable = true; - device = "nodev"; - efiSupport = true; - useOSProber = true; - - default = 2; - }; - }; - }) - ]; -} diff --git a/sys/core/core.nix b/sys/core/core.nix deleted file mode 100644 index 428d7ea..0000000 --- a/sys/core/core.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.sys.core; -in -{ - imports = [ - ./audio.nix - ./bootloader.nix - ./drivers.nix - ./fonts.nix - ./greet.nix - ./home-manager.nix - ./localization.nix - ./memory.nix - ./networking.nix - ./power.nix - ./security.nix - ./storage.nix - ./users.nix - ]; - - options.sys.core = { - allowUnfree.enable = lib.mkEnableOption "unfree software"; - - flatpak.enable = lib.mkEnableOption "Flatpak support"; - - hardwareTools = { - enable = lib.mkEnableOption "peripheral and thermal tools"; - }; - }; - - config = lib.mkMerge [ - (lib.mkIf cfg.allowUnfree.enable { - nixpkgs.config.allowUnfree = true; - }) - - (lib.mkIf cfg.flatpak.enable { - services.flatpak.enable = true; - }) - - (lib.mkIf cfg.hardwareTools.enable { - programs.coolercontrol.enable = true; - environment.systemPackages = [ pkgs.rivalcfg ]; - }) - ]; -} diff --git a/sys/core/drivers.nix b/sys/core/drivers.nix deleted file mode 100644 index c769786..0000000 --- a/sys/core/drivers.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.sys.core.drivers; -in -{ - options.sys.core.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.mkIf cfg.enable (lib.mkMerge [ - { - services.smartd.enable = true; - hardware.sensor.iio.enable = true; - hardware.enableAllFirmware = true; - hardware.cpu.amd.updateMicrocode = true; - hardware.graphics = { - enable = true; - enable32Bit = true; - }; - } - - (lib.mkIf cfg.amd.enable { - services.xserver.videoDrivers = [ "amdgpu" ]; - hardware.amdgpu = { - initrd.enable = true; - overdrive.enable = true; - }; - }) - - (lib.mkIf (cfg.amd.enable && cfg.stability == "unstable") { - services.lact.enable = true; - boot.kernelPackages = pkgs.linuxPackages_cachyos-lto-znver4; - chaotic.mesa-git = { - enable = true; - extraPackages = [ pkgs.mesa_git.opencl ]; - }; - }) - - (lib.mkIf (cfg.amd.enable && cfg.stability == "stable") { - boot.kernelPackages = pkgs.linuxPackages_latest; - }) - ]); -} diff --git a/sys/core/fonts.nix b/sys/core/fonts.nix deleted file mode 100644 index 1173439..0000000 --- a/sys/core/fonts.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.sys.core.fonts; -in -{ - options.sys.core.fonts.enable = lib.mkEnableOption "system-wide font and console configuration"; - - config = lib.mkIf cfg.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/sys/core/greet.nix b/sys/core/greet.nix deleted file mode 100644 index 95603e8..0000000 --- a/sys/core/greet.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.sys.core.greet; -in -{ - options.sys.core.greet.enable = lib.mkEnableOption "enables greetd daemon with tuigreet"; - config = lib.mkIf cfg.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/sys/core/home-manager.nix b/sys/core/home-manager.nix deleted file mode 100644 index 7bc4b18..0000000 --- a/sys/core/home-manager.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ inputs, config, lib, username, ... }: -let - cfg = config.sys.core.home-manager; -in -{ - imports = [ inputs.home-manager.nixosModules.home-manager ]; - - options.sys.core.home-manager = { - enable = lib.mkEnableOption "home Manager configuration"; - - 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 cfg.enable { - home-manager = { - extraSpecialArgs = { inherit inputs username; }; - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "bak"; - - users = lib.mapAttrs (name: userCfg: { - imports = [ userCfg.path ]; - }) cfg.users; - }; - }; -} diff --git a/sys/core/localization.nix b/sys/core/localization.nix deleted file mode 100644 index 4d45b75..0000000 --- a/sys/core/localization.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ config, lib, ... }: -let - cfg = config.sys.core.locale; -in -{ - options.sys.core.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 cfg.enable { - time.timeZone = cfg.timeZone; - - i18n = { - defaultLocale = "en_US.UTF-8"; - - extraLocaleSettings = { - LC_TIME = cfg.format; - LC_NUMERIC = cfg.format; - LC_MONETARY = cfg.format; - LC_PAPER = cfg.format; - LC_MEASUREMENT = cfg.format; - LC_COLLATE = cfg.format; - LC_NAME = cfg.format; - LC_ADDRESS = cfg.format; - LC_TELEPHONE = cfg.format; - LC_IDENTIFICATION = cfg.format; - }; - }; - }; -} diff --git a/sys/core/memory.nix b/sys/core/memory.nix deleted file mode 100644 index 956cc73..0000000 --- a/sys/core/memory.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ config, lib, ... }: -let - cfg = config.sys.core.memory; -in -{ - options.sys.core.memory = { - zram = { - enable = lib.mkEnableOption "enables zram compression"; - percent = lib.mkOption { - type = lib.types.int; - default = 25; - }; - }; - - swapfile = { - enable = lib.mkEnableOption "enables a swapfile"; - size = lib.mkOption { - type = lib.types.int; - default = 8; - }; - }; - }; - config = lib.mkMerge [ - (lib.mkIf cfg.zram.enable { - zramSwap = { - enable = true; - algorithm = "zstd"; - memoryPercent = cfg.zram.percent; - priority = 100; - }; - }) - - (lib.mkIf cfg.swapfile.enable { - swapDevices = [ { - device = "/.swapvol/swapfile"; - size = cfg.swapfile.size * 1024; - priority = 0; - } ]; - }) - ]; -} diff --git a/sys/core/networking.nix b/sys/core/networking.nix deleted file mode 100644 index 314feb7..0000000 --- a/sys/core/networking.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, lib, ... }: -let - cfg = config.sys.core.network; -in -{ - options.sys.core.network.enable = lib.mkEnableOption "system-wide networking setup"; - config = lib.mkIf cfg.enable { - networking = { - networkmanager = { - enable = true; - wifi.macAddress = "stable-ssid"; - ethernet.macAddress = "stable-ssid"; - }; - firewall = { - enable = true; - }; - }; - systemd.services."NetworkManager-wait-online".enable = false; - }; -} diff --git a/sys/core/power.nix b/sys/core/power.nix deleted file mode 100644 index f67665e..0000000 --- a/sys/core/power.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, lib, ... }: -let - cfg = config.sys.core.power; -in -{ - options.sys.core.power.enable = lib.mkEnableOption "enables AMD-optimized power management"; - config = lib.mkIf cfg.enable { - services.power-profiles-daemon.enable = true; - - boot.kernelParams = [ - "amd_pstate=active" - "nvme_core.default_ps_max_latency_us=0" - ]; - - powerManagement.powertop.enable = true; - services.thermald.enable = true; - }; -} diff --git a/sys/core/security.nix b/sys/core/security.nix deleted file mode 100644 index bf43577..0000000 --- a/sys/core/security.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.sys.core.security; -in -{ - options.sys.core.security.enable = lib.mkEnableOption "core security services"; - config = lib.mkIf cfg.enable { - services.gnome.gnome-keyring.enable = true; - - security = { - polkit.enable = true; - rtkit.enable = true; - }; - - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - pinentryPackage = pkgs.pinentry-curses; - }; - - 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; - }; - }; - - environment.systemPackages = with pkgs; [ - veracrypt - bitwarden-desktop - hello - ]; - }; -} diff --git a/sys/core/storage.nix b/sys/core/storage.nix deleted file mode 100644 index 693e5e7..0000000 --- a/sys/core/storage.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ config, lib, ... }: -let - cfg = config.sys.core.storage; -in -{ - options.sys.core.storage = { - enable = lib.mkEnableOption "enables storage management"; - - keepDays = lib.mkOption { - type = lib.types.int; - default = 14; - description = "Number of days to keep old Nix generations before GC"; - }; - }; - config = lib.mkIf cfg.enable { - nix.settings.auto-optimise-store = true; - - programs.nh = { - enable = true; - clean.enable = true; - clean.extraArgs = "--keep-days ${toString cfg.keepDays} --keep 5"; - }; - - services.fstrim.enable = true; - - services.btrfs.autoScrub = { - enable = true; - fileSystems = [ "/" ]; - }; - - boot.tmp = { - useTmpfs = true; - tmpfsSize = "50%"; - }; - }; -} diff --git a/sys/core/users.nix b/sys/core/users.nix deleted file mode 100644 index fb4e7f0..0000000 --- a/sys/core/users.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ config, lib, pkgs, username, ... }: -let - cfg = config.sys.core.users; -in -{ - options.sys.core.users.enable = lib.mkEnableOption "enables user accounts"; - config = lib.mkIf cfg.enable { - programs.fish.enable = true; - users.users.${username} = { - isNormalUser = true; - shell = pkgs.fish; - - extraGroups = lib.mkMerge [ - [ "wheel" ] - - (lib.mkIf (config.sys.core.drivers.amd.enable or false) [ "video" "render" ]) - (lib.mkIf (config.sys.core.network.enable or false) [ "networkmanager" ]) - (lib.mkIf (config.sys.srv.kvm.enable or false) [ "libvirtd" ]) - (lib.mkIf (config.sys.srv.docker.enable or false) [ "docker" ]) - ]; - }; - }; -} |
