Преглед на файлове

feat(nix): add initial support for Fedora on aarch64

This commit introduces a new home-manager configuration for Fedora on aarch64
systems, allowing for a consistent development environment across different Linux
 distributions.

The main changes include:
 - A new fedora.nix home-manager configuration.
 - Conditional logic in the desktop features to accommodate differences between
   macOS and Linux, particularly for window management (Hyprland vs. AeroSpace).
 - Adjustments to ghostty and yubikey configurations to better support Linux.
 - Documentation in the README.md for setting up a new Fedora machine with Nix.
Zander Hawke преди 10 месеца
родител
ревизия
ca8f907903
променени са 8 файла, в които са добавени 44 реда и са изтрити 4 реда
  1. 12 0
      README.md
  2. 5 0
      flake.nix
  3. 5 1
      home/features/desktop/default.nix
  4. 4 1
      home/features/desktop/ghostty.nix
  5. 6 0
      home/features/desktop/hyprland.nix
  6. 0 1
      home/features/desktop/yubikey.nix
  7. 8 0
      home/fedora.nix
  8. 4 1
      lib/default.nix

+ 12 - 0
README.md

@@ -71,6 +71,18 @@ nix run github:nix-community/nixos-anywhere -- --flake .#modgud [email protected]
 nix run github:nix-community/home-manager -- switch --flake .#thomas@modgud
 ```
 
+### For Asahi Fedora (fedora)
+```
+# Add trusted users
+echo "trusted-users = root @wheel @admin" | sudo tee -a /etc/nix/nix.custom.conf
+# Restart nix-daemon to apply changes
+sudo systemctl restart nix-daemon
+
+# Add ghostty
+sudo dnf copr enable pgdev/ghostty
+sudo dnf install ghostty
+```
+
 ## Features
 
 ### Shared CLI Tools

+ 5 - 0
flake.nix

@@ -40,6 +40,11 @@
         system = "x86_64-linux";
         modules = [ ./home/modgud.nix ];
       };
+
+      "thomas@fedora" = lib.mkHome {
+        system = "aarch64-linux";
+        modules = [ ./home/fedora.nix ];
+      };
     };
 
     nixosConfigurations = {

+ 5 - 1
home/features/desktop/default.nix

@@ -1,10 +1,14 @@
+{ lib, isDarwin, ... }:
 {
   imports = [
-    ./aerospace.nix
     ./fonts.nix
     ./ghostty.nix
     ./yubikey.nix
     ./zen-browser.nix
+  ] ++ lib.optionals (isDarwin) [
+    ./aerospace.nix
+  ] ++ lib.optionals (!isDarwin) [
+    # ./hyprland.nix
   ];
 
   services.syncthing.enable = true;

+ 4 - 1
home/features/desktop/ghostty.nix

@@ -1,5 +1,6 @@
 { config
 , lib
+, isDarwin
 , ...
 }:
 {
@@ -7,6 +8,8 @@
     enable = true;
     # Ghostty is a terminal emulator for macOS, it is not available in Nixpkgs
     # TODO: https://github.com/NixOS/nixpkgs/blob/76efb9f313b326ed24dfae33ff0496a6df370e5a/pkgs/by-name/gh/ghostty/package.nix#L192
+    # TODO: error(gtk_surface): surface failed to realize: Failed to create EGL display
+    # Segmentation fault (core dumped)
     package = null; # installed via brew cask
 
     installBatSyntax = false;
@@ -19,7 +22,7 @@
 
       background-opacity = 0.8;
       font-family = "FiraCode Nerd Font";
-      font-size = 16.0;
+      font-size = if isDarwin then 16.0 else 10.0;
 
       macos-titlebar-style = "hidden";
       theme = "Kanagawa Dragon";

+ 6 - 0
home/features/desktop/hyprland.nix

@@ -0,0 +1,6 @@
+{
+  wayland.windowManager.hyperland = {
+    enable = true;
+    systemd.enable = false;
+  };
+}

+ 0 - 1
home/features/desktop/yubikey.nix

@@ -30,7 +30,6 @@ in
     enableFishIntegration = true;
     enableNushellIntegration = true;
     enableSshSupport = true;
-    pinentryFlavor = "curses";
     sshKeys = [
       "0C8022799396573FE31D595B2C4B60B871618D9C"
     ];

+ 8 - 0
home/fedora.nix

@@ -0,0 +1,8 @@
+{
+  imports = [
+    ./features/core.nix
+    ./features/cli
+    ./features/desktop
+    ./features/nvim
+  ];
+}

+ 4 - 1
lib/default.nix

@@ -46,7 +46,10 @@ rec {
     home-manager.lib.homeManagerConfiguration {
       inherit modules;
       pkgs = getPkgsForSystem system;
-      extraSpecialArgs = { inherit inputs outputs; };
+      extraSpecialArgs = {
+        inherit inputs outputs;
+        isDarwin = isDarwin system;
+      };
     };
 
   mkDevenvShell = config: