summary refs log tree commit diff
diff options
context:
space:
mode:
authortzlil <tzlils@protonmail.com>2023-03-12 21:23:01 +0200
committertzlil <tzlils@protonmail.com>2023-03-12 21:23:01 +0200
commite94d2c69ff5ae50cc7a5ddc2598d7caef68e406f (patch)
tree205fd97e03d9bd446401446bf0fec9552ed7d7da
parent39eb0b807403c7745c2edc6024e0e713155662bc (diff)
bad commit
-rw-r--r--flake.lock32
-rw-r--r--flake.nix2
-rw-r--r--hosts/laptop/cfg.nix17
-rw-r--r--hosts/vm/cfg.nix9
-rw-r--r--mixins/greet.nix17
-rw-r--r--mixins/sway.nix2
-rw-r--r--mixins/tailscale.nix14
-rwxr-xr-xrun.sh4
8 files changed, 56 insertions, 41 deletions
diff --git a/flake.lock b/flake.lock
index dcdf236..26453be 100644
--- a/flake.lock
+++ b/flake.lock
@@ -41,6 +41,21 @@
         "type": "github"
       }
     },
+    "hardware": {
+      "locked": {
+        "lastModified": 1678397099,
+        "narHash": "sha256-5xq8YJe+h19TlD+EI4AE/3H3jcCcQ2AWU6CWBVc5tRc=",
+        "owner": "nixos",
+        "repo": "nixos-hardware",
+        "rev": "556101ff85bd6e20900ec73ee525b935154bc8ea",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "repo": "nixos-hardware",
+        "type": "github"
+      }
+    },
     "home-manager": {
       "inputs": {
         "nixpkgs": [
@@ -139,21 +154,6 @@
         "type": "github"
       }
     },
-    "nixos-hardware": {
-      "locked": {
-        "lastModified": 1678397099,
-        "narHash": "sha256-5xq8YJe+h19TlD+EI4AE/3H3jcCcQ2AWU6CWBVc5tRc=",
-        "owner": "nixos",
-        "repo": "nixos-hardware",
-        "rev": "556101ff85bd6e20900ec73ee525b935154bc8ea",
-        "type": "github"
-      },
-      "original": {
-        "owner": "nixos",
-        "repo": "nixos-hardware",
-        "type": "github"
-      }
-    },
     "nixpkgs": {
       "locked": {
         "lastModified": 1677676435,
@@ -226,11 +226,11 @@
     "root": {
       "inputs": {
         "agenix": "agenix",
+        "hardware": "hardware",
         "home-manager": "home-manager",
         "hyprland": "hyprland",
         "impermanence": "impermanence",
         "nixinate": "nixinate",
-        "nixos-hardware": "nixos-hardware",
         "nixpkgs": "nixpkgs_3",
         "programsdb": "programsdb"
       }
diff --git a/flake.nix b/flake.nix
index 6a8ecbd..71991cc 100644
--- a/flake.nix
+++ b/flake.nix
@@ -5,7 +5,7 @@
     nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
     impermanence.url = "github:nix-community/impermanence";
     agenix.url = "github:ryantm/agenix";
-    nixos-hardware.url = "github:nixos/nixos-hardware";
+    hardware.url = "github:nixos/nixos-hardware";
     nixinate.url = "github:matthewcroughan/nixinate";
     home-manager = {
       url = "github:nix-community/home-manager";
diff --git a/hosts/laptop/cfg.nix b/hosts/laptop/cfg.nix
index f4befe8..a6347f4 100644
--- a/hosts/laptop/cfg.nix
+++ b/hosts/laptop/cfg.nix
@@ -2,17 +2,21 @@
   config,
   lib,
   pkgs,
+  inputs,
   ...
 }: {
   imports = [
+    inputs.hardware.nixosModules.common-cpu-intel
+    inputs.hardware.nixosModules.common-gpu-intel
     ../../profiles/core.nix
     ../../profiles/user.nix
     ../../profiles/ssh.nix
     ../../profiles/graphical.nix
     ../../mixins/tailscale.nix
     ../../mixins/cli.nix
-    # ../../mixins/greet.nix
+    ../../mixins/greet.nix
     ../../mixins/hyprland.nix
+    ../../mixins/sway.nix
   ];
 
   config = {
@@ -32,7 +36,6 @@
       };
       kernelModules = ["kvm-intel"];
       kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
-      # extraModulePackages = [ pkgs.linuxPackages_latest.rtw88-firmware ];
       kernelParams = [
         "console=ttyS0"
         "init_on_free=1"
@@ -60,7 +63,7 @@
     fileSystems."/" = {
       device = "none";
       fsType = "tmpfs";
-      options = ["noexec" "defaults" "size=2G" "mode=755"];
+      options = ["defaults" "size=2G" "mode=755"];
     };
 
     fileSystems."/boot" = {
@@ -87,5 +90,13 @@
     hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
 
     # greeter.initialSession = "env WLR_RENDERER=pixman sh -c ${pkgs.sway}/bin/sway";
+    greeter.initialSession = "${pkgs.fish}/bin/fish";
+
+    hardware.opengl = {
+      enable = true;
+      extraPackages = with pkgs; [ rocm-opencl-icd rocm-opencl-runtime ];
+      driSupport = true;
+      driSupport32Bit = true;
+    };
   };
 }
diff --git a/hosts/vm/cfg.nix b/hosts/vm/cfg.nix
index 5ceba52..8c56336 100644
--- a/hosts/vm/cfg.nix
+++ b/hosts/vm/cfg.nix
@@ -81,6 +81,13 @@
       algorithm = "zstd";
     };
 
-    greeter.initialSession = "env WLR_RENDERER=pixman sh -c ${pkgs.sway}/bin/sway";
+    greeter.initialSession = "sh -c ${pkgs.sway}/bin/sway";
+
+    hardware.opengl = {
+      enable = true;
+      extraPackages = with pkgs; [ rocm-opencl-icd rocm-opencl-runtime ];
+      driSupport = true;
+      driSupport32Bit = true;
+    };
   };
 }
diff --git a/mixins/greet.nix b/mixins/greet.nix
index fc1d151..fe2c825 100644
--- a/mixins/greet.nix
+++ b/mixins/greet.nix
@@ -7,12 +7,9 @@
   user = "tzlil";
 
   users.users.greeter.packages = [pkgs.sway];
-  greet = "${pkgs.greetd.wlgreet}/bin/wlgreet";
+  greet = "${pkgs.greetd.gtkgreet.out}/bin/gtkgreet";
 
-  sway-kiosk = command: "env WLR_RENDERER=pixman ${pkgs.sway}/bin/sway --unsupported-gpu --config ${pkgs.writeText "kiosk.config" ''
-    output * bg #000000 solid_color
-    exec "${command}; ${pkgs.sway}/bin/swaymsg exit"
-  ''}";
+  kiosk = command: "${pkgs.cage.out}/bin/cage -- ${command}";
 in {
   options.greeter.initialSession = lib.mkOption {
     type = lib.types.str;
@@ -29,12 +26,12 @@ in {
       settings = {
         default_session = {
           inherit user;
-          command = sway-kiosk "${greet} -l &>/dev/null";
-        };
-        initial_session = {
-          inherit user;
-          command = config.greeter.initialSession;
+          command = kiosk "${greet} -l &>/dev/null";
         };
+        # initial_session = {
+        #   inherit user;
+        #   command = config.greeter.initialSession;
+        # };
       };
     };
   };
diff --git a/mixins/sway.nix b/mixins/sway.nix
index 79c20d0..3345a4c 100644
--- a/mixins/sway.nix
+++ b/mixins/sway.nix
@@ -140,7 +140,7 @@ in {
             }
           ];
 
-          modifier = "Mod5";
+          modifier = "Mod4";
           left = "h";
           down = "n";
           up = "e";
diff --git a/mixins/tailscale.nix b/mixins/tailscale.nix
index 1398a1e..d66a5ec 100644
--- a/mixins/tailscale.nix
+++ b/mixins/tailscale.nix
@@ -12,12 +12,12 @@
 
     environment.persistence."/nix/persist".directories = ["/var/lib/tailscale"];
 
-    systemd.services.tailscaled = {
-      restartIfChanged = false;
-      serviceConfig.ExecStart = [
-        ""
-        "${config.services.tailscale.package}/bin/tailscaled --state=mem: --port $PORT $FLAGS"
-      ];
-    };
+    # systemd.services.tailscaled = {
+    #   restartIfChanged = false;
+    #   serviceConfig.ExecStart = [
+    #     ""
+    #     "${config.services.tailscale.package}/bin/tailscaled --state=mem: --port $PORT $FLAGS"
+    #   ];
+    # };
   };
 }
diff --git a/run.sh b/run.sh
index 984e4cc..2b514c5 100755
--- a/run.sh
+++ b/run.sh
@@ -10,5 +10,5 @@ qemu-system-x86_64 \
     -vga none \
     -device virtio-gpu-pci \
     -audiodev pa,id=snd0 \
-    -usb \
-    -device usb-mouse
+    -serial stdio \
+    -usb -device usb-mouse