diff options
| author | adikro <adikro@disroot.org> | 2025-12-24 16:21:00 +0100 |
|---|---|---|
| committer | adikro <adikro@disroot.org> | 2025-12-24 16:21:00 +0100 |
| commit | 6aaa5993e4c1cfb205ed555d958702f9bba1770d (patch) | |
| tree | 3af8cf20967cf10542edd2e51232b1da70002fde /os | |
| parent | 2ceabfd1d1dc03ca895e960048b73a82e29e45e8 (diff) | |
a bunch of changes, renames sys to os and refactored some of the logic
Diffstat (limited to 'os')
| -rw-r--r-- | os/core/audio.nix | 30 | ||||
| -rw-r--r-- | os/core/bootloader.nix | 42 | ||||
| -rw-r--r-- | os/core/core.nix | 46 | ||||
| -rw-r--r-- | os/core/drivers.nix | 47 | ||||
| -rw-r--r-- | os/core/fonts.nix | 22 | ||||
| -rw-r--r-- | os/core/greet.nix | 29 | ||||
| -rw-r--r-- | os/core/home-manager.nix | 36 | ||||
| -rw-r--r-- | os/core/localization.nix | 41 | ||||
| -rw-r--r-- | os/core/memory.nix | 41 | ||||
| -rw-r--r-- | os/core/networking.nix | 20 | ||||
| -rw-r--r-- | os/core/power.nix | 18 | ||||
| -rw-r--r-- | os/core/security.nix | 38 | ||||
| -rw-r--r-- | os/core/storage.nix | 36 | ||||
| -rw-r--r-- | os/core/users.nix | 24 | ||||
| -rw-r--r-- | os/default.nix | 8 | ||||
| -rw-r--r-- | os/srv/autoclicker.nix | 12 | ||||
| -rw-r--r-- | os/srv/compat.nix | 24 | ||||
| -rw-r--r-- | os/srv/docker.nix | 14 | ||||
| -rw-r--r-- | os/srv/files.nix | 46 | ||||
| -rw-r--r-- | os/srv/gaming.nix | 50 | ||||
| -rw-r--r-- | os/srv/kvm.nix | 18 | ||||
| -rw-r--r-- | os/srv/nix-helper.nix | 23 | ||||
| -rw-r--r-- | os/srv/ollama.nix | 28 | ||||
| -rw-r--r-- | os/srv/srv.nix | 13 | ||||
| -rw-r--r-- | os/wm/niri.nix | 21 | ||||
| -rw-r--r-- | os/wm/wm.nix | 20 |
26 files changed, 747 insertions, 0 deletions
diff --git a/os/core/audio.nix b/os/core/audio.nix new file mode 100644 index 0000000..4868c7d --- /dev/null +++ b/os/core/audio.nix @@ -0,0 +1,30 @@ +{ 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 + ]; + }; +} diff --git a/os/core/bootloader.nix b/os/core/bootloader.nix new file mode 100644 index 0000000..ff0aad5 --- /dev/null +++ b/os/core/bootloader.nix @@ -0,0 +1,42 @@ +{ 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/os/core/core.nix b/os/core/core.nix new file mode 100644 index 0000000..428d7ea --- /dev/null +++ b/os/core/core.nix @@ -0,0 +1,46 @@ +{ 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/os/core/drivers.nix b/os/core/drivers.nix new file mode 100644 index 0000000..c769786 --- /dev/null +++ b/os/core/drivers.nix @@ -0,0 +1,47 @@ +{ 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/os/core/fonts.nix b/os/core/fonts.nix new file mode 100644 index 0000000..1173439 --- /dev/null +++ b/os/core/fonts.nix @@ -0,0 +1,22 @@ +{ 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/os/core/greet.nix b/os/core/greet.nix new file mode 100644 index 0000000..95603e8 --- /dev/null +++ b/os/core/greet.nix @@ -0,0 +1,29 @@ +{ 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/os/core/home-manager.nix b/os/core/home-manager.nix new file mode 100644 index 0000000..7bc4b18 --- /dev/null +++ b/os/core/home-manager.nix @@ -0,0 +1,36 @@ +{ 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/os/core/localization.nix b/os/core/localization.nix new file mode 100644 index 0000000..4d45b75 --- /dev/null +++ b/os/core/localization.nix @@ -0,0 +1,41 @@ +{ 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/os/core/memory.nix b/os/core/memory.nix new file mode 100644 index 0000000..956cc73 --- /dev/null +++ b/os/core/memory.nix @@ -0,0 +1,41 @@ +{ 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/os/core/networking.nix b/os/core/networking.nix new file mode 100644 index 0000000..314feb7 --- /dev/null +++ b/os/core/networking.nix @@ -0,0 +1,20 @@ +{ 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/os/core/power.nix b/os/core/power.nix new file mode 100644 index 0000000..f67665e --- /dev/null +++ b/os/core/power.nix @@ -0,0 +1,18 @@ +{ 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/os/core/security.nix b/os/core/security.nix new file mode 100644 index 0000000..cfc8bf6 --- /dev/null +++ b/os/core/security.nix @@ -0,0 +1,38 @@ +{ 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 + ]; + }; +} diff --git a/os/core/storage.nix b/os/core/storage.nix new file mode 100644 index 0000000..693e5e7 --- /dev/null +++ b/os/core/storage.nix @@ -0,0 +1,36 @@ +{ 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/os/core/users.nix b/os/core/users.nix new file mode 100644 index 0000000..d0af69f --- /dev/null +++ b/os/core/users.nix @@ -0,0 +1,24 @@ +{ 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" ]) + (lib.mkIf (config.sys.srv.autoclicker.enable or false) [ "input" ]) + ]; + }; + }; +} diff --git a/os/default.nix b/os/default.nix new file mode 100644 index 0000000..225c08f --- /dev/null +++ b/os/default.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + imports = [ + ./core/core.nix + ./srv/srv.nix + ./wm/wm.nix + ]; +} diff --git a/os/srv/autoclicker.nix b/os/srv/autoclicker.nix new file mode 100644 index 0000000..84cba2e --- /dev/null +++ b/os/srv/autoclicker.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.sys.srv.autoclicker; +in +{ + options.sys.srv.autoclicker.enable = lib.mkEnableOption "enables wl-autoclicker"; + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + wl-autoclicker + ]; + }; +} diff --git a/os/srv/compat.nix b/os/srv/compat.nix new file mode 100644 index 0000000..ab9560f --- /dev/null +++ b/os/srv/compat.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.sys.srv.compat; +in +{ + options.sys.srv.compat.enable = lib.mkEnableOption "enables compatibility with windows & x11"; + config = lib.mkIf cfg.enable { + programs.xwayland = { + enable = true; + package = pkgs.xwayland-satellite; + }; + + environment.sessionVariables = { + NIXOS_OZONE_WL = "1"; + ELECTRON_ENABLE_WAYLAND = "1"; + WINE_RT_PRIO = "1"; + }; + + environment.systemPackages = with pkgs; [ + winetricks + wineWowPackages.waylandFull + ]; + }; +} diff --git a/os/srv/docker.nix b/os/srv/docker.nix new file mode 100644 index 0000000..0ed1541 --- /dev/null +++ b/os/srv/docker.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, username, ... }: +let + cfg = config.sys.srv.docker; +in +{ + options.sys.srv.docker.enable = lib.mkEnableOption "enables the docker container engine"; + config = lib.mkIf cfg.enable { + virtualisation.docker.enable = true; + + environment.systemPackages = [ pkgs.docker-compose ]; + + users.users.${username}.extraGroups = [ "docker" ]; + }; +} diff --git a/os/srv/files.nix b/os/srv/files.nix new file mode 100644 index 0000000..9b5759e --- /dev/null +++ b/os/srv/files.nix @@ -0,0 +1,46 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.sys.srv.files; +in +{ + options.sys.srv.files = { + thunar.enable = lib.mkEnableOption "enables the thunar file manager"; + utils.enable = lib.mkEnableOption "enables compression and trash utilities"; + }; + config = lib.mkMerge [ + { + sys.srv.files.utils.enable = lib.mkDefault cfg.thunar.enable; + } + + (lib.mkIf cfg.thunar.enable { + programs.thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-volman + thunar-archive-plugin + thunar-vcs-plugin + ]; + }; + services = { + tumbler.enable = true; + gnome.gnome-keyring.enable = true; + }; + environment.systemPackages = with pkgs; [ file-roller ]; + }) + + (lib.mkIf cfg.utils.enable { + services.gvfs.enable = true; + + environment.systemPackages = with pkgs; [ + trashy + gdu + + unzip + p7zip + unrar + pxz + pigz + ]; + }) + ]; +} diff --git a/os/srv/gaming.nix b/os/srv/gaming.nix new file mode 100644 index 0000000..ee7f608 --- /dev/null +++ b/os/srv/gaming.nix @@ -0,0 +1,50 @@ +{ config, lib, pkgs, username, ... }: +let + cfg = config.sys.srv.gaming; +in +{ + options.sys.srv.gaming = { + enable = lib.mkEnableOption "enables gaming utilities"; + steam.enable = lib.mkEnableOption "enables steam utilities"; + vr.enable = lib.mkEnableOption "enables vr support"; + }; + config = lib.mkMerge [ + (lib.mkIf cfg.enable { + programs.gamescope.enable = true; + + programs.gamemode = { + enable = true; + enableRenice = true; + }; + + environment.systemPackages = with pkgs; [ + heroic + prismlauncher + ]; + + home-manager.users.${username}.hm.soft.mangohud.enable = true; + }) + + (lib.mkIf cfg.steam.enable { + programs.steam = { + enable = true; + localNetworkGameTransfers.openFirewall = true; + dedicatedServer.openFirewall = true; + remotePlay.openFirewall = false; + extest.enable = true; + protontricks.enable = true; + + extraCompatPackages = with pkgs; [ + proton-ge-custom + ]; + }; + }) + + (lib.mkIf cfg.vr.enable { + programs.alvr = { + enable = true; + openFirewall = true; + }; + }) + ]; +} diff --git a/os/srv/kvm.nix b/os/srv/kvm.nix new file mode 100644 index 0000000..2cf8c26 --- /dev/null +++ b/os/srv/kvm.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.sys.srv.kvm; +in +{ + options.sys.srv.kvm.enable = lib.mkEnableOption "KVM/QEMU virtualization with Virt-Manager"; + config = lib.mkIf cfg.enable { + virtualisation.libvirtd = { + enable = true; + qemu.package = pkgs.qemu_kvm; + qemu.swtpm.enable = true; + }; + + programs.virt-manager.enable = true; + + boot.initrd.kernelModules = lib.optional (config.sys.core.drivers.amd.enable or false) "kvm-amd"; + }; +} diff --git a/os/srv/nix-helper.nix b/os/srv/nix-helper.nix new file mode 100644 index 0000000..6a64201 --- /dev/null +++ b/os/srv/nix-helper.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, username, ... }: +let + cfg = config.sys.srv.nix-helper; +in +{ + options.sys.srv.nix-helper.enable = lib.mkEnableOption "enables nix-helper"; + config = lib.mkIf cfg.enable { + nix.settings = { + trusted-users = [ "root" "${username}" ]; + experimental-features = [ "nix-command" "flakes" ]; + }; + + programs.nh = { + enable = true; + flake = "/etc/nixos"; + }; + + environment.systemPackages = with pkgs; [ + nix-output-monitor + nvd + ]; + }; +} diff --git a/os/srv/ollama.nix b/os/srv/ollama.nix new file mode 100644 index 0000000..11babd6 --- /dev/null +++ b/os/srv/ollama.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.sys.srv.ollama; +in +{ + options.sys.srv.ollama.enable = lib.mkEnableOption "Ollama AI service"; + config = lib.mkIf cfg.enable { + fileSystems."/models" = { + device = "/home/ollama"; + fsType = "none"; + options = [ "bind" ]; + }; + + services.ollama = { + enable = true; + package = pkgs.ollama-rocm; + + user = "ollama"; + models = "/models"; + + syncModels = true; + loadModels = [ + "deepseek-r1:14b" + "qwen3:14b" + ]; + }; + }; +} diff --git a/os/srv/srv.nix b/os/srv/srv.nix new file mode 100644 index 0000000..2da7d50 --- /dev/null +++ b/os/srv/srv.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = [ + ./autoclicker + ./compat.nix + ./docker.nix + ./files.nix + ./gaming.nix + ./kvm.nix + ./nix-helper.nix + ./ollama.nix + ]; +} diff --git a/os/wm/niri.nix b/os/wm/niri.nix new file mode 100644 index 0000000..c92b068 --- /dev/null +++ b/os/wm/niri.nix @@ -0,0 +1,21 @@ +{ inputs, config, lib, pkgs, username, ... }: +let + cfg = config.sys.wm.niri; +in +{ + imports = [ inputs.niri.nixosModules.niri ]; + + options.sys.wm.niri.enable = lib.mkEnableOption "Niri"; + + config = lib.mkIf cfg.enable { + nixpkgs.overlays = [ inputs.niri.overlays.niri ]; + + programs.niri = { + enable = true; + package = pkgs.niri-unstable; + }; + + sys.srv.compat.enable = true; + home-manager.users.${username}.hm.env.niri.enable = true; + }; +} diff --git a/os/wm/wm.nix b/os/wm/wm.nix new file mode 100644 index 0000000..5374264 --- /dev/null +++ b/os/wm/wm.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.sys.wm; +in +{ + imports = [ + ./niri.nix + ]; + + options.sys.wm.enable = lib.mkEnableOption "enables shared wm features"; + config = lib.mkIf cfg.enable { + services.dbus.enable = true; + + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + }; +} |
