Compare commits
148 commits
Author | SHA1 | Date | |
---|---|---|---|
2ac1e0c90d |
|||
ca8bd5829a |
|||
84b17122d5 |
|||
f965e8b989 |
|||
7e2c5f2c7c |
|||
20029c971a |
|||
dfdd271350 |
|||
ca7192d41f |
|||
6d47209757 |
|||
edf1ab243e |
|||
20f6439cc7 |
|||
bab224d4d1 |
|||
7a072d580c |
|||
b487953311 |
|||
afc232ca26 |
|||
bbff8e9d20 |
|||
b2d8783e83 |
|||
19e72eedb7 |
|||
00f5075f17 |
|||
bb120b4e3d |
|||
db83134e6b |
|||
23871a3c73 |
|||
19fddf28fa |
|||
5e6352671a |
|||
08566ea0ee |
|||
1bef468795 |
|||
66bf7da2b3 |
|||
dfeaa9b84a |
|||
ef09316160 |
|||
1a57d0a196 |
|||
003d990eac |
|||
1a1cabb034 |
|||
449c0e59d9 |
|||
b6216a3f53 |
|||
e56dc0238f |
|||
362b20477d |
|||
f1d727cedd |
|||
ae1dbae7c9 |
|||
57c4933610 |
|||
5175a6d9f3 |
|||
395bb04422 |
|||
281ae7f645 |
|||
ef9cd89daa |
|||
8efff299f3 |
|||
a81feaf5fa |
|||
ff5b7aa636 |
|||
ecaf5df80a |
|||
7d88765f5d |
|||
2d4b39c72f |
|||
fd12988a0f |
|||
75870c32aa |
|||
0347814073 |
|||
19330c1c88 |
|||
f63fb76d78 |
|||
4c07b4d0a4 |
|||
71b70ecb3a |
|||
528ef530c0 |
|||
a0966bfdac |
|||
7962850c82 |
|||
444e364d7e |
|||
dc9f623785 |
|||
2dc89a3284 |
|||
333ca504a6 |
|||
ff3be101f9 |
|||
2e0927fc93 |
|||
51f3ed41cc |
|||
54bc34d7dc |
|||
7ff3a0adbe |
|||
64e476798d |
|||
77f1155518 |
|||
ec800c7394 |
|||
b6d7635ce0 |
|||
b60c28d972 |
|||
72381b3f46 |
|||
01a503477d |
|||
2262b4c1ff |
|||
fbbe078673 |
|||
3c656a3c03 |
|||
df966578e4 |
|||
73b4ab6874 |
|||
a2bf84b09e |
|||
712e45ca58 |
|||
583cdd7b00 |
|||
03a2702281 |
|||
08def86724 |
|||
f301f81c09 |
|||
c09a6b2010 |
|||
32e62e90f3 |
|||
05e141db88 |
|||
da68374b71 |
|||
24c2411160 |
|||
4272896370 |
|||
b74b1ba3e4 |
|||
4694410cc8 |
|||
6eb3bb0b70 |
|||
06fa623eef |
|||
78d5115aac |
|||
178e199bb7 |
|||
b7c4404575 |
|||
932fa37cfa |
|||
9475ec1a21 |
|||
c5ff41998e |
|||
a641d4fafe |
|||
3c9a9d42cf |
|||
ba450b88ef |
|||
a82a005ed2 |
|||
d15dd3bb76 |
|||
655687c683 |
|||
079708804e |
|||
db6ad0b031 |
|||
20af7fa881 |
|||
f03fa22c2d |
|||
4060060af5 |
|||
62c6c836e3 |
|||
9724c8e4f4 |
|||
9975cd7d64 |
|||
1c5f8de412 |
|||
e5f49cd89f |
|||
54281863cd |
|||
f9e7c190b6 |
|||
4a99257e90 |
|||
83c26c1e31 |
|||
a29235acb6 |
|||
d4059b5e9a |
|||
74635a6c6d |
|||
33edc82a6b |
|||
908db14e1c |
|||
0608d646c5 |
|||
a479e4633c |
|||
4f6d4cba4a |
|||
236c4b8ed2 |
|||
dad3573f27 |
|||
3685cf5abe |
|||
1747a5ad81 |
|||
dde872db67 |
|||
1f80786864 |
|||
09e506c6a6 |
|||
466f0992f1 |
|||
d125eca445 |
|||
99493bc1ce |
|||
f4df5fd49c |
|||
c2e4f54322 |
|||
2173217135 |
|||
8cdaac5bf7 |
|||
7db7922cd3 |
|||
5558d0d761 |
|||
ab9b248551 |
|||
71de8c08a0 |
133 changed files with 4442 additions and 1274 deletions
2
.envrc
2
.envrc
|
@ -1,3 +1,3 @@
|
||||||
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="
|
source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k="
|
||||||
|
|
||||||
use devenv
|
use devenv
|
28
README.md
28
README.md
|
@ -1,19 +1,29 @@
|
||||||
# My NixOS configuration
|
# My NixOS configuration
|
||||||
|
- system: `"x86_64-linux"`
|
||||||
- system: `"x86_64-linux"`
|
- host os: `Linux 6.12.2-zen1, NixOS, 25.05 (Warbler), 25.05.20241229.88195a9`
|
||||||
- host os: `Linux 6.6.44, NixOS, 24.11 (Vicuna), 24.11.20240804.cb9a96f`
|
- multi-user?: `yes`
|
||||||
- multi-user?: `yes`
|
- sandbox: `yes`
|
||||||
- sandbox: `yes`
|
- version: `nix-env (Nix) 2.24.11`
|
||||||
- version: `nix-env (Nix) 2.18.5`
|
- channels(root): `"nixos"`
|
||||||
- channels(root): `"nixos"`
|
- nixpkgs: `/nix/store/8vz84mqgnm1gz5yk7hgnnb5gir5hjxas-source`
|
||||||
- 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.
|
||||||
```
|
```
|
||||||
sudo nixos-rebuild --flake <path_to_this_config>#<your_hostname> switch
|
wget https://raw.githubusercontent.com/stvnliu/nixos-configuration/refs/heads/main/deploy.sh
|
||||||
|
chmod +x ./deploy.sh
|
||||||
|
./deploy.sh https://github.com/stvnliu/nixos-configuration nixos-msi
|
||||||
|
```
|
||||||
|
|
||||||
|
or manually:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone <repo_url> <path_to_config>
|
||||||
|
sudo nixos-rebuild --flake <path_to_config>#<your_hostname> boot
|
||||||
```
|
```
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
|
@ -1,34 +1,72 @@
|
||||||
|
{ 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; {
|
||||||
myUserName = mkOption {type = str;};
|
usingMusicPlayerDaemon = mkOption { type = bool; };
|
||||||
myHostName = mkOption {type = str;};
|
defaultApplications = {
|
||||||
myWallPaperPathString = mkOption {type = str;};
|
fileManager = mkOption { type = str; };
|
||||||
myDisplayName = mkOption {type = str;};
|
appLauncher = mkOption { type = str; };
|
||||||
myEmail = mkOption {type = str;};
|
terminal = mkOption { type = str; };
|
||||||
displayScale = mkOption {type = int;};
|
};
|
||||||
myAutostartCommands = mkOption {type = listOf str;};
|
myWallPaperPath = mkOption { type = path; };
|
||||||
myConfigLocation = mkOption {type = str;};
|
myUserName = mkOption { type = str; };
|
||||||
|
myHostName = mkOption { type = str; };
|
||||||
|
myWallPaperPathString = mkOption { type = str; };
|
||||||
|
myDisplayName = mkOption { type = str; };
|
||||||
|
myEmail = mkOption { type = str; };
|
||||||
|
displayScale = mkOption { type = int; };
|
||||||
|
myAutostartCommands = mkOption { type = listOf str; };
|
||||||
|
myConfigLocation = mkOption { type = str; };
|
||||||
|
desktopFont = {
|
||||||
|
shortName = mkOption { type = str; };
|
||||||
|
fullName = mkOption { type = str; };
|
||||||
|
package = mkOption { type = package; };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# 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 = 1;
|
displayScale = 2;
|
||||||
myWallPaperPathString = "/home/${myUserName}/wallpaper.jpg";
|
myWallPaperPathString = "/home/${myUserName}/wallpaper.png";
|
||||||
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"
|
||||||
];
|
];
|
||||||
myConfigLocation = "/home/${myUserName}/nix-conf";
|
defaultApplications = {
|
||||||
|
terminal = "${pkgs.foot}/bin/footclient";
|
||||||
|
fileManager = "${pkgs.nemo}/bin/nemo";
|
||||||
|
appLauncher = ''
|
||||||
|
${pkgs.wmenu}/bin/wmenu-run -p "Launch a program..." -N ${stylixBG} -n ${stylixFG} -S ${stylixPrimaryBG}'';
|
||||||
|
};
|
||||||
|
usingMusicPlayerDaemon = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
18
deploy.sh
Normal file
18
deploy.sh
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/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,11 +3,10 @@
|
||||||
"devenv": {
|
"devenv": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "src/modules",
|
"dir": "src/modules",
|
||||||
"lastModified": 1723156315,
|
"lastModified": 1732298876,
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "devenv",
|
"repo": "devenv",
|
||||||
"rev": "ff5eb4f2accbcda963af67f1a1159e3f6c7f5f91",
|
"rev": "741e23a22f3dc9e53075be3eaa795ea9ed6f5129",
|
||||||
"treeHash": "6624b16e4203ef3eae59ce8d5d19005e04741537",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -24,7 +23,6 @@
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -45,7 +43,6 @@
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "gitignore.nix",
|
"repo": "gitignore.nix",
|
||||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -60,7 +57,6 @@
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "devenv-nixpkgs",
|
"repo": "devenv-nixpkgs",
|
||||||
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
|
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
|
||||||
"treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -72,11 +68,10 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722869614,
|
"lastModified": 1731797254,
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "883180e6550c1723395a3a342f830bfc5c371f6b",
|
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59",
|
||||||
"treeHash": "e3ce01703c0d0324121e0d3ec6336275025b4ae6",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -96,11 +91,10 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723056346,
|
"lastModified": 1732021966,
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "3c977f1c9930f54066c085305b4b2291385e7a73",
|
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
|
||||||
"treeHash": "d6f89338ffb2ca32c20bc0f8d50009e1894ab804",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
23
devenv.nix
23
devenv.nix
|
@ -1,23 +1,18 @@
|
||||||
{
|
{ 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 = {
|
||||||
alejandra.enable = true;
|
nixpkgs-fmt.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";
|
||||||
|
@ -29,18 +24,20 @@
|
||||||
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
|
||||||
alejandra --version
|
nixpkgs-fmt --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}"
|
||||||
|
|
746
flake.lock
generated
746
flake.lock
generated
File diff suppressed because it is too large
Load diff
48
flake.nix
48
flake.nix
|
@ -2,42 +2,49 @@
|
||||||
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.url = "github:nix-community/home-manager";
|
home-manager = {
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
url = "github:nix-community/home-manager";
|
||||||
|
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 = {
|
outputs = { self, nixpkgs, home-manager, stylix, spicetify-nix, ... }@inputs:
|
||||||
self,
|
let
|
||||||
nixpkgs,
|
|
||||||
home-manager,
|
|
||||||
stylix,
|
|
||||||
spicetify-nix,
|
|
||||||
...
|
|
||||||
} @ inputs: let
|
|
||||||
inherit (self) outputs;
|
inherit (self) outputs;
|
||||||
myHostName = "nixos-msi";
|
myHostName = "nixos-msi";
|
||||||
stevenUserName = "stvnliu";
|
stevenUserName = "stvnliu";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# NixOS configuration entrypoint
|
# NixOS configuration entrypoint
|
||||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
"${myHostName}" = nixpkgs.lib.nixosSystem {
|
"${myHostName}" = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = {inherit inputs outputs;};
|
specialArgs = { inherit inputs outputs; };
|
||||||
modules = [
|
modules = [
|
||||||
./nixos/configuration.nix
|
./nixos/configuration.nix
|
||||||
|
#lix-module.nixosModules.default
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -45,14 +52,17 @@
|
||||||
# Standalone home-manager configuration entrypoint
|
# Standalone home-manager configuration entrypoint
|
||||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
"${stevenUserName}@${myHostName}" = home-manager.lib.homeManagerConfiguration {
|
"${stevenUserName}@${myHostName}" =
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
home-manager.lib.homeManagerConfiguration {
|
||||||
extraSpecialArgs = {inherit inputs outputs;};
|
pkgs =
|
||||||
|
nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||||
|
extraSpecialArgs = { inherit inputs outputs; };
|
||||||
modules = [
|
modules = [
|
||||||
./home-manager/${stevenUserName}/home.nix
|
./home-manager/${stevenUserName}/home.nix
|
||||||
|
stylix.homeManagerModules.stylix
|
||||||
inputs.nixvim.homeManagerModules.nixvim
|
inputs.nixvim.homeManagerModules.nixvim
|
||||||
inputs.stylix.homeManagerModules.stylix
|
spicetify-nix.homeManagerModules.default
|
||||||
inputs.spicetify-nix.homeManagerModules.default
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
const hyprland = await Service.import("hyprland")
|
import { Workspaces } from "./hyprworkspaces.js";
|
||||||
const network = await Service.import("network")
|
import { NetworkIndicator } from "./indicators.js";
|
||||||
// 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")
|
||||||
|
@ -12,61 +13,6 @@ 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,
|
||||||
|
@ -95,27 +41,7 @@ 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]
|
||||||
|
@ -133,7 +59,7 @@ function Media() {
|
||||||
child: Widget.Label({ label }),
|
child: Widget.Label({ label }),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
function Volume() {
|
function Volume() {
|
||||||
const icons = {
|
const icons = {
|
||||||
|
@ -213,7 +139,6 @@ function Left() {
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
Workspaces(),
|
Workspaces(),
|
||||||
ClientTitle(),
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -287,15 +212,13 @@ 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: [
|
windows: bars,
|
||||||
Bar(),
|
|
||||||
|
|
||||||
// you can call it, for each monitor
|
|
||||||
// Bar(0),
|
|
||||||
// Bar(1)
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export { }
|
export { }
|
||||||
|
|
23
home-manager/stvnliu/ags/config/hyprworkspaces.js
Normal file
23
home-manager/stvnliu/ags/config/hyprworkspaces.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
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 };
|
25
home-manager/stvnliu/ags/config/indicators.js
Normal file
25
home-manager/stvnliu/ags/config/indicators.js
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
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 };
|
3
home-manager/stvnliu/ags/config/monitorWidget.js
Normal file
3
home-manager/stvnliu/ags/config/monitorWidget.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function MonitorWidget() {
|
||||||
|
|
||||||
|
}
|
17
home-manager/stvnliu/ags/config/mpris.js
Normal file
17
home-manager/stvnliu/ags/config/mpris.js
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
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,7 +1,6 @@
|
||||||
{
|
{ pkgs
|
||||||
pkgs,
|
, config
|
||||||
config,
|
, ...
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
config = {
|
config = {
|
||||||
home.file = {
|
home.file = {
|
||||||
|
@ -9,7 +8,10 @@
|
||||||
source = ./config;
|
source = ./config;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
home.packages = with pkgs; [ags];
|
home.packages = with pkgs; [
|
||||||
|
ags
|
||||||
|
brightnessctl
|
||||||
|
];
|
||||||
myAutostartCommands = [
|
myAutostartCommands = [
|
||||||
#"${pkgs.ags}/bin/ags --init"
|
#"${pkgs.ags}/bin/ags --init"
|
||||||
"${pkgs.ags}/bin/ags"
|
"${pkgs.ags}/bin/ags"
|
||||||
|
|
BIN
home-manager/stvnliu/assets/deer-wallpaper.jpg
Normal file
BIN
home-manager/stvnliu/assets/deer-wallpaper.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 166 KiB |
Binary file not shown.
Before Width: | Height: | Size: 779 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1 MiB |
BIN
home-manager/stvnliu/assets/od_neon.png
Normal file
BIN
home-manager/stvnliu/assets/od_neon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 MiB |
|
@ -1,14 +1,22 @@
|
||||||
{
|
{ 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,24 +1,11 @@
|
||||||
{
|
{ pkgs
|
||||||
pkgs,
|
, ...
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
iconTheme = {
|
iconTheme = {
|
||||||
package = pkgs.gruvbox-plus-icons;
|
package = pkgs.adwaita-icon-theme;
|
||||||
name = "Gruvbox-Plus-Dark";
|
name = "Adwaita";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
qt = {
|
|
||||||
enable = true;
|
|
||||||
platformTheme = "gtk";
|
|
||||||
style = {
|
|
||||||
package = pkgs.libsForQt5.breeze-qt5;
|
|
||||||
name = "breeze";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
libsForQt5.breeze-qt5
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
30
home-manager/stvnliu/helix-langs.nix
Normal file
30
home-manager/stvnliu/helix-langs.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{ 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,53 +1,40 @@
|
||||||
# his is your home-manager configuration file
|
{ config, pkgs, ... }: {
|
||||||
# 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 = [
|
||||||
# If you want to use home-manager modules from other flakes (such as nix-colors):
|
#./hypr
|
||||||
# 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
|
||||||
./mako.nix
|
./services
|
||||||
./wechat
|
./wechat
|
||||||
./editors.nix
|
./editors.nix
|
||||||
./gtk.nix
|
./gtk.nix
|
||||||
./ags
|
#./ags
|
||||||
./xdg.nix
|
./xdg.nix
|
||||||
./stylix.nix
|
./stylix.nix
|
||||||
./spicetify.nix
|
#./dwl
|
||||||
./scripts
|
./scripts
|
||||||
|
./programs
|
||||||
|
./packages
|
||||||
];
|
];
|
||||||
|
|
||||||
|
#services.pass-secret-service.enable = true;
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
# You can add overlays here
|
# You can add overlays here
|
||||||
overlays = [
|
overlays = [
|
||||||
# If you want to use overlays exported from other flakes:
|
(_final: prev: {
|
||||||
# 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
|
||||||
|
@ -59,96 +46,46 @@
|
||||||
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 = ./assets/nixos-wallpaper.jpg;};
|
file = { "wallpaper.jpg".source = config.myWallPaperPath; };
|
||||||
};
|
};
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
prismlauncher
|
||||||
protonvpn-gui
|
protonvpn-gui
|
||||||
devenv
|
|
||||||
vlc
|
vlc
|
||||||
tree
|
|
||||||
zed-editor
|
|
||||||
rhythmbox
|
|
||||||
clash-verge-rev
|
clash-verge-rev
|
||||||
|
rhythmbox
|
||||||
qq
|
qq
|
||||||
libreoffice
|
|
||||||
discord
|
|
||||||
#zathura
|
|
||||||
kdePackages.okular
|
|
||||||
shotwell
|
shotwell
|
||||||
mpv
|
mpv
|
||||||
kdenlive
|
kdePackages.kdenlive
|
||||||
obsidian
|
obsidian
|
||||||
pcmanfm
|
heroic
|
||||||
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 = [pkgs.obs-studio-plugins.wlrobs];
|
plugins = with pkgs.obs-studio-plugins; [ wlrobs input-overlay ];
|
||||||
};
|
};
|
||||||
home-manager.enable = true;
|
home-manager.enable = true;
|
||||||
firefox.enable = true;
|
firefox = {
|
||||||
|
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,11 +1,7 @@
|
||||||
{
|
{ ...
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
./hyprland.nix
|
./hyprland
|
||||||
./hyprpaper.nix
|
./hyprpaper.nix
|
||||||
./hypridle.nix
|
./hypridle.nix
|
||||||
./hyprlock.nix
|
./hyprlock.nix
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{pkgs, ...}: let
|
{ ... }:
|
||||||
|
let
|
||||||
timeoutSeconds = 600;
|
timeoutSeconds = 600;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
services.hypridle = {
|
services.hypridle = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
|
@ -1,93 +0,0 @@
|
||||||
{
|
|
||||||
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;};
|
|
||||||
};
|
|
||||||
# ...
|
|
||||||
}
|
|
68
home-manager/stvnliu/hypr/hyprland/binds.nix
Normal file
68
home-manager/stvnliu/hypr/hyprland/binds.nix
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
{ 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)
|
||||||
|
*/
|
||||||
|
)
|
85
home-manager/stvnliu/hypr/hyprland/default.nix
Normal file
85
home-manager/stvnliu/hypr/hyprland/default.nix
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
{ 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
|
||||||
|
};
|
||||||
|
# ...
|
||||||
|
}
|
7
home-manager/stvnliu/hypr/hyprland/hypr_autostart.nix
Normal file
7
home-manager/stvnliu/hypr/hyprland/hypr_autostart.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ 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"
|
||||||
|
]
|
16
home-manager/stvnliu/hypr/hyprland/hyprbars.nix
Normal file
16
home-manager/stvnliu/hypr/hyprland/hyprbars.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{ 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;"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
7
home-manager/stvnliu/hypr/hyprland/window_rules.nix
Normal file
7
home-manager/stvnliu/hypr/hyprland/window_rules.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
[
|
||||||
|
"workspace special silent, class:^(foot.*)$, title:autorun"
|
||||||
|
"float, title:floats"
|
||||||
|
"float, title:ncmpc"
|
||||||
|
"size 50% 50%, title:ncmpc"
|
||||||
|
"immediate, class:^(cs2)$"
|
||||||
|
]
|
11
home-manager/stvnliu/hypr/hyprland/xf86_binds.nix
Normal file
11
home-manager/stvnliu/hypr/hyprland/xf86_binds.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{ 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,10 +1,5 @@
|
||||||
{
|
{ config, lib, ... }: {
|
||||||
pkgs,
|
programs.hyprlock = lib.mkForce {
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
programs.hyprlock = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
general = {
|
general = {
|
||||||
|
@ -14,29 +9,25 @@
|
||||||
no_fade_in = false;
|
no_fade_in = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
background = [
|
background = [{
|
||||||
{
|
|
||||||
path = "screenshot";
|
path = "screenshot";
|
||||||
blur_passes = 3;
|
blur_passes = 3;
|
||||||
blur_size = 8;
|
blur_size = 8;
|
||||||
}
|
}];
|
||||||
];
|
|
||||||
|
|
||||||
input-field = [
|
input-field = [{
|
||||||
{
|
size = "400, 50";
|
||||||
size = "200, 50";
|
|
||||||
position = "0, -80";
|
position = "0, -80";
|
||||||
monitor = "";
|
monitor = "";
|
||||||
dots_center = true;
|
dots_center = true;
|
||||||
fade_on_empty = false;
|
fade_on_empty = false;
|
||||||
font_color = "rgb(202, 211, 245)";
|
font_color = "rgb(${config.lib.stylix.colors.base07})";
|
||||||
inner_color = "rgb(91, 96, 120)";
|
inner_color = "rgb(${config.lib.stylix.colors.base02})";
|
||||||
outer_color = "rgb(24, 25, 38)";
|
outer_color = "rgb(${config.lib.stylix.colors.base03})";
|
||||||
outline_thickness = 5;
|
outline_thickness = 1;
|
||||||
#placeholder_text = '\'<span foreground="##cad3f5">Password...</span>'\';
|
placeholder_text = ''<span foreground="##cad3f5">Password...</span>'';
|
||||||
shadow_passes = 2;
|
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,10 +1,9 @@
|
||||||
{
|
{ ...
|
||||||
pkgs,
|
}:
|
||||||
lib,
|
let
|
||||||
...
|
|
||||||
}: let
|
|
||||||
defaultTimeoutMillis = 5 * 1000;
|
defaultTimeoutMillis = 5 * 1000;
|
||||||
in {
|
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;
|
||||||
enableAutoSave = true;
|
settings.enabled = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{plugins.bufferline = {enable = true;};}
|
{ plugins.bufferline = { enable = true; }; }
|
||||||
|
|
|
@ -2,45 +2,49 @@
|
||||||
{
|
{
|
||||||
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 = {
|
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; };
|
||||||
|
|
||||||
|
/*
|
||||||
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
|
||||||
''
|
''
|
||||||
|
@ -100,11 +104,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";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
6
home-manager/stvnliu/nixvim/coq.nix
Normal file
6
home-manager/stvnliu/nixvim/coq.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
plugins.coq-nvim = {
|
||||||
|
enable = true;
|
||||||
|
installArtifacts = true;
|
||||||
|
};
|
||||||
|
}
|
8
home-manager/stvnliu/nixvim/custom/binds.nix
Normal file
8
home-manager/stvnliu/nixvim/custom/binds.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>ree";
|
||||||
|
action = "<CMD>RustLsp explainError<CR>";
|
||||||
|
options.desc = "Explain this Rust error (custom)";
|
||||||
|
}
|
||||||
|
]
|
|
@ -1,15 +1,12 @@
|
||||||
{
|
{ ... }: {
|
||||||
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
|
||||||
|
@ -23,13 +20,27 @@
|
||||||
./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; };
|
||||||
keymaps = [
|
performance = {
|
||||||
|
byteCompileLua.enable = true;
|
||||||
|
combinePlugins = {
|
||||||
|
enable = true;
|
||||||
|
/*standalonePlugins = [
|
||||||
|
"nvim-treesitter"
|
||||||
|
];*/
|
||||||
|
};
|
||||||
|
};
|
||||||
|
keymaps =
|
||||||
|
[
|
||||||
# Global
|
# Global
|
||||||
# Default mode is "" which means normal-visual-op
|
# Default mode is "" which means normal-visual-op
|
||||||
{
|
{
|
||||||
|
@ -149,5 +160,6 @@
|
||||||
action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
|
action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
|
||||||
options.desc = "Start standalone rust-analyzer";
|
options.desc = "Start standalone rust-analyzer";
|
||||||
}
|
}
|
||||||
];
|
]
|
||||||
|
++ (import ./custom/binds.nix);
|
||||||
}
|
}
|
||||||
|
|
3
home-manager/stvnliu/nixvim/devicons.nix
Normal file
3
home-manager/stvnliu/nixvim/devicons.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
plugins.web-devicons.enable = true;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
{pkgs, ...}: {
|
{ pkgs, ... }: {
|
||||||
extraPlugins = with pkgs.vimPlugins; [
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
Ionide-vim
|
Ionide-vim
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,20 +1,51 @@
|
||||||
{
|
{ ... }: {
|
||||||
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;
|
||||||
bashls.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;
|
clangd.enable = true;
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
bashls.enable = true;
|
||||||
fsautocomplete.enable = true;
|
fsautocomplete.enable = true;
|
||||||
gopls.enable = true;
|
gopls.enable = true;
|
||||||
nil_ls.enable = true;
|
|
||||||
#nixd.enable = true;
|
#nushell.enable = true;
|
||||||
rust-analyzer = {
|
|
||||||
|
# For Nix
|
||||||
|
#nil_ls.enable = true;
|
||||||
|
nixd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
installRustc = true;
|
extraOptions = {
|
||||||
|
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";
|
||||||
|
@ -24,10 +55,12 @@
|
||||||
"K" = "hover";
|
"K" = "hover";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
lsp-lines = {
|
#lsp-lines.enable = true;
|
||||||
enable = true;
|
|
||||||
currentLine = true;
|
#rustaceanvim = {
|
||||||
};
|
# enable = true;
|
||||||
rust-tools.enable = true;
|
# # rust-tools.enable = true;
|
||||||
|
#};
|
||||||
};
|
};
|
||||||
|
diagnostics.virtual_lines.only_current_line = true;
|
||||||
}
|
}
|
||||||
|
|
12
home-manager/stvnliu/nixvim/lspkind.nix
Normal file
12
home-manager/stvnliu/nixvim/lspkind.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
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 = false;
|
relativenumber = true;
|
||||||
|
|
||||||
autoindent = true;
|
autoindent = true;
|
||||||
clipboard = "unnamedplus";
|
clipboard = "unnamedplus";
|
||||||
|
|
22
home-manager/stvnliu/nixvim/tagbar.nix
Normal file
22
home-manager/stvnliu/nixvim/tagbar.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ 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,10 +1,11 @@
|
||||||
{
|
{ 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
|
||||||
indent = true;
|
settings.indent.enable = true;
|
||||||
|
grammarPackages = pkgs.vimPlugins.nvim-treesitter.passthru.allGrammars;
|
||||||
};
|
};
|
||||||
treesitter-context.enable = true;
|
treesitter-context.enable = true;
|
||||||
rainbow-delimiters.enable = true;
|
rainbow-delimiters.enable = true;
|
||||||
|
|
6
home-manager/stvnliu/nixvim/twilight.nix
Normal file
6
home-manager/stvnliu/nixvim/twilight.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ ... }: {
|
||||||
|
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 = [ ":" "/" "?" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
6
home-manager/stvnliu/nixvim/wrapping.nix
Normal file
6
home-manager/stvnliu/nixvim/wrapping.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
plugins.wrapping = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
13
home-manager/stvnliu/packages/default.nix
Normal file
13
home-manager/stvnliu/packages/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ ...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
./util-programs.nix
|
||||||
|
./office-programs.nix
|
||||||
|
./discord.nix
|
||||||
|
./wayland-utils.nix
|
||||||
|
./pentesting.nix
|
||||||
|
./dev.nix
|
||||||
|
./gaming.nix
|
||||||
|
./hypr.nix
|
||||||
|
];
|
||||||
|
}
|
9
home-manager/stvnliu/packages/dev.nix
Normal file
9
home-manager/stvnliu/packages/dev.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{ pkgs
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
wget
|
||||||
|
vscodium-fhs
|
||||||
|
devenv
|
||||||
|
];
|
||||||
|
}
|
13
home-manager/stvnliu/packages/discord.nix
Normal file
13
home-manager/stvnliu/packages/discord.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ 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";
|
||||||
|
};*/
|
||||||
|
}
|
4
home-manager/stvnliu/packages/gaming.nix
Normal file
4
home-manager/stvnliu/packages/gaming.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [ bottles zeroad ];
|
||||||
|
}
|
4
home-manager/stvnliu/packages/hypr.nix
Normal file
4
home-manager/stvnliu/packages/hypr.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = [ inputs.hyprswitch.packages.x86_64-linux.default ];
|
||||||
|
}
|
13
home-manager/stvnliu/packages/office-programs.nix
Normal file
13
home-manager/stvnliu/packages/office-programs.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ pkgs
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
libreoffice
|
||||||
|
kdePackages.okular
|
||||||
|
evolution
|
||||||
|
evolution-ews
|
||||||
|
# proton mail
|
||||||
|
protonmail-bridge
|
||||||
|
protonmail-bridge-gui
|
||||||
|
];
|
||||||
|
}
|
9
home-manager/stvnliu/packages/pentesting.nix
Normal file
9
home-manager/stvnliu/packages/pentesting.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{ pkgs
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
openvpn
|
||||||
|
inetutils
|
||||||
|
nmap
|
||||||
|
];
|
||||||
|
}
|
21
home-manager/stvnliu/packages/util-programs.nix
Normal file
21
home-manager/stvnliu/packages/util-programs.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ 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
|
||||||
|
];
|
||||||
|
}
|
4
home-manager/stvnliu/packages/vscodium.nix
Normal file
4
home-manager/stvnliu/packages/vscodium.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
home.packages = with pkgs; [ vscodium-fhs ];
|
||||||
|
xdg.desktopEntries.codium = { };
|
||||||
|
}
|
5
home-manager/stvnliu/packages/wayland-utils.nix
Normal file
5
home-manager/stvnliu/packages/wayland-utils.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{ pkgs
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
home.packages = with pkgs; [ wl-clipboard ];
|
||||||
|
}
|
10
home-manager/stvnliu/programs/default.nix
Normal file
10
home-manager/stvnliu/programs/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{ ...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
./git.nix
|
||||||
|
./rofi.nix
|
||||||
|
./tmux.nix
|
||||||
|
./foot.nix
|
||||||
|
#./walker.nix
|
||||||
|
];
|
||||||
|
}
|
15
home-manager/stvnliu/programs/foot.nix
Normal file
15
home-manager/stvnliu/programs/foot.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ lib
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
programs.foot = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
main = {
|
||||||
|
term = "xterm-256color";
|
||||||
|
dpi-aware = lib.mkForce "no";
|
||||||
|
};
|
||||||
|
mouse = { hide-when-typing = "yes"; };
|
||||||
|
};
|
||||||
|
server.enable = true;
|
||||||
|
};
|
||||||
|
}
|
13
home-manager/stvnliu/programs/git.nix
Normal file
13
home-manager/stvnliu/programs/git.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ pkgs
|
||||||
|
, config
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
lfs.enable = true;
|
||||||
|
package = pkgs.gitFull;
|
||||||
|
userName = config.myDisplayName;
|
||||||
|
userEmail = config.myEmail;
|
||||||
|
extraConfig = import ./git_config.nix;
|
||||||
|
};
|
||||||
|
}
|
13
home-manager/stvnliu/programs/git_config.nix
Normal file
13
home-manager/stvnliu/programs/git_config.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
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";
|
||||||
|
}
|
6
home-manager/stvnliu/programs/rofi.nix
Normal file
6
home-manager/stvnliu/programs/rofi.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ ...
|
||||||
|
}: {
|
||||||
|
programs.rofi = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
18
home-manager/stvnliu/programs/tmux.nix
Normal file
18
home-manager/stvnliu/programs/tmux.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ 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'";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
18
home-manager/stvnliu/programs/walker.nix
Normal file
18
home-manager/stvnliu/programs/walker.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ 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,7 +1,16 @@
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, ...
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
home.packages = [(import ./heic-to-jpg.script.nix {inherit pkgs;})];
|
home.packages = [
|
||||||
|
(import ./heic-to-jpg.script.nix { inherit pkgs; })
|
||||||
|
(import ./tmux-default.script.nix {
|
||||||
|
inherit pkgs;
|
||||||
|
inherit config;
|
||||||
|
})
|
||||||
|
(import ./git-check.script.nix {
|
||||||
|
inherit pkgs;
|
||||||
|
inherit config;
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
52
home-manager/stvnliu/scripts/git-check.script.nix
Normal file
52
home-manager/stvnliu/scripts/git-check.script.nix
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
{ 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"
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
{ pkgs, }:
|
||||||
|
let
|
||||||
|
# browserPath = lib.getExe config.programs.firefox.package;
|
||||||
|
# dmenuPath = lib.getExe pkgs.wmenu;
|
||||||
|
in
|
||||||
|
pkgs.writeShellScriptBin "urlmenu" ''
|
||||||
|
#!${pkgs.bash}/bin/bash
|
||||||
|
''
|
19
home-manager/stvnliu/scripts/tmux-default.script.nix
Normal file
19
home-manager/stvnliu/scripts/tmux-default.script.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ 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}
|
||||||
|
''
|
10
home-manager/stvnliu/services/default.nix
Normal file
10
home-manager/stvnliu/services/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{ ...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
./swaync.nix
|
||||||
|
./mpd.nix
|
||||||
|
|
||||||
|
# DEPRECATED due to switch to KDE
|
||||||
|
#./waybar.nix
|
||||||
|
];
|
||||||
|
}
|
18
home-manager/stvnliu/services/mpd.nix
Normal file
18
home-manager/stvnliu/services/mpd.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ 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; };
|
||||||
|
};
|
||||||
|
}
|
6
home-manager/stvnliu/services/swaync.nix
Normal file
6
home-manager/stvnliu/services/swaync.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ ...
|
||||||
|
}: {
|
||||||
|
services.swaync = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
8
home-manager/stvnliu/services/waybar.nix
Normal file
8
home-manager/stvnliu/services/waybar.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ ... }: {
|
||||||
|
programs.waybar = {
|
||||||
|
enable = true;
|
||||||
|
systemd = { enable = true; };
|
||||||
|
style = "${import ./waybar_style.nix { }}";
|
||||||
|
settings = import ./waybar_config.nix;
|
||||||
|
};
|
||||||
|
}
|
117
home-manager/stvnliu/services/waybar_config.nix
Normal file
117
home-manager/stvnliu/services/waybar_config.nix
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
{
|
||||||
|
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"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
}
|
4
home-manager/stvnliu/services/waybar_style.nix
Normal file
4
home-manager/stvnliu/services/waybar_style.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{ ... }: ''
|
||||||
|
* {
|
||||||
|
font-family: JetBrainsMono Nerd Font;
|
||||||
|
}''
|
|
@ -1,10 +1,14 @@
|
||||||
{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,30 +1,28 @@
|
||||||
{
|
{ lib
|
||||||
pkgs,
|
, config
|
||||||
lib,
|
, ...
|
||||||
config,
|
}:
|
||||||
...
|
with lib; {
|
||||||
}: let
|
|
||||||
cfg = config.myShells;
|
|
||||||
in
|
|
||||||
with lib; {
|
|
||||||
imports = [
|
imports = [
|
||||||
./zsh.nix
|
./zsh.nix
|
||||||
./fish
|
./fish
|
||||||
|
./nushell
|
||||||
./zoxide.nix
|
./zoxide.nix
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./starship
|
./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 = {
|
config = {
|
||||||
myShells = {
|
myShells = {
|
||||||
zsh.enable = false;
|
zsh.enable = false;
|
||||||
fish.enable = true;
|
fish.enable = true;
|
||||||
defaultShell = "fish";
|
#nushell.enable = true;
|
||||||
|
defaultShell = "${config.programs.fish.package}/bin/fish";
|
||||||
prompts.starship.enable = true;
|
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
Normal file
4
home-manager/stvnliu/shells/env/default.nix
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{ ...
|
||||||
|
}: {
|
||||||
|
EDITOR = "nvim";
|
||||||
|
}
|
|
@ -1,14 +1,14 @@
|
||||||
{
|
{ pkgs
|
||||||
pkgs,
|
, config
|
||||||
config,
|
, lib
|
||||||
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 {
|
config = mkIf cfg.enable {
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
|
@ -16,12 +16,16 @@ in
|
||||||
shellInit = ''
|
shellInit = ''
|
||||||
${builtins.readFile ./init/zoxide.fish}
|
${builtins.readFile ./init/zoxide.fish}
|
||||||
${builtins.readFile ./init/nh.fish}
|
${builtins.readFile ./init/nh.fish}
|
||||||
|
${builtins.readFile ./init/tailscale.fish}
|
||||||
|
${builtins.readFile ./init/pass.fish}
|
||||||
function fish_greeting
|
function fish_greeting
|
||||||
${pkgs.fortune}/bin/fortune -a
|
${(pkgs.fortune.override {withOffensive = true;})}/bin/fortune -as | ${pkgs.cowsay}/bin/cowsay | ${pkgs.lolcat}/bin/lolcat
|
||||||
end
|
end
|
||||||
funcsave -q fish_greeting
|
funcsave -q fish_greeting
|
||||||
|
|
||||||
|
${pkgs.thefuck}/bin/thefuck --alias | source
|
||||||
'';
|
'';
|
||||||
shellAliases = import ../aliases {inherit pkgs;};
|
shellAliases = import ../aliases { inherit pkgs; };
|
||||||
plugins = with pkgs.fishPlugins; [
|
plugins = with pkgs.fishPlugins; [
|
||||||
{
|
{
|
||||||
name = "z";
|
name = "z";
|
||||||
|
@ -58,4 +62,4 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
116
home-manager/stvnliu/shells/fish/init/pass.fish
Normal file
116
home-manager/stvnliu/shells/fish/init/pass.fish
Normal file
|
@ -0,0 +1,116 @@
|
||||||
|
|
||||||
|
# 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)'
|
248
home-manager/stvnliu/shells/fish/init/tailscale.fish
Normal file
248
home-manager/stvnliu/shells/fish/init/tailscale.fish
Normal file
|
@ -0,0 +1,248 @@
|
||||||
|
# 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'
|
26
home-manager/stvnliu/shells/nushell/default.nix
Normal file
26
home-manager/stvnliu/shells/nushell/default.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
15
home-manager/stvnliu/shells/nushell/init/config.nu
Normal file
15
home-manager/stvnliu/shells/nushell/init/config.nu
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
$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,12 +1,11 @@
|
||||||
{
|
{ lib
|
||||||
lib,
|
, config
|
||||||
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 {
|
||||||
|
@ -15,11 +14,13 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
myShells.prompts.starship.confPath = ./presets/pure-direnv.toml;
|
||||||
programs.starship = {
|
programs.starship = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableZshIntegration = config.myShells.zsh.enable;
|
enableZshIntegration = config.myShells.zsh.enable;
|
||||||
enableFishIntegration = config.myShells.fish.enable;
|
enableFishIntegration = config.myShells.fish.enable;
|
||||||
|
enableNushellIntegration = config.myShells.nushell.enable;
|
||||||
settings = builtins.fromTOML (builtins.readFile cfg.confPath);
|
settings = builtins.fromTOML (builtins.readFile cfg.confPath);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
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,8 +1,5 @@
|
||||||
{
|
{ config
|
||||||
pkgs,
|
, ...
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
programs.zoxide = {
|
programs.zoxide = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
{
|
{ pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, config
|
||||||
config,
|
, ...
|
||||||
...
|
}:
|
||||||
}: let
|
with lib; {
|
||||||
cfg = config.shell.zsh;
|
|
||||||
in
|
|
||||||
with lib; {
|
|
||||||
options.myShells.zsh = {
|
options.myShells.zsh = {
|
||||||
enable = mkEnableOption "Enables zsh and components.";
|
enable = mkEnableOption "Enables zsh and components.";
|
||||||
};
|
};
|
||||||
|
@ -14,7 +11,7 @@ in
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
syntaxHighlighting.enable = true;
|
syntaxHighlighting.enable = true;
|
||||||
shellAliases = import ./aliases {inherit pkgs;};
|
shellAliases = import ./aliases { inherit pkgs; };
|
||||||
dirHashes = {
|
dirHashes = {
|
||||||
docs = "$HOME/Documents";
|
docs = "$HOME/Documents";
|
||||||
dl = "$HOME/Downloads";
|
dl = "$HOME/Downloads";
|
||||||
|
@ -31,6 +28,6 @@ in
|
||||||
theme = "agnoster";
|
theme = "agnoster";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
home.packages = with pkgs; [zoxide];
|
home.packages = with pkgs; [ zoxide ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
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,17 +1,35 @@
|
||||||
{pkgs, ...}: {
|
{ pkgs
|
||||||
|
, config
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
globalOpacity = 0.75;
|
||||||
|
in
|
||||||
|
{
|
||||||
stylix = {
|
stylix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml";
|
autoEnable = true;
|
||||||
image = ./assets/nixos-wallpaper.jpg;
|
base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark-dark.yaml";
|
||||||
|
image = config.myWallPaperPath;
|
||||||
fonts = {
|
fonts = {
|
||||||
sansSerif = {
|
/*sansSerif = {
|
||||||
name = "Aileron";
|
name = "Helvetica Neue LT Std";
|
||||||
package = pkgs.aileron;
|
package = pkgs.helvetica-neue-lt-std;
|
||||||
};
|
};*/
|
||||||
monospace = {
|
monospace = {
|
||||||
name = "BlexMono Nerd Font";
|
name = config.desktopFont.fullName;
|
||||||
package = pkgs.nerdfonts.override {fonts = ["IBMPlexMono"];};
|
package = config.desktopFont.package;
|
||||||
};
|
};
|
||||||
|
sizes = {
|
||||||
|
terminal = 16;
|
||||||
|
applications = 12;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
opacity = {
|
||||||
|
applications = globalOpacity;
|
||||||
|
desktop = globalOpacity;
|
||||||
|
popups = globalOpacity;
|
||||||
|
terminal = globalOpacity;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
wayland.windowManager.sway = {
|
|
||||||
enable = true;
|
|
||||||
config = rec {
|
|
||||||
modifier = "Mod4";
|
|
||||||
terminal = "${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=24' zsh";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
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