From 054f3f9994a1e277cb748e73f580214df5632936 Mon Sep 17 00:00:00 2001 From: quirinecker Date: Tue, 1 Sep 2026 23:16:16 +0200 Subject: [PATCH] added a bunch of nixos modules --- flake.nix | 9 +++++--- modules/ai/ai.nix | 9 ++++++++ modules/ai/ollama.nix | 5 ++++ modules/ai/open_webui.nix | 6 +++++ modules/desktop/desktop.nix | 4 ++++ modules/desktop/gnome.nix | 6 +++++ modules/desktop/gnome_services.nix | 13 +++++++++++ modules/desktop/hyprland.nix | 2 ++ modules/desktop/noctalia-greeter.nix | 20 ++++++++++++++++ modules/desktop/wayland.nix | 28 +++++++++++++++++++++++ modules/desktop/xserver.nix | 16 +++++++++++++ modules/gaming/core.nix | 9 -------- modules/gaming/gaming.nix | 2 ++ modules/gaming/gpu_screenrecorder.nix | 10 ++++++++ modules/gaming/lutris.nix | 9 ++++++++ modules/gaming/xbox_controller.nix | 5 ++++ modules/misc/flake.nix | 8 +++++++ modules/misc/keyd.nix | 27 ++++++++++++++++++++++ modules/misc/misc.nix | 10 ++++++++ modules/misc/stateversion.nix | 8 +++++++ modules/networking/mullvad.nix | 6 +++++ modules/networking/networking.nix | 16 +++++++++++++ modules/programs/_nautilus.nix | 7 ++++++ modules/programs/flatpak.nix | 5 ++++ modules/programs/programs.nix | 21 +++++++++++------ modules/system/boot.nix | 7 ++++++ modules/system/locale.nix | 20 ++++++++++++++++ modules/system/stystem.nix | 8 +++++++ modules/virtualisation/docker.nix | 10 ++++++++ modules/virtualisation/virtmanager.nix | 7 ++++++ modules/virtualisation/virtualisation.nix | 8 +++++++ 31 files changed, 302 insertions(+), 19 deletions(-) create mode 100644 modules/ai/ai.nix create mode 100644 modules/ai/ollama.nix create mode 100644 modules/ai/open_webui.nix create mode 100644 modules/desktop/gnome.nix create mode 100644 modules/desktop/gnome_services.nix create mode 100644 modules/desktop/noctalia-greeter.nix create mode 100644 modules/desktop/wayland.nix create mode 100644 modules/desktop/xserver.nix delete mode 100644 modules/gaming/core.nix create mode 100644 modules/gaming/gpu_screenrecorder.nix create mode 100644 modules/gaming/lutris.nix create mode 100644 modules/gaming/xbox_controller.nix create mode 100644 modules/misc/flake.nix create mode 100644 modules/misc/keyd.nix create mode 100644 modules/misc/misc.nix create mode 100644 modules/misc/stateversion.nix create mode 100644 modules/networking/mullvad.nix create mode 100644 modules/networking/networking.nix create mode 100644 modules/programs/_nautilus.nix create mode 100644 modules/programs/flatpak.nix create mode 100644 modules/system/boot.nix create mode 100644 modules/system/locale.nix create mode 100644 modules/system/stystem.nix create mode 100644 modules/virtualisation/docker.nix create mode 100644 modules/virtualisation/virtmanager.nix create mode 100644 modules/virtualisation/virtualisation.nix diff --git a/flake.nix b/flake.nix index 2403950..68deb26 100644 --- a/flake.nix +++ b/flake.nix @@ -14,9 +14,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + noctalia-greeter = { + url = "github:noctalia-dev/noctalia-greeter"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; - outputs = inputs: inputs.flake-parts.lib.mkFlake - { inherit inputs; } - (inputs.import-tree ./modules); + outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); } diff --git a/modules/ai/ai.nix b/modules/ai/ai.nix new file mode 100644 index 0000000..1df0584 --- /dev/null +++ b/modules/ai/ai.nix @@ -0,0 +1,9 @@ +{ self, ... }: +{ + flake.modules.nixos.ai = { + imports = [ + self.modules.nixos.ollama + # self.modules.nixos.open-webui + ]; + }; +} diff --git a/modules/ai/ollama.nix b/modules/ai/ollama.nix new file mode 100644 index 0000000..1757f23 --- /dev/null +++ b/modules/ai/ollama.nix @@ -0,0 +1,5 @@ +{ ... }: { + flake.modules.nixos.ollama = { + services.ollama.enable = true; + }; +} diff --git a/modules/ai/open_webui.nix b/modules/ai/open_webui.nix new file mode 100644 index 0000000..034621c --- /dev/null +++ b/modules/ai/open_webui.nix @@ -0,0 +1,6 @@ +{ ... }: { + flake.modules.nixos.open-webui = { + services.open-webui.enable = true; + services.open-webui.port = 7070; + }; +} diff --git a/modules/desktop/desktop.nix b/modules/desktop/desktop.nix index c91be90..7b8488c 100644 --- a/modules/desktop/desktop.nix +++ b/modules/desktop/desktop.nix @@ -3,6 +3,10 @@ flake.modules.nixos.desktop = { ... }: { imports = [ self.modules.nixos.hyprland + self.modules.nixos.noctalia-greeter + self.modules.nixos.xserver + self.modules.nixos.gnome-services + self.modules.nixos.wayland ]; }; flake.modules.homeManager.desktop = { ... }: { diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix new file mode 100644 index 0000000..bd0e6b3 --- /dev/null +++ b/modules/desktop/gnome.nix @@ -0,0 +1,6 @@ +{ ... }: { + flake.modules.nixos.gnome = { + services.desktopManager.gnome.enable = false; + services.gnome.core-apps.enable = false; + }; +} diff --git a/modules/desktop/gnome_services.nix b/modules/desktop/gnome_services.nix new file mode 100644 index 0000000..c48e8ab --- /dev/null +++ b/modules/desktop/gnome_services.nix @@ -0,0 +1,13 @@ +{ ... }: { + flake.modules.nixos.gnome-services = {pkgs, ...}: { + + programs.dconf.enable = true; + services.gnome.gnome-keyring.enable = true; + services.gnome.gnome-online-accounts.enable = true; + services.gnome.evolution-data-server.enable = true; + + environment.variables = { + POOLKIT_AGENT = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + }; + }; +} diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index ef2adb3..6305d24 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -14,6 +14,8 @@ in flake.modules.homeManager.hyprland = { pkgs, config, ... }: { home.packages = [ pkgs.hyprpicker + pkgs.hypridle + pkgs.hyprshot ]; xdg.configFile = { diff --git a/modules/desktop/noctalia-greeter.nix b/modules/desktop/noctalia-greeter.nix new file mode 100644 index 0000000..a8f42ab --- /dev/null +++ b/modules/desktop/noctalia-greeter.nix @@ -0,0 +1,20 @@ +{ inputs, ... }: +{ + flake.modules.nixos.noctalia-greeter = { pkgs, ... }: { + imports = [ + inputs.noctalia-greeter.nixosModules.default + ]; + + programs.noctalia-greeter = { + enable = true; + greeter-args = ""; + settings = { + cursor = { + theme = "Bibata-Modern-Classic"; + size = 24; + path = "${pkgs.bibata-cursors}/share/icons"; + }; + }; + }; + }; +} diff --git a/modules/desktop/wayland.nix b/modules/desktop/wayland.nix new file mode 100644 index 0000000..448835b --- /dev/null +++ b/modules/desktop/wayland.nix @@ -0,0 +1,28 @@ +{ ... }: { + flake.modules.nixos.wayland = { + services.pulseaudio.enable = false; + security.rtkit.enable = true; + security.polkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + + + environment.variables = { + WLR_NO_HARDWARE_CURSORS = "1"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + GBM_BACKEND = "nvidia-drm"; + WLR_RENDERER_ALLOW_SOFTWARE = "1"; # In case there are issues rendering + }; + + }; +} diff --git a/modules/desktop/xserver.nix b/modules/desktop/xserver.nix new file mode 100644 index 0000000..666491f --- /dev/null +++ b/modules/desktop/xserver.nix @@ -0,0 +1,16 @@ +{ ... }: { + flake.modules.nixos.xserver = { pkgs, ... }: { + + services.xserver.enable = true; + + services.xserver.excludePackages = with pkgs; [ + xterm + ]; + + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + }; +} diff --git a/modules/gaming/core.nix b/modules/gaming/core.nix deleted file mode 100644 index ce1ccfc..0000000 --- a/modules/gaming/core.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - ... -}: -{ - flake.modules.nixos.core = { pkgs, ... }: { - programs.steam.enable = true; - hardware. - }; -} diff --git a/modules/gaming/gaming.nix b/modules/gaming/gaming.nix index 96c9f49..d064b6f 100644 --- a/modules/gaming/gaming.nix +++ b/modules/gaming/gaming.nix @@ -4,6 +4,8 @@ imports = [ self.modules.nixos.cemu self.modules.nixos.steam + self.modules.nixos.xbox-controller + self.modules.nixos.gpu-screenrecorder ]; }; } diff --git a/modules/gaming/gpu_screenrecorder.nix b/modules/gaming/gpu_screenrecorder.nix new file mode 100644 index 0000000..5d5a07d --- /dev/null +++ b/modules/gaming/gpu_screenrecorder.nix @@ -0,0 +1,10 @@ +{ ... }: { + flake.modules.nixos.gpu-screenrecorder = { pkgs, ... }: { + programs.gpu-screen-recorder.enable = true; + environment.systemPackages = with pkgs; [ + gpu-screen-recorder + killall + libnotify + ]; + }; +} diff --git a/modules/gaming/lutris.nix b/modules/gaming/lutris.nix new file mode 100644 index 0000000..cd26023 --- /dev/null +++ b/modules/gaming/lutris.nix @@ -0,0 +1,9 @@ +{ ... }: { + + flake.modules.nixos.lutris = { pkgs, ... }: { + environment.systemPackages = with pkgs; [ + lutris + ]; + }; + +} diff --git a/modules/gaming/xbox_controller.nix b/modules/gaming/xbox_controller.nix new file mode 100644 index 0000000..20ed05c --- /dev/null +++ b/modules/gaming/xbox_controller.nix @@ -0,0 +1,5 @@ +{ ... }: { + flake.modules.nixos.xbox-controller = { + hardware.xone.enable = true; + }; +} diff --git a/modules/misc/flake.nix b/modules/misc/flake.nix new file mode 100644 index 0000000..524aaec --- /dev/null +++ b/modules/misc/flake.nix @@ -0,0 +1,8 @@ +{ ... }: { + flake.modules.nixos.flake = { + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + }; +} diff --git a/modules/misc/keyd.nix b/modules/misc/keyd.nix new file mode 100644 index 0000000..3381839 --- /dev/null +++ b/modules/misc/keyd.nix @@ -0,0 +1,27 @@ +{ ... }: { + flake.modules.nixos.keyd = { + services.keyd = { + enable = true; + keyboards = { + default = { + ids = [ "*" ]; + settings = { + main = { + capslock = "esc"; + }; + alt = { + u = "G-u"; + a = "G-a"; + o = "G-o"; + s = "G-s"; + U = "G-U"; + A = "G-A"; + O = "G-O"; + S = "G-S"; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/misc/misc.nix b/modules/misc/misc.nix new file mode 100644 index 0000000..0bf4a7c --- /dev/null +++ b/modules/misc/misc.nix @@ -0,0 +1,10 @@ +{ self, ... }: +{ + flake.modules.nixos.misc = { ... }: { + imports = [ + self.modules.nixos.flake + self.modules.nixos.keyd + self.modules.nixos.stateversion + ]; + }; +} diff --git a/modules/misc/stateversion.nix b/modules/misc/stateversion.nix new file mode 100644 index 0000000..842f20f --- /dev/null +++ b/modules/misc/stateversion.nix @@ -0,0 +1,8 @@ +{ ... }: { + flake.modules.nixos.stateversion = { + system.stateVersion = "24.05"; + }; + flake.modules.homeManager.stateversion = { + home.stateVersion = "26.05"; + }; +} diff --git a/modules/networking/mullvad.nix b/modules/networking/mullvad.nix new file mode 100644 index 0000000..c8dcd70 --- /dev/null +++ b/modules/networking/mullvad.nix @@ -0,0 +1,6 @@ +{ ... }: { + flake.modules.nixos.mullvad = { + services.mullvad-vpn.enable = true; + services.mullvad-vpn.gui.enable = true; + }; +} diff --git a/modules/networking/networking.nix b/modules/networking/networking.nix new file mode 100644 index 0000000..323645a --- /dev/null +++ b/modules/networking/networking.nix @@ -0,0 +1,16 @@ +{ self, ... }: +{ + flake.modules.nixos.networking = { pkgs, ... }: { + + imports = [ + self.modules.nixos.mullvad + ]; + + networking.networkmanager.enable = true; + + environment.variables = { + PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; + }; + + }; +} diff --git a/modules/programs/_nautilus.nix b/modules/programs/_nautilus.nix new file mode 100644 index 0000000..179ca63 --- /dev/null +++ b/modules/programs/_nautilus.nix @@ -0,0 +1,7 @@ +{ } +# These are just remnants of something that does not work anymore. Need to fix it when i fid the chance +# +# nautilus-open-any-terminal +# nautilus-python +# turtle +# sushi diff --git a/modules/programs/flatpak.nix b/modules/programs/flatpak.nix new file mode 100644 index 0000000..1b13934 --- /dev/null +++ b/modules/programs/flatpak.nix @@ -0,0 +1,5 @@ +{ ... }: { + flake.modules.nixos.flatpak = { + services.flatpak.enable = true; + }; +} diff --git a/modules/programs/programs.nix b/modules/programs/programs.nix index f3c1e24..ffcce20 100644 --- a/modules/programs/programs.nix +++ b/modules/programs/programs.nix @@ -1,13 +1,13 @@ { self, inputs, ... }: let tools = pkgs: [ - pkgs.playerctl - pkgs.imagemagick - pkgs.meld - pkgs.wl-clipboard - pkgs.steam-run - pkgs.sops - pkgs.pavucontrol + pkgs.playerctl + pkgs.imagemagick + pkgs.meld + pkgs.wl-clipboard + pkgs.steam-run + pkgs.sops + pkgs.pavucontrol ]; social = pkgs: [ @@ -23,15 +23,22 @@ let pkgs.gnome-system-monitor pkgs.nautilus pkgs.baobab + pkgs.gnome-disk-utility ]; others = pkgs: [ pkgs.libreoffice-qt pkgs.nextcloud-client pkgs.vlc + pkgs.home-manager ]; in { + flake.modules.nixos.programs = { ... }: { + imports = [ + self.modules.nixos.flatpak + ]; + }; flake.modules.homeManager.programs = { pkgs, config, ... }: { imports = [ self.modules.homeManager.obsidian diff --git a/modules/system/boot.nix b/modules/system/boot.nix new file mode 100644 index 0000000..677bf77 --- /dev/null +++ b/modules/system/boot.nix @@ -0,0 +1,7 @@ +{ ... }: { + flake.modules.nixos.boot = { + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.kernelModules = [ "kvm-amd" ]; + }; +} diff --git a/modules/system/locale.nix b/modules/system/locale.nix new file mode 100644 index 0000000..710367b --- /dev/null +++ b/modules/system/locale.nix @@ -0,0 +1,20 @@ +{ ... }: { + flake.modules.nixos.locale = { + time.timeZone = "Europe/Vienna"; + + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_AT.UTF-8"; + LC_IDENTIFICATION = "de_AT.UTF-8"; + LC_MEASUREMENT = "de_AT.UTF-8"; + LC_MONETARY = "de_AT.UTF-8"; + LC_NAME = "de_AT.UTF-8"; + LC_NUMERIC = "de_AT.UTF-8"; + LC_PAPER = "de_AT.UTF-8"; + LC_TELEPHONE = "de_AT.UTF-8"; + LC_TIME = "de_AT.UTF-8"; + }; + + }; +} diff --git a/modules/system/stystem.nix b/modules/system/stystem.nix new file mode 100644 index 0000000..65eb3da --- /dev/null +++ b/modules/system/stystem.nix @@ -0,0 +1,8 @@ +{ self, ... }: { + flake.modules.nixos.system = { + imports = [ + self.modules.nixos.boot + self.modules.nixos.locale + ]; + }; +} diff --git a/modules/virtualisation/docker.nix b/modules/virtualisation/docker.nix new file mode 100644 index 0000000..9906268 --- /dev/null +++ b/modules/virtualisation/docker.nix @@ -0,0 +1,10 @@ +{ ... }: { + flake.modules.nixos.docker = { pkgs, ... }: { + virtualisation.docker.enable = true; + virtualisation.docker.rootless.setSocketVariable = true; + virtualisation.docker.rootless.enable = true; + environment.systemPackages = with pkgs; [ + docker-compose + ]; + }; +} diff --git a/modules/virtualisation/virtmanager.nix b/modules/virtualisation/virtmanager.nix new file mode 100644 index 0000000..bb3ae89 --- /dev/null +++ b/modules/virtualisation/virtmanager.nix @@ -0,0 +1,7 @@ +{ ... }: { + flake.modules.nixos.virtmanager = { + programs.virt-manager.enable = true; + virtualisation.spiceUSBRedirection.enable = true; + virtualisation.libvirtd.enable = true; + }; +} diff --git a/modules/virtualisation/virtualisation.nix b/modules/virtualisation/virtualisation.nix new file mode 100644 index 0000000..97b3c6a --- /dev/null +++ b/modules/virtualisation/virtualisation.nix @@ -0,0 +1,8 @@ +{ self, ... }: { + flake.modules.nixos.virtualisation = { + imports = [ + self.modules.nixos.docker + self.modules.nixos.virtmanager + ]; + }; +}