diff --git a/.envrc b/.envrc index 894571b..5bf8fc1 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,3 @@ -source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k=" +source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0=" -use devenv +use devenv \ No newline at end of file diff --git a/README.md b/README.md index 4f7f464..20e1c2b 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,19 @@ # My NixOS configuration - - system: `"x86_64-linux"` - - host os: `Linux 6.12.2-zen1, NixOS, 25.05 (Warbler), 25.05.20241229.88195a9` - - multi-user?: `yes` - - sandbox: `yes` - - version: `nix-env (Nix) 2.24.11` - - channels(root): `"nixos"` - - nixpkgs: `/nix/store/8vz84mqgnm1gz5yk7hgnnb5gir5hjxas-source` + +- system: `"x86_64-linux"` +- host os: `Linux 6.6.44, NixOS, 24.11 (Vicuna), 24.11.20240804.cb9a96f` +- multi-user?: `yes` +- sandbox: `yes` +- version: `nix-env (Nix) 2.18.5` +- channels(root): `"nixos"` +- nixpkgs: `/nix/store/4cpakzyvfw1rmm9v5i3387x6jd2h1v86-source` ## Installation This configuration is dependent on flakes being enabled in the system building the config. -### Build script -Build the default version of this configuration. ``` -wget https://raw.githubusercontent.com/stvnliu/nixos-configuration/refs/heads/main/deploy.sh -chmod +x ./deploy.sh -./deploy.sh https://github.com/stvnliu/nixos-configuration nixos-msi -``` - -or manually: - -```sh -git clone -sudo nixos-rebuild --flake # boot +sudo nixos-rebuild --flake # switch ``` ## Features diff --git a/common/variables.nix b/common/variables.nix index 5137b06..a890e3a 100644 --- a/common/variables.nix +++ b/common/variables.nix @@ -1,72 +1,34 @@ -{ config, pkgs, lib, ... }: -let - monitorMaxBrightness = "255"; - # monitorMinBrightness = "32"; - stylixBG = config.lib.stylix.colors.base00; - stylixFG = config.lib.stylix.colors.base07; - stylixPrimaryBG = config.lib.stylix.colors.base12; -in { + config, + pkgs, + lib, + ... +}: { # Type definitions for nix variables used in this configuration options = with lib; - with types; { - usingMusicPlayerDaemon = mkOption { type = bool; }; - defaultApplications = { - fileManager = mkOption { type = str; }; - appLauncher = mkOption { type = str; }; - terminal = mkOption { type = str; }; - }; - myWallPaperPath = mkOption { type = path; }; - myUserName = mkOption { type = str; }; - myHostName = mkOption { type = str; }; - myWallPaperPathString = mkOption { type = str; }; - myDisplayName = mkOption { type = str; }; - myEmail = mkOption { type = str; }; - displayScale = mkOption { type = int; }; - myAutostartCommands = mkOption { type = listOf str; }; - myConfigLocation = mkOption { type = str; }; - desktopFont = { - shortName = mkOption { type = str; }; - fullName = mkOption { type = str; }; - package = mkOption { type = package; }; - }; - }; + with types; { + myUserName = mkOption {type = str;}; + myHostName = mkOption {type = str;}; + myWallPaperPathString = mkOption {type = str;}; + myDisplayName = mkOption {type = str;}; + myEmail = mkOption {type = str;}; + displayScale = mkOption {type = int;}; + myAutostartCommands = mkOption {type = listOf str;}; + myConfigLocation = mkOption {type = str;}; + }; # Default values for this configuration config = rec { myUserName = "stvnliu"; - myWallPaperPath = ../home-manager/${myUserName}/assets/od_neon.png; myHostName = "nixos-msi"; - displayScale = 2; - myWallPaperPathString = "/home/${myUserName}/wallpaper.png"; + displayScale = 1; + myWallPaperPathString = "/home/${myUserName}/wallpaper.jpg"; myDisplayName = "Zhongheng Liu"; myEmail = "z.liu@outlook.com.gr"; - /* specialisation."powersave".configuration = { - myAutostartCommands = - [ "${pkgs.brightnessctl}/bin/brightnessctl s ${monitorMinBrightness}" ]; - }; - */ - myConfigLocation = - "/home/${myUserName}/Development/Nix/nixos-configuration"; - desktopFont = { - shortName = "0xProto Nerd Font"; - fullName = "${desktopFont.shortName}:style=Regular"; - package = pkgs.nerd-fonts._0xproto; - }; myAutostartCommands = [ - "${pkgs.brightnessctl}/bin/brightnessctl s ${monitorMaxBrightness}" "fcitx5" - # "${pkgs.foot}/bin/foot --server -f \"${desktopFontFullName}:size=12\" -o colors.alpha=0.85" "${pkgs.udiskie}/bin/udiskie" - "${pkgs.pa-notify}/bin/pa-notify" - "${pkgs.networkmanagerapplet}/bin/nm-applet" ]; - defaultApplications = { - terminal = "${pkgs.foot}/bin/footclient"; - fileManager = "${pkgs.nemo}/bin/nemo"; - appLauncher = '' - ${pkgs.wmenu}/bin/wmenu-run -p "Launch a program..." -N ${stylixBG} -n ${stylixFG} -S ${stylixPrimaryBG}''; - }; - usingMusicPlayerDaemon = true; + myConfigLocation = "/home/${myUserName}/nix-conf"; }; } diff --git a/deploy.sh b/deploy.sh deleted file mode 100644 index cc2aaf5..0000000 --- a/deploy.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env sh - -# Deploys the configuation to your machine - -TMP_DIRNAME="/tmp/nix-config" -GIT_REMOTE_SRC=$1 -NIX_HOST=$2 -echo "Going to clone $GIT_REMOTE_SRC into $TMP_DIRNAME" -mkdir "$TMP_DIRNAME" - -git clone "$GIT_REMOTE_SRC" "$TMP_DIRNAME" -prev=$PWD -cd "$TMP_DIRNAME" || return -echo "Now going to build nix configuration for $NIX_HOST to switch on next boot" -sudo nixos-rebuild --flake .#"$NIX_HOST" boot - -cd "$prev" || return - diff --git a/devenv.lock b/devenv.lock index 1fe7a61..c2f426c 100644 --- a/devenv.lock +++ b/devenv.lock @@ -3,10 +3,11 @@ "devenv": { "locked": { "dir": "src/modules", - "lastModified": 1732298876, + "lastModified": 1723156315, "owner": "cachix", "repo": "devenv", - "rev": "741e23a22f3dc9e53075be3eaa795ea9ed6f5129", + "rev": "ff5eb4f2accbcda963af67f1a1159e3f6c7f5f91", + "treeHash": "6624b16e4203ef3eae59ce8d5d19005e04741537", "type": "github" }, "original": { @@ -23,6 +24,7 @@ "owner": "edolstra", "repo": "flake-compat", "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb", "type": "github" }, "original": { @@ -43,6 +45,7 @@ "owner": "hercules-ci", "repo": "gitignore.nix", "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9", "type": "github" }, "original": { @@ -57,6 +60,7 @@ "owner": "cachix", "repo": "devenv-nixpkgs", "rev": "4267e705586473d3e5c8d50299e71503f16a6fb6", + "treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412", "type": "github" }, "original": { @@ -68,10 +72,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1731797254, + "lastModified": 1722869614, "owner": "NixOS", "repo": "nixpkgs", - "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", + "rev": "883180e6550c1723395a3a342f830bfc5c371f6b", + "treeHash": "e3ce01703c0d0324121e0d3ec6336275025b4ae6", "type": "github" }, "original": { @@ -91,10 +96,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1732021966, + "lastModified": 1723056346, "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "3308484d1a443fc5bc92012435d79e80458fe43c", + "rev": "3c977f1c9930f54066c085305b4b2291385e7a73", + "treeHash": "d6f89338ffb2ca32c20bc0f8d50009e1894ab804", "type": "github" }, "original": { diff --git a/devenv.nix b/devenv.nix index c32313f..475b359 100644 --- a/devenv.nix +++ b/devenv.nix @@ -1,18 +1,23 @@ -{ pkgs, ... }: { +{ + pkgs, + lib, + config, + inputs, + ... +}: { # https://devenv.sh/basics/ env.GREET = "devenv"; cachix.enable = false; # https://devenv.sh/packages/ - packages = [ pkgs.git ]; + packages = [pkgs.git]; # https://devenv.sh/languages/ # languages.rust.enable = true; languages.nix.enable = true; pre-commit.hooks = { - nixpkgs-fmt.enable = true; + alejandra.enable = true; shellcheck.enable = true; commitizen.enable = true; - deadnix.enable = true; }; # https://devenv.sh/processes/ # processes.cargo-watch.exec = "cargo-watch"; @@ -24,20 +29,18 @@ scripts.hello.exec = '' echo hello from $GREET ''; - scripts.about.exec = '' - ${pkgs.glow}/bin/glow -p ./README.md - less ./LICENSE - ''; enterShell = '' hello git --version - nixpkgs-fmt --version + alejandra --version ''; # https://devenv.sh/tests/ enterTest = - # shell + /* + shell + */ '' echo "Running tests" git --version | grep --color=auto "${pkgs.git.version}" diff --git a/flake.lock b/flake.lock index 5643628..75808ce 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1746562888, - "narHash": "sha256-YgNJQyB5dQiwavdDFBMNKk1wyS77AtdgDk/VtU6wEaI=", + "lastModified": 1708890466, + "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", "owner": "SenchoPens", "repo": "base16.nix", - "rev": "806a1777a5db2a1ef9d5d6f493ef2381047f2b89", + "rev": "665b3c6748534eb766c777298721cece9453fdae", "type": "github" }, "original": { @@ -34,14 +34,30 @@ "type": "github" } }, + "base16-foot": { + "flake": false, + "locked": { + "lastModified": 1696725948, + "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", + "owner": "tinted-theming", + "repo": "base16-foot", + "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-foot", + "type": "github" + } + }, "base16-helix": { "flake": false, "locked": { - "lastModified": 1736852337, - "narHash": "sha256-esD42YdgLlEh7koBrSqcT7p2fsMctPAcGl/+2sYJa2o=", + "lastModified": 1720809814, + "narHash": "sha256-numb3xigRGnr/deF7wdjBwVg7fpbTH7reFDkJ75AJkY=", "owner": "tinted-theming", "repo": "base16-helix", - "rev": "03860521c40b0b9c04818f2218d9cc9efc21e7a5", + "rev": "34f41987bec14c0f3f6b2155c19787b1f6489625", "type": "github" }, "original": { @@ -50,46 +66,113 @@ "type": "github" } }, + "base16-kitty": { + "flake": false, + "locked": { + "lastModified": 1665001328, + "narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=", + "owner": "kdrag0n", + "repo": "base16-kitty", + "rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805", + "type": "github" + }, + "original": { + "owner": "kdrag0n", + "repo": "base16-kitty", + "type": "github" + } + }, + "base16-tmux": { + "flake": false, + "locked": { + "lastModified": 1696725902, + "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", + "owner": "tinted-theming", + "repo": "base16-tmux", + "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-tmux", + "type": "github" + } + }, "base16-vim": { "flake": false, "locked": { - "lastModified": 1732806396, - "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "lastModified": 1716150083, + "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", "owner": "tinted-theming", "repo": "base16-vim", - "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", "type": "github" }, "original": { "owner": "tinted-theming", "repo": "base16-vim", - "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", "type": "github" } }, - "firefox-gnome-theme": { - "flake": false, + "devshell": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1744642301, - "narHash": "sha256-5A6LL7T0lttn1vrKsNOKUk9V0ittdW0VEqh6AtefxJ4=", - "owner": "rafaelmardojai", - "repo": "firefox-gnome-theme", - "rev": "59e3de00f01e5adb851d824cf7911bd90c31083a", + "lastModified": 1722113426, + "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", + "owner": "numtide", + "repo": "devshell", + "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", "type": "github" }, "original": { - "owner": "rafaelmardojai", - "repo": "firefox-gnome-theme", + "owner": "numtide", + "repo": "devshell", "type": "github" } }, "flake-compat": { "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "type": "github" }, "original": { @@ -99,24 +182,6 @@ } }, "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1735774679, - "narHash": "sha256-soePLBazJk0qQdDVhdbM98vYdssfs3WFedcq+raipRI=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "f2f7418ce0ab4a5309a4596161d154cfc877af66", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_2": { "inputs": { "nixpkgs-lib": [ "nixvim", @@ -124,33 +189,11 @@ ] }, "locked": { - "lastModified": 1743550720, - "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c621e8422220273271f52058f618c94e405bb0f5", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_3": { - "inputs": { - "nixpkgs-lib": [ - "stylix", - "nur", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", "type": "github" }, "original": { @@ -161,14 +204,14 @@ }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems" }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -185,11 +228,11 @@ ] }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -201,11 +244,11 @@ "fromYaml": { "flake": false, "locked": { - "lastModified": 1731966426, - "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "lastModified": 1689549921, + "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", "owner": "SenchoPens", "repo": "fromYaml", - "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", "type": "github" }, "original": { @@ -217,21 +260,25 @@ "git-hooks": { "inputs": { "flake-compat": [ - "stylix", + "nixvim", "flake-compat" ], "gitignore": "gitignore", "nixpkgs": [ - "stylix", + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1742649964, - "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", + "lastModified": 1724440431, + "narHash": "sha256-9etXEOUtzeMgqg1u0wp+EdwG7RpmrAZ2yX516bMj2aE=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", + "rev": "c8a54057aae480c56e28ef3e14e4960628ac495b", "type": "github" }, "original": { @@ -243,7 +290,7 @@ "gitignore": { "inputs": { "nixpkgs": [ - "stylix", + "nixvim", "git-hooks", "nixpkgs" ] @@ -265,16 +312,16 @@ "gnome-shell": { "flake": false, "locked": { - "lastModified": 1732369855, - "narHash": "sha256-JhUWbcYPjHO3Xs3x9/Z9RuqXbcp5yhPluGjwsdE2GMg=", + "lastModified": 1713702291, + "narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=", "owner": "GNOME", "repo": "gnome-shell", - "rev": "dadd58f630eeea41d645ee225a63f719390829dc", + "rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934", "type": "github" }, "original": { "owner": "GNOME", - "ref": "47.2", + "ref": "46.1", "repo": "gnome-shell", "type": "github" } @@ -286,11 +333,11 @@ ] }, "locked": { - "lastModified": 1747021744, - "narHash": "sha256-IDsM/9/tHQBlhG3tXI2fTM84AUN1uRa7JDPT1LMlGes=", + "lastModified": 1724435763, + "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", "owner": "nix-community", "repo": "home-manager", - "rev": "fb061f555f821fe4fb49f8f6f2a0cc3d5728bd52", + "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", "type": "github" }, "original": { @@ -300,6 +347,27 @@ } }, "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724435763, + "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_3": { "inputs": { "nixpkgs": [ "stylix", @@ -307,11 +375,11 @@ ] }, "locked": { - "lastModified": 1746912617, - "narHash": "sha256-SSw/98B3Htw7iJWCyq08fAEL5w+a/Vj+YbQq0msVFTA=", + "lastModified": 1715930644, + "narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=", "owner": "nix-community", "repo": "home-manager", - "rev": "9ef92f1c6b77944198fd368ec805ced842352a1d", + "rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d", "type": "github" }, "original": { @@ -320,331 +388,101 @@ "type": "github" } }, - "hyprland-qt-support": { + "nix-darwin": { "inputs": { - "hyprlang": [ - "hyprland-qtutils", - "hyprlang" - ], - "nixpkgs": [ - "hyprland-qtutils", - "nixpkgs" - ], - "systems": [ - "hyprland-qtutils", - "systems" - ] - }, - "locked": { - "lastModified": 1737634706, - "narHash": "sha256-nGCibkfsXz7ARx5R+SnisRtMq21IQIhazp6viBU8I/A=", - "owner": "hyprwm", - "repo": "hyprland-qt-support", - "rev": "8810df502cdee755993cb803eba7b23f189db795", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-qt-support", - "type": "github" - } - }, - "hyprland-qtutils": { - "inputs": { - "hyprland-qt-support": "hyprland-qt-support", - "hyprlang": "hyprlang", - "hyprutils": [ - "hyprland-qtutils", - "hyprlang", - "hyprutils" - ], - "nixpkgs": "nixpkgs", - "systems": "systems" - }, - "locked": { - "lastModified": 1745951494, - "narHash": "sha256-2dModE32doiyQMmd6EDAQeZnz+5LOs6KXyE0qX76WIg=", - "owner": "hyprwm", - "repo": "hyprland-qtutils", - "rev": "4be1d324faf8d6e82c2be9f8510d299984dfdd2e", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-qtutils", - "type": "github" - } - }, - "hyprlang": { - "inputs": { - "hyprutils": "hyprutils", - "nixpkgs": [ - "hyprland-qtutils", - "nixpkgs" - ], - "systems": [ - "hyprland-qtutils", - "systems" - ] - }, - "locked": { - "lastModified": 1737634606, - "narHash": "sha256-W7W87Cv6wqZ9PHegI6rH1+ve3zJPiyevMFf0/HwdbCQ=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "f41271d35cc0f370d300413d756c2677f386af9d", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprswitch": { - "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_2", - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1745860672, - "narHash": "sha256-tJKLjWaOcJW4Ttu1noSY+lddlJvyX2eonTrgR5IycZo=", - "owner": "h3rmt", - "repo": "hyprswitch", - "rev": "313e7d5730af2e37ab73fe238b1bd3a2d3e5552f", - "type": "github" - }, - "original": { - "owner": "h3rmt", - "ref": "release", - "repo": "hyprswitch", - "type": "github" - } - }, - "hyprutils": { - "inputs": { - "nixpkgs": [ - "hyprland-qtutils", - "hyprlang", - "nixpkgs" - ], - "systems": [ - "hyprland-qtutils", - "hyprlang", - "systems" - ] - }, - "locked": { - "lastModified": 1737632363, - "narHash": "sha256-X9I8POSlHxBVjD0fiX1O2j7U9Zi1+4rIkrsyHP0uHXY=", - "owner": "hyprwm", - "repo": "hyprutils", - "rev": "006620eb29d54ea9086538891404c78563d1bae1", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprutils", - "type": "github" - } - }, - "ixx": { - "inputs": { - "flake-utils": [ - "nixvim", - "nuschtosSearch", - "flake-utils" - ], "nixpkgs": [ "nixvim", - "nuschtosSearch", "nixpkgs" ] }, "locked": { - "lastModified": 1737371634, - "narHash": "sha256-fTVAWzT1UMm1lT+YxHuVPtH+DATrhYfea3B0MxG/cGw=", - "owner": "NuschtOS", - "repo": "ixx", - "rev": "a1176e2a10ce745ff8f63e4af124ece8fe0b1648", + "lastModified": 1724469941, + "narHash": "sha256-+U5152FwmDD9EUOiFi5CFxCK6/yFESyDei9jEIlmUtI=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "ea319a737939094b48fda9063fa3201ef2479aac", "type": "github" }, "original": { - "owner": "NuschtOS", - "ref": "v0.0.7", - "repo": "ixx", + "owner": "lnl7", + "repo": "nix-darwin", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1737632463, - "narHash": "sha256-38J9QfeGSej341ouwzqf77WIHAScihAKCt8PQJ+NH28=", - "owner": "NixOS", + "lastModified": 1724224976, + "narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "0aa475546ed21629c4f5bbf90e38c846a99ec9e9", + "rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1735774519, - "narHash": "sha256-CewEm1o2eVAnoqb6Ml+Qi9Gg/EfNAxbRx1lANGVyoLI=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" - } - }, - "nixpkgs-master": { - "locked": { - "lastModified": 1747056094, - "narHash": "sha256-1EyoK6oi6LKN7z8WUK7E7DDGCGG2O4QEp0CiVavsfzo=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "496d7ecbe6794172090229169324f0b8fc426dc5", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "master", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1746810718, - "narHash": "sha256-VljtYzyttmvkWUKTVJVW93qAsJsrBbgAzy7DdnJaQfI=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "0c0bf9c057382d5f6f63d54fd61f1abd5e1c2f63", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { - "lastModified": 1735831304, - "narHash": "sha256-92A/Zr8UzZzlFYmkgO3HAgX/Cr53eodgNyvJA+Ibkz0=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "0725951bfc4bbc2efff3a537837ca13159b4aec9", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1746904237, - "narHash": "sha256-3e+AVBczosP5dCLQmMoMEogM57gmZ2qrVSrmq9aResQ=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "d89fc19e405cb2d55ce7cc114356846a0ee5e956", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1745930157, - "narHash": "sha256-y3h3NLnzRSiUkYpnfvnS669zWZLoqqI6NprtLQ+5dck=", + "lastModified": 1714912032, + "narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "46e634be05ce9dc6d4db8e664515ba10b78151ae", + "rev": "ee4a6e0f566fe5ec79968c57a9c2c3c25f2cf41d", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "nixvim": { "inputs": { - "flake-parts": "flake-parts_2", + "devshell": "devshell", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "git-hooks": "git-hooks", + "home-manager": "home-manager_2", + "nix-darwin": "nix-darwin", "nixpkgs": [ "nixpkgs" ], "nuschtosSearch": "nuschtosSearch", - "systems": "systems_3" - }, - "locked": { - "lastModified": 1747032128, - "narHash": "sha256-5t2TrnIB83FZe3rINoD6JYbujL1j4d1ZsVyL1qmMluY=", - "owner": "nix-community", - "repo": "nixvim", - "rev": "69266437beaac970568d12a46766706c72f361b3", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixvim", - "type": "github" - } - }, - "nur": { - "inputs": { - "flake-parts": "flake-parts_3", - "nixpkgs": [ - "stylix", - "nixpkgs" - ], "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1746056780, - "narHash": "sha256-/emueQGaoT4vu0QjU9LDOG5roxRSfdY0K2KkxuzazcM=", + "lastModified": 1724528976, + "narHash": "sha256-5W13nD/5ySIsxSvDqXHlj4bg2F3tNcYGKCGudWzpNzw=", "owner": "nix-community", - "repo": "NUR", - "rev": "d476cd0972dd6242d76374fcc277e6735715c167", + "repo": "nixvim", + "rev": "8234ee85eaa2c8b7f2c74f5b4cdf02c4965b07fc", "type": "github" }, "original": { "owner": "nix-community", - "repo": "NUR", + "repo": "nixvim", "type": "github" } }, "nuschtosSearch": { "inputs": { "flake-utils": "flake-utils", - "ixx": "ixx", "nixpkgs": [ "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1745046075, - "narHash": "sha256-8v4y6k16Ra/fiecb4DxhsoOGtzLKgKlS+9/XJ9z0T2I=", + "lastModified": 1723969429, + "narHash": "sha256-BuewfNEXEf11MIkJY+uvWsdLu1dIvgJqntWChvNdALg=", "owner": "NuschtOS", "repo": "search", - "rev": "066afe8643274470f4a294442aadd988356a478f", + "rev": "a05d1805f2a2bc47d230e5e92aecbf69f784f3d0", "type": "github" }, "original": { @@ -656,50 +494,25 @@ "root": { "inputs": { "home-manager": "home-manager", - "hyprland-qtutils": "hyprland-qtutils", - "hyprswitch": "hyprswitch", - "nixpkgs": "nixpkgs_3", - "nixpkgs-master": "nixpkgs-master", - "nixpkgs-stable": "nixpkgs-stable", + "nixpkgs": "nixpkgs", "nixvim": "nixvim", "spicetify-nix": "spicetify-nix", "stylix": "stylix" } }, - "rust-overlay": { + "spicetify-nix": { "inputs": { + "flake-compat": "flake-compat_2", "nixpkgs": [ - "hyprswitch", "nixpkgs" ] }, "locked": { - "lastModified": 1735784864, - "narHash": "sha256-tIl5p3ueaPw7T5T1UXkLc8ISMk6Y8CI/D/rd0msf73I=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "04d5f1836721461b256ec452883362c5edc5288e", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "spicetify-nix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_4" - }, - "locked": { - "lastModified": 1746937129, - "narHash": "sha256-Dx/YpnRridWnxF0Xpz9FUP3kl/m2QAOM2BM3KNls3sk=", + "lastModified": 1724472954, + "narHash": "sha256-65NfzEvwdJGHsOZA+w4AUFUG10RyfuQltct3h++gsw0=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "8f1c5c34cf5f99e1d7197d6d9fa7dd44f00966f0", + "rev": "3caf2a241f7af52419ce97c6682b0467219ab914", "type": "github" }, "original": { @@ -712,29 +525,24 @@ "inputs": { "base16": "base16", "base16-fish": "base16-fish", + "base16-foot": "base16-foot", "base16-helix": "base16-helix", + "base16-kitty": "base16-kitty", + "base16-tmux": "base16-tmux", "base16-vim": "base16-vim", - "firefox-gnome-theme": "firefox-gnome-theme", - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_3", "flake-utils": "flake-utils_2", - "git-hooks": "git-hooks", "gnome-shell": "gnome-shell", - "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_4", - "nur": "nur", - "systems": "systems_5", - "tinted-foot": "tinted-foot", - "tinted-kitty": "tinted-kitty", - "tinted-schemes": "tinted-schemes", - "tinted-tmux": "tinted-tmux", - "tinted-zed": "tinted-zed" + "home-manager": "home-manager_3", + "nixpkgs": "nixpkgs_2", + "systems": "systems_2" }, "locked": { - "lastModified": 1747005453, - "narHash": "sha256-78PfIpo3jCuX7pT3k4DkEES+KEy7pnrFGugsQ2w652o=", + "lastModified": 1724444244, + "narHash": "sha256-fH1lyJvJjUhZ8xMlmiI18EZNzodDSe74rFuwlZDL0aQ=", "owner": "danth", "repo": "stylix", - "rev": "6b8309550e50358b63366d9bf3edb7ef08b9a7cc", + "rev": "d042af478ce87e188139480922a3085218194106", "type": "github" }, "original": { @@ -745,16 +553,16 @@ }, "systems": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, @@ -773,147 +581,19 @@ "type": "github" } }, - "systems_3": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_5": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "tinted-foot": { - "flake": false, - "locked": { - "lastModified": 1726913040, - "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", - "owner": "tinted-theming", - "repo": "tinted-foot", - "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "tinted-foot", - "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", - "type": "github" - } - }, - "tinted-kitty": { - "flake": false, - "locked": { - "lastModified": 1716423189, - "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=", - "owner": "tinted-theming", - "repo": "tinted-kitty", - "rev": "eb39e141db14baef052893285df9f266df041ff8", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "tinted-kitty", - "rev": "eb39e141db14baef052893285df9f266df041ff8", - "type": "github" - } - }, - "tinted-schemes": { - "flake": false, - "locked": { - "lastModified": 1744974599, - "narHash": "sha256-Fg+rdGs5FAgfkYNCs74lnl8vkQmiZVdBsziyPhVqrlY=", - "owner": "tinted-theming", - "repo": "schemes", - "rev": "28c26a621123ad4ebd5bbfb34ab39421c0144bdd", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "schemes", - "type": "github" - } - }, - "tinted-tmux": { - "flake": false, - "locked": { - "lastModified": 1745111349, - "narHash": "sha256-udV+nHdpqgkJI9D0mtvvAzbqubt9jdifS/KhTTbJ45w=", - "owner": "tinted-theming", - "repo": "tinted-tmux", - "rev": "e009f18a01182b63559fb28f1c786eb027c3dee9", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "tinted-tmux", - "type": "github" - } - }, - "tinted-zed": { - "flake": false, - "locked": { - "lastModified": 1725758778, - "narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=", - "owner": "tinted-theming", - "repo": "base16-zed", - "rev": "122c9e5c0e6f27211361a04fae92df97940eccf9", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-zed", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ - "stylix", - "nur", + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1733222881, - "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "lastModified": 1724338379, + "narHash": "sha256-kKJtaiU5Ou+e/0Qs7SICXF22DLx4V/WhG1P6+k4yeOE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "rev": "070f834771efa715f3e74cd8ab93ecc96fabc951", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 59fc477..44e241e 100644 --- a/flake.nix +++ b/flake.nix @@ -2,69 +2,59 @@ description = "Your new nix config"; inputs = { - hyprswitch.url = "github:h3rmt/hyprswitch/release"; # Nixpkgs - nixpkgs-master.url = "github:nixos/nixpkgs/master"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11"; nixvim = { url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; # Home manager - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - /* lix-module = { - url = - "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - */ - stylix = { url = "github:danth/stylix"; }; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + stylix.url = "github:danth/stylix"; spicetify-nix = { url = "github:Gerg-L/spicetify-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - hyprland-qtutils.url = "github:hyprwm/hyprland-qtutils"; }; - outputs = { self, nixpkgs, home-manager, stylix, spicetify-nix, ... }@inputs: - let - inherit (self) outputs; - myHostName = "nixos-msi"; - stevenUserName = "stvnliu"; - in - { - # NixOS configuration entrypoint - # Available through 'nixos-rebuild --flake .#your-hostname' - nixosConfigurations = { - "${myHostName}" = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs outputs; }; - modules = [ - ./nixos/configuration.nix - #lix-module.nixosModules.default - ]; - }; - }; - - # Standalone home-manager configuration entrypoint - # Available through 'home-manager --flake .#your-username@your-hostname' - homeConfigurations = { - "${stevenUserName}@${myHostName}" = - home-manager.lib.homeManagerConfiguration { - pkgs = - nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance - extraSpecialArgs = { inherit inputs outputs; }; - modules = [ - ./home-manager/${stevenUserName}/home.nix - stylix.homeManagerModules.stylix - inputs.nixvim.homeManagerModules.nixvim - spicetify-nix.homeManagerModules.default - - ]; - }; + outputs = { + self, + nixpkgs, + home-manager, + stylix, + spicetify-nix, + ... + } @ inputs: let + inherit (self) outputs; + myHostName = "nixos-msi"; + stevenUserName = "stvnliu"; + in { + # NixOS configuration entrypoint + # Available through 'nixos-rebuild --flake .#your-hostname' + nixosConfigurations = { + "${myHostName}" = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; + modules = [ + ./nixos/configuration.nix + ]; }; }; + + # Standalone home-manager configuration entrypoint + # Available through 'home-manager --flake .#your-username@your-hostname' + homeConfigurations = { + "${stevenUserName}@${myHostName}" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance + extraSpecialArgs = {inherit inputs outputs;}; + modules = [ + ./home-manager/${stevenUserName}/home.nix + inputs.nixvim.homeManagerModules.nixvim + inputs.stylix.homeManagerModules.stylix + inputs.spicetify-nix.homeManagerModules.default + ]; + }; + }; + }; } diff --git a/home-manager/stvnliu/ags/config/config.js b/home-manager/stvnliu/ags/config/config.js index 3a492f4..a079594 100644 --- a/home-manager/stvnliu/ags/config/config.js +++ b/home-manager/stvnliu/ags/config/config.js @@ -1,8 +1,7 @@ -import { Workspaces } from "./hyprworkspaces.js"; -import { NetworkIndicator } from "./indicators.js"; +const hyprland = await Service.import("hyprland") +const network = await Service.import("network") // const notifications = await Service.import("notifications") -// const mpris = await Service.import("mpris") -const hyprland = await Service.import("hyprland"); +const mpris = await Service.import("mpris") const audio = await Service.import("audio") const battery = await Service.import("battery") const systemtray = await Service.import("systemtray") @@ -13,6 +12,61 @@ const date = Variable("", { // widgets can be only assigned as a child in one container // so to make a reuseable widget, make it a function // then you can simply instantiate one by calling it +const focusedTitle = Widget.Label({ + label: hyprland.active.client.bind('title'), + visible: hyprland.active.client.bind('address') + .as(addr => addr !== "0x"), +}) + +const dispatch = ws => hyprland.messageAsync(`dispatch workspace ${ws}`); + +const Workspaces = () => Widget.EventBox({ + onScrollUp: () => dispatch('+1'), + onScrollDown: () => dispatch('-1'), + child: Widget.Box({ + children: Array.from({ length: 10 }, (_, i) => i + 1).map(i => Widget.Button({ + attribute: i, + label: `${i}`, + onClicked: () => dispatch(i), + + class_name: i === hyprland.active.workspace.id ? "focused" : "" + })), + + // remove this setup hook if you want fixed number of buttons + setup: self => self.hook(hyprland, () => self.children.forEach(btn => { + btn.visible = hyprland.workspaces.some(ws => ws.id === btn.attribute); + })), + }), +}) +function ClientTitle() { + return Widget.Label({ + class_name: "client-title", + label: hyprland.active.client.bind("title"), + }) +} +const WifiIndicator = () => Widget.Box({ + children: [ + Widget.Icon({ + icon: network.wifi.bind('icon_name'), + }), + Widget.Label({ + label: network.wifi.bind('ssid') + .as(ssid => ssid || 'Unknown'), + }), + ], +}) + +const WiredIndicator = () => Widget.Icon({ + icon: network.wired.bind('icon_name'), +}) + +const NetworkIndicator = () => Widget.Stack({ + children: { + wifi: WifiIndicator(), + wired: WiredIndicator(), + }, + shown: network.bind('primary').as(p => p || 'wifi'), +}) function Clock() { const calendar = Widget.Calendar({ showDayNames: true, @@ -41,7 +95,27 @@ function Clock() { }) } -/* function Media() { + +// we don't need dunst or any other notification daemon +// because the Notifications module is a notification daemon itself +/*function Notification() { + const popups = notifications.bind("popups") + return Widget.Box({ + class_name: "notification", + visible: popups.as(p => p.length > 0), + children: [ + Widget.Icon({ + icon: "preferences-system-notifications-symbolic", + }), + Widget.Label({ + label: popups.as(p => p[0]?.summary || ""), + }), + ], + }) +}*/ + + +function Media() { const label = Utils.watch("", mpris, "player-changed", () => { if (mpris.players[0]) { const { track_artists, track_title } = mpris.players[0] @@ -59,7 +133,7 @@ function Clock() { child: Widget.Label({ label }), }) } -*/ + function Volume() { const icons = { @@ -139,6 +213,7 @@ function Left() { spacing: 8, children: [ Workspaces(), + ClientTitle(), ], }) } @@ -212,13 +287,15 @@ const cpuProgress = Widget.Label({ const ramProgress = Widget.Label({ label: ram.bind().as(usage => `${(usage * 100).toPrecision(4)}%`) }) - -const bars = hyprland.monitors.map((value, _index, _arr) => { - return Bar(value.id); -}) App.config({ style: "./style.css", - windows: bars, + windows: [ + Bar(), + + // you can call it, for each monitor + // Bar(0), + // Bar(1) + ], }) export { } diff --git a/home-manager/stvnliu/ags/config/hyprworkspaces.js b/home-manager/stvnliu/ags/config/hyprworkspaces.js deleted file mode 100644 index 270a410..0000000 --- a/home-manager/stvnliu/ags/config/hyprworkspaces.js +++ /dev/null @@ -1,23 +0,0 @@ -const hyprland = await Service.import("hyprland") - -const dispatch = ws => hyprland.messageAsync(`dispatch workspace ${ws}`); -const wsSymbols = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"] -const Workspaces = () => Widget.EventBox({ - onScrollUp: () => dispatch('+1'), - onScrollDown: () => dispatch('-1'), - child: Widget.Box({ - children: Array.from({ length: 10 }, (_, i) => i + 1).map(i => Widget.Button({ - attribute: i, - label: `${wsSymbols[i-1]}`, - onClicked: () => dispatch(i), - - class_name: i === hyprland.active.workspace.id ? "focused" : "" - })), - - // remove this setup hook if you want fixed number of buttons - setup: self => self.hook(hyprland, () => self.children.forEach(btn => { - btn.visible = hyprland.workspaces.some(ws => ws.id === btn.attribute); - })), - }), -}) -export { Workspaces }; diff --git a/home-manager/stvnliu/ags/config/indicators.js b/home-manager/stvnliu/ags/config/indicators.js deleted file mode 100644 index 0713b31..0000000 --- a/home-manager/stvnliu/ags/config/indicators.js +++ /dev/null @@ -1,25 +0,0 @@ -const network = await Service.import("network") -const WifiIndicator = () => Widget.Box({ - children: [ - Widget.Icon({ - icon: network.wifi.bind('icon_name'), - }), - Widget.Label({ - label: network.wifi.bind('ssid') - .as(ssid => ssid || 'Unknown'), - }), - ], -}) - -const WiredIndicator = () => Widget.Icon({ - icon: network.wired.bind('icon_name'), -}) - -const NetworkIndicator = () => Widget.Stack({ - children: { - wifi: WifiIndicator(), - wired: WiredIndicator(), - }, - shown: network.bind('primary').as(p => p || 'wifi'), -}) -export { NetworkIndicator }; diff --git a/home-manager/stvnliu/ags/config/monitorWidget.js b/home-manager/stvnliu/ags/config/monitorWidget.js deleted file mode 100644 index 2a7163b..0000000 --- a/home-manager/stvnliu/ags/config/monitorWidget.js +++ /dev/null @@ -1,3 +0,0 @@ -function MonitorWidget() { - -} diff --git a/home-manager/stvnliu/ags/config/mpris.js b/home-manager/stvnliu/ags/config/mpris.js deleted file mode 100644 index b096a84..0000000 --- a/home-manager/stvnliu/ags/config/mpris.js +++ /dev/null @@ -1,17 +0,0 @@ -const mpris = await Service.import('mpris') - -/** - * @param {import('types/service/mpris').MprisPlayer} player - * */ -const Player = (player, count) => Widget.Button({ - onClicked: () => player.playPause(), - child: Widget.Label().hook(player, label => { - const { track_artists, track_title } = player; - label.label = `${count} PLAYING`; - }), -}) - -export const players = Widget.Box({ - children: mpris.bind('players').as(p => p.map( - (this_player, index, array) => { return Player(this_player, array.length) })) -}) diff --git a/home-manager/stvnliu/ags/default.nix b/home-manager/stvnliu/ags/default.nix index 6518235..2980486 100644 --- a/home-manager/stvnliu/ags/default.nix +++ b/home-manager/stvnliu/ags/default.nix @@ -1,6 +1,7 @@ -{ pkgs -, config -, ... +{ + pkgs, + config, + ... }: { config = { home.file = { @@ -8,10 +9,7 @@ source = ./config; }; }; - home.packages = with pkgs; [ - ags - brightnessctl - ]; + home.packages = with pkgs; [ags]; myAutostartCommands = [ #"${pkgs.ags}/bin/ags --init" "${pkgs.ags}/bin/ags" diff --git a/home-manager/stvnliu/assets/deer-wallpaper.jpg b/home-manager/stvnliu/assets/deer-wallpaper.jpg deleted file mode 100644 index e40ce81..0000000 Binary files a/home-manager/stvnliu/assets/deer-wallpaper.jpg and /dev/null differ diff --git a/home-manager/stvnliu/assets/gruvbox-wallpaper.png b/home-manager/stvnliu/assets/gruvbox-wallpaper.png new file mode 100644 index 0000000..6e08ad6 Binary files /dev/null and b/home-manager/stvnliu/assets/gruvbox-wallpaper.png differ diff --git a/home-manager/stvnliu/assets/nixos-wallpaper.jpg b/home-manager/stvnliu/assets/nixos-wallpaper.jpg new file mode 100644 index 0000000..96fa2f4 Binary files /dev/null and b/home-manager/stvnliu/assets/nixos-wallpaper.jpg differ diff --git a/home-manager/stvnliu/assets/od_neon.png b/home-manager/stvnliu/assets/od_neon.png deleted file mode 100644 index 562e977..0000000 Binary files a/home-manager/stvnliu/assets/od_neon.png and /dev/null differ diff --git a/home-manager/stvnliu/editors.nix b/home-manager/stvnliu/editors.nix index febb37a..6399574 100644 --- a/home-manager/stvnliu/editors.nix +++ b/home-manager/stvnliu/editors.nix @@ -1,22 +1,14 @@ -{ pkgs, ... }: { +{ + lib, + pkgs, + config, + ... +}: { + imports = [ + #./vscode.nix + #./intellij.nix + ]; programs.nixvim = import ./nixvim; # dependencies for nixvim configuration - home.packages = with pkgs; [ ripgrep fd ]; - programs.helix = { - enable = true; - settings = { - editor.cursor-shape = { - normal = "block"; - insert = "bar"; - select = "underline"; - }; - }; - languages.language = import ./helix-langs.nix { inherit pkgs; }; - themes = { - autumn_night_transparent = { - "inherits" = "autumn_night"; - "ui.background" = { }; - }; - }; - }; + home.packages = with pkgs; [ripgrep fd]; } diff --git a/home-manager/stvnliu/gtk.nix b/home-manager/stvnliu/gtk.nix index c240856..c7223c1 100644 --- a/home-manager/stvnliu/gtk.nix +++ b/home-manager/stvnliu/gtk.nix @@ -1,11 +1,24 @@ -{ pkgs -, ... +{ + pkgs, + config, + ... }: { gtk = { enable = true; iconTheme = { - package = pkgs.adwaita-icon-theme; - name = "Adwaita"; + package = pkgs.gruvbox-plus-icons; + name = "Gruvbox-Plus-Dark"; }; }; + qt = { + enable = true; + platformTheme = "gtk"; + style = { + package = pkgs.libsForQt5.breeze-qt5; + name = "breeze"; + }; + }; + home.packages = with pkgs; [ + libsForQt5.breeze-qt5 + ]; } diff --git a/home-manager/stvnliu/helix-langs.nix b/home-manager/stvnliu/helix-langs.nix deleted file mode 100644 index 2adec8e..0000000 --- a/home-manager/stvnliu/helix-langs.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ pkgs }: [ - { - name = "nix"; - auto-format = true; - formatter.command = "${pkgs.nixfmt}/bin/nixfmt"; - } - { - name = "python"; - auto-format = true; - formatter.command = "${pkgs.black}/bin/black"; - } - { - name = "rust"; - auto-format = true; - formatter.command = "${pkgs.rustfmt}/bin/rustfmt"; - } - { - name = "java"; - auto-format = true; - formatter.command = "${pkgs.jdt-language-server}/bin/jdtls"; - } - { - name = "c"; - auto-format = true; - formatter.command = "${pkgs.astyle}/bin/astyle --squeeze-ws --style=c"; - } - # { } - # { } - # { } -] diff --git a/home-manager/stvnliu/home.nix b/home-manager/stvnliu/home.nix index ba30823..03bd842 100644 --- a/home-manager/stvnliu/home.nix +++ b/home-manager/stvnliu/home.nix @@ -1,40 +1,53 @@ -{ config, pkgs, ... }: { +# his is your home-manager configuration file +# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) +{ + inputs, + lib, + config, + pkgs, + ... +}: { + # You can import other home-manager modules here imports = [ - #./hypr + # If you want to use home-manager modules from other flakes (such as nix-colors): + # inputs.nix-colors.homeManagerModule + + # You can also split up your configuration and import pieces of it here: + #./swaywm.nix + ./hypr ./shells ../../common/variables.nix - ./services + ./mako.nix ./wechat ./editors.nix ./gtk.nix - #./ags + ./ags ./xdg.nix ./stylix.nix - #./dwl + ./spicetify.nix ./scripts - ./programs - ./packages ]; - #services.pass-secret-service.enable = true; nixpkgs = { # You can add overlays here overlays = [ - (_final: prev: { + # If you want to use overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + (final: prev: { ags = prev.ags.overrideAttrs (old: { - buildInputs = old.buildInputs ++ [ pkgs.libdbusmenu-gtk3 ]; + buildInputs = old.buildInputs ++ [pkgs.libdbusmenu-gtk3]; }); }) ]; # Configure your nixpkgs instance config = { - cudaSupport = true; - permittedInsecurePackages = [ - "dotnet-core-combined" - "dotnet-sdk-6.0.428" - "dotnet-sdk-7.0.410" - "dotnet-sdk-wrapped-6.0.428" - ]; # Disable if you don't want unfree packages allowUnfree = true; # Workaround for https://github.com/nix-community/home-manager/issues/2942 @@ -46,46 +59,96 @@ username = "${config.myUserName}"; homeDirectory = "/home/${config.myUserName}"; # copy wallpaper from assets - file = { "wallpaper.jpg".source = config.myWallPaperPath; }; + file = {"wallpaper.jpg".source = ./assets/nixos-wallpaper.jpg;}; }; home.packages = with pkgs; [ - prismlauncher protonvpn-gui + devenv vlc - clash-verge-rev + tree + zed-editor rhythmbox + clash-verge-rev qq + libreoffice + discord + #zathura + kdePackages.okular shotwell mpv - kdePackages.kdenlive + kdenlive obsidian - heroic + pcmanfm + udiskie + android-file-transfer + usbutils + mtpfs + teams-for-linux + sxiv ]; myAutostartCommands = [ "${pkgs.clash-verge-rev}/bin/clash-verge" + "${pkgs.firefox}/bin/firefox" + "${pkgs.thunderbird}/bin/thunderbird" ]; programs = { obs-studio = { enable = true; - plugins = with pkgs.obs-studio-plugins; [ wlrobs input-overlay ]; + plugins = [pkgs.obs-studio-plugins.wlrobs]; }; home-manager.enable = true; - firefox = { - enable = true; - package = with pkgs; - (librewolf.override { - nativeMessagingHosts = [ passff-host ]; - hasMozSystemDirPatch = true; - }); - }; + firefox.enable = true; thunderbird = { enable = true; - profiles.default = { isDefault = true; }; + profiles.default = {isDefault = true;}; + }; + git = { + enable = true; + package = pkgs.gitFull; + userName = config.myDisplayName; + userEmail = config.myEmail; + extraConfig = { + push.autoSetupRemote = true; + commit.gpgsign = true; + gpg.format = "ssh"; + gpg.ssh.allowedSignersFile = "/home/${config.myUserName}/.ssh/allowed_signers"; + user.signingkey = "/home/${config.myUserName}/.ssh/id_ed25519.pub"; + credential.helper = "libsecret"; + }; }; }; # Nicely reload system units when changing configs systemd.user.startServices = "sd-switch"; + services.kanshi = { + enable = true; + profiles = { + undocked = { + outputs = [ + { + criteria = "eDP-1"; + scale = 1.0; + status = "enable"; + } + ]; + }; + docked_office_cn = { + outputs = [ + { + criteria = "AOC 2619 M1194JA002428"; + position = "0,0"; + mode = "1920x1200@59.94Hz"; + } + { + criteria = "eDP-1"; + position = "0,0"; + status = "disable"; + } + ]; + }; + }; + systemdTarget = "hyprland-session.target"; + }; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion home.stateVersion = "24.05"; } diff --git a/home-manager/stvnliu/hypr/default.nix b/home-manager/stvnliu/hypr/default.nix index 56152f5..b23406f 100644 --- a/home-manager/stvnliu/hypr/default.nix +++ b/home-manager/stvnliu/hypr/default.nix @@ -1,7 +1,11 @@ -{ ... +{ + pkgs, + config, + lib, + ... }: { imports = [ - ./hyprland + ./hyprland.nix ./hyprpaper.nix ./hypridle.nix ./hyprlock.nix diff --git a/home-manager/stvnliu/hypr/hypridle.nix b/home-manager/stvnliu/hypr/hypridle.nix index 8d227e8..5439a41 100644 --- a/home-manager/stvnliu/hypr/hypridle.nix +++ b/home-manager/stvnliu/hypr/hypridle.nix @@ -1,8 +1,6 @@ -{ ... }: -let +{pkgs, ...}: let timeoutSeconds = 600; -in -{ +in { services.hypridle = { enable = true; settings = { diff --git a/home-manager/stvnliu/hypr/hyprland.nix b/home-manager/stvnliu/hypr/hyprland.nix new file mode 100644 index 0000000..b9af76a --- /dev/null +++ b/home-manager/stvnliu/hypr/hyprland.nix @@ -0,0 +1,93 @@ +{ + config, + pkgs, + ... +}: { + home.packages = with pkgs; [foot]; + wayland.windowManager.hyprland = { + # Whether to enable Hyprland wayland compositor + enable = true; + # The hyprland package to use + package = pkgs.hyprland; + plugins = with pkgs.hyprlandPlugins; [hyprfocus csgo-vulkan-fix]; + # Whether to enable XWayland + xwayland.enable = true; + settings = { + xwayland = {force_zero_scaling = true;}; + monitor = ",preferred,auto,${builtins.toString config.displayScale}"; + input = { + # xset rate 250 50 replacement on wayland... + # FAST MODE LET'S GOOO + repeat_rate = 50; + repeat_delay = 250; + }; + exec-once = + config.myAutostartCommands + ++ [ + "[workspace special silent] ${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=12' -o colors.alpha=0.85 ${config.myShells.defaultShell}" + ]; + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + font_family = "monospace"; + }; + "$mod" = "SUPER"; + binde = [ + ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+" + + # Example volume button that will activate even while an input inhibitor is active + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ]; + bind = let + terminalCmd = "${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=12' -o colors.alpha=0.85 ${config.myShells.defaultShell}"; + in + [ + "$mod SHIFT, L, exec, ${pkgs.hyprlock}/bin/hyprlock --immediate" + + ", Print, exec, ${pkgs.grimblast}/bin/grimblast copy area" + + # special workspace keybinds + "$mod, S, togglespecialworkspace" + "$mod SHIFT, S, movetoworkspace, special" + + # keysyms for util functions + # Example volume button that allows press and hold, volume limited to 150% + "$mod, Q, killactive" + "$mod, D, exec, ${pkgs.fuzzel}/bin/fuzzel" + # firefox quickstart + "$mod, F, exec, ${pkgs.firefox}/bin/firefox" + "$mod, E, exec, ${pkgs.pcmanfm}/bin/pcmanfm" + # foot terminal + "$mod, Return, exec, ${terminalCmd}" + "$mod SHIFT, Return, exec, [float] ${terminalCmd}" + + # vimkeys navigation + "$mod, H, movefocus, l" + "$mod, J, movefocus, d" + "$mod, K, movefocus, u" + "$mod, L, movefocus, r" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + builtins.concatLists (builtins.genList (x: let + ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10)); + in [ + "$mod, ${ws}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + ]) + 10) + ); + bindm = [ + # mouse movements + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + "$mod ALT, mouse:272, resizewindow" + ]; + }; + # Optional + # Whether to enable hyprland-session.target on hyprland startup + systemd = {enable = true;}; + }; + # ... +} diff --git a/home-manager/stvnliu/hypr/hyprland/binds.nix b/home-manager/stvnliu/hypr/hyprland/binds.nix deleted file mode 100644 index f795983..0000000 --- a/home-manager/stvnliu/hypr/hyprland/binds.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ config, pkgs, inputs, ... }: -let - terminalCmd = config.defaultApplications.terminal; - screenshotLocation = - "/home/${config.myUserName}/Screenshots/$(date '+%Y-%m-%d-%H-%M-%S').png"; -in -[ - "$mod SHIFT, L, exec, ${pkgs.wlogout}/bin/wlogout" - - "$mod SHIFT, Print, exec, ${pkgs.grimblast}/bin/grimblast copysave output ${screenshotLocation}" - ", Print, exec, ${pkgs.grimblast}/bin/grimblast copysave area ${screenshotLocation}" - "$mod, Print, exec, ${pkgs.grimblast}/bin/grimblast copy area" - - # special workspace keybinds - "$mod, S, togglespecialworkspace" - "$mod SHIFT, S, movetoworkspace, special" - - "alt, Tab, exec, ${inputs.hyprswitch.packages.x86_64-linux.default}/bin/hyprswitch gui --mod-key alt --key Tab --close mod-key-release --reverse-key=key=grave && hyprswitch dispatch" - - # keysyms for util functions - # Example volume button that allows press and hold, volume limited to 150% - "$mod, Q, killactive" - "$mod, D, exec, ${config.defaultApplications.appLauncher}" - "$mod, F, fullscreen" - "$mod, E, exec, ${config.defaultApplications.fileManager}" - # foot terminal - "$mod, Return, exec, ${terminalCmd} ${config.myShells.defaultShell}" - "$mod SHIFT, Return, exec, ${terminalCmd} --title=floats ${config.myShells.defaultShell}" - - # cmdline utilities - /* NOTE Replaced by network manager applet - nmtui interface is no longer needed - TODO Fix floating window rule - */ - # "$mod, N, exec, [float] ${terminalCmd} ${pkgs.networkmanager}/bin/nmtui" - #"$mod, M, exec, [float] ${terminalCmd} ${pkgs.zenith}/bin/zenith" - - # vimkeys navigation - "$mod, H, movefocus, l" - "$mod, J, movefocus, d" - "$mod, K, movefocus, u" - "$mod, L, movefocus, r" -] ++ (if config.services.mpd.enable then - [ "$mod, M, exec, ${terminalCmd} --title=ncmpc ${pkgs.ncmpcpp}/bin/ncmpcpp" ] -else - [ ]) ++ (if config.services.swaync.enable then - [ "$mod, N, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -t" ] -else - [ ]) ++ ( - # workspaces - # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} - builtins.concatLists (builtins.genList - (x: - let ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10)); - in [ - "$mod, ${ws}, workspace, ${toString (x + 1)}" - "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" - ]) 10) - # workspaces - # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} - /* builtins.concatLists (builtins.genList (x: - let ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10)); - in [ - "$mod M, ${ws}, workspace, ${toString (x + 10 + 1)}" - "$mod SHIFT M, ${ws}, movetoworkspace, ${toString (x + 10 + 1)}" - ]) 10) - */ -) diff --git a/home-manager/stvnliu/hypr/hyprland/default.nix b/home-manager/stvnliu/hypr/hyprland/default.nix deleted file mode 100644 index 2aa63db..0000000 --- a/home-manager/stvnliu/hypr/hyprland/default.nix +++ /dev/null @@ -1,85 +0,0 @@ -{ inputs, config, pkgs, lib, ... }: -let - bgbordercolor = config.lib.stylix.colors.base01; - fgbordercolor = config.lib.stylix.colors.base02; -in -{ - home.packages = - [ inputs.hyprland-qtutils.packages.x86_64-linux.default pkgs.foot ]; - wayland.windowManager.hyprland = { - # Whether to enable Hyprland wayland compositor - enable = true; - # The hyprland package to use - package = pkgs.hyprland; - plugins = with pkgs.hyprlandPlugins; - [ - # hyprbars - # hyprexpo - # hyprfocus - # hycov - ]; - # Whether to enable XWayland - xwayland.enable = true; - settings = { - plugins = import ./hyprbars.nix { inherit config; }; - # env = [ "AQ_DRM_DEVICES, /dev/dri/card0" ]; - xwayland = { force_zero_scaling = true; }; - monitor = [ - "desc:Xiaomi Corporation Mi 27 NFGL 3215000032603, 1920x1080@75, 2560x0, 1" - "desc:BOE 0x0B40,preferred, auto, ${ - builtins.toString config.displayScale - }" - ", preferred, auto, 1" # wildcard definition - ]; - general = { - "col.inactive_border" = lib.mkForce "rgb(${bgbordercolor})"; - "col.active_border" = lib.mkForce "rgb(${fgbordercolor})"; - border_size = 1; - gaps_in = 2.5; - gaps_out = 5; - allow_tearing = true; - }; - windowrulev2 = import ./window_rules.nix; - decoration = { rounding = 5; }; - input = { - # xset rate 250 50 replacement on wayland... - repeat_rate = 50; - repeat_delay = 250; - accel_profile = "flat"; - }; - exec-once = config.myAutostartCommands ++ (import ./hypr_autostart.nix { - inherit config; - inherit pkgs; - inherit inputs; - }); - cursor = { - # Fixes https://github.com/hyprwm/Hyprland/issues/9324 - # Needed because by default, Hyprland enabled Nvidia hardware cursors. - no_hardware_cursors = true; - }; - misc = { - disable_hyprland_logo = true; - disable_splash_rendering = true; - font_family = "monospace"; - focus_on_activate = true; - }; - "$mod" = "SUPER"; - binde = import ./xf86_binds.nix { inherit pkgs; }; - bind = import ./binds.nix { - inherit config; - inherit pkgs; - inherit inputs; - }; - bindm = [ - # mouse movements - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - "$mod ALT, mouse:272, resizewindow" - ]; - }; - # Optional - # Whether to enable hyprland-session.target on hyprland startup - systemd = { enable = true; }; # set to false due to UWSM - }; - # ... -} diff --git a/home-manager/stvnliu/hypr/hyprland/hypr_autostart.nix b/home-manager/stvnliu/hypr/hyprland/hypr_autostart.nix deleted file mode 100644 index cc41210..0000000 --- a/home-manager/stvnliu/hypr/hyprland/hypr_autostart.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, pkgs, inputs }: [ - "${config.programs.thunderbird.package}/bin/thunderbird" - "${pkgs.mpris-notifier}/bin/mpris-notifier" - "${pkgs.mpd-discord-rpc}/bin/mpd-discord-rpc" - "${pkgs.easyeffects}/bin/easyeffects --gapplication-service" - "${inputs.hyprswitch.packages.x86_64-linux.default}/bin/hyprswitch init --show-title --size-factor 5.5 --workspaces-per-row 5" -] diff --git a/home-manager/stvnliu/hypr/hyprland/hyprbars.nix b/home-manager/stvnliu/hypr/hyprland/hyprbars.nix deleted file mode 100644 index ef79e37..0000000 --- a/home-manager/stvnliu/hypr/hyprland/hyprbars.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config }: { - hyprbars = { - bar_height = 38; - bar_color = "rgb(1e1e1e)"; - "col.text" = "ffffff"; - bar_text_size = 12; - bar_text_font = config.desktopFont.fullName; - bar_button_padding = 12; - bar_padding = 10; - bar_precedence_over_border = true; - hyprbars-button = [ - "rgb(ffffff), 20, 󰅖, hyprctl dispatch killactive;" - "rgb(ffffff), 20, 󰊓, hyprctl dispatch fullscreen 2;" - ]; - }; -} diff --git a/home-manager/stvnliu/hypr/hyprland/window_rules.nix b/home-manager/stvnliu/hypr/hyprland/window_rules.nix deleted file mode 100644 index e481482..0000000 --- a/home-manager/stvnliu/hypr/hyprland/window_rules.nix +++ /dev/null @@ -1,7 +0,0 @@ -[ - "workspace special silent, class:^(foot.*)$, title:autorun" - "float, title:floats" - "float, title:ncmpc" - "size 50% 50%, title:ncmpc" - "immediate, class:^(cs2)$" -] diff --git a/home-manager/stvnliu/hypr/hyprland/xf86_binds.nix b/home-manager/stvnliu/hypr/hyprland/xf86_binds.nix deleted file mode 100644 index 566e55b..0000000 --- a/home-manager/stvnliu/hypr/hyprland/xf86_binds.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs -, -}: [ - ", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause" - ", XF86AudioStop, exec, ${pkgs.playerctl}/bin/playerctl stop" - ", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next" - ", XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous" - ", XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+" - ", XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - ", XF86AudioMute, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 0%" -] diff --git a/home-manager/stvnliu/hypr/hyprlock.nix b/home-manager/stvnliu/hypr/hyprlock.nix index bbcfc3c..e93263b 100644 --- a/home-manager/stvnliu/hypr/hyprlock.nix +++ b/home-manager/stvnliu/hypr/hyprlock.nix @@ -1,5 +1,10 @@ -{ config, lib, ... }: { - programs.hyprlock = lib.mkForce { +{ + pkgs, + config, + lib, + ... +}: { + programs.hyprlock = { enable = true; settings = { general = { @@ -9,25 +14,29 @@ no_fade_in = false; }; - background = [{ - path = "screenshot"; - blur_passes = 3; - blur_size = 8; - }]; + background = [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + } + ]; - input-field = [{ - size = "400, 50"; - position = "0, -80"; - monitor = ""; - dots_center = true; - fade_on_empty = false; - font_color = "rgb(${config.lib.stylix.colors.base07})"; - inner_color = "rgb(${config.lib.stylix.colors.base02})"; - outer_color = "rgb(${config.lib.stylix.colors.base03})"; - outline_thickness = 1; - placeholder_text = ''Password...''; - shadow_passes = 2; - }]; + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + outline_thickness = 5; + #placeholder_text = '\'Password...'\'; + shadow_passes = 2; + } + ]; }; }; } diff --git a/home-manager/stvnliu/hypr/hyprpaper.nix b/home-manager/stvnliu/hypr/hyprpaper.nix index 47f338f..b82c20f 100644 --- a/home-manager/stvnliu/hypr/hyprpaper.nix +++ b/home-manager/stvnliu/hypr/hyprpaper.nix @@ -1,15 +1,15 @@ -{ config -, ... +{ + pkgs, + config, + ... }: { services.hyprpaper = { enable = true; settings = { ipc = "on"; splash = false; - preload = [ config.myWallPaperPathString ]; - wallpaper = [ ",${config.myWallPaperPathString}" ]; - #preload = [/home/stvnliu/Downloads/mao-zedong.jpg]; - #wallpaper = [",/home/stvnliu/Downloads/mao-zedong.jpg"]; + preload = [config.myWallPaperPathString]; + wallpaper = [",${config.myWallPaperPathString}"]; }; }; } diff --git a/home-manager/stvnliu/mako.nix b/home-manager/stvnliu/mako.nix index a59dd34..5b22460 100644 --- a/home-manager/stvnliu/mako.nix +++ b/home-manager/stvnliu/mako.nix @@ -1,9 +1,10 @@ -{ ... -}: -let - defaultTimeoutMillis = 5 * 1000; -in { + pkgs, + lib, + ... +}: let + defaultTimeoutMillis = 5 * 1000; +in { services.mako = { enable = true; defaultTimeout = defaultTimeoutMillis; diff --git a/home-manager/stvnliu/nixvim/auto-pairs.nix b/home-manager/stvnliu/nixvim/auto-pairs.nix index f8a479c..c57a48b 100644 --- a/home-manager/stvnliu/nixvim/auto-pairs.nix +++ b/home-manager/stvnliu/nixvim/auto-pairs.nix @@ -1 +1 @@ -{ plugins.nvim-autopairs = { enable = true; }; } +{plugins.nvim-autopairs = {enable = true;};} diff --git a/home-manager/stvnliu/nixvim/autosave.nix b/home-manager/stvnliu/nixvim/autosave.nix index d8386e1..b2d375a 100644 --- a/home-manager/stvnliu/nixvim/autosave.nix +++ b/home-manager/stvnliu/nixvim/autosave.nix @@ -1,6 +1,6 @@ { plugins.auto-save = { enable = true; - settings.enabled = true; + enableAutoSave = true; }; } diff --git a/home-manager/stvnliu/nixvim/bufferline.nix b/home-manager/stvnliu/nixvim/bufferline.nix index 9039f66..628aaa6 100644 --- a/home-manager/stvnliu/nixvim/bufferline.nix +++ b/home-manager/stvnliu/nixvim/bufferline.nix @@ -1 +1 @@ -{ plugins.bufferline = { enable = true; }; } +{plugins.bufferline = {enable = true;};} diff --git a/home-manager/stvnliu/nixvim/cmp.nix b/home-manager/stvnliu/nixvim/cmp.nix index 260de1f..865859a 100644 --- a/home-manager/stvnliu/nixvim/cmp.nix +++ b/home-manager/stvnliu/nixvim/cmp.nix @@ -2,49 +2,45 @@ { plugins = { luasnip.enable = true; - /* - copilot-lua = { + copilot-lua = { enable = true; suggestion.enabled = false; panel.enabled = false; - }; - */ + }; + + cmp-buffer = {enable = true;}; + + cmp-emoji = {enable = true;}; + + cmp-nvim-lsp = {enable = true;}; + + cmp-path = {enable = true;}; + + cmp_luasnip = {enable = true;}; + cmp = { enable = true; - settings = { - autoEnableSources = true; - experimental = { ghost_text = false; }; - performance = { - debounce = 60; - fetchingTimeout = 200; - maxViewEntries = 30; - }; - snippet = { expand = "luasnip"; }; - cmp-buffer = { enable = true; }; - cmp-emoji = { enable = true; }; - cmp-nvim-lsp = { enable = true; }; - cmp-path = { enable = true; }; - cmp_luasnip = { enable = true; }; - /* + settings = { snippet.expand = '' function(args) require('luasnip').lsp_expand(args.body) end ''; - */ sources = [ - { name = "nvim_lsp"; } - { name = "luasnip"; } + {name = "nvim_lsp";} + {name = "luasnip";} { name = "buffer"; option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; } - { name = "nvim_lua"; } - { name = "path"; } + {name = "nvim_lua";} + {name = "path";} + {name = "copilot";} ]; + formatting = { - fields = [ "abbr" "kind" "menu" ]; + fields = ["abbr" "kind" "menu"]; format = # lua '' @@ -104,11 +100,11 @@ winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; scrollbar = false; sidePadding = 0; - border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + border = ["╭" "─" "╮" "│" "╯" "─" "╰" "│"]; }; settings.documentation = { - border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + border = ["╭" "─" "╮" "│" "╯" "─" "╰" "│"]; winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; }; }; diff --git a/home-manager/stvnliu/nixvim/coq.nix b/home-manager/stvnliu/nixvim/coq.nix deleted file mode 100644 index fc4388a..0000000 --- a/home-manager/stvnliu/nixvim/coq.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - plugins.coq-nvim = { - enable = true; - installArtifacts = true; - }; -} diff --git a/home-manager/stvnliu/nixvim/custom/binds.nix b/home-manager/stvnliu/nixvim/custom/binds.nix deleted file mode 100644 index 63e9262..0000000 --- a/home-manager/stvnliu/nixvim/custom/binds.nix +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - mode = "n"; - key = "ree"; - action = "RustLsp explainError"; - options.desc = "Explain this Rust error (custom)"; - } -] diff --git a/home-manager/stvnliu/nixvim/default.nix b/home-manager/stvnliu/nixvim/default.nix index eef2ecd..be0731b 100644 --- a/home-manager/stvnliu/nixvim/default.nix +++ b/home-manager/stvnliu/nixvim/default.nix @@ -1,12 +1,15 @@ -{ ... }: { +{ + pkgs, + config, + ... +}: { imports = [ ./auto-pairs.nix ./autosave.nix - #./bufferline.nix + ./bufferline.nix ./cmp.nix - #./coq.nix ./git.nix - #./ionide.nix + ./ionide.nix ./lualine.nix ./lsp.nix ./none-ls.nix @@ -20,146 +23,131 @@ ./which_key.nix ./wilder.nix ./virt-column.nix - ./devicons.nix - ./tagbar.nix - ./wrapping.nix - ./twilight.nix ]; enable = true; enableMan = true; defaultEditor = true; globals.mapleader = " "; - colorschemes.gruvbox = { enable = true; }; - performance = { - byteCompileLua.enable = true; - combinePlugins = { - enable = true; - /*standalonePlugins = [ - "nvim-treesitter" - ];*/ - }; - }; - keymaps = - [ - # Global - # Default mode is "" which means normal-visual-op - { - mode = "n"; - key = "bg"; - action = "TransparentToggle"; - options.desc = "Toggle background transparency"; - } - { - key = ""; - action = "NvimTreeToggle"; - options.desc = "Toggle NvimTree"; - } + colorschemes.gruvbox = {enable = true;}; + keymaps = [ + # Global + # Default mode is "" which means normal-visual-op + { + mode = "n"; + key = "bg"; + action = "TransparentToggle"; + options.desc = "Toggle background transparency"; + } + { + key = ""; + action = "NvimTreeToggle"; + options.desc = "Toggle NvimTree"; + } - # File - { - mode = "n"; - key = "f"; - action = "+find/file"; - } - { - # Format file - key = "fm"; - action = "lua vim.lsp.buf.format()"; - options.desc = "Format the current buffer"; - } + # File + { + mode = "n"; + key = "f"; + action = "+find/file"; + } + { + # Format file + key = "fm"; + action = "lua vim.lsp.buf.format()"; + options.desc = "Format the current buffer"; + } - # Git - { - mode = "n"; - key = "g"; - action = "+git"; - } - { - mode = "n"; - key = "gt"; - action = "+toggles"; - } - { - key = "gtb"; - action = "Gitsigns toggle_current_line_blame"; - options.desc = "Gitsigns current line blame"; - } - { - key = "gtd"; - action = "Gitsigns toggle_deleted"; - options.desc = "Gitsigns deleted"; - } - { - key = "gd"; - action = "Gitsigns diffthis"; - options.desc = "Gitsigns diff this buffer"; - } + # Git + { + mode = "n"; + key = "g"; + action = "+git"; + } + { + mode = "n"; + key = "gt"; + action = "+toggles"; + } + { + key = "gtb"; + action = "Gitsigns toggle_current_line_blame"; + options.desc = "Gitsigns current line blame"; + } + { + key = "gtd"; + action = "Gitsigns toggle_deleted"; + options.desc = "Gitsigns deleted"; + } + { + key = "gd"; + action = "Gitsigns diffthis"; + options.desc = "Gitsigns diff this buffer"; + } - # Tabs - { - mode = "n"; - key = "t"; - action = "+tab"; - } - { - mode = "n"; - key = "tn"; - action = "tabnew"; - options.desc = "Create new tab"; - } - { - mode = "n"; - key = "td"; - action = "tabclose"; - options.desc = "Close tab"; - } - { - mode = "n"; - key = "ts"; - action = "tabnext"; - options.desc = "Go to the sub-sequent tab"; - } - { - mode = "n"; - key = "tp"; - action = "tabprevious"; - options.desc = "Go to the previous tab"; - } + # Tabs + { + mode = "n"; + key = "t"; + action = "+tab"; + } + { + mode = "n"; + key = "tn"; + action = "tabnew"; + options.desc = "Create new tab"; + } + { + mode = "n"; + key = "td"; + action = "tabclose"; + options.desc = "Close tab"; + } + { + mode = "n"; + key = "ts"; + action = "tabnext"; + options.desc = "Go to the sub-sequent tab"; + } + { + mode = "n"; + key = "tp"; + action = "tabprevious"; + options.desc = "Go to the previous tab"; + } - # Terminal - { - # Escape terminal mode using ESC - mode = "t"; - key = ""; - action = ""; - options.desc = "Escape terminal mode"; - } + # Terminal + { + # Escape terminal mode using ESC + mode = "t"; + key = ""; + action = ""; + options.desc = "Escape terminal mode"; + } - # Trouble - { - mode = "n"; - key = "d"; - action = "+diagnostics/debug"; - } - { - key = "dt"; - action = "TroubleToggle"; - options.desc = "Toggle trouble"; - } + # Trouble + { + mode = "n"; + key = "d"; + action = "+diagnostics/debug"; + } + { + key = "dt"; + action = "TroubleToggle"; + options.desc = "Toggle trouble"; + } - # Rust - { - mode = "n"; - key = "r"; - action = "+rust"; - } - { - # Start standalone rust-analyzer (fixes issues when opening files from nvim tree) - mode = "n"; - key = "rs"; - action = "RustStartStandaloneServerForBuffer"; - options.desc = "Start standalone rust-analyzer"; - } - ] - ++ (import ./custom/binds.nix); + # Rust + { + mode = "n"; + key = "r"; + action = "+rust"; + } + { + # Start standalone rust-analyzer (fixes issues when opening files from nvim tree) + mode = "n"; + key = "rs"; + action = "RustStartStandaloneServerForBuffer"; + options.desc = "Start standalone rust-analyzer"; + } + ]; } diff --git a/home-manager/stvnliu/nixvim/devicons.nix b/home-manager/stvnliu/nixvim/devicons.nix deleted file mode 100644 index 5265533..0000000 --- a/home-manager/stvnliu/nixvim/devicons.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - plugins.web-devicons.enable = true; -} diff --git a/home-manager/stvnliu/nixvim/ionide.nix b/home-manager/stvnliu/nixvim/ionide.nix index 3de2422..db3d3fc 100644 --- a/home-manager/stvnliu/nixvim/ionide.nix +++ b/home-manager/stvnliu/nixvim/ionide.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { extraPlugins = with pkgs.vimPlugins; [ Ionide-vim ]; diff --git a/home-manager/stvnliu/nixvim/lsp.nix b/home-manager/stvnliu/nixvim/lsp.nix index 73124a1..2f552c8 100644 --- a/home-manager/stvnliu/nixvim/lsp.nix +++ b/home-manager/stvnliu/nixvim/lsp.nix @@ -1,51 +1,20 @@ -{ ... }: { +{ plugins = { - lsp-signature.enable = true; - lsp-status.enable = true; lsp = { enable = true; servers = { - # For Python pylsp.enable = true; - #pylyzer.enable = true; - #ruff.enable = true; - #ruff_lsp.enable = true; - - rust_analyzer = { - enable = true; - installCargo = false; - installRustc = false; - }; - # For CXX - clangd.enable = true; - - # Misc bashls.enable = true; + clangd.enable = true; fsautocomplete.enable = true; gopls.enable = true; - - #nushell.enable = true; - - # For Nix - #nil_ls.enable = true; - nixd = { + nil_ls.enable = true; + #nixd.enable = true; + rust-analyzer = { enable = true; - extraOptions = { - home-manager = { - expr = '' - (builtins.getFlake "/home/stvnliu/nix-conf/").homeConfigurations."stvnliu@nixos-msi".options''; - }; - }; + installRustc = true; }; - - # Haskell - hls = { - enable = true; - installGhc = false; - }; - - # For TypeScript - ts_ls.enable = true; + tsserver.enable = true; }; keymaps.lspBuf = { "gd" = "definition"; @@ -55,12 +24,10 @@ "K" = "hover"; }; }; - #lsp-lines.enable = true; - - #rustaceanvim = { - # enable = true; - # # rust-tools.enable = true; - #}; + lsp-lines = { + enable = true; + currentLine = true; + }; + rust-tools.enable = true; }; - diagnostics.virtual_lines.only_current_line = true; } diff --git a/home-manager/stvnliu/nixvim/lspkind.nix b/home-manager/stvnliu/nixvim/lspkind.nix deleted file mode 100644 index 73f2b1c..0000000 --- a/home-manager/stvnliu/nixvim/lspkind.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - plugins.lspkind = { - enable = true; - symbolMap = { - Copilot = " "; - }; - extraOptions = { - maxwidth = 50; - ellipsis_char = "..."; - }; - }; -} diff --git a/home-manager/stvnliu/nixvim/options.nix b/home-manager/stvnliu/nixvim/options.nix index 231c131..5243cf9 100644 --- a/home-manager/stvnliu/nixvim/options.nix +++ b/home-manager/stvnliu/nixvim/options.nix @@ -3,7 +3,7 @@ updatetime = 100; # Faster completion number = true; - relativenumber = true; + relativenumber = false; autoindent = true; clipboard = "unnamedplus"; diff --git a/home-manager/stvnliu/nixvim/tagbar.nix b/home-manager/stvnliu/nixvim/tagbar.nix deleted file mode 100644 index 2c7c1b0..0000000 --- a/home-manager/stvnliu/nixvim/tagbar.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: - -{ - - dependencies.ctags.package = pkgs.universal-ctags; - plugins.tagbar = { - enable = true; - settings = { - autoclose = false; - autofocus = false; - autoshowtag = true; - foldlevel = 2; - iconchars = [ "" "" ]; - position = "right"; - visibility_symbols = { - private = "󰛑 "; - protected = "󱗤 "; - public = "󰡭 "; - }; - }; - }; -} diff --git a/home-manager/stvnliu/nixvim/telescope.nix b/home-manager/stvnliu/nixvim/telescope.nix index 95e672f..989ff58 100644 --- a/home-manager/stvnliu/nixvim/telescope.nix +++ b/home-manager/stvnliu/nixvim/telescope.nix @@ -10,6 +10,6 @@ }; }; }; - extensions.fzf-native = { enable = true; }; + extensions.fzf-native = {enable = true;}; }; } diff --git a/home-manager/stvnliu/nixvim/transparent.nix b/home-manager/stvnliu/nixvim/transparent.nix index b392fb8..f81c39b 100644 --- a/home-manager/stvnliu/nixvim/transparent.nix +++ b/home-manager/stvnliu/nixvim/transparent.nix @@ -1 +1 @@ -{ plugins.transparent.enable = true; } +{plugins.transparent.enable = true;} diff --git a/home-manager/stvnliu/nixvim/treesitter.nix b/home-manager/stvnliu/nixvim/treesitter.nix index d101cb7..b611273 100644 --- a/home-manager/stvnliu/nixvim/treesitter.nix +++ b/home-manager/stvnliu/nixvim/treesitter.nix @@ -1,11 +1,10 @@ -{ pkgs, ... }: { +{ plugins = { treesitter = { enable = true; nixGrammars = true; nixvimInjections = true; # enables language injection in nixvim - settings.indent.enable = true; - grammarPackages = pkgs.vimPlugins.nvim-treesitter.passthru.allGrammars; + indent = true; }; treesitter-context.enable = true; rainbow-delimiters.enable = true; diff --git a/home-manager/stvnliu/nixvim/twilight.nix b/home-manager/stvnliu/nixvim/twilight.nix deleted file mode 100644 index 5443b00..0000000 --- a/home-manager/stvnliu/nixvim/twilight.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: { - plugins = { - zen-mode = { enable = true; }; - twilight = { enable = true; }; - }; -} diff --git a/home-manager/stvnliu/nixvim/virt-column.nix b/home-manager/stvnliu/nixvim/virt-column.nix index ef15de2..0daf880 100644 --- a/home-manager/stvnliu/nixvim/virt-column.nix +++ b/home-manager/stvnliu/nixvim/virt-column.nix @@ -1,7 +1,7 @@ { plugins.virt-column = { enable = true; - settings.char = [ "┃" ]; + settings.char = ["┃"]; settings.virtcolumn = "80"; }; } diff --git a/home-manager/stvnliu/nixvim/which_key.nix b/home-manager/stvnliu/nixvim/which_key.nix index bf4f909..1b73707 100644 --- a/home-manager/stvnliu/nixvim/which_key.nix +++ b/home-manager/stvnliu/nixvim/which_key.nix @@ -1 +1 @@ -{ plugins.which-key = { enable = true; }; } +{plugins.which-key = {enable = true;};} diff --git a/home-manager/stvnliu/nixvim/wilder.nix b/home-manager/stvnliu/nixvim/wilder.nix index 1cca351..84d2a31 100644 --- a/home-manager/stvnliu/nixvim/wilder.nix +++ b/home-manager/stvnliu/nixvim/wilder.nix @@ -1,6 +1,6 @@ { plugins.wilder = { enable = true; - modes = [ ":" "/" "?" ]; + modes = [":" "/" "?"]; }; } diff --git a/home-manager/stvnliu/nixvim/wrapping.nix b/home-manager/stvnliu/nixvim/wrapping.nix deleted file mode 100644 index 2648e62..0000000 --- a/home-manager/stvnliu/nixvim/wrapping.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - plugins.wrapping = { - enable = true; - }; -} diff --git a/home-manager/stvnliu/packages/default.nix b/home-manager/stvnliu/packages/default.nix deleted file mode 100644 index de0169f..0000000 --- a/home-manager/stvnliu/packages/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ ... -}: { - imports = [ - ./util-programs.nix - ./office-programs.nix - ./discord.nix - ./wayland-utils.nix - ./pentesting.nix - ./dev.nix - ./gaming.nix - ./hypr.nix - ]; -} diff --git a/home-manager/stvnliu/packages/dev.nix b/home-manager/stvnliu/packages/dev.nix deleted file mode 100644 index c0af3a6..0000000 --- a/home-manager/stvnliu/packages/dev.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs -, ... -}: { - home.packages = with pkgs; [ - wget - vscodium-fhs - devenv - ]; -} diff --git a/home-manager/stvnliu/packages/discord.nix b/home-manager/stvnliu/packages/discord.nix deleted file mode 100644 index b0de476..0000000 --- a/home-manager/stvnliu/packages/discord.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs -, ... -}: { - home.packages = with pkgs; [ discord vesktop cinny-desktop ]; - /*xdg.desktopEntries.discord = { - exec = "${pkgs.vesktop}/bin/vesktop"; - terminal = false; - mimeType = [ "x-scheme-handler/discord" ]; - name = "Discord - Vesktop"; - genericName = "Discord but substituted with Vesktop"; - type = "Application"; - };*/ -} diff --git a/home-manager/stvnliu/packages/gaming.nix b/home-manager/stvnliu/packages/gaming.nix deleted file mode 100644 index 325d877..0000000 --- a/home-manager/stvnliu/packages/gaming.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ bottles zeroad ]; -} diff --git a/home-manager/stvnliu/packages/hypr.nix b/home-manager/stvnliu/packages/hypr.nix deleted file mode 100644 index db9a1d9..0000000 --- a/home-manager/stvnliu/packages/hypr.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ inputs, ... }: -{ - home.packages = [ inputs.hyprswitch.packages.x86_64-linux.default ]; -} diff --git a/home-manager/stvnliu/packages/office-programs.nix b/home-manager/stvnliu/packages/office-programs.nix deleted file mode 100644 index 8863f59..0000000 --- a/home-manager/stvnliu/packages/office-programs.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs -, ... -}: { - home.packages = with pkgs; [ - libreoffice - kdePackages.okular - evolution - evolution-ews - # proton mail - protonmail-bridge - protonmail-bridge-gui - ]; -} diff --git a/home-manager/stvnliu/packages/pentesting.nix b/home-manager/stvnliu/packages/pentesting.nix deleted file mode 100644 index ea49f97..0000000 --- a/home-manager/stvnliu/packages/pentesting.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs -, ... -}: { - home.packages = with pkgs; [ - openvpn - inetutils - nmap - ]; -} diff --git a/home-manager/stvnliu/packages/util-programs.nix b/home-manager/stvnliu/packages/util-programs.nix deleted file mode 100644 index 0d002c7..0000000 --- a/home-manager/stvnliu/packages/util-programs.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ - bottom - libnotify - tree - android-file-transfer - mtpfs - usbutils - glow - tmux - ranger - lazygit - mmv - cheat - thefuck - pcmanfm - udiskie - sxiv - transmission_4-gtk - ]; -} diff --git a/home-manager/stvnliu/packages/vscodium.nix b/home-manager/stvnliu/packages/vscodium.nix deleted file mode 100644 index e1cb7fa..0000000 --- a/home-manager/stvnliu/packages/vscodium.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ vscodium-fhs ]; - xdg.desktopEntries.codium = { }; -} diff --git a/home-manager/stvnliu/packages/wayland-utils.nix b/home-manager/stvnliu/packages/wayland-utils.nix deleted file mode 100644 index 92b46ab..0000000 --- a/home-manager/stvnliu/packages/wayland-utils.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs -, ... -}: { - home.packages = with pkgs; [ wl-clipboard ]; -} diff --git a/home-manager/stvnliu/programs/default.nix b/home-manager/stvnliu/programs/default.nix deleted file mode 100644 index 74081b5..0000000 --- a/home-manager/stvnliu/programs/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... -}: { - imports = [ - ./git.nix - ./rofi.nix - ./tmux.nix - ./foot.nix - #./walker.nix - ]; -} diff --git a/home-manager/stvnliu/programs/foot.nix b/home-manager/stvnliu/programs/foot.nix deleted file mode 100644 index 8562138..0000000 --- a/home-manager/stvnliu/programs/foot.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ lib -, ... -}: { - programs.foot = { - enable = true; - settings = { - main = { - term = "xterm-256color"; - dpi-aware = lib.mkForce "no"; - }; - mouse = { hide-when-typing = "yes"; }; - }; - server.enable = true; - }; -} diff --git a/home-manager/stvnliu/programs/git.nix b/home-manager/stvnliu/programs/git.nix deleted file mode 100644 index 688902e..0000000 --- a/home-manager/stvnliu/programs/git.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs -, config -, ... -}: { - programs.git = { - enable = true; - lfs.enable = true; - package = pkgs.gitFull; - userName = config.myDisplayName; - userEmail = config.myEmail; - extraConfig = import ./git_config.nix; - }; -} diff --git a/home-manager/stvnliu/programs/git_config.nix b/home-manager/stvnliu/programs/git_config.nix deleted file mode 100644 index 15011a0..0000000 --- a/home-manager/stvnliu/programs/git_config.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - core.autocrlf = "input"; - push = { - autoSetupRemote = true; - followTags = true; - }; - commit.gpgsign = true; - #gpg.format = "ssh"; - #gpg.ssh.allowedSignersFile = "/home/${config.myUserName}/.ssh/allowed_signers"; - #user.signingkey = "/home/${config.myUserName}/.ssh/id_ed25519.pub"; - user.signingkey = "DC8F48E7B4C40905"; - credential.helper = "libsecret"; -} diff --git a/home-manager/stvnliu/programs/rofi.nix b/home-manager/stvnliu/programs/rofi.nix deleted file mode 100644 index 24b07c9..0000000 --- a/home-manager/stvnliu/programs/rofi.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... -}: { - programs.rofi = { - enable = true; - }; -} diff --git a/home-manager/stvnliu/programs/tmux.nix b/home-manager/stvnliu/programs/tmux.nix deleted file mode 100644 index ab3fe72..0000000 --- a/home-manager/stvnliu/programs/tmux.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs -, config -, ... -}: { - programs.tmux = { - enable = true; - shell = config.myShells.defaultShell; - terminal = "screen-256color"; # Fix for apps not recognising full color - mouse = true; - plugins = with pkgs; [ - tmuxPlugins.cpu - { - plugin = tmuxPlugins.resurrect; - extraConfig = "set -g @resurrect-strategy-nvim 'session'"; - } - ]; - }; -} diff --git a/home-manager/stvnliu/programs/walker.nix b/home-manager/stvnliu/programs/walker.nix deleted file mode 100644 index b0c24c6..0000000 --- a/home-manager/stvnliu/programs/walker.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config -, ... -}: { - programs.walker = { - enable = true; - runAsService = true; - - # All options from the config.json can be used here. - config = { - search.placeholder = "Example"; - list = { height = 200; }; - websearch.prefix = "?"; - switcher.prefix = "/"; - }; - - # If this is not set the default styling is used. - }; -} diff --git a/home-manager/stvnliu/scripts/default.nix b/home-manager/stvnliu/scripts/default.nix index 4096c43..f51f039 100644 --- a/home-manager/stvnliu/scripts/default.nix +++ b/home-manager/stvnliu/scripts/default.nix @@ -1,16 +1,7 @@ -{ config -, pkgs -, ... +{ + config, + pkgs, + ... }: { - home.packages = [ - (import ./heic-to-jpg.script.nix { inherit pkgs; }) - (import ./tmux-default.script.nix { - inherit pkgs; - inherit config; - }) - (import ./git-check.script.nix { - inherit pkgs; - inherit config; - }) - ]; + home.packages = [(import ./heic-to-jpg.script.nix {inherit pkgs;})]; } diff --git a/home-manager/stvnliu/scripts/git-check.script.nix b/home-manager/stvnliu/scripts/git-check.script.nix deleted file mode 100644 index b122572..0000000 --- a/home-manager/stvnliu/scripts/git-check.script.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ pkgs, config, }: -let - git = config.programs.git.package; - # checks for any Git repositories with uncommitted changes - # used because I am too lazy -in -pkgs.writeShellScriptBin "git-check" '' - #!${pkgs.bash}/bin/bash - cd_err() { - echo "change-directory occurred error. interrupting..." - } - git_check() { - prev=$1 - repo_dir=$2 - #echo "Checking git-cleanliness at $repo_dir, working in $PWD" - cd "$repo_dir" || return - inside_git_repo="$(${git}/bin/git rev-parse --is-inside-work-tree 2>/dev/null)" - result=256 - default_skip=false - if [ "$inside_git_repo" ]; then - if [ "$(${git}/bin/git status --porcelain)" ]; then - result=0 - else - result=1 - fi - #echo "not a git repository" - fi - if [[ $result -eq 0 ]]; then - echo "DIRTY $PWD" - if $default_skip; then return; fi - read -rp "Enter dirty directory? [y/n/N(skip others)] " userinput - if [[ "$userinput" = "y" ]]; then - ${pkgs.lazygit}/bin/lazygit - fi - if [[ "$userinput" = "N" ]]; then - default_skip=true - fi - fi - #echo "going back to $prev" - cd "$prev" || return - } - path=$PWD - scan_path=$PWD - if [ -z "$1" ]; then - scan_path=$PWD - else - scan_path=$1 - fi - for item in $(find $scan_path -maxdepth 1 -type d); do - git_check "$path" "$item" - done -'' diff --git a/home-manager/stvnliu/scripts/heic-to-jpg.script.nix b/home-manager/stvnliu/scripts/heic-to-jpg.script.nix index a4a4ab8..c247474 100644 --- a/home-manager/stvnliu/scripts/heic-to-jpg.script.nix +++ b/home-manager/stvnliu/scripts/heic-to-jpg.script.nix @@ -1,4 +1,4 @@ -{ pkgs }: +{pkgs}: pkgs.writeShellScriptBin "heic-to-jpg" '' mkdir -p ./heic-to-jpg-out ${pkgs.findutils}/bin/find . -type f -print0 | ${pkgs.findutils}/bin/xargs -0 -I "{}" ${pkgs.imagemagick}/bin/magick "{}" -quality 100% ./jpg-out/"{}.conv.jpg" diff --git a/home-manager/stvnliu/scripts/launch-url-firefox.script.nix b/home-manager/stvnliu/scripts/launch-url-firefox.script.nix deleted file mode 100644 index b46d2b1..0000000 --- a/home-manager/stvnliu/scripts/launch-url-firefox.script.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, }: -let - # browserPath = lib.getExe config.programs.firefox.package; - # dmenuPath = lib.getExe pkgs.wmenu; -in -pkgs.writeShellScriptBin "urlmenu" '' - #!${pkgs.bash}/bin/bash -'' diff --git a/home-manager/stvnliu/scripts/tmux-default.script.nix b/home-manager/stvnliu/scripts/tmux-default.script.nix deleted file mode 100644 index 7f28493..0000000 --- a/home-manager/stvnliu/scripts/tmux-default.script.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs -, config -, -}: -let - tmux = config.programs.tmux.package; - windowName = "code-mode"; -in -pkgs.writeShellScriptBin "tmux-code" '' - #!${pkgs.bash}/bin/bash - ${tmux}/bin/tmux has-session -t ${windowName} 2>/dev/null - if [ $? != 0 ]; then - # setting up session - ${tmux}/bin/tmux new -s ${windowName} -d - ${tmux}/bin/tmux send-keys -t ${windowName} 'nvim' Enter - ${tmux}/bin/tmux split-window -h - fi - ${tmux}/bin/tmux attach -t ${windowName} -'' diff --git a/home-manager/stvnliu/services/default.nix b/home-manager/stvnliu/services/default.nix deleted file mode 100644 index c4e81fb..0000000 --- a/home-manager/stvnliu/services/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... -}: { - imports = [ - ./swaync.nix - ./mpd.nix - - # DEPRECATED due to switch to KDE - #./waybar.nix - ]; -} diff --git a/home-manager/stvnliu/services/mpd.nix b/home-manager/stvnliu/services/mpd.nix deleted file mode 100644 index d4ce542..0000000 --- a/home-manager/stvnliu/services/mpd.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs, config, lib, ... }: -lib.mkIf config.usingMusicPlayerDaemon { - home.packages = [ pkgs.ncmpc ]; - services = { - mpd = { - enable = true; - network.listenAddress = "any"; - network.port = 6600; - extraConfig = '' - audio_output { - type "pipewire" - name "my pipewire output" - } - ''; - }; - mpd-mpris = { enable = true; }; - }; -} diff --git a/home-manager/stvnliu/services/swaync.nix b/home-manager/stvnliu/services/swaync.nix deleted file mode 100644 index 2cf818f..0000000 --- a/home-manager/stvnliu/services/swaync.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... -}: { - services.swaync = { - enable = true; - }; -} diff --git a/home-manager/stvnliu/services/waybar.nix b/home-manager/stvnliu/services/waybar.nix deleted file mode 100644 index ed489fa..0000000 --- a/home-manager/stvnliu/services/waybar.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: { - programs.waybar = { - enable = true; - systemd = { enable = true; }; - style = "${import ./waybar_style.nix { }}"; - settings = import ./waybar_config.nix; - }; -} diff --git a/home-manager/stvnliu/services/waybar_config.nix b/home-manager/stvnliu/services/waybar_config.nix deleted file mode 100644 index 382e096..0000000 --- a/home-manager/stvnliu/services/waybar_config.nix +++ /dev/null @@ -1,117 +0,0 @@ -{ - mainBar = { - layer = "top"; - position = "bottom"; - height = 30; - output = [ "eDP-1" "eDP-2" "HDMI-A-1" ]; - modules-left = [ "hyprland/workspaces" "hyprland/submap" ]; - modules-center = [ "mpd" ]; - modules-right = - [ "clock" "group/trays" "group/monitor" "wireplumber" "temperature" ]; - "battery" = { - "bat" = "BAT1"; - "format" = "BAT {capacity}% @ {power}W"; - }; - "hyprland/workspaces" = { - disable-scroll = true; - all-outputs = true; - }; - "tray" = { - "icon-size" = 18; - "spacing" = 10; - }; - "custom/tray-label" = { "format" = "[TRAY]"; }; - "custom/monitor-label" = { "format" = "[HW]"; }; - "group/trays" = { - "orientation" = "inherit"; - "modules" = [ "custom/tray-label" "tray" ]; - "drawer" = { "click-to-reveal" = true; }; - }; - "group/monitor" = { - "orientation" = "inherit"; - "modules" = [ "custom/monitor-label" "battery" "cpu" "memory" ]; - "drawer" = { "click-to-reveal" = true; }; - }; - "mpd" = { - "artist-len" = 10; - "album-len" = 10; - "title-len" = 20; - "format" = - "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) "; - "format-disconnected" = "Disconnected "; - "format-stopped" = - "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped "; - "interval" = 10; - "consume-icons" = { - "on" = " "; # Icon shows only when "consume" is on - }; - "random-icons" = { - "off" = '' - ''; # Icon grayed out when "random" is off - "on" = " "; - }; - "repeat-icons" = { "on" = " "; }; - "single-icons" = { "on" = " 1 "; }; - "state-icons" = { - "paused" = ""; - "playing" = ""; - }; - "tooltip-format" = "MPD (connected)"; - "tooltip-format-disconnected" = "MPD (disconnected)"; - }; - "wireplumber" = { - "format" = "{volume}% {icon}"; - "format-muted" = ""; - "format-icons" = [ "" "" "" ]; - }; - "cpu" = { - "format" = "CPU {icon}"; - "format-icons" = [ - "" # green - "" # blue - "" # white - "" # white - "" # yellow - "" # yellow - "" # orange - "" # red - ]; - "memory" = { "format" = "MEM {percentage}%"; }; - }; - "clock" = { - "format" = "{:%H:%M}  "; - "format-alt" = "{:%A, %B %d, %Y (%R)}"; - "tooltip-format" = "{calendar}"; - "calendar" = { - "mode" = "year"; - "mode-mon-col" = 3; - "weeks-pos" = "right"; - "on-scroll" = 1; - "format" = { - "months" = "{}"; - "days" = "{}"; - "weeks" = "W{}"; - "weekdays" = "{}"; - "today" = "{}"; - }; - }; - /* "actions" = { - "on-click-right" = "mode"; - "on-scroll-up" = "tz_up"; - "on-scroll-down" = "tz_down"; - "on-scroll-up" = "shift_up"; - "on-scroll-down" = "shift_down"; - }; - */ - }; - /* "custom/hello-from-waybar" = { - format = "hello {}"; - max-length = 40; - interval = "once"; - exec = pkgs.writeShellScript "hello-from-waybar" '' - echo "from within waybar" - ''; - }; - */ - }; -} diff --git a/home-manager/stvnliu/services/waybar_style.nix b/home-manager/stvnliu/services/waybar_style.nix deleted file mode 100644 index 2849206..0000000 --- a/home-manager/stvnliu/services/waybar_style.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: '' - * { - font-family: JetBrainsMono Nerd Font; - }'' diff --git a/home-manager/stvnliu/shells/aliases/default.nix b/home-manager/stvnliu/shells/aliases/default.nix index aa78288..b974333 100644 --- a/home-manager/stvnliu/shells/aliases/default.nix +++ b/home-manager/stvnliu/shells/aliases/default.nix @@ -1,14 +1,10 @@ -{ pkgs }: { - gil = "${pkgs.lazygit}/bin/lazygit"; +{pkgs}: { cd = "z"; cdi = "zi"; + ls = "${pkgs.eza}/bin/exa"; cat = "${pkgs.bat}/bin/bat"; - ls = "${pkgs.lsd}/bin/lsd"; ll = "ls -l"; - rm = "${pkgs.trash-cli}/bin/trash"; osupdate = "${pkgs.nh}/bin/nh os switch"; homeupdate = "${pkgs.nh}/bin/nh home switch"; batmon = "watch -n0 upower -i /org/freedesktop/UPower/devices/battery_BAT1"; - inception = "${pkgs.pipx}/bin/pipx run copier copy --trust gh:DataChefHQ/Inception ."; - help = "echo \"No help for u lololololololol\""; } diff --git a/home-manager/stvnliu/shells/default.nix b/home-manager/stvnliu/shells/default.nix index bdcc1bb..db6c054 100644 --- a/home-manager/stvnliu/shells/default.nix +++ b/home-manager/stvnliu/shells/default.nix @@ -1,28 +1,30 @@ -{ lib -, config -, ... -}: -with lib; { - imports = [ - ./zsh.nix - ./fish - ./nushell - ./zoxide.nix - ./direnv.nix - ./starship - ]; +{ + pkgs, + lib, + config, + ... +}: let + cfg = config.myShells; +in + with lib; { + imports = [ + ./zsh.nix + ./fish + ./zoxide.nix + ./direnv.nix + ./starship + ]; - options.myShells = { - defaultShell = with types; mkOption { type = str; }; - enable = mkEnableOption "Enables the shell customisation module."; - }; - config = { - myShells = { - zsh.enable = false; - fish.enable = true; - #nushell.enable = true; - defaultShell = "${config.programs.fish.package}/bin/fish"; - prompts.starship.enable = true; + options.myShells = { + defaultShell = with types; mkOption {type = str;}; + enable = mkEnableOption "Enables the shell customisation module."; }; - }; -} + config = { + myShells = { + zsh.enable = false; + fish.enable = true; + defaultShell = "fish"; + prompts.starship.enable = true; + }; + }; + } diff --git a/home-manager/stvnliu/shells/direnv.nix b/home-manager/stvnliu/shells/direnv.nix index 30e97fa..dd5b52f 100644 --- a/home-manager/stvnliu/shells/direnv.nix +++ b/home-manager/stvnliu/shells/direnv.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { programs = { direnv = { enable = true; diff --git a/home-manager/stvnliu/shells/env/default.nix b/home-manager/stvnliu/shells/env/default.nix deleted file mode 100644 index 11230f0..0000000 --- a/home-manager/stvnliu/shells/env/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... -}: { - EDITOR = "nvim"; -} diff --git a/home-manager/stvnliu/shells/fish/default.nix b/home-manager/stvnliu/shells/fish/default.nix index 4825fe2..895cc7f 100644 --- a/home-manager/stvnliu/shells/fish/default.nix +++ b/home-manager/stvnliu/shells/fish/default.nix @@ -1,65 +1,61 @@ -{ pkgs -, config -, lib -, ... -}: -let +{ + pkgs, + config, + lib, + ... +}: let cfg = config.myShells.fish; in -with lib; { - options = { - myShells.fish = { enable = mkEnableOption "Enables fish and components."; }; - }; - config = mkIf cfg.enable { - programs.fish = { - enable = true; - shellInit = '' - ${builtins.readFile ./init/zoxide.fish} - ${builtins.readFile ./init/nh.fish} - ${builtins.readFile ./init/tailscale.fish} - ${builtins.readFile ./init/pass.fish} - function fish_greeting - ${(pkgs.fortune.override {withOffensive = true;})}/bin/fortune -as | ${pkgs.cowsay}/bin/cowsay | ${pkgs.lolcat}/bin/lolcat - end - funcsave -q fish_greeting - - ${pkgs.thefuck}/bin/thefuck --alias | source - ''; - shellAliases = import ../aliases { inherit pkgs; }; - plugins = with pkgs.fishPlugins; [ - { - name = "z"; - src = z.src; - } - { - name = "plugin-git"; - src = plugin-git.src; - } - { - name = "transient-fish"; - src = transient-fish.src; - } - { - name = "done"; - src = done.src; - } - { - name = "gruvbox"; - src = gruvbox.src; - } - { - name = "colored-man-pages"; - src = colored-man-pages.src; - } - { - name = "puffer"; - src = puffer.src; - } - { - name = "pisces"; - src = pisces.src; - } - ]; + with lib; { + options = { + myShells.fish = {enable = mkEnableOption "Enables fish and components.";}; }; - }; -} + config = mkIf cfg.enable { + programs.fish = { + enable = true; + shellInit = '' + ${builtins.readFile ./init/zoxide.fish} + ${builtins.readFile ./init/nh.fish} + function fish_greeting + ${pkgs.fortune}/bin/fortune -a + end + funcsave -q fish_greeting + ''; + shellAliases = import ../aliases {inherit pkgs;}; + plugins = with pkgs.fishPlugins; [ + { + name = "z"; + src = z.src; + } + { + name = "plugin-git"; + src = plugin-git.src; + } + { + name = "transient-fish"; + src = transient-fish.src; + } + { + name = "done"; + src = done.src; + } + { + name = "gruvbox"; + src = gruvbox.src; + } + { + name = "colored-man-pages"; + src = colored-man-pages.src; + } + { + name = "puffer"; + src = puffer.src; + } + { + name = "pisces"; + src = pisces.src; + } + ]; + }; + }; + } diff --git a/home-manager/stvnliu/shells/fish/init/pass.fish b/home-manager/stvnliu/shells/fish/init/pass.fish deleted file mode 100644 index 44bd6ef..0000000 --- a/home-manager/stvnliu/shells/fish/init/pass.fish +++ /dev/null @@ -1,116 +0,0 @@ - -# Copyright (C) 2012-2014 Dmitry Medvinsky . All Rights Reserved. -# This file is licensed under the GPLv2+. Please see COPYING for more information. - -set -l PROG 'pass' - -function __fish_pass_get_prefix - if set -q PASSWORD_STORE_DIR - realpath -- "$PASSWORD_STORE_DIR" - else - echo "$HOME/.password-store" - end -end - -function __fish_pass_needs_command - [ (count (commandline -opc)) -eq 1 ] -end - -function __fish_pass_uses_command - set -l cmd (commandline -opc) - if [ (count $cmd) -gt 1 ] - if [ $argv[1] = $cmd[2] ] - return 0 - end - end - return 1 -end - -function __fish_pass_print_gpg_keys - gpg2 --list-keys | grep uid | sed 's/.*<\(.*\)>/\1/' -end - -function __fish_pass_print - set -l ext $argv[1] - set -l strip $argv[2] - set -l prefix (__fish_pass_get_prefix) - set -l matches $prefix/**$ext - printf '%s\n' $matches | sed "s#$prefix/\(.*\)$strip#\1#" -end - -function __fish_pass_print_entry_dirs - __fish_pass_print "/" -end - -function __fish_pass_print_entries - __fish_pass_print ".gpg" ".gpg" -end - -function __fish_pass_print_entries_and_dirs - __fish_pass_print_entry_dirs - __fish_pass_print_entries -end - -function __fish_pass_git_complete - set -l prefix (__fish_pass_get_prefix) - set -l git_cmd (commandline -opc) (commandline -ct) - set -e git_cmd[1 2] # Drop "pass git". - complete -C"git -C $prefix $git_cmd" -end - -complete -c $PROG -f -n '__fish_pass_needs_command' -a help -d 'Command: show usage help' -complete -c $PROG -f -n '__fish_pass_needs_command' -a version -d 'Command: show program version' - -complete -c $PROG -f -n '__fish_pass_needs_command' -a init -d 'Command: initialize new password storage' -complete -c $PROG -f -n '__fish_pass_uses_command init' -s p -l path -d 'Assign gpg-id for specified sub folder of password store' - -complete -c $PROG -f -n '__fish_pass_needs_command' -a ls -d 'Command: list passwords' -complete -c $PROG -f -n '__fish_pass_uses_command ls' -a "(__fish_pass_print_entry_dirs)" - -complete -c $PROG -f -n '__fish_pass_needs_command' -a insert -d 'Command: insert new password' -complete -c $PROG -f -n '__fish_pass_uses_command insert' -s e -l echo -d 'Echo the password on console' -complete -c $PROG -f -n '__fish_pass_uses_command insert' -s m -l multiline -d 'Provide multiline password entry' -complete -c $PROG -f -n '__fish_pass_uses_command insert' -s f -l force -d 'Do not prompt before overwritting' -complete -c $PROG -f -n '__fish_pass_uses_command insert' -a "(__fish_pass_print_entry_dirs)" - -complete -c $PROG -f -n '__fish_pass_needs_command' -a generate -d 'Command: generate new password' -complete -c $PROG -f -n '__fish_pass_uses_command generate' -s n -l no-symbols -d 'Do not use special symbols' -complete -c $PROG -f -n '__fish_pass_uses_command generate' -s c -l clip -d 'Put the password in clipboard' -complete -c $PROG -f -n '__fish_pass_uses_command generate' -s f -l force -d 'Do not prompt before overwritting' -complete -c $PROG -f -n '__fish_pass_uses_command generate' -s i -l in-place -d 'Replace only the first line with the generated password' -complete -c $PROG -f -n '__fish_pass_uses_command generate' -a "(__fish_pass_print_entry_dirs)" - -complete -c $PROG -f -n '__fish_pass_needs_command' -a mv -d 'Command: rename existing password' -complete -c $PROG -f -n '__fish_pass_uses_command mv' -s f -l force -d 'Force rename' -complete -c $PROG -f -n '__fish_pass_uses_command mv' -a "(__fish_pass_print_entries_and_dirs)" - -complete -c $PROG -f -n '__fish_pass_needs_command' -a cp -d 'Command: copy existing password' -complete -c $PROG -f -n '__fish_pass_uses_command cp' -s f -l force -d 'Force copy' -complete -c $PROG -f -n '__fish_pass_uses_command cp' -a "(__fish_pass_print_entries_and_dirs)" - -complete -c $PROG -f -n '__fish_pass_needs_command' -a rm -d 'Command: remove existing password' -complete -c $PROG -f -n '__fish_pass_uses_command rm' -s r -l recursive -d 'Remove password groups recursively' -complete -c $PROG -f -n '__fish_pass_uses_command rm' -s f -l force -d 'Force removal' -complete -c $PROG -f -n '__fish_pass_uses_command rm' -a "(__fish_pass_print_entries_and_dirs)" - -complete -c $PROG -f -n '__fish_pass_needs_command' -a edit -d 'Command: edit password using text editor' -complete -c $PROG -f -n '__fish_pass_uses_command edit' -a "(__fish_pass_print_entries)" - -complete -c $PROG -f -n '__fish_pass_needs_command' -a show -d 'Command: show existing password' -complete -c $PROG -f -n '__fish_pass_uses_command show' -s c -l clip -d 'Put password in clipboard' -complete -c $PROG -f -n '__fish_pass_uses_command show' -a "(__fish_pass_print_entries)" -# When no command is given, `show` is defaulted. -complete -c $PROG -f -n '__fish_pass_needs_command' -s c -l clip -d 'Put password in clipboard' -complete -c $PROG -f -n '__fish_pass_needs_command' -a "(__fish_pass_print_entries)" -complete -c $PROG -f -n '__fish_pass_uses_command -c' -a "(__fish_pass_print_entries)" -complete -c $PROG -f -n '__fish_pass_uses_command --clip' -a "(__fish_pass_print_entries)" - -complete -c $PROG -f -n '__fish_pass_needs_command' -a git -d 'Command: execute a git command' -complete -c $PROG -f -n '__fish_pass_uses_command git' -a '(__fish_pass_git_complete)' -complete -c $PROG -f -n '__fish_pass_needs_command' -a find -d 'Command: find a password file or directory matching pattern' -complete -c $PROG -f -n '__fish_pass_needs_command' -a grep -d 'Command: search inside of decrypted password files for matching pattern' -complete -c $PROG -f -n '__fish_pass_uses_command grep' -a '(begin - set -l cmd (commandline -opc) (commandline -ct) - set -e cmd[1 2] # Drop "pass grep". - complete -C"grep $cmd" -end)' diff --git a/home-manager/stvnliu/shells/fish/init/tailscale.fish b/home-manager/stvnliu/shells/fish/init/tailscale.fish deleted file mode 100644 index 10af6b3..0000000 --- a/home-manager/stvnliu/shells/fish/init/tailscale.fish +++ /dev/null @@ -1,248 +0,0 @@ -# Copyright 2013-2023 The Cobra Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# fish completion for tailscale -*- shell-script -*- - -function __tailscale_debug - set -l file "$BASH_COMP_DEBUG_FILE" - if test -n "$file" - echo "$argv" >> $file - end -end - -function __tailscale_perform_completion - __tailscale_debug "Starting __tailscale_perform_completion" - - # Extract all args except the last one - set -l args (commandline -opc) - # Extract the last arg and escape it in case it is a space - set -l lastArg (string escape -- (commandline -ct)) - - __tailscale_debug "args: $args" - __tailscale_debug "last arg: $lastArg" - - set -l requestComp "$args[1] completion __complete --descs=true --flags=true -- $args[2..-1] $lastArg" - - __tailscale_debug "Calling $requestComp" - set -l results (eval $requestComp 2> /dev/null) - - # Some programs may output extra empty lines after the directive. - # Let's ignore them or else it will break completion. - # Ref: https://github.com/spf13/cobra/issues/1279 - for line in $results[-1..1] - if test (string trim -- $line) = "" - # Found an empty line, remove it - set results $results[1..-2] - else - # Found non-empty line, we have our proper output - break - end - end - - set -l comps $results[1..-2] - set -l directiveLine $results[-1] - - # For Fish, when completing a flag with an = (e.g., -n=) - # completions must be prefixed with the flag - set -l flagPrefix (string match -r -- '-.*=' "$lastArg") - - __tailscale_debug "Comps: $comps" - __tailscale_debug "DirectiveLine: $directiveLine" - __tailscale_debug "flagPrefix: $flagPrefix" - - for comp in $comps - printf "%s%s\n" "$flagPrefix" "$comp" - end - - printf "%s\n" "$directiveLine" -end - -# this function limits calls to __tailscale_perform_completion, by caching the result behind $__tailscale_perform_completion_once_result -function __tailscale_perform_completion_once - __tailscale_debug "Starting __tailscale_perform_completion_once" - - if test -n "$__tailscale_perform_completion_once_result" - __tailscale_debug "Seems like a valid result already exists, skipping __tailscale_perform_completion" - return 0 - end - - set --global __tailscale_perform_completion_once_result (__tailscale_perform_completion) - if test -z "$__tailscale_perform_completion_once_result" - __tailscale_debug "No completions, probably due to a failure" - return 1 - end - - __tailscale_debug "Performed completions and set __tailscale_perform_completion_once_result" - return 0 -end - -# this function is used to clear the $__tailscale_perform_completion_once_result variable after completions are run -function __tailscale_clear_perform_completion_once_result - __tailscale_debug "" - __tailscale_debug "========= clearing previously set __tailscale_perform_completion_once_result variable ==========" - set --erase __tailscale_perform_completion_once_result - __tailscale_debug "Successfully erased the variable __tailscale_perform_completion_once_result" -end - -function __tailscale_requires_order_preservation - __tailscale_debug "" - __tailscale_debug "========= checking if order preservation is required ==========" - - __tailscale_perform_completion_once - if test -z "$__tailscale_perform_completion_once_result" - __tailscale_debug "Error determining if order preservation is required" - return 1 - end - - set -l directive (string sub --start 2 $__tailscale_perform_completion_once_result[-1]) - __tailscale_debug "Directive is: $directive" - - set -l shellCompDirectiveKeepOrder 32 - set -l keeporder (math (math --scale 0 $directive / $shellCompDirectiveKeepOrder) % 2) - __tailscale_debug "Keeporder is: $keeporder" - - if test $keeporder -ne 0 - __tailscale_debug "This does require order preservation" - return 0 - end - - __tailscale_debug "This doesn't require order preservation" - return 1 -end - - -# This function does two things: -# - Obtain the completions and store them in the global __tailscale_comp_results -# - Return false if file completion should be performed -function __tailscale_prepare_completions - __tailscale_debug "" - __tailscale_debug "========= starting completion logic ==========" - - # Start fresh - set --erase __tailscale_comp_results - - __tailscale_perform_completion_once - __tailscale_debug "Completion results: $__tailscale_perform_completion_once_result" - - if test -z "$__tailscale_perform_completion_once_result" - __tailscale_debug "No completion, probably due to a failure" - # Might as well do file completion, in case it helps - return 1 - end - - set -l directive (string sub --start 2 $__tailscale_perform_completion_once_result[-1]) - set --global __tailscale_comp_results $__tailscale_perform_completion_once_result[1..-2] - - __tailscale_debug "Completions are: $__tailscale_comp_results" - __tailscale_debug "Directive is: $directive" - - set -l shellCompDirectiveError 1 - set -l shellCompDirectiveNoSpace 2 - set -l shellCompDirectiveNoFileComp 4 - set -l shellCompDirectiveFilterFileExt 8 - set -l shellCompDirectiveFilterDirs 16 - - if test -z "$directive" - set directive 0 - end - - set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2) - if test $compErr -eq 1 - __tailscale_debug "Received error directive: aborting." - # Might as well do file completion, in case it helps - return 1 - end - - set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2) - set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2) - if test $filefilter -eq 1; or test $dirfilter -eq 1 - __tailscale_debug "File extension filtering or directory filtering not supported" - # Do full file completion instead - return 1 - end - - set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2) - set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2) - - __tailscale_debug "nospace: $nospace, nofiles: $nofiles" - - # If we want to prevent a space, or if file completion is NOT disabled, - # we need to count the number of valid completions. - # To do so, we will filter on prefix as the completions we have received - # may not already be filtered so as to allow fish to match on different - # criteria than the prefix. - if test $nospace -ne 0; or test $nofiles -eq 0 - set -l prefix (commandline -t | string escape --style=regex) - __tailscale_debug "prefix: $prefix" - - set -l completions (string match -r -- "^$prefix.*" $__tailscale_comp_results) - set --global __tailscale_comp_results $completions - __tailscale_debug "Filtered completions are: $__tailscale_comp_results" - - # Important not to quote the variable for count to work - set -l numComps (count $__tailscale_comp_results) - __tailscale_debug "numComps: $numComps" - - if test $numComps -eq 1; and test $nospace -ne 0 - # We must first split on \t to get rid of the descriptions to be - # able to check what the actual completion will be. - # We don't need descriptions anyway since there is only a single - # real completion which the shell will expand immediately. - set -l split (string split --max 1 \t $__tailscale_comp_results[1]) - - # Fish won't add a space if the completion ends with any - # of the following characters: @=/:., - set -l lastChar (string sub -s -1 -- $split) - if not string match -r -q "[@=/:.,]" -- "$lastChar" - # In other cases, to support the "nospace" directive we trick the shell - # by outputting an extra, longer completion. - __tailscale_debug "Adding second completion to perform nospace directive" - set --global __tailscale_comp_results $split[1] $split[1]. - __tailscale_debug "Completions are now: $__tailscale_comp_results" - end - end - - if test $numComps -eq 0; and test $nofiles -eq 0 - # To be consistent with bash and zsh, we only trigger file - # completion when there are no other completions - __tailscale_debug "Requesting file completion" - return 1 - end - end - - return 0 -end - -# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves -# so we can properly delete any completions provided by another script. -# Only do this if the program can be found, or else fish may print some errors; besides, -# the existing completions will only be loaded if the program can be found. -if type -q "tailscale" - # The space after the program name is essential to trigger completion for the program - # and not completion of the program name itself. - # Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish. - complete --do-complete "tailscale " > /dev/null 2>&1 -end - -# Remove any pre-existing completions for the program since we will be handling all of them. -complete -c tailscale -e - -# this will get called after the two calls below and clear the $__tailscale_perform_completion_once_result global -complete -c tailscale -n '__tailscale_clear_perform_completion_once_result' -# The call to __tailscale_prepare_completions will setup __tailscale_comp_results -# which provides the program's completion choices. -# If this doesn't require order preservation, we don't use the -k flag -complete -c tailscale -n 'not __tailscale_requires_order_preservation && __tailscale_prepare_completions' -f -a '$__tailscale_comp_results' -# otherwise we use the -k flag -complete -k -c tailscale -n '__tailscale_requires_order_preservation && __tailscale_prepare_completions' -f -a '$__tailscale_comp_results' diff --git a/home-manager/stvnliu/shells/nushell/default.nix b/home-manager/stvnliu/shells/nushell/default.nix deleted file mode 100644 index 0b048e0..0000000 --- a/home-manager/stvnliu/shells/nushell/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs -, config -, lib -, ... -}: -let - cfg = config.myShells.nushell; -in -with lib; { - options = { - myShells.nushell = { enable = mkEnableOption "Enables nushell config"; }; - }; - config = mkIf cfg.enable { - programs = { - nushell = { - enable = true; - configFile.source = ./init/config.nu; - shellAliases = import ../aliases/default.nix { inherit pkgs; }; - }; - carapace = { - enable = true; - enableNushellIntegration = true; - }; - }; - }; -} diff --git a/home-manager/stvnliu/shells/nushell/init/config.nu b/home-manager/stvnliu/shells/nushell/init/config.nu deleted file mode 100644 index afbcf84..0000000 --- a/home-manager/stvnliu/shells/nushell/init/config.nu +++ /dev/null @@ -1,15 +0,0 @@ -$env.config = { - show_banner: false, - hooks: { - pre_prompt: [{ || - if (which direnv | is-empty) { - return - } - - direnv export json | from json | default {} | load-env - if 'ENV_CONVERSIONS' in $env and 'PATH' in $env.ENV_CONVERSIONS { - $env.PATH = do $env.ENV_CONVERSIONS.PATH.from_string $env.PATH - } - }] - } -} diff --git a/home-manager/stvnliu/shells/starship/default.nix b/home-manager/stvnliu/shells/starship/default.nix index 95bb8d6..ef91a38 100644 --- a/home-manager/stvnliu/shells/starship/default.nix +++ b/home-manager/stvnliu/shells/starship/default.nix @@ -1,26 +1,25 @@ -{ lib -, config -, ... -}: -let +{ + lib, + pkgs, + config, + ... +}: let cfg = config.myShells.prompts.starship; in -with lib; { - options = { - myShells.prompts.starship.enable = mkEnableOption "Enables starship prompts."; - myShells.prompts.starship.confPath = mkOption { - type = types.path; - default = ./presets/default.toml; + with lib; { + options = { + myShells.prompts.starship.enable = mkEnableOption "Enables starship prompts."; + myShells.prompts.starship.confPath = mkOption { + type = types.path; + default = ./presets/default.toml; + }; }; - }; - config = mkIf cfg.enable { - myShells.prompts.starship.confPath = ./presets/pure-direnv.toml; - programs.starship = { - enable = true; - enableZshIntegration = config.myShells.zsh.enable; - enableFishIntegration = config.myShells.fish.enable; - enableNushellIntegration = config.myShells.nushell.enable; - settings = builtins.fromTOML (builtins.readFile cfg.confPath); + config = mkIf cfg.enable { + programs.starship = { + enable = true; + enableZshIntegration = config.myShells.zsh.enable; + enableFishIntegration = config.myShells.fish.enable; + settings = builtins.fromTOML (builtins.readFile cfg.confPath); + }; }; - }; -} + } diff --git a/home-manager/stvnliu/shells/starship/presets/pure-direnv.toml b/home-manager/stvnliu/shells/starship/presets/pure-direnv.toml deleted file mode 100644 index 3886289..0000000 --- a/home-manager/stvnliu/shells/starship/presets/pure-direnv.toml +++ /dev/null @@ -1,56 +0,0 @@ -format = """ -${direnv}\ -$username\ -$hostname\ -$directory\ -$git_branch\ -$git_state\ -$git_status\ -$cmd_duration\ -$line_break\ -$python\ -$character""" - -[direnv] -disabled = false -#command = '[[ $(direnv status) =~ "Found RC allowed false" ]] && echo "=========> missing: direnv allow <============"' # shows output of command -detect_files = ['.envrc'] # can specify filters but wildcards are not supported - -[directory] -style = "blue" -truncate_to_repo = false -truncation_length = 8 -truncation_symbol = ".../" - - -[character] -success_symbol = "[❯](purple)" -error_symbol = "[❯](red)" -vimcmd_symbol = "[❮](green)" - -[git_branch] -format = "[$branch]($style)" -style = "bright-black" - -[git_status] -format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)" -style = "cyan" -conflicted = "!" -untracked = "U" -modified = "*" -staged = "+" -renamed = "R" -deleted = "-" -stashed = "≡" - -[git_state] -format = '\([$state( $progress_current/$progress_total)]($style)\) ' -style = "bright-black" - -[cmd_duration] -format = "[$duration]($style) " -style = "yellow" - -[python] -format = "[$virtualenv]($style) " -style = "bright-black" diff --git a/home-manager/stvnliu/shells/zoxide.nix b/home-manager/stvnliu/shells/zoxide.nix index 39b6ab3..9f33410 100644 --- a/home-manager/stvnliu/shells/zoxide.nix +++ b/home-manager/stvnliu/shells/zoxide.nix @@ -1,5 +1,8 @@ -{ config -, ... +{ + pkgs, + config, + lib, + ... }: { programs.zoxide = { enable = true; diff --git a/home-manager/stvnliu/shells/zsh.nix b/home-manager/stvnliu/shells/zsh.nix index 18c0695..c329684 100644 --- a/home-manager/stvnliu/shells/zsh.nix +++ b/home-manager/stvnliu/shells/zsh.nix @@ -1,33 +1,36 @@ -{ pkgs -, lib -, config -, ... -}: -with lib; { - options.myShells.zsh = { - enable = mkEnableOption "Enables zsh and components."; - }; - config = { - programs.zsh = { - enable = true; - syntaxHighlighting.enable = true; - shellAliases = import ./aliases { inherit pkgs; }; - dirHashes = { - docs = "$HOME/Documents"; - dl = "$HOME/Downloads"; - dev = "$HOME/devel"; - screen = "$HOME/Pictures/Screenshots"; - }; - oh-my-zsh = { - enable = true; - plugins = [ - "git" - "rsync" - "zoxide" - ]; - theme = "agnoster"; - }; +{ + pkgs, + lib, + config, + ... +}: let + cfg = config.shell.zsh; +in + with lib; { + options.myShells.zsh = { + enable = mkEnableOption "Enables zsh and components."; }; - home.packages = with pkgs; [ zoxide ]; - }; -} + config = { + programs.zsh = { + enable = true; + syntaxHighlighting.enable = true; + shellAliases = import ./aliases {inherit pkgs;}; + dirHashes = { + docs = "$HOME/Documents"; + dl = "$HOME/Downloads"; + dev = "$HOME/devel"; + screen = "$HOME/Pictures/Screenshots"; + }; + oh-my-zsh = { + enable = true; + plugins = [ + "git" + "rsync" + "zoxide" + ]; + theme = "agnoster"; + }; + }; + home.packages = with pkgs; [zoxide]; + }; + } diff --git a/home-manager/stvnliu/spicetify.nix b/home-manager/stvnliu/spicetify.nix new file mode 100644 index 0000000..d8b2d9b --- /dev/null +++ b/home-manager/stvnliu/spicetify.nix @@ -0,0 +1,26 @@ +{ + pkgs, + lib, + inputs, + ... +}: let + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; +in { + # allow spotify to be installed if you don't have unfree enabled already + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "spotify" + ]; + programs.spicetify = { + enable = true; + theme = spicePkgs.themes.onepunch; + colorScheme = "Dark"; + + enabledExtensions = with spicePkgs.extensions; [ + adblock + fullAppDisplay + shuffle # shuffle+ (special characters are sanitized out of ext names) + hidePodcasts + ]; + }; +} diff --git a/home-manager/stvnliu/stylix.nix b/home-manager/stvnliu/stylix.nix index acef9b6..f672668 100644 --- a/home-manager/stvnliu/stylix.nix +++ b/home-manager/stvnliu/stylix.nix @@ -1,35 +1,17 @@ -{ pkgs -, config -, ... -}: -let - globalOpacity = 0.75; -in -{ +{pkgs, ...}: { stylix = { enable = true; - autoEnable = true; - base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark-dark.yaml"; - image = config.myWallPaperPath; + base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml"; + image = ./assets/nixos-wallpaper.jpg; fonts = { - /*sansSerif = { - name = "Helvetica Neue LT Std"; - package = pkgs.helvetica-neue-lt-std; - };*/ + sansSerif = { + name = "Aileron"; + package = pkgs.aileron; + }; monospace = { - name = config.desktopFont.fullName; - package = config.desktopFont.package; + name = "BlexMono Nerd Font"; + package = pkgs.nerdfonts.override {fonts = ["IBMPlexMono"];}; }; - sizes = { - terminal = 16; - applications = 12; - }; - }; - opacity = { - applications = globalOpacity; - desktop = globalOpacity; - popups = globalOpacity; - terminal = globalOpacity; }; }; } diff --git a/home-manager/stvnliu/swaywm.nix b/home-manager/stvnliu/swaywm.nix new file mode 100644 index 0000000..dfe7305 --- /dev/null +++ b/home-manager/stvnliu/swaywm.nix @@ -0,0 +1,13 @@ +{ + pkgs, + lib, + ... +}: { + wayland.windowManager.sway = { + enable = true; + config = rec { + modifier = "Mod4"; + terminal = "${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=24' zsh"; + }; + }; +} diff --git a/home-manager/stvnliu/variables.nix b/home-manager/stvnliu/variables.nix new file mode 100644 index 0000000..21ba288 --- /dev/null +++ b/home-manager/stvnliu/variables.nix @@ -0,0 +1,20 @@ +{ + pkgs, + config, + lib, + ... +}: { + options = with lib; + with types; { + myWallPaperPathString = mkOption {type = str;}; + myUserName = mkOption {type = str;}; + myDisplayName = mkOption {type = str;}; + myEmail = mkOption {type = str;}; + }; + config = rec { + myUserName = "stvnliu"; + myWallPaperPathString = "/home/${config.myUserName}/wallpaper.png"; + myDisplayName = "Zhongheng Liu"; + myEmail = "z.liu@outlook.com.gr"; + }; +} diff --git a/home-manager/stvnliu/wechat/default.nix b/home-manager/stvnliu/wechat/default.nix index 0362926..c20e301 100644 --- a/home-manager/stvnliu/wechat/default.nix +++ b/home-manager/stvnliu/wechat/default.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }: { +{pkgs, ...}: { nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ]; home.packages = with pkgs; [ - wechat-uos + (wechat-uos.override {uosLicense = ./license.tar.gz;}) ]; } diff --git a/home-manager/stvnliu/wechat/license.tar.gz b/home-manager/stvnliu/wechat/license.tar.gz new file mode 100644 index 0000000..fcef1de Binary files /dev/null and b/home-manager/stvnliu/wechat/license.tar.gz differ diff --git a/home-manager/stvnliu/xdg.nix b/home-manager/stvnliu/xdg.nix index 25cbeed..2899822 100644 --- a/home-manager/stvnliu/xdg.nix +++ b/home-manager/stvnliu/xdg.nix @@ -1,7 +1,6 @@ -{ ... }: { +{pkgs, ...}: { xdg = { enable = true; - userDirs.enable = true; mimeApps = { enable = true; defaultApplications = { diff --git a/nixos/ags.nix b/nixos/ags.nix new file mode 100644 index 0000000..036fee1 --- /dev/null +++ b/nixos/ags.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + environment.systemPackages = [ + pkgs.ags + ]; +} diff --git a/nixos/bootloader.nix b/nixos/bootloader.nix deleted file mode 100644 index ace48f8..0000000 --- a/nixos/bootloader.nix +++ /dev/null @@ -1,97 +0,0 @@ -{ pkgs -, ... -}: -let - xenlism-grub-themes = pkgs.stdenv.mkDerivation { - pname = "xenlism-grub-themes"; - version = "1.0"; - src = pkgs.fetchFromGitHub { - owner = "xenlism"; - repo = "Grub-themes"; - rev = "40ac048df9aacfc053c515b97fcd24af1a06762f"; - hash = "sha256-ProTKsFocIxWAFbYgQ46A+GVZ7mUHXxZrvdiPJqZJ6I="; - }; - installPhase = "cp -r xenlism-grub-1080p-nixos/Xenlism-Nixos $out"; - }; -in -{ - environment.systemPackages = with pkgs; [ hack-font ]; - #fileSystems."/mnt/winsys" = { - # device = "/dev/nvme0n1p5"; - # fsType = "ntfs-3g"; - # options = [ "rw" "uid=1000" ]; - #}; - #fileSystems."/mnt/windata" = { - # device = "/dev/nvme0n1p3"; - # fsType = "ntfs-3g"; - # options = [ "rw" "uid=1000" ]; - #}; - boot = { - /*plymouth = { - enable = true; - theme = "rings"; - themePackages = with pkgs; [ - # By default we would install all themes - (adi1090x-plymouth-themes.override { selected_themes = [ "rings" ]; }) - ]; - };*/ - - # Enable "Silent Boot" - consoleLogLevel = 0; - initrd.verbose = false; - kernelParams = [ - "quiet" - "splash" - "boot.shell_on_fail" - "loglevel=3" - "rd.systemd.show_status=false" - "rd.udev.log_level=3" - "udev.log_priority=3" - ]; - # Hide the OS choice for bootloaders. - # It's still possible to open the bootloader list by pressing any key - # It will just not appear on screen unless a key is pressed - supportedFilesystems = [ "ntfs" ]; - loader = { - #timeout = 0; - efi = { canTouchEfiVariables = true; }; - grub = { - enable = true; - efiSupport = true; - device = "nodev"; - fsIdentifier = "label"; - devices = [ "nodev" ]; - extraConfig = '' - function load_video { - if [ x$feature_all_video_module = xy ]; then - insmod all_video - else - insmod efi_gop - insmod efi_uga - insmod ieee1275_fb - insmod vbe - insmod vga - insmod video_bochs - insmod video_cirrus - fi - }''; - extraEntries = '' - - menuentry "UEFI Firmware Settings" { - fwsetup - } - menuentry "Reboot" { - reboot - } - menuentry "Poweroff" { - halt - } - ''; - useOSProber = true; - configurationLimit = 10; - fontSize = 32; - theme = xenlism-grub-themes; - }; - }; - }; -} diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 53b156b..af1a358 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,64 +1,29 @@ # This is your system's configuration file. # Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) -{ inputs, lib, config, pkgs, ... }: { +{ + inputs, + lib, + config, + pkgs, + ... +}: { imports = [ ../common/variables.nix ./greetd.nix - ./bootloader.nix + ./grub.nix ./nvidia.nix ./fonts.nix ./services/laptop.preset.nix - ./virtualisation.nix - #./dwm - #./spec.nix ./hardware-configuration.nix - #./custom-hosts.nix ]; - # Virtual cam settings: see https://wiki.nixos.org/wiki/OBS_Studio#Using_the_Virtual_Camera - environment.sessionVariables = { + environment.variables = { GDK_SCALE = config.displayScale; FLAKE = config.myConfigLocation; - MANPAGER = "nvim +Man!"; - NVD_BACKEND = "direct"; - NIXOS_OZONE_WL = "1"; - # GTK_IM_MODULE = lib.mkForce ""; + GTK_IM_MODULE = lib.mkForce ""; }; - /* services.jellyfin = { - enable = true; - openFirewall = true; - }; - */ - services.displayManager.sddm.enable = true; - services.displayManager.sddm.wayland.enable = true; - services.desktopManager.plasma6.enable = true; - services.keyd = { - enable = true; - keyboards = { - default = { - ids = [ "*" ]; - settings = { - main = { - capslock = "esc"; - esc = "capslock"; - }; - }; - extraConfig = ""; - }; - }; - }; - programs.gnupg.agent = { - enable = true; - pinentryPackage = pkgs.pinentry-gnome3; - enableSSHSupport = true; - }; - programs.gamescope = { - enable = true; - capSysNice = true; - }; - security.pam.services.hyprlock = { }; + security.pam.services.hyprlock = {}; i18n.inputMethod = { - type = "fcitx5"; - enable = true; + enabled = "fcitx5"; fcitx5.addons = with pkgs; [ fcitx5-mozc fcitx5-gtk @@ -68,86 +33,52 @@ #enabled = "ibus"; #ibus.engines = with pkgs.ibus-engines; [rime]; }; - #programs.hyprland = { enable = true; }; hardware.bluetooth = { enable = true; powerOnBoot = true; - settings = { General = { Disable = "Handsfree,Headset"; }; }; }; - #specialisation = { - # in-china.configuration = { - # networking.proxy = { - # default = "http://127.0.0.1:7897/"; - # noProxy = "127.0.0.1,localhost,internal.domain"; - # }; - # }; - #}; - xdg.portal = { - enable = true; - extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; - config = { common.default = [ "gtk" ]; }; + specialisation = { + in-china.configuration = { + networking.proxy = { + default = "http://127.0.0.1:7897/"; + noProxy = "127.0.0.1,localhost,internal.domain"; + }; + }; }; + systemd.user.services.mpris-proxy = { description = "Mpris proxy"; - after = [ "network.target" "sound.target" ]; - wantedBy = [ "default.target" ]; + after = ["network.target" "sound.target"]; + wantedBy = ["default.target"]; serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; }; - programs = { - steam = { - enable = true; - remotePlay.openFirewall = - true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = - true; # Open ports in the firewall for Source Dedicated Server - localNetworkGameTransfers.openFirewall = - true; # Open ports in the firewall for Steam Local Network Game Transfers - extraCompatPackages = with pkgs; [ proton-ge-bin ]; - }; - gamemode.enable = true; - }; - boot = { - extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; - extraModprobeConfig = '' - options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 - ''; - kernelPackages = pkgs.linuxPackages_zen; - supportedFilesystems = [ "ntfs" ]; - }; - documentation = { + programs.steam = { enable = true; - dev.enable = true; - doc.enable = true; - man.enable = true; + remotePlay.openFirewall = + true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = + true; # Open ports in the firewall for Source Dedicated Server + localNetworkGameTransfers.openFirewall = + true; # Open ports in the firewall for Steam Local Network Game Transfers + }; + + boot = { + kernelPackages = pkgs.linuxPackages_zen; + supportedFilesystems = ["ntfs"]; }; security.polkit.enable = true; environment.systemPackages = with pkgs; [ - man-pages-posix - man-pages - (pass-wayland.withExtensions (exts: [ exts.pass-otp exts.pass-import ])) - gparted - zed-editor libsForQt5.qt5.qtquickcontrols2 libsForQt5.qt5.qtgraphicaleffects - /* (blender.override { - cudaSupport = true; - }) - */ - trash-cli - #inputs.hyprswitch.packages.x86_64-linux.default ]; - # turned off because timedatectl doesn't like it - time.hardwareClockInLocalTime = false; - time.timeZone = "Asia/Shanghai"; + time.hardwareClockInLocalTime = true; services = { #displayManager.sddm = { # enable = true; # wayland.enable = true; # theme = "${import ./sddm-theme.nix {inherit pkgs;}}"; #}; - #automatic-timezoned.enable = true; - pcscd.enable = true; - + automatic-timezoned.enable = true; openssh = { enable = true; settings = { @@ -162,51 +93,35 @@ # enable = true; # wrapperFeatures.gtk = true; #}; + programs.hyprland.enable = true; # enables Hyprland DM. nixpkgs = { - overlays = [ ]; - config = { - cudaSupport = true; - allowUnfree = true; - permittedInsecurePackages = [ "dotnet-core-combined" ]; - }; + overlays = []; + config = {allowUnfree = true;}; }; - nix = - let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; - in { - settings = { - experimental-features = "nix-command flakes"; - # flake-registry = ""; - nix-path = config.nix.nixPath; - }; - extraOptions = '' - trusted-users = root stvnliu - ''; - channel.enable = false; - registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; - nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + nix = let + flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; + in { + settings = { + experimental-features = "nix-command flakes"; + flake-registry = ""; + nix-path = config.nix.nixPath; }; - - systemd.network.wait-online.enable = false; + channel.enable = false; + registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs; + nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + }; networking = { hostName = "${config.myHostName}"; networkmanager.enable = true; - useNetworkd = lib.mkDefault true; - useDHCP = lib.mkDefault true; }; users.users = { "${config.myUserName}" = { initialPassword = "stevenpassword"; isNormalUser = true; - openssh.authorizedKeys.keys = [ ]; - packages = with pkgs; [ nh ]; - extraGroups = [ "wheel" "input" "networkmanager" ]; - }; - "xi_jinping" = { - initialPassword = "bingchilling"; - isNormalUser = true; - packages = with pkgs; [ git ]; - extraGroups = [ "input" ]; + openssh.authorizedKeys.keys = []; + packages = with pkgs; [nh gparted]; + extraGroups = ["wheel" "input" "networkmanager"]; }; }; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion diff --git a/nixos/custom-hosts.nix b/nixos/custom-hosts.nix deleted file mode 100644 index a0a18b4..0000000 --- a/nixos/custom-hosts.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ ... -}: -let - rootDomainName = "stvnliu.me"; - subdomains = [ - "git" - "kellnr" - "www" - "blog" - "files" - "code" - "chat" - ]; -in -{ - networking.extraHosts = '' - # home IP mapping - 192.168.1.100 ${rootDomainName} ${builtins.concatStringsSep " " (map (x: x + "." + rootDomainName) subdomains)} - ''; -} diff --git a/nixos/droidcam.nix b/nixos/droidcam.nix deleted file mode 100644 index 5db1483..0000000 --- a/nixos/droidcam.nix +++ /dev/null @@ -1,26 +0,0 @@ -# /etc/nixos/configuration.nix -{ config, pkgs, ... }: - -{ - # Virtual cam settings: see https://wiki.nixos.org/wiki/OBS_Studio#Using_the_Virtual_Camera - boot.extraModulePackages = with config.boot.kernelPackages; [ - v4l2loopback - ]; - boot.extraModprobeConfig = '' - options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 - ''; - security.polkit.enable = true; - - # Install OBS Studio with droidcam-obs - users.users.foo = { - packages = with pkgs; [ - # ... - (wrapOBS { - plugins = with obs-studio-plugins; [ - droidcam-obs - ]; - }) - # ... - ]; - }; -} diff --git a/nixos/dwm/default.nix b/nixos/dwm/default.nix deleted file mode 100644 index c3f3bdd..0000000 --- a/nixos/dwm/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, }: { - #options = { - #dwm.enable = lib.mkEnableOption "Enables dwm."; - #}; - environment.systemPackages = with pkgs; [ st dmenu slstatus pamixer ]; - programs.dconf.enable = true; - services.xserver = { - enable = true; - windowManager = { - dwm = { - enable = true; - package = pkgs.dwm.override { - patches = [ - ./patches/config-20240325.diff - ./patches/dwm-flextile-20210722-138b405.diff - ./patches/dwm-systray-6.4.diff - ]; - }; - }; - }; - }; -} diff --git a/nixos/dwm/patches/accessnthmon.diff b/nixos/dwm/patches/accessnthmon.diff deleted file mode 100644 index a65ec15..0000000 --- a/nixos/dwm/patches/accessnthmon.diff +++ /dev/null @@ -1,100 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 1c0b587..8595a71 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -49,7 +49,10 @@ static const Layout layouts[] = { - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ -- { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, -+ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \ -+ { ALTMOD, KEY, focusnthmon, {.i = TAG } }, \ -+ { ALTMOD|ShiftMask, KEY, tagnthmon, {.i = TAG } }, -+ - - /* helper for spawning shell commands in the pre dwm-5.0 fashion */ - #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } -diff --git a/dwm.c b/dwm.c -index b0b3466..96fa0bd 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -161,6 +161,7 @@ static void destroynotify(XEvent *e); - static void detach(Client *c); - static void detachstack(Client *c); - static Monitor *dirtomon(int dir); -+static Monitor *numtomon(int num); - static void drawbar(Monitor *m); - static void drawbars(void); - static void enternotify(XEvent *e); -@@ -168,6 +169,7 @@ static void expose(XEvent *e); - static void focus(Client *c); - static void focusin(XEvent *e); - static void focusmon(const Arg *arg); -+static void focusnthmon(const Arg *arg); - static void focusstack(const Arg *arg); - static Atom getatomprop(Client *c, Atom prop); - static int getrootptr(int *x, int *y); -@@ -209,6 +211,7 @@ static void sigchld(int unused); - static void spawn(const Arg *arg); - static void tag(const Arg *arg); - static void tagmon(const Arg *arg); -+static void tagnthmon(const Arg *arg); - static void tile(Monitor *); - static void togglebar(const Arg *arg); - static void togglefloating(const Arg *arg); -@@ -693,6 +696,18 @@ dirtomon(int dir) - return m; - } - -+Monitor * -+numtomon(int num) -+{ -+ Monitor *m = NULL; -+ int i = 0; -+ -+ for(m = mons, i=0; m->next && i < num; m = m->next){ -+ i++; -+ } -+ return m; -+} -+ - void - drawbar(Monitor *m) - { -@@ -830,6 +845,21 @@ focusmon(const Arg *arg) - focus(NULL); - } - -+void -+focusnthmon(const Arg *arg) -+{ -+ Monitor *m; -+ -+ if (!mons->next) -+ return; -+ -+ if ((m = numtomon(arg->i)) == selmon) -+ return; -+ unfocus(selmon->sel, 0); -+ selmon = m; -+ focus(NULL); -+} -+ - void - focusstack(const Arg *arg) - { -@@ -1671,6 +1701,14 @@ tagmon(const Arg *arg) - sendmon(selmon->sel, dirtomon(arg->i)); - } - -+void -+tagnthmon(const Arg *arg) -+{ -+ if (!selmon->sel || !mons->next) -+ return; -+ sendmon(selmon->sel, numtomon(arg->i)); -+} -+ - void - tile(Monitor *m) - { diff --git a/nixos/dwm/patches/config-20240325.diff b/nixos/dwm/patches/config-20240325.diff deleted file mode 100644 index 0533a97..0000000 --- a/nixos/dwm/patches/config-20240325.diff +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 9efa774..1b543e3 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -1,21 +1,22 @@ - /* See LICENSE file for copyright and license details. */ -- -+#include - /* appearance */ - static const unsigned int borderpx = 1; /* border pixel of windows */ - static const unsigned int snap = 32; /* snap pixel */ - static const int showbar = 1; /* 0 means no bar */ --static const int topbar = 1; /* 0 means bottom bar */ --static const char *fonts[] = { "monospace:size=10" }; --static const char dmenufont[] = "monospace:size=10"; --static const char col_gray1[] = "#222222"; --static const char col_gray2[] = "#444444"; -+static const int topbar = 0; /* 0 means bottom bar */ -+static const char *fonts[] = { "IntoneMonoNerdFont:size=10" }; -+static const char dmenufont[] = "IntoneMonoNerdFont:size=10"; -+static const char col_gray1[] = "#1d1d19"; -+static const char col_gray2[] = "#444440"; - static const char col_gray3[] = "#bbbbbb"; - static const char col_gray4[] = "#eeeeee"; - static const char col_cyan[] = "#005577"; -+static const char col_gruvbox_yellow[] = "#353124"; - static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, -- [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -+ [SchemeSel] = { col_gray4, col_gruvbox_yellow, col_gruvbox_yellow }, - }; - - /* tagging */ -@@ -59,11 +60,24 @@ static const Layout layouts[] = { - static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ - static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; - static const char *termcmd[] = { "st", NULL }; -- -+static const char *lockcmd[] = { "xlock" , "-mode", "space", NULL }; -+static const char *mccmd[] = { "st", "-e", "mc", NULL }; -+static const char *raisevol[] = { "pamixer", "-i", "5", NULL}; -+static const char *lowervol[] = { "pamixer", "-d", "5", NULL}; -+static const char *mutevol[] = {"pamixer", "--set-volume", "0", NULL}; -+static const char *screenshot[] = {"flameshot", "gui", NULL}; -+static const char *btop[] = {"btop", NULL}; - static const Key keys[] = { - /* modifier key function argument */ -+ {0, XF86XK_AudioRaiseVolume, spawn, {.v = raisevol } }, -+ {0, XF86XK_AudioLowerVolume, spawn, {.v = lowervol } }, -+ {0, XF86XK_AudioMute, spawn, {.v = mutevol } }, -+ {0, XK_Print, spawn, {.v = screenshot } }, -+ { MODKEY, XK_e, spawn, {.v = mccmd } }, - { MODKEY, XK_p, spawn, {.v = dmenucmd } }, - { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, -+ { MODKEY|ControlMask, XK_m, spawn, {.v = btop } }, -+ {MODKEY|ControlMask, XK_l, spawn, {.v = lockcmd } }, - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, diff --git a/nixos/dwm/patches/config.h b/nixos/dwm/patches/config.h deleted file mode 100644 index 4c8dc93..0000000 --- a/nixos/dwm/patches/config.h +++ /dev/null @@ -1,121 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -/* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ -static const unsigned int snap = 32; /* snap pixel */ -static const int showbar = 1; /* 0 means no bar */ -static const int topbar = 0; /* 0 means bottom bar */ -static const char *fonts[] = { "monospace:size=10" }; -static const char dmenufont[] = "monospace:size=10"; -static const char col_gray1[] = "#222222"; -static const char col_gray2[] = "#444444"; -static const char col_gray3[] = "#bbbbbb"; -static const char col_gray4[] = "#eeeeee"; -static const char col_cyan[] = "#005577"; -static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -}; - -/* tagging */ -static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - -static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, -}; - -/* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ -static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ - -static const Layout layouts[] = { - /* symbol arrange function */ - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -}; - -/* key definitions */ -#define MODKEY Mod1Mask -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - -/* commands */ -static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -static const char *termcmd[] = { "st", NULL }; -static const char *mccmd[] = { "st", "-e", "mc", NULL }; -static const char *raisevol[] = { "pamixer", "-i", "5", NULL}; -static const char *lowervol[] = { "pamixer", "-d", "5", NULL}; -static const Key keys[] = { - /* modifier key function argument */ - {0, XF86XK_AudioRaiseVolume, spawn, {.v = raisevol } }, - {0, XF86XK_AudioLowerVolume, spawn, {.v = lowervol } }, - { MODKEY, XK_e, spawn, {.v = mccmd } }, - { MODKEY, XK_p, spawn, {.v = dmenucmd } }, - { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY, XK_Return, zoom, {0} }, - { MODKEY, XK_Tab, view, {0} }, - { MODKEY|ShiftMask, XK_c, killclient, {0} }, - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, - { MODKEY, XK_space, setlayout, {0} }, - { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - { MODKEY, XK_comma, focusmon, {.i = -1 } }, - { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) - TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, -}; - -/* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ -static const Button buttons[] = { - /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, -}; - diff --git a/nixos/dwm/patches/dwm-flextile-20210722-138b405.diff b/nixos/dwm/patches/dwm-flextile-20210722-138b405.diff deleted file mode 100644 index f6028ee..0000000 --- a/nixos/dwm/patches/dwm-flextile-20210722-138b405.diff +++ /dev/null @@ -1,447 +0,0 @@ -From cb3d26193fafd0b06217c3bf2d65a6eac74b4941 Mon Sep 17 00:00:00 2001 -From: Max Schillinger -Date: Thu, 22 Jul 2021 23:19:36 +0200 -Subject: [PATCH] flextile layout for dwm commit 138b405 - ---- - config.def.h | 17 +++++- - dwm.c | 123 +++++++++++++++++++------------------- - flextile.h | 163 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 238 insertions(+), 65 deletions(-) - create mode 100644 flextile.h - -diff --git a/config.def.h b/config.def.h -index a2ac963..1330db2 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -21,6 +21,9 @@ static const char *colors[][3] = { - /* tagging */ - static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; - -+/* include(s) depending on the tags array */ -+#include "flextile.h" -+ - static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class -@@ -33,8 +36,12 @@ static const Rule rules[] = { - - /* layout(s) */ - static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ --static const int nmaster = 1; /* number of clients in master area */ - static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ -+static const int layoutaxis[] = { -+ 1, /* layout axis: 1 = x, 2 = y; negative values mirror the layout, setting the master area to the right / bottom instead of left / top */ -+ 2, /* master axis: 1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle) */ -+ 2, /* stack axis: 1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle) */ -+}; - static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ - - static const Layout layouts[] = { -@@ -67,8 +74,8 @@ static Key keys[] = { - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, -- { MODKEY, XK_i, incnmaster, {.i = +1 } }, -- { MODKEY, XK_d, incnmaster, {.i = -1 } }, -+ { MODKEY, XK_i, shiftmastersplit, {.i = +1} }, /* increase the number of tiled clients in the master area */ -+ { MODKEY, XK_d, shiftmastersplit, {.i = -1} }, /* reduce the number of tiled clients in the master area */ - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY, XK_Return, zoom, {0} }, -@@ -95,6 +102,10 @@ static Key keys[] = { - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, -+ { MODKEY|ControlMask, XK_t, rotatelayoutaxis, {.i = 0} }, /* 0 = layout axis */ -+ { MODKEY|ControlMask, XK_Tab, rotatelayoutaxis, {.i = 1} }, /* 1 = master axis */ -+ { MODKEY|ControlMask|ShiftMask, XK_Tab, rotatelayoutaxis, {.i = 2} }, /* 2 = stack axis */ -+ { MODKEY|ControlMask, XK_Return, mirrorlayout, {0} }, - }; - - /* button definitions */ -diff --git a/dwm.c b/dwm.c -index 5e4d494..1f1487a 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -111,27 +111,6 @@ typedef struct { - void (*arrange)(Monitor *); - } Layout; - --struct Monitor { -- char ltsymbol[16]; -- float mfact; -- int nmaster; -- int num; -- int by; /* bar geometry */ -- int mx, my, mw, mh; /* screen size */ -- int wx, wy, ww, wh; /* window area */ -- unsigned int seltags; -- unsigned int sellt; -- unsigned int tagset[2]; -- int showbar; -- int topbar; -- Client *clients; -- Client *sel; -- Client *stack; -- Monitor *next; -- Window barwin; -- const Layout *lt[2]; --}; -- - typedef struct { - const char *class; - const char *instance; -@@ -175,7 +154,6 @@ static long getstate(Window w); - static int gettextprop(Window w, Atom atom, char *text, unsigned int size); - static void grabbuttons(Client *c, int focused); - static void grabkeys(void); --static void incnmaster(const Arg *arg); - static void keypress(XEvent *e); - static void killclient(const Arg *arg); - static void manage(Window w, XWindowAttributes *wa); -@@ -631,17 +609,32 @@ configurerequest(XEvent *e) - Monitor * - createmon(void) - { -+ unsigned int i; - Monitor *m; - - m = ecalloc(1, sizeof(Monitor)); - m->tagset[0] = m->tagset[1] = 1; - m->mfact = mfact; -- m->nmaster = nmaster; - m->showbar = showbar; - m->topbar = topbar; - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); -+ m->ltaxis[0] = layoutaxis[0]; -+ m->ltaxis[1] = layoutaxis[1]; -+ m->ltaxis[2] = layoutaxis[2]; -+ m->msplit = 1; -+ /* init tags, bars, layouts, axes, msplits and mfacts */ -+ m->curtag = m->prevtag = 1; -+ for(i = 0; i < LENGTH(tags) + 1; i++){ -+ m->showbars[i] = m->showbar; -+ m->lts[i] = &layouts[0]; -+ m->mfacts[i] = m->mfact; -+ m->ltaxes[i][0] = m->ltaxis[0]; -+ m->ltaxes[i][1] = m->ltaxis[1]; -+ m->ltaxes[i][2] = m->ltaxis[2]; -+ m->msplits[i] = m->msplit; -+ } - return m; - } - -@@ -964,13 +957,6 @@ grabkeys(void) - } - } - --void --incnmaster(const Arg *arg) --{ -- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); -- arrange(selmon); --} -- - #ifdef XINERAMA - static int - isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info) -@@ -1504,7 +1490,7 @@ setlayout(const Arg *arg) - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) - selmon->sellt ^= 1; - if (arg && arg->v) -- selmon->lt[selmon->sellt] = (Layout *)arg->v; -+ selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag] = (Layout *)arg->v; - strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); - if (selmon->sel) - arrange(selmon); -@@ -1523,7 +1509,7 @@ setmfact(const Arg *arg) - f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - if (f < 0.05 || f > 0.95) - return; -- selmon->mfact = f; -+ selmon->mfact = selmon->mfacts[selmon->curtag] = f; - arrange(selmon); - } - -@@ -1671,38 +1657,10 @@ tagmon(const Arg *arg) - sendmon(selmon->sel, dirtomon(arg->i)); - } - --void --tile(Monitor *m) --{ -- unsigned int i, n, h, mw, my, ty; -- Client *c; -- -- for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); -- if (n == 0) -- return; -- -- if (n > m->nmaster) -- mw = m->nmaster ? m->ww * m->mfact : 0; -- else -- mw = m->ww; -- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) -- if (i < m->nmaster) { -- h = (m->wh - my) / (MIN(n, m->nmaster) - i); -- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); -- if (my + HEIGHT(c) < m->wh) -- my += HEIGHT(c); -- } else { -- h = (m->wh - ty) / (n - i); -- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); -- if (ty + HEIGHT(c) < m->wh) -- ty += HEIGHT(c); -- } --} -- - void - togglebar(const Arg *arg) - { -- selmon->showbar = !selmon->showbar; -+ selmon->showbar = selmon->showbars[selmon->curtag] = !selmon->showbar; - updatebarpos(selmon); - XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); - arrange(selmon); -@@ -1726,12 +1684,31 @@ void - toggletag(const Arg *arg) - { - unsigned int newtags; -+ unsigned int i; - - if (!selmon->sel) - return; - newtags = selmon->sel->tags ^ (arg->ui & TAGMASK); - if (newtags) { - selmon->sel->tags = newtags; -+ if(newtags == ~0) { -+ selmon->prevtag = selmon->curtag; -+ selmon->curtag = 0; -+ } -+ if(!(newtags & 1 << (selmon->curtag - 1))) { -+ selmon->prevtag = selmon->curtag; -+ for (i=0; !(newtags & 1 << i); i++); -+ selmon->curtag = i + 1; -+ } -+ selmon->sel->tags = newtags; -+ selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag]; -+ selmon->mfact = selmon->mfacts[selmon->curtag]; -+ if (selmon->showbar != selmon->showbars[selmon->curtag]) -+ togglebar(NULL); -+ selmon->ltaxis[0] = selmon->ltaxes[selmon->curtag][0]; -+ selmon->ltaxis[1] = selmon->ltaxes[selmon->curtag][1]; -+ selmon->ltaxis[2] = selmon->ltaxes[selmon->curtag][2]; -+ selmon->msplit = selmon->msplits[selmon->curtag]; - focus(NULL); - arrange(selmon); - } -@@ -2038,11 +2015,33 @@ updatewmhints(Client *c) - void - view(const Arg *arg) - { -+ unsigned int i; -+ - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) - return; - selmon->seltags ^= 1; /* toggle sel tagset */ -- if (arg->ui & TAGMASK) -+ if (arg->ui & TAGMASK) { - selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; -+ selmon->prevtag = selmon->curtag; -+ if(arg->ui == ~0) -+ selmon->curtag = 0; -+ else { -+ for (i=0; !(arg->ui & 1 << i); i++); -+ selmon->curtag = i + 1; -+ } -+ } else { -+ selmon->prevtag = selmon->curtag ^ selmon->prevtag; -+ selmon->curtag ^= selmon->prevtag; -+ selmon->prevtag = selmon->curtag ^ selmon->prevtag; -+ } -+ selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag]; -+ selmon->mfact = selmon->mfacts[selmon->curtag]; -+ if(selmon->showbar != selmon->showbars[selmon->curtag]) -+ togglebar(NULL); -+ selmon->ltaxis[0] = selmon->ltaxes[selmon->curtag][0]; -+ selmon->ltaxis[1] = selmon->ltaxes[selmon->curtag][1]; -+ selmon->ltaxis[2] = selmon->ltaxes[selmon->curtag][2]; -+ selmon->msplit = selmon->msplits[selmon->curtag]; - focus(NULL); - arrange(selmon); - } -diff --git a/flextile.h b/flextile.h -new file mode 100644 -index 0000000..edab893 ---- /dev/null -+++ b/flextile.h -@@ -0,0 +1,163 @@ -+/* See LICENSE file for copyright and license details. */ -+/* © 2010 joten */ -+ -+struct Monitor { -+ char ltsymbol[16]; -+ float mfact; -+ double mfacts[LENGTH(tags) + 1]; -+ int ltaxis[3]; -+ int ltaxes[LENGTH(tags) + 1][3]; -+ int num; -+ int curtag; -+ int prevtag; -+ int by; /* bar geometry */ -+ int mx, my, mw, mh; /* screen size */ -+ int wx, wy, ww, wh; /* window area */ -+ unsigned int msplit; -+ unsigned int msplits[LENGTH(tags) + 1]; -+ unsigned int seltags; -+ unsigned int sellt; -+ unsigned int tagset[2]; -+ int showbar; -+ int showbars[LENGTH(tags) + 1]; -+ int topbar; -+ Client *clients; -+ Client *sel; -+ Client *stack; -+ Monitor *next; -+ Window barwin; -+ const Layout *lt[2]; -+ const Layout *lts[LENGTH(tags) + 1]; -+}; -+ -+/* function declarations */ -+static void mirrorlayout(const Arg *arg); -+static void rotatelayoutaxis(const Arg *arg); -+static void shiftmastersplit(const Arg *arg); -+ -+void -+mirrorlayout(const Arg *arg) -+{ -+ if(!selmon->lt[selmon->sellt]->arrange) -+ return; -+ selmon->ltaxis[0] *= -1; -+ selmon->ltaxes[selmon->curtag][0] = selmon->ltaxis[0]; -+ arrange(selmon); -+} -+ -+void -+rotatelayoutaxis(const Arg *arg) -+{ -+ if(!selmon->lt[selmon->sellt]->arrange) -+ return; -+ if(arg->i == 0) { -+ if(selmon->ltaxis[0] > 0) -+ selmon->ltaxis[0] = selmon->ltaxis[0] + 1 > 2 ? 1 : selmon->ltaxis[0] + 1; -+ else -+ selmon->ltaxis[0] = selmon->ltaxis[0] - 1 < -2 ? -1 : selmon->ltaxis[0] - 1; -+ } else -+ selmon->ltaxis[arg->i] = selmon->ltaxis[arg->i] + 1 > 3 ? 1 : selmon->ltaxis[arg->i] + 1; -+ selmon->ltaxes[selmon->curtag][arg->i] = selmon->ltaxis[arg->i]; -+ arrange(selmon); -+} -+ -+void -+shiftmastersplit(const Arg *arg) -+{ -+ unsigned int n; -+ Client *c; -+ -+ for(n = 0, c = nexttiled(selmon->clients); c; c = nexttiled(c->next), n++); -+ if(!arg || !selmon->lt[selmon->sellt]->arrange || selmon->msplit + arg->i < 1 || selmon->msplit + arg->i > n) -+ return; -+ selmon->msplit += arg->i; -+ selmon->msplits[selmon->curtag] = selmon->msplit; -+ arrange(selmon); -+} -+ -+void -+tile(Monitor *m) -+{ -+ char sym1 = 61, sym2 = 93, sym3 = 61, sym; -+ int x1 = m->wx, y1 = m->wy, h1 = m->wh, w1 = m->ww, X1 = x1 + w1, Y1 = y1 + h1; -+ int x2 = m->wx, y2 = m->wy, h2 = m->wh, w2 = m->ww, X2 = x2 + w2, Y2 = y2 + h2; -+ unsigned int i, n, n1, n2; -+ Client *c; -+ -+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); -+ if(m->msplit > n) -+ m->msplit = (n == 0) ? 1 : n; -+ /* layout symbol */ -+ if(abs(m->ltaxis[0]) == m->ltaxis[1]) /* explicitly: ((abs(m->ltaxis[0]) == 1 && m->ltaxis[1] == 1) || (abs(m->ltaxis[0]) == 2 && m->ltaxis[1] == 2)) */ -+ sym1 = 124; -+ if(abs(m->ltaxis[0]) == m->ltaxis[2]) -+ sym3 = 124; -+ if(m->ltaxis[1] == 3) -+ sym1 = (n == 0) ? 0 : m->msplit; -+ if(m->ltaxis[2] == 3) -+ sym3 = (n == 0) ? 0 : n - m->msplit; -+ if(m->ltaxis[0] < 0) { -+ sym = sym1; -+ sym1 = sym3; -+ sym2 = 91; -+ sym3 = sym; -+ } -+ if(m->msplit == 1) { -+ if(m->ltaxis[0] > 0) -+ sym1 = 91; -+ else -+ sym3 = 93; -+ } -+ if(m->msplit > 1 && m->ltaxis[1] == 3 && m->ltaxis[2] == 3) -+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "%d%c%d", sym1, sym2, sym3); -+ else if((m->msplit > 1 && m->ltaxis[1] == 3 && m->ltaxis[0] > 0) || (m->ltaxis[2] == 3 && m->ltaxis[0] < 0)) -+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "%d%c%c", sym1, sym2, sym3); -+ else if((m->ltaxis[2] == 3 && m->ltaxis[0] > 0) || (m->msplit > 1 && m->ltaxis[1] == 3 && m->ltaxis[0] < 0)) -+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "%c%c%d", sym1, sym2, sym3); -+ else -+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "%c%c%c", sym1, sym2, sym3); -+ if(n == 0) -+ return; -+ /* master and stack area */ -+ if(abs(m->ltaxis[0]) == 1 && n > m->msplit) { -+ w1 *= m->mfact; -+ w2 -= w1; -+ x1 += (m->ltaxis[0] < 0) ? w2 : 0; -+ x2 += (m->ltaxis[0] < 0) ? 0 : w1; -+ X1 = x1 + w1; -+ X2 = x2 + w2; -+ } else if(abs(m->ltaxis[0]) == 2 && n > m->msplit) { -+ h1 *= m->mfact; -+ h2 -= h1; -+ y1 += (m->ltaxis[0] < 0) ? h2 : 0; -+ y2 += (m->ltaxis[0] < 0) ? 0 : h1; -+ Y1 = y1 + h1; -+ Y2 = y2 + h2; -+ } -+ /* master */ -+ n1 = (m->ltaxis[1] != 1 || w1 / m->msplit < bh) ? 1 : m->msplit; -+ n2 = (m->ltaxis[1] != 2 || h1 / m->msplit < bh) ? 1 : m->msplit; -+ for(i = 0, c = nexttiled(m->clients); i < m->msplit; c = nexttiled(c->next), i++) { -+ resize(c, x1, y1, -+ (m->ltaxis[1] == 1 && i + 1 == m->msplit) ? X1 - x1 - 2 * c->bw : w1 / n1 - 2 * c->bw, -+ (m->ltaxis[1] == 2 && i + 1 == m->msplit) ? Y1 - y1 - 2 * c->bw : h1 / n2 - 2 * c->bw, False); -+ if(n1 > 1) -+ x1 = c->x + WIDTH(c); -+ if(n2 > 1) -+ y1 = c->y + HEIGHT(c); -+ } -+ /* stack */ -+ if(n > m->msplit) { -+ n1 = (m->ltaxis[2] != 1 || w2 / (n - m->msplit) < bh) ? 1 : n - m->msplit; -+ n2 = (m->ltaxis[2] != 2 || h2 / (n - m->msplit) < bh) ? 1 : n - m->msplit; -+ for(i = 0; c; c = nexttiled(c->next), i++) { -+ resize(c, x2, y2, -+ (m->ltaxis[2] == 1 && i + 1 == n - m->msplit) ? X2 - x2 - 2 * c->bw : w2 / n1 - 2 * c->bw, -+ (m->ltaxis[2] == 2 && i + 1 == n - m->msplit) ? Y2 - y2 - 2 * c->bw : h2 / n2 - 2 * c->bw, False); -+ if(n1 > 1) -+ x2 = c->x + WIDTH(c); -+ if(n2 > 1) -+ y2 = c->y + HEIGHT(c); -+ } -+ } -+} --- -2.25.1 - diff --git a/nixos/dwm/patches/dwm-systray-6.4.diff b/nixos/dwm/patches/dwm-systray-6.4.diff deleted file mode 100644 index 58e4a69..0000000 --- a/nixos/dwm/patches/dwm-systray-6.4.diff +++ /dev/null @@ -1,746 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 9efa774..750529d 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -3,6 +3,11 @@ - /* appearance */ - static const unsigned int borderpx = 1; /* border pixel of windows */ - static const unsigned int snap = 32; /* snap pixel */ -+static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ -+static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */ -+static const unsigned int systrayspacing = 2; /* systray spacing */ -+static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ -+static const int showsystray = 1; /* 0 means no systray */ - static const int showbar = 1; /* 0 means no bar */ - static const int topbar = 1; /* 0 means bottom bar */ - static const char *fonts[] = { "monospace:size=10" }; -@@ -101,8 +106,8 @@ static const Key keys[] = { - /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ - static const Button buttons[] = { - /* click event mask button function argument */ -- { ClkLtSymbol, 0, Button1, setlayout, {0} }, -- { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, -+ { ClkTagBar, MODKEY, Button1, tag, {0} }, -+ { ClkTagBar, MODKEY, Button3, toggletag, {0} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, -diff --git a/dwm.c b/dwm.c -index 03baf42..4611a03 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -57,12 +57,27 @@ - #define TAGMASK ((1 << LENGTH(tags)) - 1) - #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) - -+#define SYSTEM_TRAY_REQUEST_DOCK 0 -+/* XEMBED messages */ -+#define XEMBED_EMBEDDED_NOTIFY 0 -+#define XEMBED_WINDOW_ACTIVATE 1 -+#define XEMBED_FOCUS_IN 4 -+#define XEMBED_MODALITY_ON 10 -+#define XEMBED_MAPPED (1 << 0) -+#define XEMBED_WINDOW_ACTIVATE 1 -+#define XEMBED_WINDOW_DEACTIVATE 2 -+#define VERSION_MAJOR 0 -+#define VERSION_MINOR 0 -+#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR -+ - /* enums */ - enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ - enum { SchemeNorm, SchemeSel }; /* color schemes */ - enum { NetSupported, NetWMName, NetWMState, NetWMCheck, -+ NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz, - NetWMFullscreen, NetActiveWindow, NetWMWindowType, - NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ -+enum { Manager, Xembed, XembedInfo, XLast }; /* Xembed atoms */ - enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ - enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, - ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ -@@ -141,6 +156,12 @@ typedef struct { - int monitor; - } Rule; - -+typedef struct Systray Systray; -+struct Systray { -+ Window win; -+ Client *icons; -+}; -+ - /* function declarations */ - static void applyrules(Client *c); - static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact); -@@ -172,6 +193,7 @@ static void focusstack(const Arg *arg); - static Atom getatomprop(Client *c, Atom prop); - static int getrootptr(int *x, int *y); - static long getstate(Window w); -+static unsigned int getsystraywidth(); - static int gettextprop(Window w, Atom atom, char *text, unsigned int size); - static void grabbuttons(Client *c, int focused); - static void grabkeys(void); -@@ -189,13 +211,16 @@ static void pop(Client *c); - static void propertynotify(XEvent *e); - static void quit(const Arg *arg); - static Monitor *recttomon(int x, int y, int w, int h); -+static void removesystrayicon(Client *i); - static void resize(Client *c, int x, int y, int w, int h, int interact); -+static void resizebarwin(Monitor *m); - static void resizeclient(Client *c, int x, int y, int w, int h); - static void resizemouse(const Arg *arg); -+static void resizerequest(XEvent *e); - static void restack(Monitor *m); - static void run(void); - static void scan(void); --static int sendevent(Client *c, Atom proto); -+static int sendevent(Window w, Atom proto, int m, long d0, long d1, long d2, long d3, long d4); - static void sendmon(Client *c, Monitor *m); - static void setclientstate(Client *c, long state); - static void setfocus(Client *c); -@@ -207,6 +232,7 @@ static void seturgent(Client *c, int urg); - static void showhide(Client *c); - static void sigchld(int unused); - static void spawn(const Arg *arg); -+static Monitor *systraytomon(Monitor *m); - static void tag(const Arg *arg); - static void tagmon(const Arg *arg); - static void tile(Monitor *m); -@@ -224,18 +250,23 @@ static int updategeom(void); - static void updatenumlockmask(void); - static void updatesizehints(Client *c); - static void updatestatus(void); -+static void updatesystray(void); -+static void updatesystrayicongeom(Client *i, int w, int h); -+static void updatesystrayiconstate(Client *i, XPropertyEvent *ev); - static void updatetitle(Client *c); - static void updatewindowtype(Client *c); - static void updatewmhints(Client *c); - static void view(const Arg *arg); - static Client *wintoclient(Window w); - static Monitor *wintomon(Window w); -+static Client *wintosystrayicon(Window w); - static int xerror(Display *dpy, XErrorEvent *ee); - static int xerrordummy(Display *dpy, XErrorEvent *ee); - static int xerrorstart(Display *dpy, XErrorEvent *ee); - static void zoom(const Arg *arg); - - /* variables */ -+static Systray *systray = NULL; - static const char broken[] = "broken"; - static char stext[256]; - static int screen; -@@ -258,9 +289,10 @@ static void (*handler[LASTEvent]) (XEvent *) = { - [MapRequest] = maprequest, - [MotionNotify] = motionnotify, - [PropertyNotify] = propertynotify, -+ [ResizeRequest] = resizerequest, - [UnmapNotify] = unmapnotify - }; --static Atom wmatom[WMLast], netatom[NetLast]; -+static Atom wmatom[WMLast], netatom[NetLast], xatom[XLast]; - static int running = 1; - static Cur *cursor[CurLast]; - static Clr **scheme; -@@ -442,7 +474,7 @@ buttonpress(XEvent *e) - arg.ui = 1 << i; - } else if (ev->x < x + TEXTW(selmon->ltsymbol)) - click = ClkLtSymbol; -- else if (ev->x > selmon->ww - (int)TEXTW(stext)) -+ else if (ev->x > selmon->ww - (int)TEXTW(stext) - getsystraywidth()) - click = ClkStatusText; - else - click = ClkWinTitle; -@@ -485,6 +517,13 @@ cleanup(void) - XUngrabKey(dpy, AnyKey, AnyModifier, root); - while (mons) - cleanupmon(mons); -+ -+ if (showsystray) { -+ XUnmapWindow(dpy, systray->win); -+ XDestroyWindow(dpy, systray->win); -+ free(systray); -+ } -+ - for (i = 0; i < CurLast; i++) - drw_cur_free(drw, cursor[i]); - for (i = 0; i < LENGTH(colors); i++) -@@ -516,9 +555,58 @@ cleanupmon(Monitor *mon) - void - clientmessage(XEvent *e) - { -+ XWindowAttributes wa; -+ XSetWindowAttributes swa; - XClientMessageEvent *cme = &e->xclient; - Client *c = wintoclient(cme->window); - -+ if (showsystray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) { -+ /* add systray icons */ -+ if (cme->data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) { -+ if (!(c = (Client *)calloc(1, sizeof(Client)))) -+ die("fatal: could not malloc() %u bytes\n", sizeof(Client)); -+ if (!(c->win = cme->data.l[2])) { -+ free(c); -+ return; -+ } -+ c->mon = selmon; -+ c->next = systray->icons; -+ systray->icons = c; -+ if (!XGetWindowAttributes(dpy, c->win, &wa)) { -+ /* use sane defaults */ -+ wa.width = bh; -+ wa.height = bh; -+ wa.border_width = 0; -+ } -+ c->x = c->oldx = c->y = c->oldy = 0; -+ c->w = c->oldw = wa.width; -+ c->h = c->oldh = wa.height; -+ c->oldbw = wa.border_width; -+ c->bw = 0; -+ c->isfloating = True; -+ /* reuse tags field as mapped status */ -+ c->tags = 1; -+ updatesizehints(c); -+ updatesystrayicongeom(c, wa.width, wa.height); -+ XAddToSaveSet(dpy, c->win); -+ XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask); -+ XReparentWindow(dpy, c->win, systray->win, 0, 0); -+ /* use parents background color */ -+ swa.background_pixel = scheme[SchemeNorm][ColBg].pixel; -+ XChangeWindowAttributes(dpy, c->win, CWBackPixel, &swa); -+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_EMBEDDED_NOTIFY, 0 , systray->win, XEMBED_EMBEDDED_VERSION); -+ /* FIXME not sure if I have to send these events, too */ -+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_FOCUS_IN, 0 , systray->win, XEMBED_EMBEDDED_VERSION); -+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0 , systray->win, XEMBED_EMBEDDED_VERSION); -+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_MODALITY_ON, 0 , systray->win, XEMBED_EMBEDDED_VERSION); -+ XSync(dpy, False); -+ resizebarwin(selmon); -+ updatesystray(); -+ setclientstate(c, NormalState); -+ } -+ return; -+ } -+ - if (!c) - return; - if (cme->message_type == netatom[NetWMState]) { -@@ -571,7 +659,7 @@ configurenotify(XEvent *e) - for (c = m->clients; c; c = c->next) - if (c->isfullscreen) - resizeclient(c, m->mx, m->my, m->mw, m->mh); -- XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); -+ resizebarwin(m); - } - focus(NULL); - arrange(NULL); -@@ -656,6 +744,11 @@ destroynotify(XEvent *e) - - if ((c = wintoclient(ev->window))) - unmanage(c, 1); -+ else if ((c = wintosystrayicon(ev->window))) { -+ removesystrayicon(c); -+ resizebarwin(selmon); -+ updatesystray(); -+ } - } - - void -@@ -699,7 +792,7 @@ dirtomon(int dir) - void - drawbar(Monitor *m) - { -- int x, w, tw = 0; -+ int x, w, tw = 0, stw = 0; - int boxs = drw->fonts->h / 9; - int boxw = drw->fonts->h / 6 + 2; - unsigned int i, occ = 0, urg = 0; -@@ -708,13 +801,17 @@ drawbar(Monitor *m) - if (!m->showbar) - return; - -+ if(showsystray && m == systraytomon(m) && !systrayonleft) -+ stw = getsystraywidth(); -+ - /* draw status first so it can be overdrawn by tags later */ - if (m == selmon) { /* status is only drawn on selected monitor */ - drw_setscheme(drw, scheme[SchemeNorm]); -- tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ -- drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0); -+ tw = TEXTW(stext) - lrpad / 2 + 2; /* 2px extra right padding */ -+ drw_text(drw, m->ww - tw - stw, 0, tw, bh, lrpad / 2 - 2, stext, 0); - } - -+ resizebarwin(m); - for (c = m->clients; c; c = c->next) { - occ |= c->tags; - if (c->isurgent) -@@ -735,7 +832,7 @@ drawbar(Monitor *m) - drw_setscheme(drw, scheme[SchemeNorm]); - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); - -- if ((w = m->ww - tw - x) > bh) { -+ if ((w = m->ww - tw - stw - x) > bh) { - if (m->sel) { - drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); -@@ -746,7 +843,7 @@ drawbar(Monitor *m) - drw_rect(drw, x, 0, w, bh, 1, 1); - } - } -- drw_map(drw, m->barwin, 0, 0, m->ww, bh); -+ drw_map(drw, m->barwin, 0, 0, m->ww - stw, bh); - } - - void -@@ -783,8 +880,11 @@ expose(XEvent *e) - Monitor *m; - XExposeEvent *ev = &e->xexpose; - -- if (ev->count == 0 && (m = wintomon(ev->window))) -+ if (ev->count == 0 && (m = wintomon(ev->window))) { - drawbar(m); -+ if (m == selmon) -+ updatesystray(); -+ } - } - - void -@@ -870,14 +970,32 @@ getatomprop(Client *c, Atom prop) - unsigned char *p = NULL; - Atom da, atom = None; - -- if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM, -+ /* FIXME getatomprop should return the number of items and a pointer to -+ * the stored data instead of this workaround */ -+ Atom req = XA_ATOM; -+ if (prop == xatom[XembedInfo]) -+ req = xatom[XembedInfo]; -+ -+ if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, req, - &da, &di, &dl, &dl, &p) == Success && p) { - atom = *(Atom *)p; -+ if (da == xatom[XembedInfo] && dl == 2) -+ atom = ((Atom *)p)[1]; - XFree(p); - } - return atom; - } - -+unsigned int -+getsystraywidth() -+{ -+ unsigned int w = 0; -+ Client *i; -+ if(showsystray) -+ for(i = systray->icons; i; w += i->w + systrayspacing, i = i->next) ; -+ return w ? w + systrayspacing : 1; -+} -+ - int - getrootptr(int *x, int *y) - { -@@ -1018,7 +1136,8 @@ killclient(const Arg *arg) - { - if (!selmon->sel) - return; -- if (!sendevent(selmon->sel, wmatom[WMDelete])) { -+ -+ if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0 , 0, 0)) { - XGrabServer(dpy); - XSetErrorHandler(xerrordummy); - XSetCloseDownMode(dpy, DestroyAll); -@@ -1105,6 +1224,13 @@ maprequest(XEvent *e) - static XWindowAttributes wa; - XMapRequestEvent *ev = &e->xmaprequest; - -+ Client *i; -+ if ((i = wintosystrayicon(ev->window))) { -+ sendevent(i->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0, systray->win, XEMBED_EMBEDDED_VERSION); -+ resizebarwin(selmon); -+ updatesystray(); -+ } -+ - if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect) - return; - if (!wintoclient(ev->window)) -@@ -1226,6 +1352,17 @@ propertynotify(XEvent *e) - Window trans; - XPropertyEvent *ev = &e->xproperty; - -+ if ((c = wintosystrayicon(ev->window))) { -+ if (ev->atom == XA_WM_NORMAL_HINTS) { -+ updatesizehints(c); -+ updatesystrayicongeom(c, c->w, c->h); -+ } -+ else -+ updatesystrayiconstate(c, ev); -+ resizebarwin(selmon); -+ updatesystray(); -+ } -+ - if ((ev->window == root) && (ev->atom == XA_WM_NAME)) - updatestatus(); - else if (ev->state == PropertyDelete) -@@ -1276,6 +1413,19 @@ recttomon(int x, int y, int w, int h) - return r; - } - -+void -+removesystrayicon(Client *i) -+{ -+ Client **ii; -+ -+ if (!showsystray || !i) -+ return; -+ for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next); -+ if (ii) -+ *ii = i->next; -+ free(i); -+} -+ - void - resize(Client *c, int x, int y, int w, int h, int interact) - { -@@ -1283,6 +1433,14 @@ resize(Client *c, int x, int y, int w, int h, int interact) - resizeclient(c, x, y, w, h); - } - -+void -+resizebarwin(Monitor *m) { -+ unsigned int w = m->ww; -+ if (showsystray && m == systraytomon(m) && !systrayonleft) -+ w -= getsystraywidth(); -+ XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, w, bh); -+} -+ - void - resizeclient(Client *c, int x, int y, int w, int h) - { -@@ -1298,6 +1456,19 @@ resizeclient(Client *c, int x, int y, int w, int h) - XSync(dpy, False); - } - -+void -+resizerequest(XEvent *e) -+{ -+ XResizeRequestEvent *ev = &e->xresizerequest; -+ Client *i; -+ -+ if ((i = wintosystrayicon(ev->window))) { -+ updatesystrayicongeom(i, ev->width, ev->height); -+ resizebarwin(selmon); -+ updatesystray(); -+ } -+} -+ - void - resizemouse(const Arg *arg) - { -@@ -1444,26 +1615,37 @@ setclientstate(Client *c, long state) - } - - int --sendevent(Client *c, Atom proto) -+sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, long d4) - { - int n; -- Atom *protocols; -+ Atom *protocols, mt; - int exists = 0; - XEvent ev; - -- if (XGetWMProtocols(dpy, c->win, &protocols, &n)) { -- while (!exists && n--) -- exists = protocols[n] == proto; -- XFree(protocols); -+ if (proto == wmatom[WMTakeFocus] || proto == wmatom[WMDelete]) { -+ mt = wmatom[WMProtocols]; -+ if (XGetWMProtocols(dpy, w, &protocols, &n)) { -+ while (!exists && n--) -+ exists = protocols[n] == proto; -+ XFree(protocols); -+ } -+ } -+ else { -+ exists = True; -+ mt = proto; - } -+ - if (exists) { - ev.type = ClientMessage; -- ev.xclient.window = c->win; -- ev.xclient.message_type = wmatom[WMProtocols]; -+ ev.xclient.window = w; -+ ev.xclient.message_type = mt; - ev.xclient.format = 32; -- ev.xclient.data.l[0] = proto; -- ev.xclient.data.l[1] = CurrentTime; -- XSendEvent(dpy, c->win, False, NoEventMask, &ev); -+ ev.xclient.data.l[0] = d0; -+ ev.xclient.data.l[1] = d1; -+ ev.xclient.data.l[2] = d2; -+ ev.xclient.data.l[3] = d3; -+ ev.xclient.data.l[4] = d4; -+ XSendEvent(dpy, w, False, mask, &ev); - } - return exists; - } -@@ -1477,7 +1659,7 @@ setfocus(Client *c) - XA_WINDOW, 32, PropModeReplace, - (unsigned char *) &(c->win), 1); - } -- sendevent(c, wmatom[WMTakeFocus]); -+ sendevent(c->win, wmatom[WMTakeFocus], NoEventMask, wmatom[WMTakeFocus], CurrentTime, 0, 0, 0); - } - - void -@@ -1566,6 +1748,10 @@ setup(void) - wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); - netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); - netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); -+ netatom[NetSystemTray] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_S0", False); -+ netatom[NetSystemTrayOP] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False); -+ netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False); -+ netatom[NetSystemTrayOrientationHorz] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION_HORZ", False); - netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); - netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); - netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); -@@ -1573,6 +1759,9 @@ setup(void) - netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); - netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); - netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); -+ xatom[Manager] = XInternAtom(dpy, "MANAGER", False); -+ xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False); -+ xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False); - /* init cursors */ - cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); - cursor[CurResize] = drw_cur_create(drw, XC_sizing); -@@ -1581,6 +1770,8 @@ setup(void) - scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); - for (i = 0; i < LENGTH(colors); i++) - scheme[i] = drw_scm_create(drw, colors[i], 3); -+ /* init system tray */ -+ updatesystray(); - /* init bars */ - updatebars(); - updatestatus(); -@@ -1711,7 +1902,18 @@ togglebar(const Arg *arg) - { - selmon->showbar = !selmon->showbar; - updatebarpos(selmon); -- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); -+ resizebarwin(selmon); -+ if (showsystray) { -+ XWindowChanges wc; -+ if (!selmon->showbar) -+ wc.y = -bh; -+ else if (selmon->showbar) { -+ wc.y = 0; -+ if (!selmon->topbar) -+ wc.y = selmon->mh - bh; -+ } -+ XConfigureWindow(dpy, systray->win, CWY, &wc); -+ } - arrange(selmon); - } - -@@ -1807,11 +2009,18 @@ unmapnotify(XEvent *e) - else - unmanage(c, 0); - } -+ else if ((c = wintosystrayicon(ev->window))) { -+ /* KLUDGE! sometimes icons occasionally unmap their windows, but do -+ * _not_ destroy them. We map those windows back */ -+ XMapRaised(dpy, c->win); -+ updatesystray(); -+ } - } - - void - updatebars(void) - { -+ unsigned int w; - Monitor *m; - XSetWindowAttributes wa = { - .override_redirect = True, -@@ -1822,10 +2031,15 @@ updatebars(void) - for (m = mons; m; m = m->next) { - if (m->barwin) - continue; -- m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), -+ w = m->ww; -+ if (showsystray && m == systraytomon(m)) -+ w -= getsystraywidth(); -+ m->barwin = XCreateWindow(dpy, root, m->wx, m->by, w, bh, 0, DefaultDepth(dpy, screen), - CopyFromParent, DefaultVisual(dpy, screen), - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); - XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); -+ if (showsystray && m == systraytomon(m)) -+ XMapRaised(dpy, systray->win); - XMapRaised(dpy, m->barwin); - XSetClassHint(dpy, m->barwin, &ch); - } -@@ -2002,6 +2216,125 @@ updatestatus(void) - if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) - strcpy(stext, "dwm-"VERSION); - drawbar(selmon); -+ updatesystray(); -+} -+ -+ -+void -+updatesystrayicongeom(Client *i, int w, int h) -+{ -+ if (i) { -+ i->h = bh; -+ if (w == h) -+ i->w = bh; -+ else if (h == bh) -+ i->w = w; -+ else -+ i->w = (int) ((float)bh * ((float)w / (float)h)); -+ applysizehints(i, &(i->x), &(i->y), &(i->w), &(i->h), False); -+ /* force icons into the systray dimensions if they don't want to */ -+ if (i->h > bh) { -+ if (i->w == i->h) -+ i->w = bh; -+ else -+ i->w = (int) ((float)bh * ((float)i->w / (float)i->h)); -+ i->h = bh; -+ } -+ } -+} -+ -+void -+updatesystrayiconstate(Client *i, XPropertyEvent *ev) -+{ -+ long flags; -+ int code = 0; -+ -+ if (!showsystray || !i || ev->atom != xatom[XembedInfo] || -+ !(flags = getatomprop(i, xatom[XembedInfo]))) -+ return; -+ -+ if (flags & XEMBED_MAPPED && !i->tags) { -+ i->tags = 1; -+ code = XEMBED_WINDOW_ACTIVATE; -+ XMapRaised(dpy, i->win); -+ setclientstate(i, NormalState); -+ } -+ else if (!(flags & XEMBED_MAPPED) && i->tags) { -+ i->tags = 0; -+ code = XEMBED_WINDOW_DEACTIVATE; -+ XUnmapWindow(dpy, i->win); -+ setclientstate(i, WithdrawnState); -+ } -+ else -+ return; -+ sendevent(i->win, xatom[Xembed], StructureNotifyMask, CurrentTime, code, 0, -+ systray->win, XEMBED_EMBEDDED_VERSION); -+} -+ -+void -+updatesystray(void) -+{ -+ XSetWindowAttributes wa; -+ XWindowChanges wc; -+ Client *i; -+ Monitor *m = systraytomon(NULL); -+ unsigned int x = m->mx + m->mw; -+ unsigned int sw = TEXTW(stext) - lrpad + systrayspacing; -+ unsigned int w = 1; -+ -+ if (!showsystray) -+ return; -+ if (systrayonleft) -+ x -= sw + lrpad / 2; -+ if (!systray) { -+ /* init systray */ -+ if (!(systray = (Systray *)calloc(1, sizeof(Systray)))) -+ die("fatal: could not malloc() %u bytes\n", sizeof(Systray)); -+ systray->win = XCreateSimpleWindow(dpy, root, x, m->by, w, bh, 0, 0, scheme[SchemeSel][ColBg].pixel); -+ wa.event_mask = ButtonPressMask | ExposureMask; -+ wa.override_redirect = True; -+ wa.background_pixel = scheme[SchemeNorm][ColBg].pixel; -+ XSelectInput(dpy, systray->win, SubstructureNotifyMask); -+ XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32, -+ PropModeReplace, (unsigned char *)&netatom[NetSystemTrayOrientationHorz], 1); -+ XChangeWindowAttributes(dpy, systray->win, CWEventMask|CWOverrideRedirect|CWBackPixel, &wa); -+ XMapRaised(dpy, systray->win); -+ XSetSelectionOwner(dpy, netatom[NetSystemTray], systray->win, CurrentTime); -+ if (XGetSelectionOwner(dpy, netatom[NetSystemTray]) == systray->win) { -+ sendevent(root, xatom[Manager], StructureNotifyMask, CurrentTime, netatom[NetSystemTray], systray->win, 0, 0); -+ XSync(dpy, False); -+ } -+ else { -+ fprintf(stderr, "dwm: unable to obtain system tray.\n"); -+ free(systray); -+ systray = NULL; -+ return; -+ } -+ } -+ for (w = 0, i = systray->icons; i; i = i->next) { -+ /* make sure the background color stays the same */ -+ wa.background_pixel = scheme[SchemeNorm][ColBg].pixel; -+ XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa); -+ XMapRaised(dpy, i->win); -+ w += systrayspacing; -+ i->x = w; -+ XMoveResizeWindow(dpy, i->win, i->x, 0, i->w, i->h); -+ w += i->w; -+ if (i->mon != m) -+ i->mon = m; -+ } -+ w = w ? w + systrayspacing : 1; -+ x -= w; -+ XMoveResizeWindow(dpy, systray->win, x, m->by, w, bh); -+ wc.x = x; wc.y = m->by; wc.width = w; wc.height = bh; -+ wc.stack_mode = Above; wc.sibling = m->barwin; -+ XConfigureWindow(dpy, systray->win, CWX|CWY|CWWidth|CWHeight|CWSibling|CWStackMode, &wc); -+ XMapWindow(dpy, systray->win); -+ XMapSubwindows(dpy, systray->win); -+ /* redraw background */ -+ XSetForeground(dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel); -+ XFillRectangle(dpy, systray->win, drw->gc, 0, 0, w, bh); -+ XSync(dpy, False); - } - - void -@@ -2069,6 +2402,16 @@ wintoclient(Window w) - return NULL; - } - -+Client * -+wintosystrayicon(Window w) { -+ Client *i = NULL; -+ -+ if (!showsystray || !w) -+ return i; -+ for (i = systray->icons; i && i->win != w; i = i->next) ; -+ return i; -+} -+ - Monitor * - wintomon(Window w) - { -@@ -2122,6 +2465,22 @@ xerrorstart(Display *dpy, XErrorEvent *ee) - return -1; - } - -+Monitor * -+systraytomon(Monitor *m) { -+ Monitor *t; -+ int i, n; -+ if(!systraypinning) { -+ if(!m) -+ return selmon; -+ return m == selmon ? m : NULL; -+ } -+ for(n = 1, t = mons; t && t->next; n++, t = t->next) ; -+ for(i = 1, t = mons; t && t->next && i < systraypinning; i++, t = t->next) ; -+ if(systraypinningfailfirst && n < systraypinning) -+ return mons; -+ return t; -+} -+ - void - zoom(const Arg *arg) - { diff --git a/nixos/fonts.nix b/nixos/fonts.nix index 4de6abf..64d065b 100644 --- a/nixos/fonts.nix +++ b/nixos/fonts.nix @@ -1,27 +1,29 @@ -{ pkgs, ... }: { - fonts.packages = with pkgs; - [ - helvetica-neue-lt-std - aileron - corefonts - vistafonts - vistafonts-chs - noto-fonts - noto-fonts-cjk-sans - noto-fonts-emoji - liberation_ttf - mplus-outline-fonts.githubRelease - dina-font - - #proggyfonts - #glasstty-ttf - ] - ++ (with nerd-fonts; [ - ubuntu-mono - jetbrains-mono - intone-mono - fira-code - commit-mono - blex-mono - ]); +{pkgs, ...}: { + fonts.packages = with pkgs; [ + helvetica-neue-lt-std + aileron + corefonts + vistafonts + vistafonts-chs + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + liberation_ttf + mplus-outline-fonts.githubRelease + dina-font + #proggyfonts + #glasstty-ttf + ( + nerdfonts.override { + fonts = [ + "FiraCode" + "IBMPlexMono" + "IntelOneMono" + "CascadiaMono" + "CommitMono" + "JetBrainsMono" + ]; + } + ) + ]; } diff --git a/nixos/greetd.nix b/nixos/greetd.nix index 7222c85..212cde7 100644 --- a/nixos/greetd.nix +++ b/nixos/greetd.nix @@ -1,15 +1,16 @@ -{ pkgs -, ... -}: -let - tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet"; -in { + pkgs, + config, + lib, + ... +}: let + tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet"; +in { services.greetd = { enable = true; settings = { default_session = { - command = "${tuigreet} --time --remember"; + command = "${tuigreet} --time --remember --cmd Hyprland"; user = "greeter"; }; }; diff --git a/nixos/grub.nix b/nixos/grub.nix new file mode 100644 index 0000000..5af6773 --- /dev/null +++ b/nixos/grub.nix @@ -0,0 +1,64 @@ +{ + config, + pkgs, + ... +}: let + distro-grub-themes = pkgs.stdenv.mkDerivation { + pname = "distro-grub-themes"; + version = "3.1"; + src = pkgs.fetchFromGitHub { + owner = "AdisonCavani"; + repo = "distro-grub-themes"; + rev = "v3.1"; + hash = "sha256-ZcoGbbOMDDwjLhsvs77C7G7vINQnprdfI37a9ccrmPs="; + }; + installPhase = "cp -r customize/nixos $out"; + }; + xenlism-grub-themes = pkgs.stdenv.mkDerivation { + pname = "xenlism-grub-themes"; + version = "1.0"; + src = pkgs.fetchFromGitHub { + owner = "xenlism"; + repo = "Grub-themes"; + rev = "40ac048df9aacfc053c515b97fcd24af1a06762f"; + hash = "sha256-ProTKsFocIxWAFbYgQ46A+GVZ7mUHXxZrvdiPJqZJ6I="; + }; + installPhase = "cp -r xenlism-grub-1080p-nixos/Xenlism-Nixos $out"; + }; +in { + environment.systemPackages = with pkgs; [hack-font]; + boot.supportedFilesystems = ["ntfs"]; + #fileSystems."/mnt/winsys" = { + # device = "/dev/nvme0n1p5"; + # fsType = "ntfs-3g"; + # options = [ "rw" "uid=1000" ]; + #}; + #fileSystems."/mnt/windata" = { + # device = "/dev/nvme0n1p3"; + # fsType = "ntfs-3g"; + # options = [ "rw" "uid=1000" ]; + #}; + boot.loader = { + efi = { + canTouchEfiVariables = true; + }; + grub = { + enable = true; + efiSupport = true; + device = "nodev"; + fsIdentifier = "label"; + devices = ["nodev"]; + extraEntries = '' + menuentry "Reboot" { + reboot + } + menuentry "Poweroff" { + halt + } + ''; + useOSProber = true; + configurationLimit = 10; + theme = xenlism-grub-themes; + }; + }; +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index 2691edf..81b97e4 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -1,19 +1,21 @@ # 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 -, modulesPath -, ... +{ + config, + lib, + pkgs, + modulesPath, + ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; fileSystems."/" = { device = "/dev/disk/by-uuid/f9ff609f-6e72-43cf-917c-3bd3fde6c410"; @@ -23,9 +25,10 @@ fileSystems."/boot" = { device = "/dev/disk/by-uuid/2E4F-3060"; fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; + options = ["fmask=0022" "dmask=0022"]; }; - swapDevices = [ ]; + + swapDevices = []; # 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 @@ -36,6 +39,5 @@ # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.enableAllFirmware = true; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/nixos/nvidia.nix b/nixos/nvidia.nix index fa603e5..efc198f 100644 --- a/nixos/nvidia.nix +++ b/nixos/nvidia.nix @@ -1,41 +1,41 @@ -{ config -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: { - #specialisation = { - # powersave.configuration = { - # hardware.nvidia.prime = { - # offload = { - # enable = lib.mkForce true; - # enableOffloadCmd = lib.mkForce true; - # }; - # sync.enable = lib.mkForce false; - # }; - # }; - #}; - boot.kernelModules = [ "nvidia_uvm" ]; + specialisation = { + powersave.configuration = { + hardware.nvidia.prime = { + offload = { + enable = lib.mkForce true; + enableOffloadCmd = lib.mkForce true; + }; + sync.enable = lib.mkForce false; + }; + }; + }; + boot.kernelModules = ["nvidia_uvm"]; hardware.graphics = { enable = true; extraPackages = with pkgs; [ libvdpau-va-gl ]; }; - services.xserver.videoDrivers = [ "nvidia" ]; + services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { - dynamicBoost.enable = true; prime = { offload.enable = false; sync = { enable = true; }; - amdgpuBusId = "PCI:6:0:0"; + amdgpuBusId = "PCI:5:0:0"; nvidiaBusId = "PCI:1:0:0"; }; forceFullCompositionPipeline = true; - powerManagement.enable = true; modesetting.enable = true; - open = true; + # open = true; nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.latest; + package = config.boot.kernelPackages.nvidiaPackages.beta; }; } diff --git a/nixos/sddm-theme.nix b/nixos/sddm-theme.nix index b285337..463038d 100644 --- a/nixos/sddm-theme.nix +++ b/nixos/sddm-theme.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{pkgs, ...}: pkgs.stdenv.mkDerivation { name = "sddm-theme"; src = pkgs.fetchFromGitHub { diff --git a/nixos/services/avahi.service.nix b/nixos/services/avahi.service.nix index b0bd53f..54bf88c 100644 --- a/nixos/services/avahi.service.nix +++ b/nixos/services/avahi.service.nix @@ -1,7 +1,7 @@ -{ ... }: { +{...}: { services.avahi = { enable = true; - nssmdns4 = true; + nssmdns = true; openFirewall = true; }; } diff --git a/nixos/services/laptop.preset.nix b/nixos/services/laptop.preset.nix index 152442b..31d0137 100644 --- a/nixos/services/laptop.preset.nix +++ b/nixos/services/laptop.preset.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { imports = [ ./nginx.service.nix ./pipewire.service.nix @@ -6,10 +6,5 @@ ./misc.service.nix ./avahi.service.nix ./printing.service.nix - ./tailscale.service.nix - ./power_management.service.nix - #./seatd.service.nix - ./logind.service.nix - #./mpd.service.nix ]; } diff --git a/nixos/services/logind.service.nix b/nixos/services/logind.service.nix deleted file mode 100644 index 0c8225f..0000000 --- a/nixos/services/logind.service.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... -}: { - services.logind.extraConfig = '' - # don't shutdown in short press - HandlePowerKey=ignore - - # Milliseconds - IdleActionSec=600 - ''; -} diff --git a/nixos/services/misc.service.nix b/nixos/services/misc.service.nix index f204f44..72fcd2c 100644 --- a/nixos/services/misc.service.nix +++ b/nixos/services/misc.service.nix @@ -1,7 +1,7 @@ -{ ... }: { - #specialisation.powersave.configuration = { - # services.auto-cpufreq.enable = true; - #}; +{...}: { + specialisation.powersave.configuration = { + services.auto-cpufreq.enable = true; + }; services = { upower.enable = true; udisks2.enable = true; diff --git a/nixos/services/nginx.service.nix b/nixos/services/nginx.service.nix index a627b30..798f078 100644 --- a/nixos/services/nginx.service.nix +++ b/nixos/services/nginx.service.nix @@ -1,5 +1,4 @@ -{ ... -}: { +{pkgs, ...}: { services.nginx = { enable = true; virtualHosts."localhost" = { @@ -12,8 +11,11 @@ ''; }; }; - listenAddresses = [ "127.0.0.1" "[::1]" ]; + listenAddresses = [ + "127.0.0.1" + "[::1]" + ]; }; }; - networking.firewall.allowedTCPPorts = [ 80 ]; + networking.firewall.allowedTCPPorts = [80]; } diff --git a/nixos/services/pipewire.service.nix b/nixos/services/pipewire.service.nix index 0cf6a8a..3781405 100644 --- a/nixos/services/pipewire.service.nix +++ b/nixos/services/pipewire.service.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { services.pipewire = { enable = true; alsa = { @@ -9,28 +8,7 @@ pulse.enable = true; jack.enable = true; wireplumber.configPackages = [ - (pkgs.writeTextDir - "share/wireplumber/wireplumber.conf.d/52-profile-switch.conf" '' - wireplumber.settings = { - bluetooth.autoswitch-to-headset-profile = false - } - - monitor.bluez.properties = { - ## Supported roles: hsp_hs (HSP Headset), - ## hsp_ag (HSP Audio Gateway), - ## hfp_hf (HFP Hands-Free), - ## hfp_ag (HFP Audio Gateway) - ## a2dp_sink (A2DP Audio Sink) - ## a2dp_source (A2DP Audio Source) - ## bap_sink (LE Audio Basic Audio Profile Sink) - ## bap_source (LE Audio Basic Audio Profile Source) - ## -- - ## Only enable A2DP here and disable HFP. See note at the top as to why. - bluez5.roles = [ a2dp_sink a2dp_source ] - } - '') - (pkgs.writeTextDir - "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" '' + (pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" '' bluez_monitor.properties = { ["bluez5.enable-sbc-xq"] = true, ["bluez5.enable-msbc"] = true, @@ -39,6 +17,5 @@ } '') ]; - #extraConfig.pipewire."99-input-denoising" = pw_rnnoise_config; }; } diff --git a/nixos/services/power_management.service.nix b/nixos/services/power_management.service.nix deleted file mode 100644 index 3c2cec2..0000000 --- a/nixos/services/power_management.service.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ ... -}: { - /*services.tlp = { - enable = true; - settings = { - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; - CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; - - CPU_MIN_PERF_ON_AC = 0; - CPU_MAX_PERF_ON_AC = 100; - CPU_MIN_PERF_ON_BAT = 0; - CPU_MAX_PERF_ON_BAT = 20; - }; - };*/ -} diff --git a/nixos/services/printing.service.nix b/nixos/services/printing.service.nix index 88c01b2..a89c732 100644 --- a/nixos/services/printing.service.nix +++ b/nixos/services/printing.service.nix @@ -1,6 +1,6 @@ -{ ... }: { +{...}: { services.printing = { enable = true; - drivers = [ ]; + drivers = []; }; } diff --git a/nixos/services/seatd.service.nix b/nixos/services/seatd.service.nix deleted file mode 100644 index d738a79..0000000 --- a/nixos/services/seatd.service.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... -}: { - services.seatd = { - enable = true; - }; -} diff --git a/nixos/services/syncthing.service.nix b/nixos/services/syncthing.service.nix index e285e0e..47015e2 100644 --- a/nixos/services/syncthing.service.nix +++ b/nixos/services/syncthing.service.nix @@ -1,5 +1,8 @@ -{ config -, ... +{ + pkgs, + config, + lib, + ... }: { services = { syncthing = { @@ -9,6 +12,6 @@ configDir = "/home/${config.myUserName}/.config/syncthing"; }; }; - networking.firewall.allowedTCPPorts = [ 8384 22000 ]; - networking.firewall.allowedUDPPorts = [ 22000 21027 ]; + networking.firewall.allowedTCPPorts = [8384 22000]; + networking.firewall.allowedUDPPorts = [22000 21027]; } diff --git a/nixos/services/tailscale.service.nix b/nixos/services/tailscale.service.nix deleted file mode 100644 index 0b7e27a..0000000 --- a/nixos/services/tailscale.service.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... -}: { - services.tailscale = { - enable = true; - useRoutingFeatures = "client"; - }; -} diff --git a/nixos/spec.nix b/nixos/spec.nix deleted file mode 100644 index 2df9e6a..0000000 --- a/nixos/spec.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs, lib, ... }: { - specialisation = { - wayland = { - configuration = { - programs = { - hyprland = { - enable = true; # enables Hyprland DM. - #withUWSM = true; # NEW Universal Wayland Session Manager - }; - }; - }; - }; - xorg = { - configuration = lib.recursiveUpdate - { - services.xserver.displayManager.startx.enable = true; - } - (import ./dwm { - #inherit config; - inherit pkgs; - #inherit lib; - }); - }; - }; -} diff --git a/nixos/virtualisation.nix b/nixos/virtualisation.nix deleted file mode 100644 index 0fcadcf..0000000 --- a/nixos/virtualisation.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config -, pkgs -, ... -}: { - virtualisation = { - libvirtd.enable = true; - # waydroid.enable = true; - podman = { - enable = true; - dockerCompat = true; - }; - }; - environment.systemPackages = [ pkgs.distrobox pkgs.distrobox-tui ]; - programs.virt-manager.enable = true; - #virtualisation.vmware.host.enable = true; - #virtualisation.virtualbox.host = { - # enable = true; - #}; - users.users."${config.myUserName}".extraGroups = [ "libvirtd" ]; -}