about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/default.nix2
-rw-r--r--modules/programs/default.nix5
-rw-r--r--modules/programs/sway/default.nix25
-rw-r--r--modules/services/default.nix1
-rw-r--r--modules/services/gnome/default.nix27
-rw-r--r--modules/system/default.nix13
-rw-r--r--modules/system/fonts/default.nix29
-rw-r--r--modules/system/security/default.nix1
8 files changed, 100 insertions, 3 deletions
diff --git a/modules/default.nix b/modules/default.nix
index e593055..54aa833 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -1,7 +1,7 @@
 { lib, ... }:
 
 {
-  imports = [ ./hardware ./system ./services ./home ];
+  imports = [ ./hardware ./system ./services ./home ./programs ];
 
   options.my = with lib; {
     user = {
diff --git a/modules/programs/default.nix b/modules/programs/default.nix
new file mode 100644
index 0000000..2de6855
--- /dev/null
+++ b/modules/programs/default.nix
@@ -0,0 +1,5 @@
+{ ... }:
+
+{
+  imports = [ ./sway ];
+}
diff --git a/modules/programs/sway/default.nix b/modules/programs/sway/default.nix
new file mode 100644
index 0000000..1fb4c00
--- /dev/null
+++ b/modules/programs/sway/default.nix
@@ -0,0 +1,25 @@
+{ pkgs, config, lib, ... }:
+let cfg = config.my.programs.sway;
+in {
+  options.my.programs.sway = with lib; {
+    enable = mkEnableOption "sway configuration";
+  };
+
+  config = lib.mkIf cfg.enable {
+    programs.sway = {
+      enable = true;
+      wrapperFeatures.gtk = true;
+      extraPackages = with pkgs; [
+        brightnessctl
+        polkit_gnome
+        xsettingsd
+        swaylock
+        swayidle
+        wl-clipboard
+      ];
+      extraSessionCommands = ''
+        export MOZ_ENABLE_WAYLAND=1
+      '';
+    };
+  };
+}
diff --git a/modules/services/default.nix b/modules/services/default.nix
index 085e881..38b6a6b 100644
--- a/modules/services/default.nix
+++ b/modules/services/default.nix
@@ -4,6 +4,7 @@
   imports = [
     ./fwupd
     ./gitea
+    ./gnome
     ./grafana
     ./metrics-exporter
     ./navidrome
diff --git a/modules/services/gnome/default.nix b/modules/services/gnome/default.nix
new file mode 100644
index 0000000..448934f
--- /dev/null
+++ b/modules/services/gnome/default.nix
@@ -0,0 +1,27 @@
+{ config, pkgs, lib, ... }:
+let cfg = config.my.services.gnome;
+in {
+  options.my.services.gnome = with lib; { enable = mkEnableOption "gnome"; };
+
+  config = lib.mkIf cfg.enable {
+    services = {
+      dbus = {
+        enable = true;
+        packages = with pkgs; [ gcr gnome3.dconf gnome3.gnome-keyring ];
+      };
+
+      udev.packages = with pkgs; [ gnome3.gnome-settings-daemon ];
+
+      gvfs = {
+        enable = true;
+        package = pkgs.gnome.gvfs;
+      };
+
+      gnome = {
+        gnome-keyring.enable = true;
+        # !https://github.com/NixOS/nixpkgs/issues/16327
+        at-spi2-core.enable = true;
+      };
+    };
+  };
+}
diff --git a/modules/system/default.nix b/modules/system/default.nix
index 71a469c..32f560b 100644
--- a/modules/system/default.nix
+++ b/modules/system/default.nix
@@ -1,6 +1,15 @@
 { ... }:
 
 {
-  imports =
-    [ ./packages ./boot ./console ./locale ./nix ./users ./security ./btrfs ];
+  imports = [
+    ./packages
+    ./boot
+    ./console
+    ./locale
+    ./nix
+    ./users
+    ./security
+    ./btrfs
+    ./fonts
+  ];
 }
diff --git a/modules/system/fonts/default.nix b/modules/system/fonts/default.nix
new file mode 100644
index 0000000..df01140
--- /dev/null
+++ b/modules/system/fonts/default.nix
@@ -0,0 +1,29 @@
+{ pkgs, config, lib, ... }:
+let cfg = config.my.systems.fonts;
+in {
+  options.my.systems.fonts = with lib; {
+    enable = mkEnableOption "fonts configuration";
+  };
+
+  config = lib.mkIf cfg.enable {
+    fonts = {
+      enableDefaultFonts = true;
+      fontDir.enable = true;
+      fontconfig.enable = true;
+      fonts = with pkgs; [
+        dejavu_fonts
+        font-awesome_5
+        noto-fonts
+        noto-fonts-cjk # Chinese, Japanese, Korean
+        noto-fonts-emoji
+        noto-fonts-emoji
+        noto-fonts-extra
+        source-code-pro
+        source-sans-pro
+        source-serif-pro
+      ];
+
+      fontconfig.defaultFonts = { monospace = [ "Source Code Pro" ]; };
+    };
+  };
+}
diff --git a/modules/system/security/default.nix b/modules/system/security/default.nix
index 9550e8d..1181e6a 100644
--- a/modules/system/security/default.nix
+++ b/modules/system/security/default.nix
@@ -2,4 +2,5 @@
 
 {
   security.sudo.wheelNeedsPassword = false;
+  security.polkit.enable = true;
 }