Compare commits
No commits in common. "main" and "v1.0" have entirely different histories.
133 changed files with 1281 additions and 4449 deletions
2
.envrc
2
.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
|
28
README.md
28
README.md
|
@ -1,29 +1,19 @@
|
||||||
# My NixOS configuration
|
# My NixOS configuration
|
||||||
- system: `"x86_64-linux"`
|
|
||||||
- host os: `Linux 6.12.2-zen1, NixOS, 25.05 (Warbler), 25.05.20241229.88195a9`
|
- system: `"x86_64-linux"`
|
||||||
- multi-user?: `yes`
|
- host os: `Linux 6.6.44, NixOS, 24.11 (Vicuna), 24.11.20240804.cb9a96f`
|
||||||
- sandbox: `yes`
|
- multi-user?: `yes`
|
||||||
- version: `nix-env (Nix) 2.24.11`
|
- sandbox: `yes`
|
||||||
- channels(root): `"nixos"`
|
- version: `nix-env (Nix) 2.18.5`
|
||||||
- nixpkgs: `/nix/store/8vz84mqgnm1gz5yk7hgnnb5gir5hjxas-source`
|
- channels(root): `"nixos"`
|
||||||
|
- nixpkgs: `/nix/store/4cpakzyvfw1rmm9v5i3387x6jd2h1v86-source`
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
This configuration is dependent on flakes being enabled in the system building the config.
|
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
|
sudo nixos-rebuild --flake <path_to_this_config>#<your_hostname> switch
|
||||||
chmod +x ./deploy.sh
|
|
||||||
./deploy.sh https://github.com/stvnliu/nixos-configuration nixos-msi
|
|
||||||
```
|
|
||||||
|
|
||||||
or manually:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git clone <repo_url> <path_to_config>
|
|
||||||
sudo nixos-rebuild --flake <path_to_config>#<your_hostname> boot
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
|
@ -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
|
# Type definitions for nix variables used in this configuration
|
||||||
options = with lib;
|
options = with lib;
|
||||||
with types; {
|
with types; {
|
||||||
usingMusicPlayerDaemon = mkOption { type = bool; };
|
myUserName = mkOption {type = str;};
|
||||||
defaultApplications = {
|
myHostName = mkOption {type = str;};
|
||||||
fileManager = mkOption { type = str; };
|
myWallPaperPathString = mkOption {type = str;};
|
||||||
appLauncher = mkOption { type = str; };
|
myDisplayName = mkOption {type = str;};
|
||||||
terminal = mkOption { type = str; };
|
myEmail = mkOption {type = str;};
|
||||||
};
|
displayScale = mkOption {type = int;};
|
||||||
myWallPaperPath = mkOption { type = path; };
|
myAutostartCommands = mkOption {type = listOf str;};
|
||||||
myUserName = mkOption { type = str; };
|
myConfigLocation = 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; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Default values for this configuration
|
# Default values for this configuration
|
||||||
config = rec {
|
config = rec {
|
||||||
myUserName = "stvnliu";
|
myUserName = "stvnliu";
|
||||||
myWallPaperPath = ../home-manager/${myUserName}/assets/od_neon.png;
|
|
||||||
myHostName = "nixos-msi";
|
myHostName = "nixos-msi";
|
||||||
displayScale = 2;
|
displayScale = 1;
|
||||||
myWallPaperPathString = "/home/${myUserName}/wallpaper.png";
|
myWallPaperPathString = "/home/${myUserName}/wallpaper.jpg";
|
||||||
myDisplayName = "Zhongheng Liu";
|
myDisplayName = "Zhongheng Liu";
|
||||||
myEmail = "z.liu@outlook.com.gr";
|
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 = [
|
myAutostartCommands = [
|
||||||
"${pkgs.brightnessctl}/bin/brightnessctl s ${monitorMaxBrightness}"
|
|
||||||
"fcitx5"
|
"fcitx5"
|
||||||
# "${pkgs.foot}/bin/foot --server -f \"${desktopFontFullName}:size=12\" -o colors.alpha=0.85"
|
|
||||||
"${pkgs.udiskie}/bin/udiskie"
|
"${pkgs.udiskie}/bin/udiskie"
|
||||||
"${pkgs.pa-notify}/bin/pa-notify"
|
|
||||||
"${pkgs.networkmanagerapplet}/bin/nm-applet"
|
|
||||||
];
|
];
|
||||||
defaultApplications = {
|
myConfigLocation = "/home/${myUserName}/nix-conf";
|
||||||
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;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
18
deploy.sh
18
deploy.sh
|
@ -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
|
|
||||||
|
|
18
devenv.lock
18
devenv.lock
|
@ -3,10 +3,11 @@
|
||||||
"devenv": {
|
"devenv": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "src/modules",
|
"dir": "src/modules",
|
||||||
"lastModified": 1732298876,
|
"lastModified": 1723156315,
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "devenv",
|
"repo": "devenv",
|
||||||
"rev": "741e23a22f3dc9e53075be3eaa795ea9ed6f5129",
|
"rev": "ff5eb4f2accbcda963af67f1a1159e3f6c7f5f91",
|
||||||
|
"treeHash": "6624b16e4203ef3eae59ce8d5d19005e04741537",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -23,6 +24,7 @@
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -43,6 +45,7 @@
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "gitignore.nix",
|
"repo": "gitignore.nix",
|
||||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -57,6 +60,7 @@
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "devenv-nixpkgs",
|
"repo": "devenv-nixpkgs",
|
||||||
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
|
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
|
||||||
|
"treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -68,10 +72,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731797254,
|
"lastModified": 1722869614,
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59",
|
"rev": "883180e6550c1723395a3a342f830bfc5c371f6b",
|
||||||
|
"treeHash": "e3ce01703c0d0324121e0d3ec6336275025b4ae6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -91,10 +96,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732021966,
|
"lastModified": 1723056346,
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
|
"rev": "3c977f1c9930f54066c085305b4b2291385e7a73",
|
||||||
|
"treeHash": "d6f89338ffb2ca32c20bc0f8d50009e1894ab804",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
23
devenv.nix
23
devenv.nix
|
@ -1,18 +1,23 @@
|
||||||
{ pkgs, ... }: {
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
# https://devenv.sh/basics/
|
# https://devenv.sh/basics/
|
||||||
env.GREET = "devenv";
|
env.GREET = "devenv";
|
||||||
cachix.enable = false;
|
cachix.enable = false;
|
||||||
# https://devenv.sh/packages/
|
# https://devenv.sh/packages/
|
||||||
packages = [ pkgs.git ];
|
packages = [pkgs.git];
|
||||||
|
|
||||||
# https://devenv.sh/languages/
|
# https://devenv.sh/languages/
|
||||||
# languages.rust.enable = true;
|
# languages.rust.enable = true;
|
||||||
languages.nix.enable = true;
|
languages.nix.enable = true;
|
||||||
pre-commit.hooks = {
|
pre-commit.hooks = {
|
||||||
nixpkgs-fmt.enable = true;
|
alejandra.enable = true;
|
||||||
shellcheck.enable = true;
|
shellcheck.enable = true;
|
||||||
commitizen.enable = true;
|
commitizen.enable = true;
|
||||||
deadnix.enable = true;
|
|
||||||
};
|
};
|
||||||
# https://devenv.sh/processes/
|
# https://devenv.sh/processes/
|
||||||
# processes.cargo-watch.exec = "cargo-watch";
|
# processes.cargo-watch.exec = "cargo-watch";
|
||||||
|
@ -24,20 +29,18 @@
|
||||||
scripts.hello.exec = ''
|
scripts.hello.exec = ''
|
||||||
echo hello from $GREET
|
echo hello from $GREET
|
||||||
'';
|
'';
|
||||||
scripts.about.exec = ''
|
|
||||||
${pkgs.glow}/bin/glow -p ./README.md
|
|
||||||
less ./LICENSE
|
|
||||||
'';
|
|
||||||
|
|
||||||
enterShell = ''
|
enterShell = ''
|
||||||
hello
|
hello
|
||||||
git --version
|
git --version
|
||||||
nixpkgs-fmt --version
|
alejandra --version
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# https://devenv.sh/tests/
|
# https://devenv.sh/tests/
|
||||||
enterTest =
|
enterTest =
|
||||||
# shell
|
/*
|
||||||
|
shell
|
||||||
|
*/
|
||||||
''
|
''
|
||||||
echo "Running tests"
|
echo "Running tests"
|
||||||
git --version | grep --color=auto "${pkgs.git.version}"
|
git --version | grep --color=auto "${pkgs.git.version}"
|
||||||
|
|
750
flake.lock
generated
750
flake.lock
generated
File diff suppressed because it is too large
Load diff
90
flake.nix
90
flake.nix
|
@ -2,69 +2,59 @@
|
||||||
description = "Your new nix config";
|
description = "Your new nix config";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
hyprswitch.url = "github:h3rmt/hyprswitch/release";
|
|
||||||
# Nixpkgs
|
# Nixpkgs
|
||||||
nixpkgs-master.url = "github:nixos/nixpkgs/master";
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
|
|
||||||
nixvim = {
|
nixvim = {
|
||||||
url = "github:nix-community/nixvim";
|
url = "github:nix-community/nixvim";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
# Home manager
|
# Home manager
|
||||||
home-manager = {
|
home-manager.url = "github:nix-community/home-manager";
|
||||||
url = "github:nix-community/home-manager";
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
stylix.url = "github:danth/stylix";
|
||||||
/* 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"; };
|
|
||||||
spicetify-nix = {
|
spicetify-nix = {
|
||||||
url = "github:Gerg-L/spicetify-nix";
|
url = "github:Gerg-L/spicetify-nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
hyprland-qtutils.url = "github:hyprwm/hyprland-qtutils";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager, stylix, spicetify-nix, ... }@inputs:
|
outputs = {
|
||||||
let
|
self,
|
||||||
inherit (self) outputs;
|
nixpkgs,
|
||||||
myHostName = "nixos-msi";
|
home-manager,
|
||||||
stevenUserName = "stvnliu";
|
stylix,
|
||||||
in
|
spicetify-nix,
|
||||||
{
|
...
|
||||||
# NixOS configuration entrypoint
|
} @ inputs: let
|
||||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
inherit (self) outputs;
|
||||||
nixosConfigurations = {
|
myHostName = "nixos-msi";
|
||||||
"${myHostName}" = nixpkgs.lib.nixosSystem {
|
stevenUserName = "stvnliu";
|
||||||
specialArgs = { inherit inputs outputs; };
|
in {
|
||||||
modules = [
|
# NixOS configuration entrypoint
|
||||||
./nixos/configuration.nix
|
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||||
#lix-module.nixosModules.default
|
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
|
|
||||||
stylix.homeManagerModules.stylix
|
|
||||||
inputs.nixvim.homeManagerModules.nixvim
|
|
||||||
spicetify-nix.homeManagerModules.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
|
||||||
|
inputs.nixvim.homeManagerModules.nixvim
|
||||||
|
inputs.stylix.homeManagerModules.stylix
|
||||||
|
inputs.spicetify-nix.homeManagerModules.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { Workspaces } from "./hyprworkspaces.js";
|
const hyprland = await Service.import("hyprland")
|
||||||
import { NetworkIndicator } from "./indicators.js";
|
const network = await Service.import("network")
|
||||||
// const notifications = await Service.import("notifications")
|
// const notifications = await Service.import("notifications")
|
||||||
// const mpris = await Service.import("mpris")
|
const mpris = await Service.import("mpris")
|
||||||
const hyprland = await Service.import("hyprland");
|
|
||||||
const audio = await Service.import("audio")
|
const audio = await Service.import("audio")
|
||||||
const battery = await Service.import("battery")
|
const battery = await Service.import("battery")
|
||||||
const systemtray = await Service.import("systemtray")
|
const systemtray = await Service.import("systemtray")
|
||||||
|
@ -13,6 +12,61 @@ const date = Variable("", {
|
||||||
// widgets can be only assigned as a child in one container
|
// widgets can be only assigned as a child in one container
|
||||||
// so to make a reuseable widget, make it a function
|
// so to make a reuseable widget, make it a function
|
||||||
// then you can simply instantiate one by calling it
|
// 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() {
|
function Clock() {
|
||||||
const calendar = Widget.Calendar({
|
const calendar = Widget.Calendar({
|
||||||
showDayNames: true,
|
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", () => {
|
const label = Utils.watch("", mpris, "player-changed", () => {
|
||||||
if (mpris.players[0]) {
|
if (mpris.players[0]) {
|
||||||
const { track_artists, track_title } = mpris.players[0]
|
const { track_artists, track_title } = mpris.players[0]
|
||||||
|
@ -59,7 +133,7 @@ function Clock() {
|
||||||
child: Widget.Label({ label }),
|
child: Widget.Label({ label }),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
function Volume() {
|
function Volume() {
|
||||||
const icons = {
|
const icons = {
|
||||||
|
@ -139,6 +213,7 @@ function Left() {
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
Workspaces(),
|
Workspaces(),
|
||||||
|
ClientTitle(),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -212,13 +287,15 @@ const cpuProgress = Widget.Label({
|
||||||
const ramProgress = Widget.Label({
|
const ramProgress = Widget.Label({
|
||||||
label: ram.bind().as(usage => `${(usage * 100).toPrecision(4)}%`)
|
label: ram.bind().as(usage => `${(usage * 100).toPrecision(4)}%`)
|
||||||
})
|
})
|
||||||
|
|
||||||
const bars = hyprland.monitors.map((value, _index, _arr) => {
|
|
||||||
return Bar(value.id);
|
|
||||||
})
|
|
||||||
App.config({
|
App.config({
|
||||||
style: "./style.css",
|
style: "./style.css",
|
||||||
windows: bars,
|
windows: [
|
||||||
|
Bar(),
|
||||||
|
|
||||||
|
// you can call it, for each monitor
|
||||||
|
// Bar(0),
|
||||||
|
// Bar(1)
|
||||||
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
export { }
|
export { }
|
||||||
|
|
|
@ -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 };
|
|
|
@ -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 };
|
|
|
@ -1,3 +0,0 @@
|
||||||
function MonitorWidget() {
|
|
||||||
|
|
||||||
}
|
|
|
@ -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) }))
|
|
||||||
})
|
|
|
@ -1,6 +1,7 @@
|
||||||
{ pkgs
|
{
|
||||||
, config
|
pkgs,
|
||||||
, ...
|
config,
|
||||||
|
...
|
||||||
}: {
|
}: {
|
||||||
config = {
|
config = {
|
||||||
home.file = {
|
home.file = {
|
||||||
|
@ -8,10 +9,7 @@
|
||||||
source = ./config;
|
source = ./config;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [ags];
|
||||||
ags
|
|
||||||
brightnessctl
|
|
||||||
];
|
|
||||||
myAutostartCommands = [
|
myAutostartCommands = [
|
||||||
#"${pkgs.ags}/bin/ags --init"
|
#"${pkgs.ags}/bin/ags --init"
|
||||||
"${pkgs.ags}/bin/ags"
|
"${pkgs.ags}/bin/ags"
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 166 KiB |
BIN
home-manager/stvnliu/assets/gruvbox-wallpaper.png
Normal file
BIN
home-manager/stvnliu/assets/gruvbox-wallpaper.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 779 KiB |
BIN
home-manager/stvnliu/assets/nixos-wallpaper.jpg
Normal file
BIN
home-manager/stvnliu/assets/nixos-wallpaper.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1 MiB |
Binary file not shown.
Before Width: | Height: | Size: 2.3 MiB |
|
@ -1,22 +1,14 @@
|
||||||
{ pkgs, ... }: {
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
#./vscode.nix
|
||||||
|
#./intellij.nix
|
||||||
|
];
|
||||||
programs.nixvim = import ./nixvim;
|
programs.nixvim = import ./nixvim;
|
||||||
# dependencies for nixvim configuration
|
# dependencies for nixvim configuration
|
||||||
home.packages = with pkgs; [ ripgrep fd ];
|
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" = { };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,24 @@
|
||||||
{ pkgs
|
{
|
||||||
, ...
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
}: {
|
}: {
|
||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
iconTheme = {
|
iconTheme = {
|
||||||
package = pkgs.adwaita-icon-theme;
|
package = pkgs.gruvbox-plus-icons;
|
||||||
name = "Adwaita";
|
name = "Gruvbox-Plus-Dark";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
qt = {
|
||||||
|
enable = true;
|
||||||
|
platformTheme = "gtk";
|
||||||
|
style = {
|
||||||
|
package = pkgs.libsForQt5.breeze-qt5;
|
||||||
|
name = "breeze";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
libsForQt5.breeze-qt5
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -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";
|
|
||||||
}
|
|
||||||
# { }
|
|
||||||
# { }
|
|
||||||
# { }
|
|
||||||
]
|
|
|
@ -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 = [
|
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
|
./shells
|
||||||
../../common/variables.nix
|
../../common/variables.nix
|
||||||
./services
|
./mako.nix
|
||||||
./wechat
|
./wechat
|
||||||
./editors.nix
|
./editors.nix
|
||||||
./gtk.nix
|
./gtk.nix
|
||||||
#./ags
|
./ags
|
||||||
./xdg.nix
|
./xdg.nix
|
||||||
./stylix.nix
|
./stylix.nix
|
||||||
#./dwl
|
./spicetify.nix
|
||||||
./scripts
|
./scripts
|
||||||
./programs
|
|
||||||
./packages
|
|
||||||
];
|
];
|
||||||
|
|
||||||
#services.pass-secret-service.enable = true;
|
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
# You can add overlays here
|
# You can add overlays here
|
||||||
overlays = [
|
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: {
|
ags = prev.ags.overrideAttrs (old: {
|
||||||
buildInputs = old.buildInputs ++ [ pkgs.libdbusmenu-gtk3 ];
|
buildInputs = old.buildInputs ++ [pkgs.libdbusmenu-gtk3];
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
# Configure your nixpkgs instance
|
# Configure your nixpkgs instance
|
||||||
config = {
|
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
|
# Disable if you don't want unfree packages
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
# Workaround for https://github.com/nix-community/home-manager/issues/2942
|
# Workaround for https://github.com/nix-community/home-manager/issues/2942
|
||||||
|
@ -46,46 +59,96 @@
|
||||||
username = "${config.myUserName}";
|
username = "${config.myUserName}";
|
||||||
homeDirectory = "/home/${config.myUserName}";
|
homeDirectory = "/home/${config.myUserName}";
|
||||||
# copy wallpaper from assets
|
# copy wallpaper from assets
|
||||||
file = { "wallpaper.jpg".source = config.myWallPaperPath; };
|
file = {"wallpaper.jpg".source = ./assets/nixos-wallpaper.jpg;};
|
||||||
};
|
};
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
prismlauncher
|
|
||||||
protonvpn-gui
|
protonvpn-gui
|
||||||
|
devenv
|
||||||
vlc
|
vlc
|
||||||
clash-verge-rev
|
tree
|
||||||
|
zed-editor
|
||||||
rhythmbox
|
rhythmbox
|
||||||
|
clash-verge-rev
|
||||||
qq
|
qq
|
||||||
|
libreoffice
|
||||||
|
discord
|
||||||
|
#zathura
|
||||||
|
kdePackages.okular
|
||||||
shotwell
|
shotwell
|
||||||
mpv
|
mpv
|
||||||
kdePackages.kdenlive
|
kdenlive
|
||||||
obsidian
|
obsidian
|
||||||
heroic
|
pcmanfm
|
||||||
|
udiskie
|
||||||
|
android-file-transfer
|
||||||
|
usbutils
|
||||||
|
mtpfs
|
||||||
|
teams-for-linux
|
||||||
|
sxiv
|
||||||
];
|
];
|
||||||
myAutostartCommands = [
|
myAutostartCommands = [
|
||||||
"${pkgs.clash-verge-rev}/bin/clash-verge"
|
"${pkgs.clash-verge-rev}/bin/clash-verge"
|
||||||
|
"${pkgs.firefox}/bin/firefox"
|
||||||
|
"${pkgs.thunderbird}/bin/thunderbird"
|
||||||
];
|
];
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
obs-studio = {
|
obs-studio = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = with pkgs.obs-studio-plugins; [ wlrobs input-overlay ];
|
plugins = [pkgs.obs-studio-plugins.wlrobs];
|
||||||
};
|
};
|
||||||
home-manager.enable = true;
|
home-manager.enable = true;
|
||||||
firefox = {
|
firefox.enable = true;
|
||||||
enable = true;
|
|
||||||
package = with pkgs;
|
|
||||||
(librewolf.override {
|
|
||||||
nativeMessagingHosts = [ passff-host ];
|
|
||||||
hasMozSystemDirPatch = true;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
thunderbird = {
|
thunderbird = {
|
||||||
enable = true;
|
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
|
# Nicely reload system units when changing configs
|
||||||
systemd.user.startServices = "sd-switch";
|
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
|
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||||
home.stateVersion = "24.05";
|
home.stateVersion = "24.05";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
{ ...
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
./hyprland
|
./hyprland.nix
|
||||||
./hyprpaper.nix
|
./hyprpaper.nix
|
||||||
./hypridle.nix
|
./hypridle.nix
|
||||||
./hyprlock.nix
|
./hyprlock.nix
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
{ ... }:
|
{pkgs, ...}: let
|
||||||
let
|
|
||||||
timeoutSeconds = 600;
|
timeoutSeconds = 600;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
services.hypridle = {
|
services.hypridle = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
93
home-manager/stvnliu/hypr/hyprland.nix
Normal file
93
home-manager/stvnliu/hypr/hyprland.nix
Normal file
|
@ -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;};
|
||||||
|
};
|
||||||
|
# ...
|
||||||
|
}
|
|
@ -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)
|
|
||||||
*/
|
|
||||||
)
|
|
|
@ -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
|
|
||||||
};
|
|
||||||
# ...
|
|
||||||
}
|
|
|
@ -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"
|
|
||||||
]
|
|
|
@ -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;"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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)$"
|
|
||||||
]
|
|
|
@ -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%"
|
|
||||||
]
|
|
|
@ -1,5 +1,10 @@
|
||||||
{ config, lib, ... }: {
|
{
|
||||||
programs.hyprlock = lib.mkForce {
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
programs.hyprlock = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
general = {
|
general = {
|
||||||
|
@ -9,25 +14,29 @@
|
||||||
no_fade_in = false;
|
no_fade_in = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
background = [{
|
background = [
|
||||||
path = "screenshot";
|
{
|
||||||
blur_passes = 3;
|
path = "screenshot";
|
||||||
blur_size = 8;
|
blur_passes = 3;
|
||||||
}];
|
blur_size = 8;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
input-field = [{
|
input-field = [
|
||||||
size = "400, 50";
|
{
|
||||||
position = "0, -80";
|
size = "200, 50";
|
||||||
monitor = "";
|
position = "0, -80";
|
||||||
dots_center = true;
|
monitor = "";
|
||||||
fade_on_empty = false;
|
dots_center = true;
|
||||||
font_color = "rgb(${config.lib.stylix.colors.base07})";
|
fade_on_empty = false;
|
||||||
inner_color = "rgb(${config.lib.stylix.colors.base02})";
|
font_color = "rgb(202, 211, 245)";
|
||||||
outer_color = "rgb(${config.lib.stylix.colors.base03})";
|
inner_color = "rgb(91, 96, 120)";
|
||||||
outline_thickness = 1;
|
outer_color = "rgb(24, 25, 38)";
|
||||||
placeholder_text = ''<span foreground="##cad3f5">Password...</span>'';
|
outline_thickness = 5;
|
||||||
shadow_passes = 2;
|
#placeholder_text = '\'<span foreground="##cad3f5">Password...</span>'\';
|
||||||
}];
|
shadow_passes = 2;
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
{ config
|
{
|
||||||
, ...
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
}: {
|
}: {
|
||||||
services.hyprpaper = {
|
services.hyprpaper = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
ipc = "on";
|
ipc = "on";
|
||||||
splash = false;
|
splash = false;
|
||||||
preload = [ config.myWallPaperPathString ];
|
preload = [config.myWallPaperPathString];
|
||||||
wallpaper = [ ",${config.myWallPaperPathString}" ];
|
wallpaper = [",${config.myWallPaperPathString}"];
|
||||||
#preload = [/home/stvnliu/Downloads/mao-zedong.jpg];
|
|
||||||
#wallpaper = [",/home/stvnliu/Downloads/mao-zedong.jpg"];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{ ...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
defaultTimeoutMillis = 5 * 1000;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
defaultTimeoutMillis = 5 * 1000;
|
||||||
|
in {
|
||||||
services.mako = {
|
services.mako = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultTimeout = defaultTimeoutMillis;
|
defaultTimeout = defaultTimeoutMillis;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{ plugins.nvim-autopairs = { enable = true; }; }
|
{plugins.nvim-autopairs = {enable = true;};}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
plugins.auto-save = {
|
plugins.auto-save = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.enabled = true;
|
enableAutoSave = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{ plugins.bufferline = { enable = true; }; }
|
{plugins.bufferline = {enable = true;};}
|
||||||
|
|
|
@ -2,49 +2,45 @@
|
||||||
{
|
{
|
||||||
plugins = {
|
plugins = {
|
||||||
luasnip.enable = true;
|
luasnip.enable = true;
|
||||||
/*
|
copilot-lua = {
|
||||||
copilot-lua = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
suggestion.enabled = false;
|
suggestion.enabled = false;
|
||||||
panel.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 = {
|
cmp = {
|
||||||
enable = true;
|
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 = ''
|
snippet.expand = ''
|
||||||
function(args)
|
function(args)
|
||||||
require('luasnip').lsp_expand(args.body)
|
require('luasnip').lsp_expand(args.body)
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
*/
|
|
||||||
sources = [
|
sources = [
|
||||||
{ name = "nvim_lsp"; }
|
{name = "nvim_lsp";}
|
||||||
{ name = "luasnip"; }
|
{name = "luasnip";}
|
||||||
{
|
{
|
||||||
name = "buffer";
|
name = "buffer";
|
||||||
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
||||||
}
|
}
|
||||||
{ name = "nvim_lua"; }
|
{name = "nvim_lua";}
|
||||||
{ name = "path"; }
|
{name = "path";}
|
||||||
|
{name = "copilot";}
|
||||||
];
|
];
|
||||||
|
|
||||||
formatting = {
|
formatting = {
|
||||||
fields = [ "abbr" "kind" "menu" ];
|
fields = ["abbr" "kind" "menu"];
|
||||||
format =
|
format =
|
||||||
# lua
|
# lua
|
||||||
''
|
''
|
||||||
|
@ -104,11 +100,11 @@
|
||||||
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
||||||
scrollbar = false;
|
scrollbar = false;
|
||||||
sidePadding = 0;
|
sidePadding = 0;
|
||||||
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
border = ["╭" "─" "╮" "│" "╯" "─" "╰" "│"];
|
||||||
};
|
};
|
||||||
|
|
||||||
settings.documentation = {
|
settings.documentation = {
|
||||||
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
border = ["╭" "─" "╮" "│" "╯" "─" "╰" "│"];
|
||||||
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
plugins.coq-nvim = {
|
|
||||||
enable = true;
|
|
||||||
installArtifacts = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
mode = "n";
|
|
||||||
key = "<leader>ree";
|
|
||||||
action = "<CMD>RustLsp explainError<CR>";
|
|
||||||
options.desc = "Explain this Rust error (custom)";
|
|
||||||
}
|
|
||||||
]
|
|
|
@ -1,12 +1,15 @@
|
||||||
{ ... }: {
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
./auto-pairs.nix
|
./auto-pairs.nix
|
||||||
./autosave.nix
|
./autosave.nix
|
||||||
#./bufferline.nix
|
./bufferline.nix
|
||||||
./cmp.nix
|
./cmp.nix
|
||||||
#./coq.nix
|
|
||||||
./git.nix
|
./git.nix
|
||||||
#./ionide.nix
|
./ionide.nix
|
||||||
./lualine.nix
|
./lualine.nix
|
||||||
./lsp.nix
|
./lsp.nix
|
||||||
./none-ls.nix
|
./none-ls.nix
|
||||||
|
@ -20,146 +23,131 @@
|
||||||
./which_key.nix
|
./which_key.nix
|
||||||
./wilder.nix
|
./wilder.nix
|
||||||
./virt-column.nix
|
./virt-column.nix
|
||||||
./devicons.nix
|
|
||||||
./tagbar.nix
|
|
||||||
./wrapping.nix
|
|
||||||
./twilight.nix
|
|
||||||
];
|
];
|
||||||
enable = true;
|
enable = true;
|
||||||
enableMan = true;
|
enableMan = true;
|
||||||
defaultEditor = true;
|
defaultEditor = true;
|
||||||
globals.mapleader = " ";
|
globals.mapleader = " ";
|
||||||
colorschemes.gruvbox = { enable = true; };
|
colorschemes.gruvbox = {enable = true;};
|
||||||
performance = {
|
keymaps = [
|
||||||
byteCompileLua.enable = true;
|
# Global
|
||||||
combinePlugins = {
|
# Default mode is "" which means normal-visual-op
|
||||||
enable = true;
|
{
|
||||||
/*standalonePlugins = [
|
mode = "n";
|
||||||
"nvim-treesitter"
|
key = "<leader>bg";
|
||||||
];*/
|
action = "<CMD>TransparentToggle<CR>";
|
||||||
};
|
options.desc = "Toggle background transparency";
|
||||||
};
|
}
|
||||||
keymaps =
|
{
|
||||||
[
|
key = "<C-n>";
|
||||||
# Global
|
action = "<CMD>NvimTreeToggle<CR>";
|
||||||
# Default mode is "" which means normal-visual-op
|
options.desc = "Toggle NvimTree";
|
||||||
{
|
}
|
||||||
mode = "n";
|
|
||||||
key = "<leader>bg";
|
|
||||||
action = "<CMD>TransparentToggle<CR>";
|
|
||||||
options.desc = "Toggle background transparency";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "<C-n>";
|
|
||||||
action = "<CMD>NvimTreeToggle<CR>";
|
|
||||||
options.desc = "Toggle NvimTree";
|
|
||||||
}
|
|
||||||
|
|
||||||
# File
|
# File
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>f";
|
key = "<leader>f";
|
||||||
action = "+find/file";
|
action = "+find/file";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
# Format file
|
# Format file
|
||||||
key = "<leader>fm";
|
key = "<leader>fm";
|
||||||
action = "<CMD>lua vim.lsp.buf.format()<CR>";
|
action = "<CMD>lua vim.lsp.buf.format()<CR>";
|
||||||
options.desc = "Format the current buffer";
|
options.desc = "Format the current buffer";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Git
|
# Git
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>g";
|
key = "<leader>g";
|
||||||
action = "+git";
|
action = "+git";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>gt";
|
key = "<leader>gt";
|
||||||
action = "+toggles";
|
action = "+toggles";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
key = "<leader>gtb";
|
key = "<leader>gtb";
|
||||||
action = "<CMD>Gitsigns toggle_current_line_blame<CR>";
|
action = "<CMD>Gitsigns toggle_current_line_blame<CR>";
|
||||||
options.desc = "Gitsigns current line blame";
|
options.desc = "Gitsigns current line blame";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
key = "<leader>gtd";
|
key = "<leader>gtd";
|
||||||
action = "<CMD>Gitsigns toggle_deleted";
|
action = "<CMD>Gitsigns toggle_deleted";
|
||||||
options.desc = "Gitsigns deleted";
|
options.desc = "Gitsigns deleted";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
key = "<leader>gd";
|
key = "<leader>gd";
|
||||||
action = "<CMD>Gitsigns diffthis<CR>";
|
action = "<CMD>Gitsigns diffthis<CR>";
|
||||||
options.desc = "Gitsigns diff this buffer";
|
options.desc = "Gitsigns diff this buffer";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Tabs
|
# Tabs
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>t";
|
key = "<leader>t";
|
||||||
action = "+tab";
|
action = "+tab";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>tn";
|
key = "<leader>tn";
|
||||||
action = "<CMD>tabnew<CR>";
|
action = "<CMD>tabnew<CR>";
|
||||||
options.desc = "Create new tab";
|
options.desc = "Create new tab";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>td";
|
key = "<leader>td";
|
||||||
action = "<CMD>tabclose<CR>";
|
action = "<CMD>tabclose<CR>";
|
||||||
options.desc = "Close tab";
|
options.desc = "Close tab";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>ts";
|
key = "<leader>ts";
|
||||||
action = "<CMD>tabnext<CR>";
|
action = "<CMD>tabnext<CR>";
|
||||||
options.desc = "Go to the sub-sequent tab";
|
options.desc = "Go to the sub-sequent tab";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>tp";
|
key = "<leader>tp";
|
||||||
action = "<CMD>tabprevious<CR>";
|
action = "<CMD>tabprevious<CR>";
|
||||||
options.desc = "Go to the previous tab";
|
options.desc = "Go to the previous tab";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Terminal
|
# Terminal
|
||||||
{
|
{
|
||||||
# Escape terminal mode using ESC
|
# Escape terminal mode using ESC
|
||||||
mode = "t";
|
mode = "t";
|
||||||
key = "<esc>";
|
key = "<esc>";
|
||||||
action = "<C-\\><C-n>";
|
action = "<C-\\><C-n>";
|
||||||
options.desc = "Escape terminal mode";
|
options.desc = "Escape terminal mode";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Trouble
|
# Trouble
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>d";
|
key = "<leader>d";
|
||||||
action = "+diagnostics/debug";
|
action = "+diagnostics/debug";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
key = "<leader>dt";
|
key = "<leader>dt";
|
||||||
action = "<CMD>TroubleToggle<CR>";
|
action = "<CMD>TroubleToggle<CR>";
|
||||||
options.desc = "Toggle trouble";
|
options.desc = "Toggle trouble";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Rust
|
# Rust
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>r";
|
key = "<leader>r";
|
||||||
action = "+rust";
|
action = "+rust";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
# Start standalone rust-analyzer (fixes issues when opening files from nvim tree)
|
# Start standalone rust-analyzer (fixes issues when opening files from nvim tree)
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>rs";
|
key = "<leader>rs";
|
||||||
action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
|
action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
|
||||||
options.desc = "Start standalone rust-analyzer";
|
options.desc = "Start standalone rust-analyzer";
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
++ (import ./custom/binds.nix);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
plugins.web-devicons.enable = true;
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, ... }: {
|
{pkgs, ...}: {
|
||||||
extraPlugins = with pkgs.vimPlugins; [
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
Ionide-vim
|
Ionide-vim
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,51 +1,20 @@
|
||||||
{ ... }: {
|
{
|
||||||
plugins = {
|
plugins = {
|
||||||
lsp-signature.enable = true;
|
|
||||||
lsp-status.enable = true;
|
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
servers = {
|
servers = {
|
||||||
# For Python
|
|
||||||
pylsp.enable = true;
|
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;
|
bashls.enable = true;
|
||||||
|
clangd.enable = true;
|
||||||
fsautocomplete.enable = true;
|
fsautocomplete.enable = true;
|
||||||
gopls.enable = true;
|
gopls.enable = true;
|
||||||
|
nil_ls.enable = true;
|
||||||
#nushell.enable = true;
|
#nixd.enable = true;
|
||||||
|
rust-analyzer = {
|
||||||
# For Nix
|
|
||||||
#nil_ls.enable = true;
|
|
||||||
nixd = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
extraOptions = {
|
installRustc = true;
|
||||||
home-manager = {
|
|
||||||
expr = ''
|
|
||||||
(builtins.getFlake "/home/stvnliu/nix-conf/").homeConfigurations."stvnliu@nixos-msi".options'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
tsserver.enable = true;
|
||||||
# Haskell
|
|
||||||
hls = {
|
|
||||||
enable = true;
|
|
||||||
installGhc = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# For TypeScript
|
|
||||||
ts_ls.enable = true;
|
|
||||||
};
|
};
|
||||||
keymaps.lspBuf = {
|
keymaps.lspBuf = {
|
||||||
"gd" = "definition";
|
"gd" = "definition";
|
||||||
|
@ -55,12 +24,10 @@
|
||||||
"K" = "hover";
|
"K" = "hover";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#lsp-lines.enable = true;
|
lsp-lines = {
|
||||||
|
enable = true;
|
||||||
#rustaceanvim = {
|
currentLine = true;
|
||||||
# enable = true;
|
};
|
||||||
# # rust-tools.enable = true;
|
rust-tools.enable = true;
|
||||||
#};
|
|
||||||
};
|
};
|
||||||
diagnostics.virtual_lines.only_current_line = true;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
plugins.lspkind = {
|
|
||||||
enable = true;
|
|
||||||
symbolMap = {
|
|
||||||
Copilot = " ";
|
|
||||||
};
|
|
||||||
extraOptions = {
|
|
||||||
maxwidth = 50;
|
|
||||||
ellipsis_char = "...";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -3,7 +3,7 @@
|
||||||
updatetime = 100; # Faster completion
|
updatetime = 100; # Faster completion
|
||||||
|
|
||||||
number = true;
|
number = true;
|
||||||
relativenumber = true;
|
relativenumber = false;
|
||||||
|
|
||||||
autoindent = true;
|
autoindent = true;
|
||||||
clipboard = "unnamedplus";
|
clipboard = "unnamedplus";
|
||||||
|
|
|
@ -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 = " ";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -10,6 +10,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
extensions.fzf-native = { enable = true; };
|
extensions.fzf-native = {enable = true;};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{ plugins.transparent.enable = true; }
|
{plugins.transparent.enable = true;}
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
{ pkgs, ... }: {
|
{
|
||||||
plugins = {
|
plugins = {
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nixGrammars = true;
|
nixGrammars = true;
|
||||||
nixvimInjections = true; # enables language injection in nixvim
|
nixvimInjections = true; # enables language injection in nixvim
|
||||||
settings.indent.enable = true;
|
indent = true;
|
||||||
grammarPackages = pkgs.vimPlugins.nvim-treesitter.passthru.allGrammars;
|
|
||||||
};
|
};
|
||||||
treesitter-context.enable = true;
|
treesitter-context.enable = true;
|
||||||
rainbow-delimiters.enable = true;
|
rainbow-delimiters.enable = true;
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{ ... }: {
|
|
||||||
plugins = {
|
|
||||||
zen-mode = { enable = true; };
|
|
||||||
twilight = { enable = true; };
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
plugins.virt-column = {
|
plugins.virt-column = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.char = [ "┃" ];
|
settings.char = ["┃"];
|
||||||
settings.virtcolumn = "80";
|
settings.virtcolumn = "80";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{ plugins.which-key = { enable = true; }; }
|
{plugins.which-key = {enable = true;};}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
plugins.wilder = {
|
plugins.wilder = {
|
||||||
enable = true;
|
enable = true;
|
||||||
modes = [ ":" "/" "?" ];
|
modes = [":" "/" "?"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
plugins.wrapping = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{ ...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
./util-programs.nix
|
|
||||||
./office-programs.nix
|
|
||||||
./discord.nix
|
|
||||||
./wayland-utils.nix
|
|
||||||
./pentesting.nix
|
|
||||||
./dev.nix
|
|
||||||
./gaming.nix
|
|
||||||
./hypr.nix
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{ pkgs
|
|
||||||
, ...
|
|
||||||
}: {
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
wget
|
|
||||||
vscodium-fhs
|
|
||||||
devenv
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -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";
|
|
||||||
};*/
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [ bottles zeroad ];
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
{ inputs, ... }:
|
|
||||||
{
|
|
||||||
home.packages = [ inputs.hyprswitch.packages.x86_64-linux.default ];
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{ pkgs
|
|
||||||
, ...
|
|
||||||
}: {
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
libreoffice
|
|
||||||
kdePackages.okular
|
|
||||||
evolution
|
|
||||||
evolution-ews
|
|
||||||
# proton mail
|
|
||||||
protonmail-bridge
|
|
||||||
protonmail-bridge-gui
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{ pkgs
|
|
||||||
, ...
|
|
||||||
}: {
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
openvpn
|
|
||||||
inetutils
|
|
||||||
nmap
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -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
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
{ pkgs, ... }: {
|
|
||||||
home.packages = with pkgs; [ vscodium-fhs ];
|
|
||||||
xdg.desktopEntries.codium = { };
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{ pkgs
|
|
||||||
, ...
|
|
||||||
}: {
|
|
||||||
home.packages = with pkgs; [ wl-clipboard ];
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{ ...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
./git.nix
|
|
||||||
./rofi.nix
|
|
||||||
./tmux.nix
|
|
||||||
./foot.nix
|
|
||||||
#./walker.nix
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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";
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{ ...
|
|
||||||
}: {
|
|
||||||
programs.rofi = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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'";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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.
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,16 +1,7 @@
|
||||||
{ config
|
{
|
||||||
, pkgs
|
config,
|
||||||
, ...
|
pkgs,
|
||||||
|
...
|
||||||
}: {
|
}: {
|
||||||
home.packages = [
|
home.packages = [(import ./heic-to-jpg.script.nix {inherit pkgs;})];
|
||||||
(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;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
|
||||||
''
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs }:
|
{pkgs}:
|
||||||
pkgs.writeShellScriptBin "heic-to-jpg" ''
|
pkgs.writeShellScriptBin "heic-to-jpg" ''
|
||||||
mkdir -p ./heic-to-jpg-out
|
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"
|
${pkgs.findutils}/bin/find . -type f -print0 | ${pkgs.findutils}/bin/xargs -0 -I "{}" ${pkgs.imagemagick}/bin/magick "{}" -quality 100% ./jpg-out/"{}.conv.jpg"
|
||||||
|
|
|
@ -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
|
|
||||||
''
|
|
|
@ -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}
|
|
||||||
''
|
|
|
@ -1,10 +0,0 @@
|
||||||
{ ...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
./swaync.nix
|
|
||||||
./mpd.nix
|
|
||||||
|
|
||||||
# DEPRECATED due to switch to KDE
|
|
||||||
#./waybar.nix
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -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; };
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{ ...
|
|
||||||
}: {
|
|
||||||
services.swaync = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{ ... }: {
|
|
||||||
programs.waybar = {
|
|
||||||
enable = true;
|
|
||||||
systemd = { enable = true; };
|
|
||||||
style = "${import ./waybar_style.nix { }}";
|
|
||||||
settings = import ./waybar_config.nix;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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" = ''
|
|
||||||
<span color="#f53c3c"></span> ''; # 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" = [
|
|
||||||
"<span color='#69ff94'>▁</span>" # green
|
|
||||||
"<span color='#2aa9ff'>▂</span>" # blue
|
|
||||||
"<span color='#f8f8f2'>▃</span>" # white
|
|
||||||
"<span color='#f8f8f2'>▄</span>" # white
|
|
||||||
"<span color='#ffffa5'>▅</span>" # yellow
|
|
||||||
"<span color='#ffffa5'>▆</span>" # yellow
|
|
||||||
"<span color='#ff9977'>▇</span>" # orange
|
|
||||||
"<span color='#dd532e'>█</span>" # red
|
|
||||||
];
|
|
||||||
"memory" = { "format" = "MEM {percentage}%"; };
|
|
||||||
};
|
|
||||||
"clock" = {
|
|
||||||
"format" = "{:%H:%M} ";
|
|
||||||
"format-alt" = "{:%A, %B %d, %Y (%R)}";
|
|
||||||
"tooltip-format" = "<tt><small>{calendar}</small></tt>";
|
|
||||||
"calendar" = {
|
|
||||||
"mode" = "year";
|
|
||||||
"mode-mon-col" = 3;
|
|
||||||
"weeks-pos" = "right";
|
|
||||||
"on-scroll" = 1;
|
|
||||||
"format" = {
|
|
||||||
"months" = "<span color='#ffead3'><b>{}</b></span>";
|
|
||||||
"days" = "<span color='#ecc6d9'><b>{}</b></span>";
|
|
||||||
"weeks" = "<span color='#99ffdd'><b>W{}</b></span>";
|
|
||||||
"weekdays" = "<span color='#ffcc66'><b>{}</b></span>";
|
|
||||||
"today" = "<span color='#ff6699'><b><u>{}</u></b></span>";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
/* "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"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
{ ... }: ''
|
|
||||||
* {
|
|
||||||
font-family: JetBrainsMono Nerd Font;
|
|
||||||
}''
|
|
|
@ -1,14 +1,10 @@
|
||||||
{ pkgs }: {
|
{pkgs}: {
|
||||||
gil = "${pkgs.lazygit}/bin/lazygit";
|
|
||||||
cd = "z";
|
cd = "z";
|
||||||
cdi = "zi";
|
cdi = "zi";
|
||||||
|
ls = "${pkgs.eza}/bin/exa";
|
||||||
cat = "${pkgs.bat}/bin/bat";
|
cat = "${pkgs.bat}/bin/bat";
|
||||||
ls = "${pkgs.lsd}/bin/lsd";
|
|
||||||
ll = "ls -l";
|
ll = "ls -l";
|
||||||
rm = "${pkgs.trash-cli}/bin/trash";
|
|
||||||
osupdate = "${pkgs.nh}/bin/nh os switch";
|
osupdate = "${pkgs.nh}/bin/nh os switch";
|
||||||
homeupdate = "${pkgs.nh}/bin/nh home switch";
|
homeupdate = "${pkgs.nh}/bin/nh home switch";
|
||||||
batmon = "watch -n0 upower -i /org/freedesktop/UPower/devices/battery_BAT1";
|
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\"";
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,30 @@
|
||||||
{ lib
|
{
|
||||||
, config
|
pkgs,
|
||||||
, ...
|
lib,
|
||||||
}:
|
config,
|
||||||
with lib; {
|
...
|
||||||
imports = [
|
}: let
|
||||||
./zsh.nix
|
cfg = config.myShells;
|
||||||
./fish
|
in
|
||||||
./nushell
|
with lib; {
|
||||||
./zoxide.nix
|
imports = [
|
||||||
./direnv.nix
|
./zsh.nix
|
||||||
./starship
|
./fish
|
||||||
];
|
./zoxide.nix
|
||||||
|
./direnv.nix
|
||||||
|
./starship
|
||||||
|
];
|
||||||
|
|
||||||
options.myShells = {
|
options.myShells = {
|
||||||
defaultShell = with types; mkOption { type = str; };
|
defaultShell = with types; mkOption {type = str;};
|
||||||
enable = mkEnableOption "Enables the shell customisation module.";
|
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;
|
|
||||||
};
|
};
|
||||||
};
|
config = {
|
||||||
}
|
myShells = {
|
||||||
|
zsh.enable = false;
|
||||||
|
fish.enable = true;
|
||||||
|
defaultShell = "fish";
|
||||||
|
prompts.starship.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ ... }: {
|
{...}: {
|
||||||
programs = {
|
programs = {
|
||||||
direnv = {
|
direnv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
4
home-manager/stvnliu/shells/env/default.nix
vendored
4
home-manager/stvnliu/shells/env/default.nix
vendored
|
@ -1,4 +0,0 @@
|
||||||
{ ...
|
|
||||||
}: {
|
|
||||||
EDITOR = "nvim";
|
|
||||||
}
|
|
|
@ -1,65 +1,61 @@
|
||||||
{ pkgs
|
{
|
||||||
, config
|
pkgs,
|
||||||
, lib
|
config,
|
||||||
, ...
|
lib,
|
||||||
}:
|
...
|
||||||
let
|
}: let
|
||||||
cfg = config.myShells.fish;
|
cfg = config.myShells.fish;
|
||||||
in
|
in
|
||||||
with lib; {
|
with lib; {
|
||||||
options = {
|
options = {
|
||||||
myShells.fish = { enable = mkEnableOption "Enables fish and components."; };
|
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;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
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;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -1,116 +0,0 @@
|
||||||
|
|
||||||
# Copyright (C) 2012-2014 Dmitry Medvinsky <me@dmedvinsky.name>. 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)'
|
|
|
@ -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., <program> -n=<TAB>)
|
|
||||||
# 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'
|
|
|
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +1,25 @@
|
||||||
{ lib
|
{
|
||||||
, config
|
lib,
|
||||||
, ...
|
pkgs,
|
||||||
}:
|
config,
|
||||||
let
|
...
|
||||||
|
}: let
|
||||||
cfg = config.myShells.prompts.starship;
|
cfg = config.myShells.prompts.starship;
|
||||||
in
|
in
|
||||||
with lib; {
|
with lib; {
|
||||||
options = {
|
options = {
|
||||||
myShells.prompts.starship.enable = mkEnableOption "Enables starship prompts.";
|
myShells.prompts.starship.enable = mkEnableOption "Enables starship prompts.";
|
||||||
myShells.prompts.starship.confPath = mkOption {
|
myShells.prompts.starship.confPath = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = ./presets/default.toml;
|
default = ./presets/default.toml;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
config = mkIf cfg.enable {
|
||||||
config = mkIf cfg.enable {
|
programs.starship = {
|
||||||
myShells.prompts.starship.confPath = ./presets/pure-direnv.toml;
|
enable = true;
|
||||||
programs.starship = {
|
enableZshIntegration = config.myShells.zsh.enable;
|
||||||
enable = true;
|
enableFishIntegration = config.myShells.fish.enable;
|
||||||
enableZshIntegration = config.myShells.zsh.enable;
|
settings = builtins.fromTOML (builtins.readFile cfg.confPath);
|
||||||
enableFishIntegration = config.myShells.fish.enable;
|
};
|
||||||
enableNushellIntegration = config.myShells.nushell.enable;
|
|
||||||
settings = builtins.fromTOML (builtins.readFile cfg.confPath);
|
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -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"
|
|
|
@ -1,5 +1,8 @@
|
||||||
{ config
|
{
|
||||||
, ...
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
}: {
|
}: {
|
||||||
programs.zoxide = {
|
programs.zoxide = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -1,33 +1,36 @@
|
||||||
{ pkgs
|
{
|
||||||
, lib
|
pkgs,
|
||||||
, config
|
lib,
|
||||||
, ...
|
config,
|
||||||
}:
|
...
|
||||||
with lib; {
|
}: let
|
||||||
options.myShells.zsh = {
|
cfg = config.shell.zsh;
|
||||||
enable = mkEnableOption "Enables zsh and components.";
|
in
|
||||||
};
|
with lib; {
|
||||||
config = {
|
options.myShells.zsh = {
|
||||||
programs.zsh = {
|
enable = mkEnableOption "Enables zsh and components.";
|
||||||
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 ];
|
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];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
26
home-manager/stvnliu/spicetify.nix
Normal file
26
home-manager/stvnliu/spicetify.nix
Normal file
|
@ -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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,35 +1,17 @@
|
||||||
{ pkgs
|
{pkgs, ...}: {
|
||||||
, config
|
|
||||||
, ...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
globalOpacity = 0.75;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
stylix = {
|
stylix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autoEnable = true;
|
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml";
|
||||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark-dark.yaml";
|
image = ./assets/nixos-wallpaper.jpg;
|
||||||
image = config.myWallPaperPath;
|
|
||||||
fonts = {
|
fonts = {
|
||||||
/*sansSerif = {
|
sansSerif = {
|
||||||
name = "Helvetica Neue LT Std";
|
name = "Aileron";
|
||||||
package = pkgs.helvetica-neue-lt-std;
|
package = pkgs.aileron;
|
||||||
};*/
|
};
|
||||||
monospace = {
|
monospace = {
|
||||||
name = config.desktopFont.fullName;
|
name = "BlexMono Nerd Font";
|
||||||
package = config.desktopFont.package;
|
package = pkgs.nerdfonts.override {fonts = ["IBMPlexMono"];};
|
||||||
};
|
};
|
||||||
sizes = {
|
|
||||||
terminal = 16;
|
|
||||||
applications = 12;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
opacity = {
|
|
||||||
applications = globalOpacity;
|
|
||||||
desktop = globalOpacity;
|
|
||||||
popups = globalOpacity;
|
|
||||||
terminal = globalOpacity;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
13
home-manager/stvnliu/swaywm.nix
Normal file
13
home-manager/stvnliu/swaywm.nix
Normal file
|
@ -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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
20
home-manager/stvnliu/variables.nix
Normal file
20
home-manager/stvnliu/variables.nix
Normal file
|
@ -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";
|
||||||
|
};
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue