From 7531426abe10ec0fdce6ade1109480b1bd9cec31 Mon Sep 17 00:00:00 2001 From: cnst Date: Sat, 6 Jul 2024 10:57:11 +0200 Subject: [PATCH] services update --- nixos/hosts/cnix/default.nix | 1 - nixos/services/cnix.nix | 46 ++++++------------------------------ nixos/services/greetd.nix | 16 +++++++++++++ nixos/services/mullvad.nix | 6 +++++ nixos/services/openssh.nix | 9 +++++++ nixos/services/xserver.nix | 17 +++++++++++++ 6 files changed, 55 insertions(+), 40 deletions(-) create mode 100644 nixos/services/greetd.nix create mode 100644 nixos/services/mullvad.nix create mode 100644 nixos/services/openssh.nix create mode 100644 nixos/services/xserver.nix diff --git a/nixos/hosts/cnix/default.nix b/nixos/hosts/cnix/default.nix index 8e719236..e32ebf05 100644 --- a/nixos/hosts/cnix/default.nix +++ b/nixos/hosts/cnix/default.nix @@ -36,7 +36,6 @@ in { ../../core ../../extra/cnix.nix ../../services/cnix.nix - ../../services/pipewire.nix ../../hardware/cnix.nix ../../locale/cnix.nix ./hardware-configuration.nix diff --git a/nixos/services/cnix.nix b/nixos/services/cnix.nix index 14662449..c59da6ad 100644 --- a/nixos/services/cnix.nix +++ b/nixos/services/cnix.nix @@ -1,4 +1,11 @@ {pkgs, ...}: { + imports = [ + ./pipewire.nix + ./greetd.nix + ./xserver.nix + ./openssh.nix + ./mullvad.nix + ]; services = { dbus.packages = with pkgs; [ gcr @@ -7,44 +14,5 @@ gvfs.enable = true; blueman.enable = true; gnome.gnome-keyring.enable = true; - mullvad-vpn = { - enable = true; - package = pkgs.mullvad-vpn; - }; - greetd = { - enable = true; - settings = { - # initial_session = { - # command = "${pkgs.hyprland}/bin/Hyprland"; - # user = "cnst"; - # }; - default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet -r --remember-session"; - user = "greeter"; - }; - }; - }; - openssh = { - enable = true; - settings = { - PermitRootLogin = "no"; - PasswordAuthentication = false; - }; - }; - xserver = { - enable = true; - videoDrivers = ["amdgpu"]; - xkb = { - extraLayouts.hhkbse = { - description = "HHKBse by cnst"; - languages = ["se"]; - symbolsFile = /home/cnst/.nix-config/nixos/hosts/cnix/xkb/symbols/hhkbse; - }; - layout = "hhkbse"; - # dir = "/home/cnst/.nix-config/nixos/xkb"; - variant = ""; - options = "lv3:rwin_switch"; - }; - }; }; } diff --git a/nixos/services/greetd.nix b/nixos/services/greetd.nix new file mode 100644 index 00000000..ea74553e --- /dev/null +++ b/nixos/services/greetd.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: { + services.greetd = { + enable = true; + settings = { + # AUTOLOGIN + # initial_session = { + # command = "${pkgs.hyprland}/bin/Hyprland"; + # user = "cnst"; + # }; + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet -r --remember-session"; + user = "greeter"; + }; + }; + }; +} diff --git a/nixos/services/mullvad.nix b/nixos/services/mullvad.nix new file mode 100644 index 00000000..31d3c05d --- /dev/null +++ b/nixos/services/mullvad.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + services.mullvad-vpn = { + enable = true; + package = pkgs.mullvad-vpn; + }; +} diff --git a/nixos/services/openssh.nix b/nixos/services/openssh.nix new file mode 100644 index 00000000..cc414dbe --- /dev/null +++ b/nixos/services/openssh.nix @@ -0,0 +1,9 @@ +{ + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; +} diff --git a/nixos/services/xserver.nix b/nixos/services/xserver.nix new file mode 100644 index 00000000..ab27b7d1 --- /dev/null +++ b/nixos/services/xserver.nix @@ -0,0 +1,17 @@ +{ + services.xserver = { + enable = true; + videoDrivers = ["amdgpu"]; + xkb = { + extraLayouts.hhkbse = { + description = "HHKBse by cnst"; + languages = ["se"]; + symbolsFile = /home/cnst/.nix-config/nixos/hosts/cnix/xkb/symbols/hhkbse; + }; + layout = "hhkbse"; + # dir = "/home/cnst/.nix-config/nixos/xkb"; + variant = ""; + options = "lv3:rwin_switch"; + }; + }; +}