瀏覽代碼

Refactor host specific hyprland & shell stuff

Johan Rong 1 月之前
父節點
當前提交
3d545528ae
共有 31 個文件被更改,包括 420 次插入 和 98 次删除
  1. 6 0
      config/hosts.nix
  2. 116 0
      flake.lock
  3. 8 10
      home/modules/desktop/hyprland/default.nix
  4. 2 3
      home/modules/desktop/hyprland/lua/hyprland.lua
  5. 0 0
      home/modules/desktop/hyprland/lua/modules/autostart.lua
  6. 0 0
      home/modules/desktop/hyprland/lua/modules/environment.lua
  7. 1 4
      home/modules/desktop/hyprland/lua/modules/input.lua
  8. 0 0
      home/modules/desktop/hyprland/lua/modules/keybindings.lua
  9. 0 0
      home/modules/desktop/hyprland/lua/modules/look_and_feel.lua
  10. 0 0
      home/modules/desktop/hyprland/lua/modules/misc.lua
  11. 0 0
      home/modules/desktop/hyprland/lua/modules/windows_and_workspaces.lua
  12. 110 0
      home/modules/desktop/hyprland/modules/config-builder.nix
  13. 18 0
      home/modules/shells/dms-shell/wm/hyprland/default.nix
  14. 1 1
      hosts/ideapad/home/default.nix
  15. 16 0
      hosts/ideapad/home/hyprland.nix
  16. 0 3
      hosts/ideapad/home/modules/desktop/hyprland/hypr/modules/monitors.lua
  17. 0 16
      hosts/ideapad/home/modules/desktop/hyprland/hypr/modules/shell.lua
  18. 1 1
      hosts/ideapad/nixos/default.nix
  19. 2 2
      hosts/nixstation/home/default.nix
  20. 24 0
      hosts/nixstation/home/hyprland.nix
  21. 0 20
      hosts/nixstation/home/modules/desktop/hyprland/hypr/modules/monitors.lua
  22. 0 16
      hosts/nixstation/home/modules/desktop/hyprland/hypr/modules/shell.lua
  23. 13 0
      hosts/ono/home/default.nix
  24. 16 0
      hosts/ono/home/hyprland.nix
  25. 6 0
      hosts/ono/iso.nix
  26. 32 0
      hosts/ono/nixos/default.nix
  27. 0 14
      nixos/modules/hardware/biometric/elan-fingerprint.nix
  28. 15 0
      nixos/modules/hardware/biometric/fingerprint/default.nix
  29. 10 0
      nixos/modules/hardware/biometric/fingerprint/elan.nix
  30. 1 0
      nixos/modules/system/nixos-base.nix
  31. 22 8
      nixos/profiles/workstation/default.nix

+ 6 - 0
config/hosts.nix

@@ -20,4 +20,10 @@ in
     arch = "x86_64-linux";
     user = users.server; 
   };
+  ono = {
+    hostname = "ono";
+    dir = "ono";
+    arch = "x86_64-linux";
+    user = users.server; 
+  };
 }

+ 116 - 0
flake.lock

@@ -92,6 +92,46 @@
         "type": "github"
       }
     },
+    "flake-parts": {
+      "inputs": {
+        "nixpkgs-lib": "nixpkgs-lib"
+      },
+      "locked": {
+        "lastModified": 1782949081,
+        "narHash": "sha256-vp6Y/Grm98ESt6ceOkWiHWyZRDV3J1RID4w+6NWK9yA=",
+        "owner": "hercules-ci",
+        "repo": "flake-parts",
+        "rev": "17c9d6cdfc60c64f4ee8d306f9bc0b4ccb51481e",
+        "type": "github"
+      },
+      "original": {
+        "owner": "hercules-ci",
+        "repo": "flake-parts",
+        "type": "github"
+      }
+    },
+    "flake-utils": {
+      "inputs": {
+        "systems": [
+          "mangowm",
+          "scenefx",
+          "systems"
+        ]
+      },
+      "locked": {
+        "lastModified": 1731533236,
+        "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
     "home-manager": {
       "inputs": {
         "nixpkgs": [
@@ -113,6 +153,28 @@
         "type": "github"
       }
     },
+    "mangowm": {
+      "inputs": {
+        "flake-parts": "flake-parts",
+        "nixpkgs": [
+          "nixpkgs"
+        ],
+        "scenefx": "scenefx"
+      },
+      "locked": {
+        "lastModified": 1789649711,
+        "narHash": "sha256-22UfPBrkTn+6Dr4VETMWcGy7B8taQMeivV3CV3KrbcU=",
+        "owner": "mangowm",
+        "repo": "mango",
+        "rev": "9d225a968a2e80c44fb2e5bc14d262b1ddb39967",
+        "type": "github"
+      },
+      "original": {
+        "owner": "mangowm",
+        "repo": "mango",
+        "type": "github"
+      }
+    },
     "nix-flatpak": {
       "locked": {
         "lastModified": 1767983141,
@@ -145,14 +207,68 @@
         "type": "github"
       }
     },
+    "nixpkgs-lib": {
+      "locked": {
+        "lastModified": 1782614948,
+        "narHash": "sha256-ePjCwr1sNm9NYUqywL7QfK3JnlS015msC+eBu2zKlp8=",
+        "owner": "nix-community",
+        "repo": "nixpkgs.lib",
+        "rev": "db3f255737b94216eb71cce308e2912cf6bc2d7c",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-community",
+        "repo": "nixpkgs.lib",
+        "type": "github"
+      }
+    },
     "root": {
       "inputs": {
         "dank-greeter": "dank-greeter",
         "dms": "dms",
         "home-manager": "home-manager",
+        "mangowm": "mangowm",
         "nix-flatpak": "nix-flatpak",
         "nixpkgs": "nixpkgs"
       }
+    },
+    "scenefx": {
+      "inputs": {
+        "flake-utils": "flake-utils",
+        "nixpkgs": [
+          "mangowm",
+          "nixpkgs"
+        ],
+        "systems": "systems"
+      },
+      "locked": {
+        "lastModified": 1782624992,
+        "narHash": "sha256-vUjLG6eubEhJJVa9LPygIcVmNoHwYbSUTJcWEcbxnU4=",
+        "owner": "wlrfx",
+        "repo": "scenefx",
+        "rev": "37ccd723bef49e6891156ffafce8f549f01446cc",
+        "type": "github"
+      },
+      "original": {
+        "owner": "wlrfx",
+        "repo": "scenefx",
+        "type": "github"
+      }
+    },
+    "systems": {
+      "locked": {
+        "lastModified": 1689347949,
+        "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
+        "owner": "nix-systems",
+        "repo": "default-linux",
+        "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-systems",
+        "repo": "default-linux",
+        "type": "github"
+      }
     }
   },
   "root": "root",

+ 8 - 10
home/modules/desktop/hyprland/default.nix

@@ -5,16 +5,14 @@ let
 in 
 {
   config = {
-    home.file.".config/hypr/hyprland.lua".source = ./hypr/hyprland.lua;
-    home.file.".config/hypr/modules/autostart.lua".source = ./hypr/modules/autostart.lua; 
-    home.file.".config/hypr/modules/environment.lua".source = ./hypr/modules/environment.lua; 
-    home.file.".config/hypr/modules/look_and_feel.lua".source = ./hypr/modules/look_and_feel.lua; 
-    home.file.".config/hypr/modules/misc.lua".source = ./hypr/modules/misc.lua; 
-    home.file.".config/hypr/modules/input.lua".source = ./hypr/modules/input.lua; 
-    home.file.".config/hypr/modules/keybindings.lua".source = ./hypr/modules/keybindings.lua; 
-    home.file.".config/hypr/modules/windows_and_workspaces.lua".source = ./hypr/modules/windows_and_workspaces.lua; 
-    home.file.".config/hypr/modules/monitors.lua".source = (./. + "/../../../../hosts/${hostname}/home/modules/desktop/hyprland/hypr/modules/monitors.lua");
-    home.file.".config/hypr/modules/shell.lua".source = (./. + "/../../../../hosts/${hostname}/home/modules/desktop/hyprland/hypr/modules/shell.lua");
+    home.file.".config/hypr/hyprland.lua".source = ./lua/hyprland.lua;
+    home.file.".config/hypr/modules/autostart.lua".source = ./lua/modules/autostart.lua; 
+    home.file.".config/hypr/modules/environment.lua".source = ./lua/modules/environment.lua; 
+    home.file.".config/hypr/modules/look_and_feel.lua".source = ./lua/modules/look_and_feel.lua; 
+    home.file.".config/hypr/modules/misc.lua".source = ./lua/modules/misc.lua; 
+    home.file.".config/hypr/modules/input.lua".source = ./lua/modules/input.lua; 
+    home.file.".config/hypr/modules/keybindings.lua".source = ./lua/modules/keybindings.lua; 
+    home.file.".config/hypr/modules/windows_and_workspaces.lua".source = ./lua/modules/windows_and_workspaces.lua; 
 
     xdg = {
       userDirs = {

+ 2 - 3
home/modules/desktop/hyprland/hypr/hyprland.lua → home/modules/desktop/hyprland/lua/hyprland.lua

@@ -1,5 +1,6 @@
 require("modules.autostart")
-require("modules.shell")
+
+pcall(require, "host_specific")
 
 require("modules.environment")
 require("modules.look_and_feel")
@@ -7,5 +8,3 @@ require("modules.misc")
 require("modules.input")
 require("modules.keybindings")
 require("modules.windows_and_workspaces")
-
-require("modules.monitors")

+ 0 - 0
home/modules/desktop/hyprland/hypr/modules/autostart.lua → home/modules/desktop/hyprland/lua/modules/autostart.lua


+ 0 - 0
home/modules/desktop/hyprland/hypr/modules/environment.lua → home/modules/desktop/hyprland/lua/modules/environment.lua


+ 1 - 4
home/modules/desktop/hyprland/hypr/modules/input.lua → home/modules/desktop/hyprland/lua/modules/input.lua

@@ -5,11 +5,8 @@ hl.config({
         kb_model   = "",
         kb_options = "compose:rctrl",
         kb_rules   = "",
-
         follow_mouse = 1,
-
-        sensitivity = 0, -- -1.0 - 1.0, 0 means no modification.
-
+        sensitivity = 0,
         touchpad = {
             natural_scroll = false,
             clickfinger_behavior = true,

+ 0 - 0
home/modules/desktop/hyprland/hypr/modules/keybindings.lua → home/modules/desktop/hyprland/lua/modules/keybindings.lua


+ 0 - 0
home/modules/desktop/hyprland/hypr/modules/look_and_feel.lua → home/modules/desktop/hyprland/lua/modules/look_and_feel.lua


+ 0 - 0
home/modules/desktop/hyprland/hypr/modules/misc.lua → home/modules/desktop/hyprland/lua/modules/misc.lua


+ 0 - 0
home/modules/desktop/hyprland/hypr/modules/windows_and_workspaces.lua → home/modules/desktop/hyprland/lua/modules/windows_and_workspaces.lua


+ 110 - 0
home/modules/desktop/hyprland/modules/config-builder.nix

@@ -0,0 +1,110 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.programs.hyprlandLua;
+
+  mkMonitorLua = m: 
+    let 
+      mirrorStr = if (m ? mirror && m.mirror != null) then ", mirror = \"${m.mirror}\"" else "";
+    in
+      ''hl.monitor({ output = "${m.output}", mode = "${m.mode}", position = "${m.position}", scale = ${toString m.scale}${mirrorStr} })'';
+
+  mkBindLua = b:
+    ''hl.bind("${b.key}", ${b.action})'';
+
+  mkWorkspaceRules = rules: concatMapStringsSep "\n" (r: ''
+    for i = ${toString r.startIdx}, ${toString r.endIdx} do
+        hl.workspace_rule({ workspace = ${r.formula}, monitor = "${r.monitor}", default = ${boolToString r.default} })
+    end
+  '') rules;
+
+  generatedLua = ''
+    -- Auto-generated by Nix
+    ${optionalString (cfg.shellCommand != "") ''
+      hl.on("hyprland.start", function ()
+          hl.exec_cmd("${cfg.shellCommand}")
+      end)
+    ''}
+
+    mainMod = "${cfg.mainMod}"
+    secMod = "${cfg.secMod}"
+
+    ${concatMapStringsSep "\n" mkBindLua cfg.bindings}
+
+    -- Monitors Configuration
+    ${concatMapStringsSep "\n" mkMonitorLua cfg.monitors}
+
+    -- Workspace Rules
+    ${mkWorkspaceRules cfg.workspaceRules}
+
+    ${optionalString (cfg.defaultCursorMonitor != "") ''
+      hl.config({
+          cursor = {
+              default_monitor = "${cfg.defaultCursorMonitor}"
+          }
+      })
+    ''}
+
+    ${cfg.extraLua}
+  '';
+
+in {
+  options.programs.hyprlandLua = {
+    enable = mkEnableOption "Nix-generated Hyprland Lua configuration";
+
+    shellCommand = mkOption {
+      type = types.str;
+      default = "";
+      example = "dms run";
+      description = "Command executed on hyprland start (e.g. dms-shell, waybar, etc.)";
+    };
+
+    mainMod = mkOption { type = types.str; default = "ALT"; };
+    secMod = mkOption { type = types.str; default = "SUPER"; };
+
+    bindings = mkOption {
+      type = types.listOf (types.submodule {
+        options = {
+          key = mkOption { type = types.str; };
+          action = mkOption { type = types.str; example = ''hl.dsp.exec_cmd("dms screenshot")''; };
+        };
+      });
+      default = [];
+    };
+
+    monitors = mkOption {
+      type = types.listOf (types.submodule {
+        options = {
+          output = mkOption { type = types.str; default = ""; };
+          mode = mkOption { type = types.str; default = "preferred"; };
+          position = mkOption { type = types.str; default = "auto"; };
+          scale = mkOption { type = types.int; default = 1; };
+          mirror = mkOption { type = types.nullOr types.str; default = null; };
+        };
+      });
+      default = [];
+    };
+
+    workspaceRules = mkOption {
+      type = types.listOf (types.submodule {
+        options = {
+          startIdx = mkOption { type = types.int; };
+          endIdx = mkOption { type = types.int; };
+          formula = mkOption { type = types.str; example = "i % 10"; };
+          monitor = mkOption { type = types.str; };
+          default = mkOption { type = types.bool; default = true; };
+        };
+      });
+      default = [];
+    };
+
+    defaultCursorMonitor = mkOption { type = types.str; default = ""; };
+    extraLua = mkOption { type = types.lines; default = ""; };
+  };
+
+  config = mkIf cfg.enable {
+    xdg.configFile."hypr/host_specific.lua".text = generatedLua;
+  };
+}

+ 18 - 0
home/modules/shells/dms-shell/wm/hyprland/default.nix

@@ -0,0 +1,18 @@
+{ config, pkgs, ... }: {
+  imports = [ ../../../../../../home/modules/desktop/hyprland/modules/config-builder.nix ];
+
+  programs.hyprlandLua = {
+    shellCommand = "dms-run";
+
+    bindings = [
+      { key = "ALT + D"; action = ''hl.dsp.exec_cmd("dms ipc spotlight toggle")''; }
+      { key = "SUPER + V"; action = ''hl.dsp.exec_cmd("dms ipc clipboard open")''; }
+      { key = "ALT + SHIFT + E"; action = ''hl.dsp.exec_cmd("dms ipc powermenu open")''; }
+      { key = "CONTROL + ALT + DELETE"; action = ''hl.dsp.exec_cmd("dms ipc powermenu open")''; }
+      { key = "SUPER + L"; action = ''hl.dsp.exec_cmd("dms ipc lock lock")''; }
+      { key = "SUPER + SHIFT + S"; action = ''hl.dsp.exec_cmd("dms screenshot")''; }
+      { key = "CONTROL + SHIFT + ESCAPE"; action = ''hl.dsp.exec_cmd("dms ipc call processlist open")''; }
+      { key = "SUPER + CONTROL + SHIFT + C"; action = ''hl.dsp.exec_cmd("dms ipc color-picker toggle")''; }
+    ];
+  };
+}

+ 1 - 1
hosts/ideapad/home/default.nix

@@ -6,7 +6,7 @@
 
     #../../../home/modules/desktop/mango
     ../../../home/modules/desktop/hyprland
-    ../../../home/modules/shells/dms-shell
+    ./hyprland.nix
 
     ../../../home/modules/configs/alacritty.nix
     ../../../home/modules/configs/fish

+ 16 - 0
hosts/ideapad/home/hyprland.nix

@@ -0,0 +1,16 @@
+{ config, pkgs, ... }: {
+  imports = [
+    ../../../home/modules/desktop/hyprland/modules/config-builder.nix
+    ../../../home/modules/shells/dms-shell
+    ../../../home/modules/shells/dms-shell/wm/hyprland
+  ];
+
+  programs.hyprlandLua = {
+    enable = true;
+
+    monitors = [
+      { output = "eDP-1"; mode = "preferred"; position = "auto"; scale = 1; }
+      { output = ""; mode = "preferred"; position = "auto"; scale = 1; mirror = "eDP-1"; }
+    ];
+  };
+}

+ 0 - 3
hosts/ideapad/home/modules/desktop/hyprland/hypr/modules/monitors.lua

@@ -1,3 +0,0 @@
-hl.monitor({ output = "HDMI-A-1", mode = "preferred", position = "auto", scale = 1 })
-hl.monitor({ output = "eDP-1", mode = "preferred", position = "auto", scale = 1 })
-hl.monitor({ output = "", mode = "preferred", position = "auto", scale = 1, mirror = "eDP-1" })

+ 0 - 16
hosts/ideapad/home/modules/desktop/hyprland/hypr/modules/shell.lua

@@ -1,16 +0,0 @@
-hl.on("hyprland.start", function ()
-    hl.exec_cmd("dms run")
-end)
-
-mainMod = "ALT"
-secMod = "SUPER"
-
-hl.bind(mainMod .. " + D", hl.dsp.exec_cmd("dms ipc spotlight toggle"))
-hl.bind(secMod .. " + V", hl.dsp.exec_cmd("dms ipc clipboard open"))
-hl.bind(mainMod .. " + SHIFT + E", hl.dsp.exec_cmd("dms ipc powermenu open"))
-hl.bind("CONTROL + ALT + DELETE", hl.dsp.exec_cmd("dms ipc powermenu open"))
-hl.bind(secMod .. " + L", hl.dsp.exec_cmd("dms ipc lock lock"))
-hl.bind(secMod .. " + SHIFT + S", hl.dsp.exec_cmd("dms screenshot"))
-
-hl.bind("CONTROL + SHIFT + ESCAPE", hl.dsp.exec_cmd("dms ipc call processlist open"))
-hl.bind(secMod .. " + CONTROL + SHIFT + C", hl.dsp.exec_cmd("dms ipc color-picker toggle"))

+ 1 - 1
hosts/ideapad/nixos/default.nix

@@ -18,7 +18,7 @@ in
     ../../../nixos/modules/hardware/networking
     ../../../nixos/modules/hardware/sound
     ../../../nixos/modules/hardware/bluetooth
-    ../../../nixos/modules/hardware/biometric/elan-fingerprint.nix
+    ../../../nixos/modules/hardware/biometric/fingerprint/elan.nix
 
     #../../../nixos/modules/desktop/mango
     #../../../nixos/modules/greeter/tuigreet/mango.nix

+ 2 - 2
hosts/nixstation/home/default.nix

@@ -4,8 +4,8 @@
   imports = [
     ../../../home/modules/system/home-base.nix
 
-    #../../../home/modules/desktop/hyprland
-    #../../../home/modules/shells/dms-shell
+    ../../../home/modules/desktop/hyprland
+    ./hyprland.nix
 
     ../../../home/modules/configs/alacritty.nix
     ../../../home/modules/configs/fish

+ 24 - 0
hosts/nixstation/home/hyprland.nix

@@ -0,0 +1,24 @@
+{ config, pkgs, ... }: {
+  imports = [
+    ../../../home/modules/desktop/hyprland/modules/config-builder.nix
+    ../../../home/modules/shells/dms-shell
+    ../../../home/modules/shells/dms-shell/wm/hyprland
+  ];
+
+  programs.hyprlandLua = {
+    enable = true;
+
+    monitors = [
+      { output = "DP-1"; mode = "1920x1080@143.98"; position = "0x0"; scale = 1; }
+      { output = "HDMI-A-1"; mode = "1920x1080@143.98"; position = "1920x0"; scale = 1; }
+      { output = ""; mode = "preferred"; position = "auto"; scale = 1; }
+    ];
+
+    workspaceRules = [
+      { startIdx = 1; endIdx = 10; formula = "i % 10"; monitor = "DP-1"; default = true; }
+      { startIdx = 11; endIdx = 20; formula = "i"; monitor = "HDMI-A-1"; default = true; }
+    ];
+
+    defaultCursorMonitor = "DP-2";
+  };
+}

+ 0 - 20
hosts/nixstation/home/modules/desktop/hyprland/hypr/modules/monitors.lua

@@ -1,20 +0,0 @@
-hl.monitor({ output = "DP-1", mode = "1920x1080@143.98", position = "0x0", scale = 1 })
-hl.monitor({ output = "HDMI-A-1", mode = "1920x1080@143.98", position = "1920x0", scale = 1 })
-
--- fallback:
-hl.monitor({ output = "", mode = "preferred", position = "auto", scale = 1 })
-
--- rules
-for i = 1, 10 do
-    hl.workspace_rule({ workspace = i % 10, monitor = "DP-1", default = true })
-end
-
-for i = 11, 20 do
-    hl.workspace_rule({ workspace = i, monitor = "HDMI-A-1", default = true })
-end
-
-hl.config({
-    cursor = {
-        default_monitor = "DP-2"
-    }
-})

+ 0 - 16
hosts/nixstation/home/modules/desktop/hyprland/hypr/modules/shell.lua

@@ -1,16 +0,0 @@
-hl.on("hyprland.start", function ()
-    hl.exec_cmd("dms run")
-end)
-
-mainMod = "ALT"
-secMod = "SUPER"
-
-hl.bind(mainMod .. " + D", hl.dsp.exec_cmd("dms ipc spotlight toggle"))
-hl.bind(secMod .. " + V", hl.dsp.exec_cmd("dms ipc clipboard open"))
-hl.bind(mainMod .. " + SHIFT + E", hl.dsp.exec_cmd("dms ipc powermenu open"))
-hl.bind("CONTROL + ALT + DELETE", hl.dsp.exec_cmd("dms ipc powermenu open"))
-hl.bind(secMod .. " + L", hl.dsp.exec_cmd("dms ipc lock lock"))
-hl.bind(secMod .. " + SHIFT + S", hl.dsp.exec_cmd("dms screenshot"))
-
-hl.bind("CONTROL + SHIFT + ESCAPE", hl.dsp.exec_cmd("dms ipc call processlist open"))
-hl.bind(secMod .. " + CONTROL + SHIFT + C", hl.dsp.exec_cmd("dms ipc color-picker toggle"))

+ 13 - 0
hosts/ono/home/default.nix

@@ -0,0 +1,13 @@
+{ config, pkgs, lib, ... }:
+
+{
+  imports = [
+    ../../../home/modules/system/home-base.nix
+
+    ../../../home/modules/desktop/hyprland
+    ./hyprland.nix
+
+    ../../../home/modules/configs/alacritty.nix
+    ../../../home/modules/configs/fish
+  ];
+}

+ 16 - 0
hosts/ono/home/hyprland.nix

@@ -0,0 +1,16 @@
+{ config, pkgs, ... }: {
+  imports = [
+    ../../../home/modules/desktop/hyprland/modules/config-builder.nix
+    ../../../home/modules/shells/dms-shell
+    ../../../home/modules/shells/dms-shell/wm/hyprland
+  ];
+
+  programs.hyprlandLua = {
+    enable = true;
+
+    monitors = [
+      { output = "eDP-1"; mode = "preferred"; position = "auto"; scale = 1; }
+      { output = ""; mode = "preferred"; position = "auto"; scale = 1; mirror = "eDP-1"; }
+    ];
+  };
+}

+ 6 - 0
hosts/ono/iso.nix

@@ -0,0 +1,6 @@
+{ ... }:
+{
+  imports = [
+    ../../nixos/features/system/iso-base.nix
+  ];
+}

+ 32 - 0
hosts/ono/nixos/default.nix

@@ -0,0 +1,32 @@
+{ config, pkgs, lib, ... }:
+
+let 
+  hosts = import ../../../config/hosts.nix;
+in
+{
+  imports = [
+    ./hardware.nix
+
+    ../../../nixos/modules/system/nixos-base.nix
+    ../../../nixos/modules/system/users.nix
+
+    ../../../nixos/profiles/workstation
+    ../../../nixos/profiles/development
+    ../../../nixos/profiles/gaming
+    ../../../nixos/profiles/school
+
+    ../../../nixos/modules/hardware/networking
+    ../../../nixos/modules/hardware/sound
+    ../../../nixos/modules/hardware/bluetooth
+    ../../../nixos/modules/hardware/biometric/fingerprint
+
+    ../../../nixos/modules/desktop/hyprland
+    ../../../nixos/modules/greeter/tuigreet/hyprland.nix
+  ];
+
+  #boot.kernelParams = [
+  #  "resume=UUID=3f914128-2e08-4080-b1bb-d7ddf9ef647a"
+  #];
+
+  networking.hostName = hosts.ono.hostname;
+}

+ 0 - 14
nixos/modules/hardware/biometric/elan-fingerprint.nix

@@ -1,14 +0,0 @@
-{ config, pkgs, ... }:
-
-{
-    services.fprintd = {
-        enable = true;
-        tod.enable = true;
-        tod.driver = pkgs.libfprint-2-tod1-elan;
-    };
-
-    security.pam.services = {
-        sudo.fprintAuth = true;
-        polkit-1.fprintAuth = true;
-    };
-}

+ 15 - 0
nixos/modules/hardware/biometric/fingerprint/default.nix

@@ -0,0 +1,15 @@
+{ config, pkgs, ... }:
+
+{
+  services.fprintd = {
+      enable = true;
+      tod.enable = true;
+      tod.driver = pkgs.libfprint-2-tod1-elan;
+  };
+
+  security.pam.services = {
+      sudo.fprintAuth = true;
+      login.fprintAuth = true;
+      polkit-1.fprintAuth = true;
+  };
+}

+ 10 - 0
nixos/modules/hardware/biometric/fingerprint/elan.nix

@@ -0,0 +1,10 @@
+{ config, pkgs, ... }:
+
+{
+  services.fprintd = {
+    tod.enable = true;
+    tod.driver = pkgs.libfprint-2-tod1-elan;
+  };
+
+  security.pam.services.polkit-1.fprintAuth = true;
+}

+ 1 - 0
nixos/modules/system/nixos-base.nix

@@ -3,6 +3,7 @@
 {
   nixpkgs.config.allowUnfree = true;
   hardware.enableAllFirmware = true;
+  services.fwupd.enable = true;
 
   nix.settings.experimental-features = [ "nix-command" "flakes" ];
 

+ 22 - 8
nixos/profiles/workstation/default.nix

@@ -100,9 +100,31 @@
   services.xserver.xkb = {
     layout = "no";
     variant = "winkeys";
+    options = "compose:rctrl";
   };
+
   console.keyMap = "no";
 
+  services.udev.extraHwdb = ''
+    evdev:name:AT Translated Set 2 keyboard:*
+      KEYBOARD_KEY_3a=f12
+
+    evdev:input:b*v*p*e*
+      KEYBOARD_KEY_3a=f12
+  '';
+
+  services.libinput = {
+    enable = true;
+    touchpad = {
+      naturalScrolling = false;
+      tapping = true;
+      clickMethod = "clickfinger";
+    };
+    mouse = {
+      accelProfile = "flat";
+    };
+  };
+
   time.timeZone = "Europe/Oslo";
 
   i18n.defaultLocale = "en_US.UTF-8";
@@ -155,14 +177,6 @@
 
   programs.virt-manager.enable = true;
 
-  services.udev.extraHwdb = ''
-    evdev:name:AT Translated Set 2 keyboard:*
-      KEYBOARD_KEY_3a=f12
-
-    evdev:input:b*v*p*e*
-      KEYBOARD_KEY_3a=f12
-  '';
-
   virtualisation = {
     libvirtd = {
       enable = true;