From ce7de9b9a6693333df2f67243b2e345b3c03e43e Mon Sep 17 00:00:00 2001
From: Nydragon <6582485n@proton.me>
Date: Thu, 16 May 2024 03:31:48 +0900
Subject: [PATCH] format: update formatting to new rfc style

---
 .gitignore                               |   1 +
 flake.lock                               |  24 +-
 flake.nix                                |  12 +-
 home/default.nix                         |  35 +-
 home/firefox/default.nix                 | 115 +++---
 home/fish/default.nix                    |   6 +-
 home/neovim/default.nix                  |  88 ++---
 home/rofi/default.nix                    |  65 ++--
 home/scripts/default.nix                 |  27 +-
 home/sway/default.nix                    | 445 +++++++++++------------
 home/sway/swayidle.nix                   |   3 +-
 home/sway/swaylock.nix                   |   9 +-
 home/thunderbird/default.nix             |   7 +-
 hosts/xps9510/configuration.nix          |  87 +++--
 hosts/xps9510/hardware-configuration.nix |  16 +-
 15 files changed, 478 insertions(+), 462 deletions(-)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..105c8fb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+./result/
diff --git a/flake.lock b/flake.lock
index 86e9fad..0cabe2f 100644
--- a/flake.lock
+++ b/flake.lock
@@ -22,26 +22,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1715458517,
-        "narHash": "sha256-oi4z6RuLnGTR8TbjPcN/D2jFKywCrMRhAtSfgPHY9nE=",
+        "lastModified": 1715534503,
+        "narHash": "sha256-5ZSVkFadZbFP1THataCaSf0JH2cAH3S29hU9rrxTEqk=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "09208c1471b96985c809998af55d82e134a750b8",
-        "type": "github"
-      },
-      "original": {
-        "owner": "nixos",
-        "repo": "nixpkgs",
-        "type": "github"
-      }
-    },
-    "nixpkgs-unstable": {
-      "locked": {
-        "lastModified": 1715266358,
-        "narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=",
-        "owner": "nixos",
-        "repo": "nixpkgs",
-        "rev": "f1010e0469db743d14519a1efd37e23f8513d714",
+        "rev": "2057814051972fa1453ddfb0d98badbea9b83c06",
         "type": "github"
       },
       "original": {
@@ -54,8 +39,7 @@
     "root": {
       "inputs": {
         "home-manager": "home-manager",
-        "nixpkgs": "nixpkgs",
-        "nixpkgs-unstable": "nixpkgs-unstable"
+        "nixpkgs": "nixpkgs"
       }
     }
   },
diff --git a/flake.nix b/flake.nix
index 1773490..d0408eb 100644
--- a/flake.nix
+++ b/flake.nix
@@ -2,8 +2,7 @@
   description = "Nydragon's configuration'";
 
   inputs = {
-    nixpkgs = { url = "github:nixos/nixpkgs"; };
-    nixpkgs-unstable = { url = "github:nixos/nixpkgs?ref=nixos-unstable"; };
+    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
 
     home-manager = {
       url = "github:nix-community/home-manager";
@@ -11,7 +10,7 @@
     };
   };
 
-  outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager }:
+  outputs = inputs@{ self, nixpkgs, home-manager }:
     let
       inherit (self) outputs;
 
@@ -22,18 +21,13 @@
         config.allowUnfree = true;
       };
 
-      unstable = import nixpkgs-unstable {
-        inherit system;
-        config.allowUnfree = true;
-      };
-
       lib = nixpkgs.lib;
     in {
       nixosConfigurations = {
         xps9510 = lib.nixosSystem {
           inherit system;
           modules = [ ./hosts/xps9510/configuration.nix ];
-          specialArgs = { inherit inputs outputs system unstable; };
+          specialArgs = { inherit inputs outputs system pkgs; };
         };
       };
     };
diff --git a/home/default.nix b/home/default.nix
index f89d83a..2fbceab 100644
--- a/home/default.nix
+++ b/home/default.nix
@@ -1,11 +1,24 @@
-{ config, inputs, system, stateVersion, username, homeDirectory, pkgs, unstable
-, ... }:
-let scripts = import ./scripts { inherit pkgs; };
-in {
-  imports = [ ./firefox ./fish ./sway ./neovim ./rofi ./thunderbird ];
+{
+  stateVersion,
+  username,
+  homeDirectory,
+  pkgs,
+  ...
+}:
+let
+  scripts = import ./scripts { inherit pkgs; };
+in
+{
+  imports = [
+    ./firefox
+    ./fish
+    ./sway
+    ./neovim
+    ./rofi
+    ./thunderbird
+  ];
 
-  xdg.configFile."gtk-4.0/gtk.css".source =
-    "${pkgs.catppuccin-gtk}/share/themes/Catppuccin-Frappe-Standard-Blue-Dark/gtk-4.0/gtk.css";
+  xdg.configFile."gtk-4.0/gtk.css".source = "${pkgs.catppuccin-gtk}/share/themes/Catppuccin-Frappe-Standard-Blue-Dark/gtk-4.0/gtk.css";
 
   dconf = {
     enable = true;
@@ -38,11 +51,11 @@ in {
       thunderbird
       gnome.nautilus
       rofi-power-menu
-      unstable.lollypop
+      lollypop
 
       # Proprietary
-      unstable.postman
-      unstable.mongodb-compass
+      postman
+      mongodb-compass
 
       # CLI tools
       delta
@@ -56,11 +69,11 @@ in {
       lazygit
       fd
       ripgrep
+      swaybg
 
       # Scripts
       scripts.screenshot
       scripts.set-background
-
     ];
     sessionVariables = {
       EDITOR = "nvim";
diff --git a/home/firefox/default.nix b/home/firefox/default.nix
index 286cf8f..63e2bcb 100644
--- a/home/firefox/default.nix
+++ b/home/firefox/default.nix
@@ -1,4 +1,5 @@
-{ pkgs, config, lib, ... }: {
+{ pkgs, ... }:
+{
   programs.firefox = {
     enable = true;
     profiles.nico = {
@@ -7,66 +8,60 @@
       search = {
         default = "DuckDuckGo";
         force = true;
-        engines = let
-          nixicon =
-            "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
-          iconUpdateInteval = 24 * 60 * 60 * 1000; # every day
-        in {
-          "NixOS Packages" = {
-            urls = [{
-              template =
-                "https://search.nixos.org/packages?query={searchTerms}";
-            }];
-            icon = nixicon;
-            definedAliases = [ "@nixpkg" ];
+        engines =
+          let
+            nixicon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+            iconUpdateInteval = 24 * 60 * 60 * 1000; # every day
+          in
+          {
+            "NixOS Packages" = {
+              urls = [ { template = "https://search.nixos.org/packages?query={searchTerms}"; } ];
+              icon = nixicon;
+              definedAliases = [ "@nixpkg" ];
+            };
+            "NixOS Wiki" = {
+              urls = [ { template = "https://wiki.nixos.org/index.php?search={searchTerms}"; } ];
+              icon = nixicon;
+              definedAliases = [ "@nixwiki" ];
+            };
+            "NixOS Options" = {
+              urls = [ { template = "https://search.nixos.org/options?query={searchTerms}"; } ];
+              icon = nixicon;
+              definedAliases = [ "@nixoptions" ];
+            };
+            "Arch Wiki" = {
+              urls = [
+                { template = "https://wiki.archlinux.org/index.php?title=Special:Search&search={searchTerms}"; }
+              ];
+              iconUpdateURL = "https://nixos.wiki/favicon.ico";
+              updateInterval = iconUpdateInteval;
+              definedAliases = [ "@archwiki" ];
+            };
+            "DuckDuckGo" = {
+              urls = [ { template = "https://duckduckgo.com/?q={searchTerms}"; } ];
+              iconUpdateURL = "https://duckduckgo.com/favicon.ico";
+              updateInterval = iconUpdateInteval;
+              definedAliases = [
+                "@duckduckgo"
+                "@ddg"
+              ];
+            };
+            "MyNixOS" = {
+              urls = [ { template = "https://mynixos.com/search?q={searchTerms}"; } ];
+              iconUpdateURL = "https://mynixos.com/favicon.ico";
+              updateInterval = iconUpdateInteval;
+              definedAliases = [
+                "@hm"
+                "@mynixos"
+              ];
+            };
+            "stackoverflow" = {
+              urls = [ { template = "https://stackoverflow.com/search?q={searchTerms}"; } ];
+              iconUpdateURL = "https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico";
+              updateInterval = iconUpdateInteval;
+              definedAliases = [ "@stackoverflow" ];
+            };
           };
-          "NixOS Wiki" = {
-            urls = [{
-              template =
-                "https://wiki.nixos.org/index.php?search={searchTerms}";
-            }];
-            icon = nixicon;
-            definedAliases = [ "@nixwiki" ];
-          };
-          "NixOS Options" = {
-            urls = [{
-              template = "https://search.nixos.org/options?query={searchTerms}";
-            }];
-            icon = nixicon;
-            definedAliases = [ "@nixoptions" ];
-          };
-          "Arch Wiki" = {
-            urls = [{
-              template =
-                "https://wiki.archlinux.org/index.php?title=Special:Search&search={searchTerms}";
-            }];
-            iconUpdateURL = "https://nixos.wiki/favicon.ico";
-            updateInterval = iconUpdateInteval;
-            definedAliases = [ "@archwiki" ];
-          };
-          "DuckDuckGo" = {
-            urls = [{ template = "https://duckduckgo.com/?q={searchTerms}"; }];
-            iconUpdateURL = "https://duckduckgo.com/favicon.ico";
-            updateInterval = iconUpdateInteval;
-            definedAliases = [ "@duckduckgo" "@ddg" ];
-          };
-          "MyNixOS" = {
-            urls =
-              [{ template = "https://mynixos.com/search?q={searchTerms}"; }];
-            iconUpdateURL = "https://mynixos.com/favicon.ico";
-            updateInterval = iconUpdateInteval;
-            definedAliases = [ "@hm" "@mynixos" ];
-          };
-          "stackoverflow" = {
-            urls = [{
-              template = "https://stackoverflow.com/search?q={searchTerms}";
-            }];
-            iconUpdateURL =
-              "https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico";
-            updateInterval = iconUpdateInteval;
-            definedAliases = [ "@stackoverflow" ];
-          };
-        };
       };
     };
   };
diff --git a/home/fish/default.nix b/home/fish/default.nix
index 62b0a7a..6035787 100644
--- a/home/fish/default.nix
+++ b/home/fish/default.nix
@@ -1,4 +1,5 @@
-{ pkgs, config, lib, ... }: {
+{ ... }:
+{
   programs.fish = {
     enable = true;
     shellAbbrs = {
@@ -12,8 +13,7 @@
     functions = {
       gitignore = "curl -sL https://www.gitignore.io/api/$argv";
       nrun = "nix run nixpkgs#$argv[1] -- $argv[2..]";
-      mv-bad-creation-date = ''
-        exiftool -if 'not $CreateDate' -p '$FileName' "$PWD/$argv[1]" | xargs -I {} mv -i "$PWD/$argv[1]/{}" "$argv[2]"'';
+      mv-bad-creation-date = ''exiftool -if 'not $CreateDate' -p '$FileName' "$PWD/$argv[1]" | xargs -I {} mv -i "$PWD/$argv[1]/{}" "$argv[2]"'';
       rename-images = ''
         set -f input "$PWD/$argv[1]"
 
diff --git a/home/neovim/default.nix b/home/neovim/default.nix
index b91dc03..1682da0 100644
--- a/home/neovim/default.nix
+++ b/home/neovim/default.nix
@@ -1,44 +1,48 @@
-{ pkgs, system, config, lib, ... }: {
-  programs.neovim = let
-    customR = pkgs.rWrapper.override {
-      packages = with pkgs.rPackages; [ styler languageserver ];
+{ pkgs, ... }:
+{
+  programs.neovim =
+    let
+      customR = pkgs.rWrapper.override {
+        packages = with pkgs.rPackages; [
+          styler
+          languageserver
+        ];
+      };
+    in
+    {
+      defaultEditor = true;
+      viAlias = true;
+      vimAlias = true;
+      enable = true;
+      withPython3 = false;
+      withRuby = false;
+      extraPackages = with pkgs; [
+        # Language Servers
+        rust-analyzer
+        nixd
+        clang
+        nodePackages_latest.pyright
+        nodePackages_latest.bash-language-server
+        lua-language-server
+        zls
+        #rPackages.languageserver
+
+        # Formatter
+        python311Packages.black # Python formatter
+        #rPackages.styler # R formatter
+        nodePackages_latest.prettier # JSON, JS, TS formatter
+        yamlfmt # YAML formatter
+        taplo # TOML formatter
+        rustfmt # Rust formatter
+        shfmt # Shell, Bash etc.
+        nixfmt-rfc-style
+        # Misc
+        ripgrep
+        rustc
+        cargo
+
+        # R
+        customR
+      ];
     };
-  in {
-    defaultEditor = true;
-    viAlias = true;
-    vimAlias = true;
-    enable = true;
-    withPython3 = false;
-    withRuby = false;
-    extraPackages = with pkgs; [
-      # Language Servers
-      rust-analyzer
-      #unstable.rust-analyzer
-      nixd
-      clang
-      nodePackages_latest.pyright
-      nodePackages_latest.bash-language-server
-      lua-language-server
-      zls
-      #rPackages.languageserver
-
-      # Formatter
-      python311Packages.black # Python formatter
-      #rPackages.styler # R formatter
-      nodePackages_latest.prettier # JSON, JS, TS formatter
-      yamlfmt # YAML formatter
-      taplo # TOML formatter
-      rustfmt # Rust formatter
-      shfmt # Shell, Bash etc.
-
-      # Misc
-      ripgrep
-      rustc
-      cargo
-
-      # R
-      customR
-    ];
-  };
-
 }
diff --git a/home/rofi/default.nix b/home/rofi/default.nix
index 67c614a..ccfe368 100644
--- a/home/rofi/default.nix
+++ b/home/rofi/default.nix
@@ -1,29 +1,40 @@
-{ pkgs, config, lib, ... }: {
-  programs.rofi = let conf = "${config.home.homeDirectory}/.config/rofi";
-  in {
-    enable = true;
-    plugins = [ pkgs.rofi-calc ];
-    theme = "${conf}/themes/rounded-gray-dark.rasi";
-    terminal = "${pkgs.alacritty}/bin/alacritty";
-    extraConfig = {
-      modes = [
-        "combi"
-        "filebrowser"
-        "ssh"
-        "drun"
-        "run"
-        "calc"
-        "vm:${conf}/scripts/libvirt-controller.py"
-        "obsidian:rofi-obsidian"
-      ];
-      matching = "fuzzy";
-      sort = true;
-      sorting-method = "fzf";
-      show-icons = true;
-      steal-focus = true;
-      drun-use-desktop-cache = true;
-      drun-reload-desktop-cache = true;
-      combi-modes = [ "window" "drun" "filebrowser" "ssh" "calc" "obsidian" ];
+{ pkgs, config, ... }:
+{
+  programs.rofi =
+    let
+      conf = "${config.home.homeDirectory}/.config/rofi";
+    in
+    {
+      enable = true;
+      plugins = [ pkgs.rofi-calc ];
+      theme = "${conf}/themes/rounded-gray-dark.rasi";
+      terminal = "${pkgs.alacritty}/bin/alacritty";
+      extraConfig = {
+        modes = [
+          "combi"
+          "filebrowser"
+          "ssh"
+          "drun"
+          "run"
+          "calc"
+          "vm:${conf}/scripts/libvirt-controller.py"
+          "obsidian:rofi-obsidian"
+        ];
+        matching = "fuzzy";
+        sort = true;
+        sorting-method = "fzf";
+        show-icons = true;
+        steal-focus = true;
+        drun-use-desktop-cache = true;
+        drun-reload-desktop-cache = true;
+        combi-modes = [
+          "window"
+          "drun"
+          "filebrowser"
+          "ssh"
+          "calc"
+          "obsidian"
+        ];
+      };
     };
-  };
 }
diff --git a/home/scripts/default.nix b/home/scripts/default.nix
index 062a922..0737623 100644
--- a/home/scripts/default.nix
+++ b/home/scripts/default.nix
@@ -1,8 +1,14 @@
-{ pkgs, ... }: {
-  screenshot = with pkgs;
+{ pkgs, ... }:
+{
+  screenshot =
+    with pkgs;
     writeShellApplication {
       name = "screenshot";
-      runtimeInputs = [ slurp wl-clipboard libnotify ];
+      runtimeInputs = [
+        slurp
+        wl-clipboard
+        libnotify
+      ];
       text = ''
         location="$HOME/Pictures/Screenshots/$(date +%Y-%m-%d-%H%M%S)-screenshot.png";
 
@@ -12,11 +18,12 @@
         fi
       '';
     };
-  set-background = pkgs.writers.writeFishBin "set-background" (builtins.readFile
-    (pkgs.fetchurl {
-      url =
-        "https://codeberg.org/Nydragon/scripts/raw/commit/bb7a40545fa5cfce177cdac009d9f46f4823d360/set_background.fish";
-      hash = "sha256-Qoz5nn0tqV6QtsXv9fsOkf3PafL30iO/eIkh8ro6O+c=";
-    }));
-
+  set-background = pkgs.writers.writeFishBin "set-background" (
+    builtins.readFile (
+      pkgs.fetchurl {
+        url = "https://codeberg.org/Nydragon/scripts/raw/commit/bb7a40545fa5cfce177cdac009d9f46f4823d360/set_background.fish";
+        hash = "sha256-Qoz5nn0tqV6QtsXv9fsOkf3PafL30iO/eIkh8ro6O+c=";
+      }
+    )
+  );
 }
diff --git a/home/sway/default.nix b/home/sway/default.nix
index cbdfa9a..94821ab 100644
--- a/home/sway/default.nix
+++ b/home/sway/default.nix
@@ -1,188 +1,168 @@
 # vim:fileencoding=utf-8:foldmethod=marker
-{ pkgs, config, lib, ... }: {
-  imports = [ ./swayidle.nix ];
+{
+  pkgs,
+  config,
+  lib,
+  ...
+}:
+{
+  imports = [
+    ./swayidle.nix
+    ./swaylock.nix
+  ];
 
-  wayland.windowManager.sway = let
-    screenshot = (import ../scripts { inherit pkgs; }).screenshot;
-    set-background = (import ../scripts { inherit pkgs; }).set-background;
+  wayland.windowManager.sway =
+    let
+      screenshot = (import ../scripts { inherit pkgs; }).screenshot;
+      set-background = (import ../scripts { inherit pkgs; }).set-background;
 
-    homeDirectory = config.home.homeDirectory;
-    term = "${pkgs.alacritty}/bin/alacritty";
-    filemanager = "${pkgs.gnome.nautilus}/bin/nautilus";
-    colors = {
-      lavender = "#babbf1";
-      black = "#000000";
-    };
-    inputs = {
-      kb = {
-        builtin = "1:1:AT_Translated_Set_2_keyboard";
-        keychron = "1452:591:Keychron_K4_Keychron_K4";
-        keychron_bt = "1452:591:Keychron_K4";
+      homeDirectory = config.home.homeDirectory;
+      term = "${pkgs.alacritty}/bin/alacritty";
+      filemanager = "${pkgs.gnome.nautilus}/bin/nautilus";
+      colors = {
+        lavender = "#babbf1";
+        black = "#000000";
       };
-    };
-    wallpaper = "${homeDirectory}/Pictures/backgrounds/catppucchin";
-    scripts = "${homeDirectory}/.config/system_scripts";
-  in {
-    enable = true;
-    xwayland = true;
-    wrapperFeatures.gtk = true;
-    extraConfigEarly = ''
-      exec systemctl --user import-environment PATH && systemctl --user restart xdg-desktop-portal.service
-    '';
-    extraConfig = ''
-      titlebar_padding 1
-      floating_modifier Mod4 normal
-      bindgesture {
-        swipe:right workspace prev
-        swipe:left workspace next
-        swipe:up focus up
-        swipe:down focus down
-      }
-      workspace 1
-    '';
-    config = {
-      bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
-      modifier = "Mod4";
-      #: Keybindings {{{
-      keybindings = let mod = config.wayland.windowManager.sway.config.modifier;
-      in lib.mkOptionDefault {
-        "${mod}+p" = "exec ${pkgs.swaylock}/bin/swaylock";
-        "${mod}+Shift+p" =
-          "exec ${pkgs.rofi}/bin/rofi -show p -modi p:rofi-power-menu";
-        # Reload the config file
-        "${mod}+Shift+c" = "reload";
-        # Kill the focused window
-        "${mod}+Shift+q" = "kill";
-        # Make focused window fullscreen
-        "${mod}+f" = "fullscreen";
-        # Start launcher
-        "${mod}+d" =
-          "exec rofi -config ${homeDirectory}/.config/rofi/config.rasi -show combi -automatic-save-to-history | xargs swaymsg exec --";
-        # Toggle the current focus between tiling and floating mode
-        "${mod}+Shift+space" = "floating toggle";
-        "${mod}+Return" = "exec ${term}";
-        "${mod}+e" = "exec ${filemanager}";
-        "${mod}+x" = "layout toggle stacking split";
-        "${mod}+Control+Left" = "workspace prev";
-        "${mod}+Control+Right" = "workspace next";
-        "${mod}+n" = "exec ${pkgs.swaynotificationcenter}/bin/swaync-client -t";
-        "--locked XF86MonBrightnessUp" =
-          "exec --no-startup-id ${pkgs.brightnessctl}/bin/brightnessctl s +10%";
-        "--locked XF86MonBrightnessDown" =
-          "exec --no-startup-id ${pkgs.brightnessctl}/bin/brightnessctl s 10%-";
-        "--locked XF86AudioRaiseVolume" =
-          "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -i 5";
-        "--locked XF86AudioLowerVolume" =
-          "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -d 5";
-        "--locked XF86AudioMicMute" =
-          "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer --default-source -m";
-        "--locked XF86AudioMute" =
-          "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t";
-        "--locked XF86AudioPlay" = "exec playerctl play-pause";
-        "--locked XF86AudioPause" = "exec playerctl play-pause";
-        "--locked XF86AudioNext" = "exec playerctl next";
-        "--locked XF86AudioPrev" = "exec playerctl previous";
-        "Print" = "exec ${screenshot}/bin/screenshot";
-        "${mod}+u" = "exec ${screenshot}/bin/screenshot";
-        #: {{{
-        "--input-device=${inputs.kb.builtin} ${mod}+ampersand" =
-          "workspace number 1";
-        "--input-device=${inputs.kb.builtin} ${mod}+eacute" =
-          "workspace number 2";
-        "--input-device=${inputs.kb.builtin} ${mod}+quotedbl" =
-          "workspace number 3";
-        "--input-device=${inputs.kb.builtin} ${mod}+apostrophe" =
-          "workspace number 4";
-        "--input-device=${inputs.kb.builtin} ${mod}+parenleft" =
-          "workspace number 5";
-        "--input-device=${inputs.kb.builtin} ${mod}+minus" =
-          "workspace number 6";
-        "--input-device=${inputs.kb.builtin} ${mod}+egrave" =
-          "workspace number 7";
-        "--input-device=${inputs.kb.builtin} ${mod}+underscore" =
-          "workspace number 8";
-        "--input-device=${inputs.kb.builtin} ${mod}+ccedilla" =
-          "workspace number 9";
-        "--input-device=${inputs.kb.builtin} ${mod}+agrave" =
-          "workspace number 10";
-        "--input-device=${inputs.kb.builtin} ${mod}+Shift+ampersand" =
-          "move container to workspace number 1";
-        "--input-device=${inputs.kb.builtin} ${mod}+Shift+eacute" =
-          "move container to workspace number 2";
-        "--input-device=${inputs.kb.builtin} ${mod}+Shift+quotedbl" =
-          "move container to workspace number 3";
-        "--input-device=${inputs.kb.builtin} ${mod}+Shift+apostrophe" =
-          "move container to workspace number 4";
-        "--input-device=${inputs.kb.builtin} ${mod}+Shift+parenleft" =
-          "move container to workspace number 5";
-        "--input-device=${inputs.kb.builtin} ${mod}+Shift+minus" =
-          "move container to workspace number 6";
-        "--input-device=${inputs.kb.builtin} ${mod}+Shift+egrave" =
-          "move container to workspace number 7";
-        "--input-device=${inputs.kb.builtin} ${mod}+Shift+underscore" =
-          "move container to workspace number 8";
-        "--input-device=${inputs.kb.builtin} ${mod}+Shift+ccedilla" =
-          "move container to workspace number 9";
-        "--input-device=${inputs.kb.builtin} ${mod}+Shift+agrave" =
-          "move container to workspace number 10";
-        #: }}}
-      };
-      #: }}}
-      #: Startup {{{
-      startup = [
-        {
-          command =
-            "${pkgs.swayidle}/bin/swayidle -C ${homeDirectory}/.config/swayidle/config";
-        }
-        {
-
-          command = "${pkgs.swaynotificationcenter}/bin/swaync";
-        }
-        {
-          command = ''
-            [ -z "$(pidof nextcloud)" ] && ${pkgs.nextcloud-client}/bin/nextcloud --background'';
-        }
-        {
-          command = ''
-            [ -z "$(pidof kdeconnect-indicator)" ] && ${pkgs.kdeconnect}/bin/kdeconnect-indicator
-          '';
-        }
-        {
-          command = "${set-background}/bin/set-background -f ${wallpaper}";
-          always = true;
-        }
-        {
-          command =
-            "${pkgs.swaynotificationcenter}/bin/swaync-client --reload-config --reload-css";
-          always = true;
-        }
-      ];
-      #: }}}
-      assigns = {
-        "2" = [{ app_id = "firefox"; }];
-        "3" = [ ];
-        "4" = [{ class = "discord"; }];
-        "5" = [{ app_id = "lollypop"; }];
-      };
-      seat = {
-        "*" = {
-          xcursor_theme = "Catppuccin-Frappe-Lavender-Cursors 32";
-          keyboard_grouping = "none";
+      inputs = {
+        kb = {
+          builtin = "1:1:AT_Translated_Set_2_keyboard";
+          keychron = "1452:591:Keychron_K4_Keychron_K4";
+          keychron_bt = "1452:591:Keychron_K4";
         };
       };
-      window = {
-        border = 3;
-        commands = [
+      wallpaper = "${homeDirectory}/Pictures/backgrounds/catppucchin";
+    in
+    {
+      enable = true;
+      xwayland = true;
+      wrapperFeatures.gtk = true;
+      extraConfigEarly = ''
+        exec systemctl --user import-environment PATH && systemctl --user restart xdg-desktop-portal.service
+      '';
+      extraConfig = ''
+        titlebar_padding 1
+        floating_modifier Mod4 normal
+        bindgesture {
+          swipe:right workspace prev
+          swipe:left workspace next
+          swipe:up focus up
+          swipe:down focus down
+        }
+        workspace 1
+      '';
+      config = {
+        bars = [ { command = "${pkgs.waybar}/bin/waybar"; } ];
+        modifier = "Mod4";
+        #: Keybindings {{{
+        keybindings =
+          let
+            mod = config.wayland.windowManager.sway.config.modifier;
+          in
+          lib.mkOptionDefault {
+            "${mod}+p" = "exec ${pkgs.swaylock}/bin/swaylock";
+            "${mod}+Shift+p" = "exec ${pkgs.rofi}/bin/rofi -show p -modi p:rofi-power-menu";
+            # Reload the config file
+            "${mod}+Shift+c" = "reload";
+            # Kill the focused window
+            "${mod}+Shift+q" = "kill";
+            # Make focused window fullscreen
+            "${mod}+f" = "fullscreen";
+            # Start launcher
+            "${mod}+d" = "exec rofi -config ${homeDirectory}/.config/rofi/config.rasi -show combi -automatic-save-to-history | xargs swaymsg exec --";
+            # Toggle the current focus between tiling and floating mode
+            "${mod}+Shift+space" = "floating toggle";
+            "${mod}+Return" = "exec ${term}";
+            "${mod}+e" = "exec ${filemanager}";
+            "${mod}+x" = "layout toggle stacking split";
+            "${mod}+Control+Left" = "workspace prev";
+            "${mod}+Control+Right" = "workspace next";
+            "${mod}+n" = "exec ${pkgs.swaynotificationcenter}/bin/swaync-client -t";
+            "--locked XF86MonBrightnessUp" = "exec --no-startup-id ${pkgs.brightnessctl}/bin/brightnessctl s +10%";
+            "--locked XF86MonBrightnessDown" = "exec --no-startup-id ${pkgs.brightnessctl}/bin/brightnessctl s 10%-";
+            "--locked XF86AudioRaiseVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -i 5";
+            "--locked XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -d 5";
+            "--locked XF86AudioMicMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer --default-source -m";
+            "--locked XF86AudioMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t";
+            "--locked XF86AudioPlay" = "exec playerctl play-pause";
+            "--locked XF86AudioPause" = "exec playerctl play-pause";
+            "--locked XF86AudioNext" = "exec playerctl next";
+            "--locked XF86AudioPrev" = "exec playerctl previous";
+            "Print" = "exec ${screenshot}/bin/screenshot";
+            "${mod}+u" = "exec ${screenshot}/bin/screenshot";
+            #: {{{
+            "--input-device=${inputs.kb.builtin} ${mod}+ampersand" = "workspace number 1";
+            "--input-device=${inputs.kb.builtin} ${mod}+eacute" = "workspace number 2";
+            "--input-device=${inputs.kb.builtin} ${mod}+quotedbl" = "workspace number 3";
+            "--input-device=${inputs.kb.builtin} ${mod}+apostrophe" = "workspace number 4";
+            "--input-device=${inputs.kb.builtin} ${mod}+parenleft" = "workspace number 5";
+            "--input-device=${inputs.kb.builtin} ${mod}+minus" = "workspace number 6";
+            "--input-device=${inputs.kb.builtin} ${mod}+egrave" = "workspace number 7";
+            "--input-device=${inputs.kb.builtin} ${mod}+underscore" = "workspace number 8";
+            "--input-device=${inputs.kb.builtin} ${mod}+ccedilla" = "workspace number 9";
+            "--input-device=${inputs.kb.builtin} ${mod}+agrave" = "workspace number 10";
+            "--input-device=${inputs.kb.builtin} ${mod}+Shift+ampersand" = "move container to workspace number 1";
+            "--input-device=${inputs.kb.builtin} ${mod}+Shift+eacute" = "move container to workspace number 2";
+            "--input-device=${inputs.kb.builtin} ${mod}+Shift+quotedbl" = "move container to workspace number 3";
+            "--input-device=${inputs.kb.builtin} ${mod}+Shift+apostrophe" = "move container to workspace number 4";
+            "--input-device=${inputs.kb.builtin} ${mod}+Shift+parenleft" = "move container to workspace number 5";
+            "--input-device=${inputs.kb.builtin} ${mod}+Shift+minus" = "move container to workspace number 6";
+            "--input-device=${inputs.kb.builtin} ${mod}+Shift+egrave" = "move container to workspace number 7";
+            "--input-device=${inputs.kb.builtin} ${mod}+Shift+underscore" = "move container to workspace number 8";
+            "--input-device=${inputs.kb.builtin} ${mod}+Shift+ccedilla" = "move container to workspace number 9";
+            "--input-device=${inputs.kb.builtin} ${mod}+Shift+agrave" = "move container to workspace number 10";
+            #: }}}
+          };
+        #: }}}
+        #: Startup {{{
+        startup = [
+          { command = "${pkgs.swayidle}/bin/swayidle -C ${homeDirectory}/.config/swayidle/config"; }
           {
-            command = "inhibit_idle fullscreen";
-            criteria = {
-              class = "^.*$";
-              app_id = "^.*$";
-            };
+
+            command = "${pkgs.swaynotificationcenter}/bin/swaync";
           }
           {
-            command = "floating enable";
-            criteria.app_id = "^(${
+            command = ''[ -z "$(pidof nextcloud)" ] && ${pkgs.nextcloud-client}/bin/nextcloud --background'';
+          }
+          {
+            command = ''
+              [ -z "$(pidof kdeconnect-indicator)" ] && ${pkgs.kdeconnect}/bin/kdeconnect-indicator
+            '';
+          }
+          {
+            command = "${set-background}/bin/set-background -f ${wallpaper}";
+            always = true;
+          }
+          {
+            command = "${pkgs.swaynotificationcenter}/bin/swaync-client --reload-config --reload-css";
+            always = true;
+          }
+        ];
+        #: }}}
+        assigns = {
+          "2" = [ { app_id = "firefox"; } ];
+          "3" = [ ];
+          "4" = [ { class = "discord"; } ];
+          "5" = [ { app_id = "lollypop"; } ];
+        };
+        seat = {
+          "*" = {
+            xcursor_theme = "Catppuccin-Frappe-Lavender-Cursors 32";
+            keyboard_grouping = "none";
+          };
+        };
+        window = {
+          border = 3;
+          commands = [
+            {
+              command = "inhibit_idle fullscreen";
+              criteria = {
+                class = "^.*$";
+                app_id = "^.*$";
+              };
+            }
+            {
+              command = "floating enable";
+              criteria.app_id = "^(${
                 (lib.strings.concatStringsSep "|" [
                   "org.keepassxc.KeePassXC"
                   "xdg-desktop-portal-gtk"
@@ -190,61 +170,64 @@
                   "com.nextcloud.desktopclient.nextcloud"
                 ])
               })$";
-
-          }
-          {
-            command = ''title_format "[XWayland] %title"'';
-            criteria.shell = "xwayland";
-          }
-          {
-            command = "move position mouse";
-            criteria.app_id = "com.nextcloud.desktopclient.nextcloud";
-          }
-        ];
+            }
+            {
+              command = ''title_format "[XWayland] %title"'';
+              criteria.shell = "xwayland";
+            }
+            {
+              command = "move position mouse";
+              criteria.app_id = "com.nextcloud.desktopclient.nextcloud";
+            }
+          ];
+        };
+        terminal = "${term}";
+        colors = with colors; {
+          focused = {
+            border = lavender;
+            background = lavender;
+            text = black;
+            indicator = "#00d4ff";
+            childBorder = lavender;
+          };
+        };
+        gaps = {
+          inner = 5;
+        };
+        #: Input {{{
+        input = {
+          "*" = {
+            xkb_layout = "fr,us";
+            xkb_options = "grp:alt_shift_toggle,compose:caps";
+          };
+          "${inputs.kb.builtin}" = {
+            xkb_layout = "fr";
+          };
+          "${inputs.kb.keychron}" = {
+            xkb_layout = "us";
+            xkb_numlock = "enabled";
+          };
+          "${inputs.kb.keychron_bt}" = {
+            xkb_layout = "us";
+            xkb_numlock = "enabled";
+          };
+          "type:touchpad" = {
+            tap = "enabled";
+            natural_scroll = "enabled";
+            click_method = "clickfinger";
+          };
+        };
+        #: }}}
+        #: Output {{{
+        output = {
+          eDP-1 = {
+            scale = "2";
+            pos = "0 0";
+            res = "3840x2400";
+            adaptive_sync = "on";
+          };
+        };
+        #: }}}
       };
-      terminal = "${term}";
-      colors = with colors; {
-        focused = {
-          border = lavender;
-          background = lavender;
-          text = black;
-          indicator = "#00d4ff";
-          childBorder = lavender;
-        };
-      };
-      gaps = { inner = 5; };
-      #: Input {{{
-      input = {
-        "*" = {
-          xkb_layout = "fr,us";
-          xkb_options = "grp:alt_shift_toggle,compose:caps";
-        };
-        "${inputs.kb.builtin}" = { xkb_layout = "fr"; };
-        "${inputs.kb.keychron}" = {
-          xkb_layout = "us";
-          xkb_numlock = "enabled";
-        };
-        "${inputs.kb.keychron_bt}" = {
-          xkb_layout = "us";
-          xkb_numlock = "enabled";
-        };
-        "type:touchpad" = {
-          tap = "enabled";
-          natural_scroll = "enabled";
-          click_method = "clickfinger";
-        };
-      };
-      #: }}}
-      #: Output {{{
-      output = {
-        eDP-1 = {
-          scale = "2";
-          pos = "0 0";
-          res = "3840x2400";
-          adaptive_sync = "on";
-        };
-      };
-      #: }}}
     };
-  };
 }
diff --git a/home/sway/swayidle.nix b/home/sway/swayidle.nix
index 072119b..d1fa0d7 100644
--- a/home/sway/swayidle.nix
+++ b/home/sway/swayidle.nix
@@ -1,4 +1,5 @@
-{ pkgs, config, lib, ... }: {
+{ pkgs, ... }:
+{
   services.swayidle = {
     enable = true;
     events = [
diff --git a/home/sway/swaylock.nix b/home/sway/swaylock.nix
index 069d70d..951a6e4 100644
--- a/home/sway/swaylock.nix
+++ b/home/sway/swaylock.nix
@@ -1,4 +1,4 @@
-{ pkgs, config, lib, ... }:
+{ pkgs, ... }:
 
 let
   pointer = {
@@ -6,8 +6,11 @@ let
     package = pkgs.catppuccin-cursors.frappeLavender;
     size = 32;
   };
-in {
-  programs.swaylock = { enable = true; };
+in
+{
+  programs.swaylock = {
+    enable = true;
+  };
   gtk = {
     enable = true;
     theme = {
diff --git a/home/thunderbird/default.nix b/home/thunderbird/default.nix
index b570124..3e63b89 100644
--- a/home/thunderbird/default.nix
+++ b/home/thunderbird/default.nix
@@ -1,7 +1,10 @@
-{ pkgs, config, lib, ... }: {
+{ ... }:
+{
   programs.thunderbird = {
     enable = true;
     #settings = { mailnews.wraplength = 80; };
-    profiles.nico = { isDefault = true; };
+    profiles.nico = {
+      isDefault = true;
+    };
   };
 }
diff --git a/hosts/xps9510/configuration.nix b/hosts/xps9510/configuration.nix
index 4c55cfb..7700d31 100644
--- a/hosts/xps9510/configuration.nix
+++ b/hosts/xps9510/configuration.nix
@@ -1,13 +1,20 @@
 # vim:fileencoding=utf-8:foldmethod=marker
-{ config, pkgs, lib, inputs, system, unstable, ... }:
+{
+  config,
+  pkgs,
+  inputs,
+  system,
+  ...
+}:
 let
   stateVersion = "23.11";
   username = "nico";
-  hostename = "xps9510";
+  hostname = "xps9510";
   homeDirectory = "/home/${username}";
-
-in {
-  imports = [ # Include the results of the hardware scan.
+in
+{
+  imports = [
+    # Include the results of the hardware scan.
     ./hardware-configuration.nix
     inputs.home-manager.nixosModules.home-manager
     ../../modules
@@ -17,13 +24,9 @@ in {
   boot.loader.systemd-boot.enable = true;
   boot.loader.efi.canTouchEfiVariables = true;
 
-  boot.initrd.luks.devices."luks-7adaa102-d438-4e9e-9972-4a3c91b887b3".device =
-    "/dev/disk/by-uuid/7adaa102-d438-4e9e-9972-4a3c91b887b3";
-  networking.hostName = hostename;
+  boot.initrd.luks.devices."luks-7adaa102-d438-4e9e-9972-4a3c91b887b3".device = "/dev/disk/by-uuid/7adaa102-d438-4e9e-9972-4a3c91b887b3";
+  networking.hostName = hostname;
 
-  # Configure network proxy if necessary
-  # networking.proxy.default = "http://user:password@proxy:port/";
-  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
   # Enable networking
   networking.networkmanager.enable = true;
 
@@ -52,26 +55,35 @@ in {
 
   xdg.mime = {
     enable = true;
-    defaultApplications = let
-      fileManager = "org.gnome.Nautilus.desktop";
-      browser = "firefox.desktop";
-    in {
-      "inode/directory" = fileManager;
-      "application/zip" = fileManager;
-      "application/pdf" = browser;
-      "x-www-browser" = browser;
-      "text/html" = browser;
-      "image/*" = "org.gnome.Loupe.desktop";
-      "image/png" = "org.gnome.Loupe.desktop";
-      "image/jpeg" = "org.gnome.Loupe.desktop";
-      "x-scheme-handler/http" = browser;
-      "x-scheme-handler/https" = browser;
-    };
+    defaultApplications =
+      let
+        fileManager = "org.gnome.Nautilus.desktop";
+        browser = "firefox.desktop";
+      in
+      {
+        "inode/directory" = fileManager;
+        "application/zip" = fileManager;
+        "application/pdf" = browser;
+        "x-www-browser" = browser;
+        "text/html" = browser;
+        "image/*" = "org.gnome.Loupe.desktop";
+        "image/png" = "org.gnome.Loupe.desktop";
+        "image/jpeg" = "org.gnome.Loupe.desktop";
+        "x-scheme-handler/http" = browser;
+        "x-scheme-handler/https" = browser;
+      };
   };
 
   home-manager.users.${username} = import ../../home {
-    inherit config pkgs system inputs stateVersion username homeDirectory
-      unstable;
+    inherit
+      config
+      pkgs
+      system
+      inputs
+      stateVersion
+      username
+      homeDirectory
+      ;
   };
 
   #  home-manager.users.nico =
@@ -79,7 +91,7 @@ in {
   #{ config, pkgs, ... }:
   #programs.vscode = {
   #enable = false;
-  #package = unstable.vscodium;
+  #package = vscodium;
   #extensions = with pkgs.vscode-extensions; [
   #yzhang.markdown-all-in-one
   #rust-lang.rust-analyzer
@@ -117,7 +129,6 @@ in {
       #Optional helps save long term battery health
       START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
       STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
-
     };
   };
 
@@ -153,15 +164,19 @@ in {
   users.users.${username} = {
     isNormalUser = true;
     createHome = true;
-    extraGroups = [ "networkmanager" "wheel" "audio" "libvirtd" ];
+    extraGroups = [
+      "networkmanager"
+      "wheel"
+      "audio"
+      "libvirtd"
+    ];
   };
 
   services.greetd = {
     enable = true;
     settings = rec {
       initial_session = {
-        command =
-          "${pkgs.greetd.greetd}/bin/agreety --cmd ${pkgs.sway}/bin/sway";
+        command = "${pkgs.greetd.greetd}/bin/agreety --cmd ${pkgs.sway}/bin/sway";
         user = "${username}";
       };
       default_session = initial_session;
@@ -179,7 +194,7 @@ in {
   #grim
   #slurp
   #wl-clipboard
-  #unstable.swaynotificationcenter
+  #swaynotificationcenter
   #swaybg
   #swaylock
   #swayidle
@@ -208,10 +223,11 @@ in {
   environment.systemPackages = with pkgs; [
     shared-mime-info
     fish
-    firefox
     nextcloud-client
     git
     keepassxc
+    firefox
+    htop
     alacritty
     eza
     bat
@@ -224,7 +240,6 @@ in {
     dconf
     pavucontrol
     xdg-utils
-    htop
     brightnessctl
   ];
 
diff --git a/hosts/xps9510/hardware-configuration.nix b/hosts/xps9510/hardware-configuration.nix
index 6e32819..1d79056 100644
--- a/hosts/xps9510/hardware-configuration.nix
+++ b/hosts/xps9510/hardware-configuration.nix
@@ -1,7 +1,12 @@
 # Do not modify this file!  It was generated by ‘nixos-generate-config’
 # and may be overwritten by future invocations.  Please make changes
 # to /etc/nixos/configuration.nix instead.
-{ config, lib, pkgs, modulesPath, ... }:
+{
+  config,
+  lib,
+  modulesPath,
+  ...
+}:
 
 {
   imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
@@ -24,16 +29,14 @@
     fsType = "ext4";
   };
 
-  boot.initrd.luks.devices."luks-ef68c7a7-4355-4c37-bd6f-b753f6b9520c".device =
-    "/dev/disk/by-uuid/ef68c7a7-4355-4c37-bd6f-b753f6b9520c";
+  boot.initrd.luks.devices."luks-ef68c7a7-4355-4c37-bd6f-b753f6b9520c".device = "/dev/disk/by-uuid/ef68c7a7-4355-4c37-bd6f-b753f6b9520c";
 
   fileSystems."/boot" = {
     device = "/dev/disk/by-uuid/83C5-F9F2";
     fsType = "vfat";
   };
 
-  swapDevices =
-    [{ device = "/dev/disk/by-uuid/ba211282-a02a-42d6-9a89-9998ffee4755"; }];
+  swapDevices = [ { device = "/dev/disk/by-uuid/ba211282-a02a-42d6-9a89-9998ffee4755"; } ];
 
   # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
   # (the default) this is the recommended approach. When using systemd-networkd it's
@@ -43,6 +46,5 @@
   # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
 
   nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
-  hardware.cpu.intel.updateMicrocode =
-    lib.mkDefault config.hardware.enableRedistributableFirmware;
+  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
 }