aboutsummaryrefslogtreecommitdiff
path: root/modules/home-manager/i3
diff options
context:
space:
mode:
authorDylan <boss@tehbox.org>2026-10-17 22:02:09 +1300
committerDylan <boss@tehbox.org>2026-10-17 22:04:40 +1300
commit008b591a0a5942ae42f4c07a5abbee4dbd2d0743 (patch)
tree0ae88a36bc00ede3b43b31489adae633dc54e8cd /modules/home-manager/i3
parent280e1bbe5e733128a451260685cc8ecd10a042a3 (diff)
downloadnixos-configuration-008b591a0a5942ae42f4c07a5abbee4dbd2d0743.tar.gz
nixos-configuration-008b591a0a5942ae42f4c07a5abbee4dbd2d0743.zip
feat: Formatting changes
Diffstat (limited to 'modules/home-manager/i3')
-rw-r--r--modules/home-manager/i3/default.nix86
-rw-r--r--modules/home-manager/i3/i3-commands.nix48
-rw-r--r--modules/home-manager/i3/rofi-passmenu.nix138
3 files changed, 136 insertions, 136 deletions
diff --git a/modules/home-manager/i3/default.nix b/modules/home-manager/i3/default.nix
index 982aea1..757c7a9 100644
--- a/modules/home-manager/i3/default.nix
+++ b/modules/home-manager/i3/default.nix
@@ -1,49 +1,49 @@
{ inputs, config, ... }:
let
- hm = config.flake.modules.homeManager;
+ hm = config.flake.modules.homeManager;
in
{
- flake.modules.homeManager.i3 =
- # let
- # nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.11";
- # pkgs = import nixpkgs { config = {}; overlays = []; };
- # in
- # {
- # i3-commands = pkgs.callPackage ./i3-commands.nix { };
- # }
+ flake.modules.homeManager.i3 =
+ # let
+ # nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.11";
+ # pkgs = import nixpkgs { config = {}; overlays = []; };
+ # in
+ # {
+ # i3-commands = pkgs.callPackage ./i3-commands.nix { };
+ # }
-
- {
- config,
- pkgs,
- ...
- } : {
- imports = [
- hm.polybar
- hm.rofi
- hm.kitty
- hm.picom
- ];
- xsession.enable = true;
- xsession.windowManager.i3 = {
- enable = true;
- package = pkgs.i3;
- };
- xdg.configFile."i3/config".enable = false;
- home.file.".config/i3/config" = {
- source = ./config;
- onChange = "${pkgs.i3}/bin/i3-msg restart";
- };
- home.packages = with pkgs; [
- i3lock
- xss-lock
- networkmanagerapplet
- flameshot
- picom
- nitrogen
- pamixer
- inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.i3-commands
- inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.rofi-passmenu
- ];
- };
+ {
+ config,
+ pkgs,
+ ...
+ }:
+ {
+ imports = [
+ hm.polybar
+ hm.rofi
+ hm.kitty
+ hm.picom
+ ];
+ xsession.enable = true;
+ xsession.windowManager.i3 = {
+ enable = true;
+ package = pkgs.i3;
+ };
+ xdg.configFile."i3/config".enable = false;
+ home.file.".config/i3/config" = {
+ source = ./config;
+ onChange = "${pkgs.i3}/bin/i3-msg restart";
+ };
+ home.packages = with pkgs; [
+ i3lock
+ xss-lock
+ networkmanagerapplet
+ flameshot
+ picom
+ nitrogen
+ pamixer
+ inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.i3-commands
+ inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.rofi-passmenu
+ ];
+ };
}
diff --git a/modules/home-manager/i3/i3-commands.nix b/modules/home-manager/i3/i3-commands.nix
index d3df9a4..fdfafb3 100644
--- a/modules/home-manager/i3/i3-commands.nix
+++ b/modules/home-manager/i3/i3-commands.nix
@@ -1,28 +1,28 @@
{
- perSystem =
- { pkgs, ... }:
- {
- packages.i3-commands = pkgs.callPackage (
- {
- stdenv,
- lib
- }:
- stdenv.mkDerivation {
- pname = "i3-commands";
- version = "0.0.1";
+ perSystem =
+ { pkgs, ... }:
+ {
+ packages.i3-commands = pkgs.callPackage (
+ {
+ stdenv,
+ lib,
+ }:
+ stdenv.mkDerivation {
+ pname = "i3-commands";
+ version = "0.0.1";
- srcs = lib.cleanSourceWith {
- src = ./scripts;
- filter = path: type: baseNameOf path != "rofi-passmenu";
- };
+ srcs = lib.cleanSourceWith {
+ src = ./scripts;
+ filter = path: type: baseNameOf path != "rofi-passmenu";
+ };
- installPhase = ''
- runHook preInstall
- mkdir -p $out/bin
- install -D -m 755 ./* $out/bin
- runHook postInstall
- '';
- }
- ) { };
- };
+ installPhase = ''
+ runHook preInstall
+ mkdir -p $out/bin
+ install -D -m 755 ./* $out/bin
+ runHook postInstall
+ '';
+ }
+ ) { };
+ };
}
diff --git a/modules/home-manager/i3/rofi-passmenu.nix b/modules/home-manager/i3/rofi-passmenu.nix
index 006fcb3..0cd60d2 100644
--- a/modules/home-manager/i3/rofi-passmenu.nix
+++ b/modules/home-manager/i3/rofi-passmenu.nix
@@ -1,80 +1,80 @@
{
- perSystem =
- { pkgs, ... }:
- {
- packages.rofi-passmenu = pkgs.callPackage (
- {
- pkgs
- }:
+ perSystem =
+ { pkgs, ... }:
+ {
+ packages.rofi-passmenu = pkgs.callPackage (
+ {
+ pkgs,
+ }:
- pkgs.writeShellApplication {
- name = "rofi-passmenu";
+ pkgs.writeShellApplication {
+ name = "rofi-passmenu";
- runtimeInputs = with pkgs; [
- pass
- rofi
- xclip
- xdotool
- gnugrep
- gawk
- coreutils
- libnotify
- ];
+ runtimeInputs = with pkgs; [
+ pass
+ rofi
+ xclip
+ xdotool
+ gnugrep
+ gawk
+ coreutils
+ libnotify
+ ];
- text = ''
- #!/usr/bin/env bash
+ text = ''
+ #!/usr/bin/env bash
- store_dir="''${PASSWORD_STORE_DIR:-$HOME/.password-store}"
+ store_dir="''${PASSWORD_STORE_DIR:-$HOME/.password-store}"
- get_passwords() {
- echo "[+] Add New Password"
- if [ -d "$store_dir" ]; then
- find "$store_dir" -name "*.gpg" | sort | while IFS= read -r file; do
- pass="''${file#"$store_dir"/}"
- echo "''${pass%.gpg}"
- done
- fi
- }
+ get_passwords() {
+ echo "[+] Add New Password"
+ if [ -d "$store_dir" ]; then
+ find "$store_dir" -name "*.gpg" | sort | while IFS= read -r file; do
+ pass="''${file#"$store_dir"/}"
+ echo "''${pass%.gpg}"
+ done
+ fi
+ }
- selected=$(get_passwords | rofi -dmenu -i -p "pass")
- [[ -z "$selected" ]] && exit 0
+ selected=$(get_passwords | rofi -dmenu -i -p "pass")
+ [[ -z "$selected" ]] && exit 0
- if [[ "$selected" == "[+] Add New Password" ]]; then
- new_path=$(rofi -dmenu -p "Enter path/name for new password:")
- [[ -z "$new_path" ]] && exit 0
-
- choice=$(echo -e "Generate\nManual" | rofi -dmenu -p "Password method:")
- if [[ "$choice" == "Generate" ]]; then
- pass generate "$new_path" 20
- notify-send "Pass" "Generated password for $new_path"
- elif [[ "$choice" == "Manual" ]]; then
- new_pass=$(rofi -dmenu -p "Enter password:" -password)
- [[ -n "$new_pass" ]] && echo "$new_pass" | pass insert -m "$new_path"
- fi
- exit 0
- fi
+ if [[ "$selected" == "[+] Add New Password" ]]; then
+ new_path=$(rofi -dmenu -p "Enter path/name for new password:")
+ [[ -z "$new_path" ]] && exit 0
+
+ choice=$(echo -e "Generate\nManual" | rofi -dmenu -p "Password method:")
+ if [[ "$choice" == "Generate" ]]; then
+ pass generate "$new_path" 20
+ notify-send "Pass" "Generated password for $new_path"
+ elif [[ "$choice" == "Manual" ]]; then
+ new_pass=$(rofi -dmenu -p "Enter password:" -password)
+ [[ -n "$new_pass" ]] && echo "$new_pass" | pass insert -m "$new_path"
+ fi
+ exit 0
+ fi
- action=$(echo -e "1. Type Password\n2. Type Username\n3. Copy Password\n4. Copy Username\n5. Show Password" | rofi -dmenu -i -p "$selected")
+ action=$(echo -e "1. Type Password\n2. Type Username\n3. Copy Password\n4. Copy Username\n5. Show Password" | rofi -dmenu -i -p "$selected")
- case "$action" in
- "1. Type Password")
- pass show "$selected" | head -n 1 | tr -d '\n' | xdotool type --clearmodifiers -fi -
- ;;
- "2. Type Username")
- pass show "$selected" | grep -i "^username:" | sed 's/^[^:]*:[[:space:]]*//' | tr -d '\n' | xdotool type --clearmodifiers -fi -
- ;;
- "3. Copy Password")
- pass show -c "$selected"
- ;;
- "4. Copy Username")
- pass show "$selected" | grep -i "^username:" | sed 's/^[^:]*:[[:space:]]*//' | xclip -selection clipboard
- ;;
- "5. Show Password")
- pass show "$selected" | head -n 1 | rofi -dmenu -p "Password for $selected"
- ;;
- esac
- '';
- }
- ) { };
- };
+ case "$action" in
+ "1. Type Password")
+ pass show "$selected" | head -n 1 | tr -d '\n' | xdotool type --clearmodifiers -fi -
+ ;;
+ "2. Type Username")
+ pass show "$selected" | grep -i "^username:" | sed 's/^[^:]*:[[:space:]]*//' | tr -d '\n' | xdotool type --clearmodifiers -fi -
+ ;;
+ "3. Copy Password")
+ pass show -c "$selected"
+ ;;
+ "4. Copy Username")
+ pass show "$selected" | grep -i "^username:" | sed 's/^[^:]*:[[:space:]]*//' | xclip -selection clipboard
+ ;;
+ "5. Show Password")
+ pass show "$selected" | head -n 1 | rofi -dmenu -p "Password for $selected"
+ ;;
+ esac
+ '';
+ }
+ ) { };
+ };
}