Compare commits
141 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 |
|||
5558d0d761 |
133 changed files with 4168 additions and 1322 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
|
28
README.md
28
README.md
|
@ -1,19 +1,29 @@
|
|||
# My NixOS configuration
|
||||
|
||||
- system: `"x86_64-linux"`
|
||||
- host os: `Linux 6.6.44, NixOS, 24.11 (Vicuna), 24.11.20240804.cb9a96f`
|
||||
- multi-user?: `yes`
|
||||
- sandbox: `yes`
|
||||
- version: `nix-env (Nix) 2.18.5`
|
||||
- channels(root): `"nixos"`
|
||||
- nixpkgs: `/nix/store/4cpakzyvfw1rmm9v5i3387x6jd2h1v86-source`
|
||||
- system: `"x86_64-linux"`
|
||||
- host os: `Linux 6.12.2-zen1, NixOS, 25.05 (Warbler), 25.05.20241229.88195a9`
|
||||
- multi-user?: `yes`
|
||||
- sandbox: `yes`
|
||||
- version: `nix-env (Nix) 2.24.11`
|
||||
- channels(root): `"nixos"`
|
||||
- nixpkgs: `/nix/store/8vz84mqgnm1gz5yk7hgnnb5gir5hjxas-source`
|
||||
|
||||
## Installation
|
||||
|
||||
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
|
||||
|
|
|
@ -1,35 +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
|
||||
options = with lib;
|
||||
with types; {
|
||||
myUserName = mkOption {type = str;};
|
||||
myHostName = mkOption {type = str;};
|
||||
myWallPaperPathString = mkOption {type = str;};
|
||||
myDisplayName = mkOption {type = str;};
|
||||
myEmail = mkOption {type = str;};
|
||||
displayScale = mkOption {type = int;};
|
||||
myAutostartCommands = mkOption {type = listOf str;};
|
||||
myConfigLocation = mkOption {type = str;};
|
||||
};
|
||||
with types; {
|
||||
usingMusicPlayerDaemon = mkOption { type = bool; };
|
||||
defaultApplications = {
|
||||
fileManager = mkOption { type = str; };
|
||||
appLauncher = mkOption { type = str; };
|
||||
terminal = mkOption { type = str; };
|
||||
};
|
||||
myWallPaperPath = mkOption { type = path; };
|
||||
myUserName = mkOption { type = str; };
|
||||
myHostName = mkOption { type = str; };
|
||||
myWallPaperPathString = mkOption { type = str; };
|
||||
myDisplayName = mkOption { type = str; };
|
||||
myEmail = mkOption { type = str; };
|
||||
displayScale = mkOption { type = int; };
|
||||
myAutostartCommands = mkOption { type = listOf str; };
|
||||
myConfigLocation = mkOption { type = str; };
|
||||
desktopFont = {
|
||||
shortName = mkOption { type = str; };
|
||||
fullName = mkOption { type = str; };
|
||||
package = mkOption { type = package; };
|
||||
};
|
||||
};
|
||||
|
||||
# Default values for this configuration
|
||||
config = rec {
|
||||
myUserName = "stvnliu";
|
||||
myWallPaperPath = ../home-manager/${myUserName}/assets/od_neon.png;
|
||||
myHostName = "nixos-msi";
|
||||
displayScale = 2;
|
||||
myWallPaperPathString = "/home/${myUserName}/wallpaper.jpg";
|
||||
myWallPaperPathString = "/home/${myUserName}/wallpaper.png";
|
||||
myDisplayName = "Zhongheng Liu";
|
||||
myEmail = "z.liu@outlook.com.gr";
|
||||
/* specialisation."powersave".configuration = {
|
||||
myAutostartCommands =
|
||||
[ "${pkgs.brightnessctl}/bin/brightnessctl s ${monitorMinBrightness}" ];
|
||||
};
|
||||
*/
|
||||
myConfigLocation =
|
||||
"/home/${myUserName}/Development/Nix/nixos-configuration";
|
||||
desktopFont = {
|
||||
shortName = "0xProto Nerd Font";
|
||||
fullName = "${desktopFont.shortName}:style=Regular";
|
||||
package = pkgs.nerd-fonts._0xproto;
|
||||
};
|
||||
myAutostartCommands = [
|
||||
"${pkgs.brightnessctl}/bin/brightnessctl s ${monitorMaxBrightness}"
|
||||
"fcitx5"
|
||||
# "${pkgs.foot}/bin/foot --server -f \"${desktopFontFullName}:size=12\" -o colors.alpha=0.85"
|
||||
"${pkgs.udiskie}/bin/udiskie"
|
||||
"${pkgs.pa-notify}/bin/pa-notify"
|
||||
"${pkgs.networkmanagerapplet}/bin/nm-applet"
|
||||
];
|
||||
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": {
|
||||
"locked": {
|
||||
"dir": "src/modules",
|
||||
"lastModified": 1723156315,
|
||||
"lastModified": 1732298876,
|
||||
"owner": "cachix",
|
||||
"repo": "devenv",
|
||||
"rev": "ff5eb4f2accbcda963af67f1a1159e3f6c7f5f91",
|
||||
"treeHash": "6624b16e4203ef3eae59ce8d5d19005e04741537",
|
||||
"rev": "741e23a22f3dc9e53075be3eaa795ea9ed6f5129",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -24,7 +23,6 @@
|
|||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -45,7 +43,6 @@
|
|||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -60,7 +57,6 @@
|
|||
"owner": "cachix",
|
||||
"repo": "devenv-nixpkgs",
|
||||
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
|
||||
"treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -72,11 +68,10 @@
|
|||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1722869614,
|
||||
"lastModified": 1731797254,
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "883180e6550c1723395a3a342f830bfc5c371f6b",
|
||||
"treeHash": "e3ce01703c0d0324121e0d3ec6336275025b4ae6",
|
||||
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -96,11 +91,10 @@
|
|||
"nixpkgs-stable": "nixpkgs-stable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1723056346,
|
||||
"lastModified": 1732021966,
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "3c977f1c9930f54066c085305b4b2291385e7a73",
|
||||
"treeHash": "d6f89338ffb2ca32c20bc0f8d50009e1894ab804",
|
||||
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
23
devenv.nix
23
devenv.nix
|
@ -1,23 +1,18 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
{ pkgs, ... }: {
|
||||
# https://devenv.sh/basics/
|
||||
env.GREET = "devenv";
|
||||
cachix.enable = false;
|
||||
# https://devenv.sh/packages/
|
||||
packages = [pkgs.git];
|
||||
packages = [ pkgs.git ];
|
||||
|
||||
# https://devenv.sh/languages/
|
||||
# languages.rust.enable = true;
|
||||
languages.nix.enable = true;
|
||||
pre-commit.hooks = {
|
||||
alejandra.enable = true;
|
||||
nixpkgs-fmt.enable = true;
|
||||
shellcheck.enable = true;
|
||||
commitizen.enable = true;
|
||||
deadnix.enable = true;
|
||||
};
|
||||
# https://devenv.sh/processes/
|
||||
# processes.cargo-watch.exec = "cargo-watch";
|
||||
|
@ -29,18 +24,20 @@
|
|||
scripts.hello.exec = ''
|
||||
echo hello from $GREET
|
||||
'';
|
||||
scripts.about.exec = ''
|
||||
${pkgs.glow}/bin/glow -p ./README.md
|
||||
less ./LICENSE
|
||||
'';
|
||||
|
||||
enterShell = ''
|
||||
hello
|
||||
git --version
|
||||
alejandra --version
|
||||
nixpkgs-fmt --version
|
||||
'';
|
||||
|
||||
# https://devenv.sh/tests/
|
||||
enterTest =
|
||||
/*
|
||||
shell
|
||||
*/
|
||||
# shell
|
||||
''
|
||||
echo "Running tests"
|
||||
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
86
flake.nix
86
flake.nix
|
@ -2,59 +2,69 @@
|
|||
description = "Your new nix config";
|
||||
|
||||
inputs = {
|
||||
hyprswitch.url = "github:h3rmt/hyprswitch/release";
|
||||
# Nixpkgs
|
||||
nixpkgs-master.url = "github:nixos/nixpkgs/master";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||
nixvim = {
|
||||
url = "github:nix-community/nixvim";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# Home manager
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
stylix.url = "github:danth/stylix";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
/* lix-module = {
|
||||
url =
|
||||
"https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
*/
|
||||
stylix = { url = "github:danth/stylix"; };
|
||||
spicetify-nix = {
|
||||
url = "github:Gerg-L/spicetify-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
hyprland-qtutils.url = "github:hyprwm/hyprland-qtutils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
stylix,
|
||||
spicetify-nix,
|
||||
...
|
||||
} @ inputs: let
|
||||
inherit (self) outputs;
|
||||
myHostName = "nixos-msi";
|
||||
stevenUserName = "stvnliu";
|
||||
in {
|
||||
# NixOS configuration entrypoint
|
||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||
nixosConfigurations = {
|
||||
"${myHostName}" = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
modules = [
|
||||
./nixos/configuration.nix
|
||||
];
|
||||
outputs = { self, nixpkgs, home-manager, stylix, spicetify-nix, ... }@inputs:
|
||||
let
|
||||
inherit (self) outputs;
|
||||
myHostName = "nixos-msi";
|
||||
stevenUserName = "stvnliu";
|
||||
in
|
||||
{
|
||||
# NixOS configuration entrypoint
|
||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||
nixosConfigurations = {
|
||||
"${myHostName}" = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs outputs; };
|
||||
modules = [
|
||||
./nixos/configuration.nix
|
||||
#lix-module.nixosModules.default
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Standalone home-manager configuration entrypoint
|
||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||
homeConfigurations = {
|
||||
"${stevenUserName}@${myHostName}" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = {inherit inputs outputs;};
|
||||
modules = [
|
||||
./home-manager/${stevenUserName}/home.nix
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
inputs.stylix.homeManagerModules.stylix
|
||||
inputs.spicetify-nix.homeManagerModules.default
|
||||
];
|
||||
# Standalone home-manager configuration entrypoint
|
||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||
homeConfigurations = {
|
||||
"${stevenUserName}@${myHostName}" =
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
pkgs =
|
||||
nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = { inherit inputs outputs; };
|
||||
modules = [
|
||||
./home-manager/${stevenUserName}/home.nix
|
||||
stylix.homeManagerModules.stylix
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
spicetify-nix.homeManagerModules.default
|
||||
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
const hyprland = await Service.import("hyprland")
|
||||
const network = await Service.import("network")
|
||||
import { Workspaces } from "./hyprworkspaces.js";
|
||||
import { NetworkIndicator } from "./indicators.js";
|
||||
// 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 battery = await Service.import("battery")
|
||||
const systemtray = await Service.import("systemtray")
|
||||
|
@ -12,61 +13,6 @@ const date = Variable("", {
|
|||
// widgets can be only assigned as a child in one container
|
||||
// so to make a reuseable widget, make it a function
|
||||
// then you can simply instantiate one by calling it
|
||||
const focusedTitle = Widget.Label({
|
||||
label: hyprland.active.client.bind('title'),
|
||||
visible: hyprland.active.client.bind('address')
|
||||
.as(addr => addr !== "0x"),
|
||||
})
|
||||
|
||||
const dispatch = ws => hyprland.messageAsync(`dispatch workspace ${ws}`);
|
||||
|
||||
const Workspaces = () => Widget.EventBox({
|
||||
onScrollUp: () => dispatch('+1'),
|
||||
onScrollDown: () => dispatch('-1'),
|
||||
child: Widget.Box({
|
||||
children: Array.from({ length: 10 }, (_, i) => i + 1).map(i => Widget.Button({
|
||||
attribute: i,
|
||||
label: `${i}`,
|
||||
onClicked: () => dispatch(i),
|
||||
|
||||
class_name: i === hyprland.active.workspace.id ? "focused" : ""
|
||||
})),
|
||||
|
||||
// remove this setup hook if you want fixed number of buttons
|
||||
setup: self => self.hook(hyprland, () => self.children.forEach(btn => {
|
||||
btn.visible = hyprland.workspaces.some(ws => ws.id === btn.attribute);
|
||||
})),
|
||||
}),
|
||||
})
|
||||
function ClientTitle() {
|
||||
return Widget.Label({
|
||||
class_name: "client-title",
|
||||
label: hyprland.active.client.bind("title").as(title => title.length <= 30 ? title : `${title.substring(0, 29)}...`),
|
||||
})
|
||||
}
|
||||
const WifiIndicator = () => Widget.Box({
|
||||
children: [
|
||||
Widget.Icon({
|
||||
icon: network.wifi.bind('icon_name'),
|
||||
}),
|
||||
Widget.Label({
|
||||
label: network.wifi.bind('ssid')
|
||||
.as(ssid => ssid || 'Unknown'),
|
||||
}),
|
||||
],
|
||||
})
|
||||
|
||||
const WiredIndicator = () => Widget.Icon({
|
||||
icon: network.wired.bind('icon_name'),
|
||||
})
|
||||
|
||||
const NetworkIndicator = () => Widget.Stack({
|
||||
children: {
|
||||
wifi: WifiIndicator(),
|
||||
wired: WiredIndicator(),
|
||||
},
|
||||
shown: network.bind('primary').as(p => p || 'wifi'),
|
||||
})
|
||||
function Clock() {
|
||||
const calendar = Widget.Calendar({
|
||||
showDayNames: true,
|
||||
|
@ -95,27 +41,7 @@ function Clock() {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
// 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() {
|
||||
/* function Media() {
|
||||
const label = Utils.watch("", mpris, "player-changed", () => {
|
||||
if (mpris.players[0]) {
|
||||
const { track_artists, track_title } = mpris.players[0]
|
||||
|
@ -133,7 +59,7 @@ function Media() {
|
|||
child: Widget.Label({ label }),
|
||||
})
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
function Volume() {
|
||||
const icons = {
|
||||
|
@ -213,7 +139,6 @@ function Left() {
|
|||
spacing: 8,
|
||||
children: [
|
||||
Workspaces(),
|
||||
ClientTitle(),
|
||||
],
|
||||
})
|
||||
}
|
||||
|
@ -287,15 +212,13 @@ const cpuProgress = Widget.Label({
|
|||
const ramProgress = Widget.Label({
|
||||
label: ram.bind().as(usage => `${(usage * 100).toPrecision(4)}%`)
|
||||
})
|
||||
|
||||
const bars = hyprland.monitors.map((value, _index, _arr) => {
|
||||
return Bar(value.id);
|
||||
})
|
||||
App.config({
|
||||
style: "./style.css",
|
||||
windows: [
|
||||
Bar(),
|
||||
|
||||
// you can call it, for each monitor
|
||||
// Bar(0),
|
||||
// Bar(1)
|
||||
],
|
||||
windows: bars,
|
||||
})
|
||||
|
||||
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,
|
||||
config,
|
||||
...
|
||||
{ pkgs
|
||||
, config
|
||||
, ...
|
||||
}: {
|
||||
config = {
|
||||
home.file = {
|
||||
|
@ -9,7 +8,10 @@
|
|||
source = ./config;
|
||||
};
|
||||
};
|
||||
home.packages = with pkgs; [ags];
|
||||
home.packages = with pkgs; [
|
||||
ags
|
||||
brightnessctl
|
||||
];
|
||||
myAutostartCommands = [
|
||||
#"${pkgs.ags}/bin/ags --init"
|
||||
"${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 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
#./vscode.nix
|
||||
#./intellij.nix
|
||||
];
|
||||
{ pkgs, ... }: {
|
||||
programs.nixvim = import ./nixvim;
|
||||
# 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,
|
||||
config,
|
||||
...
|
||||
{ pkgs
|
||||
, ...
|
||||
}: {
|
||||
gtk = {
|
||||
enable = true;
|
||||
iconTheme = {
|
||||
package = pkgs.gruvbox-plus-icons;
|
||||
name = "Gruvbox-Plus-Dark";
|
||||
package = pkgs.adwaita-icon-theme;
|
||||
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
|
||||
# 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
|
||||
{ config, pkgs, ... }: {
|
||||
imports = [
|
||||
# If you want to use home-manager modules from other flakes (such as nix-colors):
|
||||
# inputs.nix-colors.homeManagerModule
|
||||
|
||||
# You can also split up your configuration and import pieces of it here:
|
||||
#./swaywm.nix
|
||||
./hypr
|
||||
#./hypr
|
||||
./shells
|
||||
../../common/variables.nix
|
||||
./mako.nix
|
||||
./services
|
||||
./wechat
|
||||
./editors.nix
|
||||
./gtk.nix
|
||||
./ags
|
||||
#./ags
|
||||
./xdg.nix
|
||||
./stylix.nix
|
||||
./spicetify.nix
|
||||
#./dwl
|
||||
./scripts
|
||||
./programs
|
||||
./packages
|
||||
];
|
||||
|
||||
#services.pass-secret-service.enable = true;
|
||||
nixpkgs = {
|
||||
# You can add overlays here
|
||||
overlays = [
|
||||
# If you want to use overlays exported from other flakes:
|
||||
# neovim-nightly-overlay.overlays.default
|
||||
|
||||
# Or define it inline, for example:
|
||||
# (final: prev: {
|
||||
# hi = final.hello.overrideAttrs (oldAttrs: {
|
||||
# patches = [ ./change-hello-to-hi.patch ];
|
||||
# });
|
||||
# })
|
||||
(final: prev: {
|
||||
(_final: prev: {
|
||||
ags = prev.ags.overrideAttrs (old: {
|
||||
buildInputs = old.buildInputs ++ [pkgs.libdbusmenu-gtk3];
|
||||
buildInputs = old.buildInputs ++ [ pkgs.libdbusmenu-gtk3 ];
|
||||
});
|
||||
})
|
||||
];
|
||||
# Configure your nixpkgs instance
|
||||
config = {
|
||||
cudaSupport = true;
|
||||
permittedInsecurePackages = [
|
||||
"dotnet-core-combined"
|
||||
"dotnet-sdk-6.0.428"
|
||||
"dotnet-sdk-7.0.410"
|
||||
"dotnet-sdk-wrapped-6.0.428"
|
||||
];
|
||||
# Disable if you don't want unfree packages
|
||||
allowUnfree = true;
|
||||
# Workaround for https://github.com/nix-community/home-manager/issues/2942
|
||||
|
@ -59,65 +46,42 @@
|
|||
username = "${config.myUserName}";
|
||||
homeDirectory = "/home/${config.myUserName}";
|
||||
# copy wallpaper from assets
|
||||
file = {"wallpaper.jpg".source = ./assets/nixos-wallpaper.jpg;};
|
||||
file = { "wallpaper.jpg".source = config.myWallPaperPath; };
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
prismlauncher
|
||||
protonvpn-gui
|
||||
devenv
|
||||
vlc
|
||||
tree
|
||||
zed-editor
|
||||
clash-verge-rev
|
||||
rhythmbox
|
||||
#clash-verge-rev
|
||||
qq
|
||||
libreoffice
|
||||
discord
|
||||
#zathura
|
||||
kdePackages.okular
|
||||
shotwell
|
||||
mpv
|
||||
kdenlive
|
||||
kdePackages.kdenlive
|
||||
obsidian
|
||||
pcmanfm
|
||||
udiskie
|
||||
android-file-transfer
|
||||
usbutils
|
||||
mtpfs
|
||||
teams-for-linux
|
||||
sxiv
|
||||
heroic
|
||||
];
|
||||
myAutostartCommands = [
|
||||
#"${pkgs.clash-verge-rev}/bin/clash-verge"
|
||||
"${pkgs.firefox}/bin/firefox"
|
||||
"${pkgs.thunderbird}/bin/thunderbird"
|
||||
"${pkgs.clash-verge-rev}/bin/clash-verge"
|
||||
];
|
||||
|
||||
programs = {
|
||||
obs-studio = {
|
||||
enable = true;
|
||||
plugins = [pkgs.obs-studio-plugins.wlrobs];
|
||||
plugins = with pkgs.obs-studio-plugins; [ wlrobs input-overlay ];
|
||||
};
|
||||
home-manager.enable = true;
|
||||
firefox.enable = true;
|
||||
firefox = {
|
||||
enable = true;
|
||||
package = with pkgs;
|
||||
(librewolf.override {
|
||||
nativeMessagingHosts = [ passff-host ];
|
||||
hasMozSystemDirPatch = true;
|
||||
});
|
||||
};
|
||||
thunderbird = {
|
||||
enable = 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";
|
||||
};
|
||||
profiles.default = { isDefault = true; };
|
||||
};
|
||||
};
|
||||
# Nicely reload system units when changing configs
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
{ ...
|
||||
}: {
|
||||
imports = [
|
||||
./hyprland.nix
|
||||
./hyprland
|
||||
./hyprpaper.nix
|
||||
./hypridle.nix
|
||||
./hyprlock.nix
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{pkgs, ...}: let
|
||||
{ ... }:
|
||||
let
|
||||
timeoutSeconds = 600;
|
||||
in {
|
||||
in
|
||||
{
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
@ -1,102 +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 = [
|
||||
#"eDP-1, 1920x1080@165,0x0,1"
|
||||
",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}";
|
||||
screenshotLocation = "/home/${config.myUserName}/Screenshots/$(date '+%Y-%m-%d-%H-%M-%S').png";
|
||||
in
|
||||
[
|
||||
"$mod SHIFT, L, exec, ${pkgs.hyprlock}/bin/hyprlock --immediate"
|
||||
|
||||
"$mod SHIFT, Print, exec, ${pkgs.grimblast}/bin/grimblast copysave output ${screenshotLocation}"
|
||||
"$mod, Print, exec, ${pkgs.grimblast}/bin/grimblast copysave area ${screenshotLocation}"
|
||||
", 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 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.hyprlock = {
|
||||
{ config, lib, ... }: {
|
||||
programs.hyprlock = lib.mkForce {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
|
@ -14,29 +9,25 @@
|
|||
no_fade_in = false;
|
||||
};
|
||||
|
||||
background = [
|
||||
{
|
||||
path = "screenshot";
|
||||
blur_passes = 3;
|
||||
blur_size = 8;
|
||||
}
|
||||
];
|
||||
background = [{
|
||||
path = "screenshot";
|
||||
blur_passes = 3;
|
||||
blur_size = 8;
|
||||
}];
|
||||
|
||||
input-field = [
|
||||
{
|
||||
size = "200, 50";
|
||||
position = "0, -80";
|
||||
monitor = "";
|
||||
dots_center = true;
|
||||
fade_on_empty = false;
|
||||
font_color = "rgb(202, 211, 245)";
|
||||
inner_color = "rgb(91, 96, 120)";
|
||||
outer_color = "rgb(24, 25, 38)";
|
||||
outline_thickness = 5;
|
||||
#placeholder_text = '\'<span foreground="##cad3f5">Password...</span>'\';
|
||||
shadow_passes = 2;
|
||||
}
|
||||
];
|
||||
input-field = [{
|
||||
size = "400, 50";
|
||||
position = "0, -80";
|
||||
monitor = "";
|
||||
dots_center = true;
|
||||
fade_on_empty = false;
|
||||
font_color = "rgb(${config.lib.stylix.colors.base07})";
|
||||
inner_color = "rgb(${config.lib.stylix.colors.base02})";
|
||||
outer_color = "rgb(${config.lib.stylix.colors.base03})";
|
||||
outline_thickness = 1;
|
||||
placeholder_text = ''<span foreground="##cad3f5">Password...</span>'';
|
||||
shadow_passes = 2;
|
||||
}];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
{ config
|
||||
, ...
|
||||
}: {
|
||||
services.hyprpaper = {
|
||||
enable = true;
|
||||
settings = {
|
||||
ipc = "on";
|
||||
splash = false;
|
||||
preload = [config.myWallPaperPathString];
|
||||
wallpaper = [",${config.myWallPaperPathString}"];
|
||||
preload = [ config.myWallPaperPathString ];
|
||||
wallpaper = [ ",${config.myWallPaperPathString}" ];
|
||||
#preload = [/home/stvnliu/Downloads/mao-zedong.jpg];
|
||||
#wallpaper = [",/home/stvnliu/Downloads/mao-zedong.jpg"];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
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";
|
||||
}
|
||||
];
|
||||
};
|
||||
docked_office_gr = {
|
||||
outputs = [
|
||||
{
|
||||
criteria = "HDMI-A-1";
|
||||
position = "0,0";
|
||||
mode = "1920x1080@60.00Hz";
|
||||
}
|
||||
{
|
||||
criteria = "eDP-1";
|
||||
position = "0,0";
|
||||
status = "disable";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
systemdTarget = "hyprland-session.target";
|
||||
};
|
||||
}
|
|
@ -1,10 +1,9 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
{ ...
|
||||
}:
|
||||
let
|
||||
defaultTimeoutMillis = 5 * 1000;
|
||||
in {
|
||||
in
|
||||
{
|
||||
services.mako = {
|
||||
enable = true;
|
||||
defaultTimeout = defaultTimeoutMillis;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{plugins.nvim-autopairs = {enable = true;};}
|
||||
{ plugins.nvim-autopairs = { enable = true; }; }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
plugins.auto-save = {
|
||||
enable = true;
|
||||
enableAutoSave = true;
|
||||
settings.enabled = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{plugins.bufferline = {enable = true;};}
|
||||
{ plugins.bufferline = { enable = true; }; }
|
||||
|
|
|
@ -2,45 +2,49 @@
|
|||
{
|
||||
plugins = {
|
||||
luasnip.enable = true;
|
||||
copilot-lua = {
|
||||
/*
|
||||
copilot-lua = {
|
||||
enable = true;
|
||||
suggestion.enabled = false;
|
||||
panel.enabled = false;
|
||||
};
|
||||
|
||||
cmp-buffer = {enable = true;};
|
||||
|
||||
cmp-emoji = {enable = true;};
|
||||
|
||||
cmp-nvim-lsp = {enable = true;};
|
||||
|
||||
cmp-path = {enable = true;};
|
||||
|
||||
cmp_luasnip = {enable = true;};
|
||||
|
||||
};
|
||||
*/
|
||||
cmp = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
autoEnableSources = true;
|
||||
experimental = { ghost_text = false; };
|
||||
performance = {
|
||||
debounce = 60;
|
||||
fetchingTimeout = 200;
|
||||
maxViewEntries = 30;
|
||||
};
|
||||
snippet = { expand = "luasnip"; };
|
||||
cmp-buffer = { enable = true; };
|
||||
cmp-emoji = { enable = true; };
|
||||
cmp-nvim-lsp = { enable = true; };
|
||||
cmp-path = { enable = true; };
|
||||
cmp_luasnip = { enable = true; };
|
||||
|
||||
/*
|
||||
snippet.expand = ''
|
||||
function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
'';
|
||||
*/
|
||||
sources = [
|
||||
{name = "nvim_lsp";}
|
||||
{name = "luasnip";}
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "luasnip"; }
|
||||
{
|
||||
name = "buffer";
|
||||
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
||||
}
|
||||
{name = "nvim_lua";}
|
||||
{name = "path";}
|
||||
{name = "copilot";}
|
||||
{ name = "nvim_lua"; }
|
||||
{ name = "path"; }
|
||||
];
|
||||
|
||||
formatting = {
|
||||
fields = ["abbr" "kind" "menu"];
|
||||
fields = [ "abbr" "kind" "menu" ];
|
||||
format =
|
||||
# lua
|
||||
''
|
||||
|
@ -100,11 +104,11 @@
|
|||
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
||||
scrollbar = false;
|
||||
sidePadding = 0;
|
||||
border = ["╭" "─" "╮" "│" "╯" "─" "╰" "│"];
|
||||
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
||||
};
|
||||
|
||||
settings.documentation = {
|
||||
border = ["╭" "─" "╮" "│" "╯" "─" "╰" "│"];
|
||||
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
||||
winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
||||
};
|
||||
};
|
||||
|
|
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 = [
|
||||
./auto-pairs.nix
|
||||
./autosave.nix
|
||||
./bufferline.nix
|
||||
#./bufferline.nix
|
||||
./cmp.nix
|
||||
#./coq.nix
|
||||
./git.nix
|
||||
./ionide.nix
|
||||
#./ionide.nix
|
||||
./lualine.nix
|
||||
./lsp.nix
|
||||
./none-ls.nix
|
||||
|
@ -23,131 +20,146 @@
|
|||
./which_key.nix
|
||||
./wilder.nix
|
||||
./virt-column.nix
|
||||
./devicons.nix
|
||||
./tagbar.nix
|
||||
./wrapping.nix
|
||||
./twilight.nix
|
||||
];
|
||||
enable = true;
|
||||
enableMan = true;
|
||||
defaultEditor = true;
|
||||
globals.mapleader = " ";
|
||||
colorschemes.gruvbox = {enable = true;};
|
||||
keymaps = [
|
||||
# Global
|
||||
# Default mode is "" which means normal-visual-op
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bg";
|
||||
action = "<CMD>TransparentToggle<CR>";
|
||||
options.desc = "Toggle background transparency";
|
||||
}
|
||||
{
|
||||
key = "<C-n>";
|
||||
action = "<CMD>NvimTreeToggle<CR>";
|
||||
options.desc = "Toggle NvimTree";
|
||||
}
|
||||
colorschemes.gruvbox = { enable = true; };
|
||||
performance = {
|
||||
byteCompileLua.enable = true;
|
||||
combinePlugins = {
|
||||
enable = true;
|
||||
/*standalonePlugins = [
|
||||
"nvim-treesitter"
|
||||
];*/
|
||||
};
|
||||
};
|
||||
keymaps =
|
||||
[
|
||||
# Global
|
||||
# Default mode is "" which means normal-visual-op
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bg";
|
||||
action = "<CMD>TransparentToggle<CR>";
|
||||
options.desc = "Toggle background transparency";
|
||||
}
|
||||
{
|
||||
key = "<C-n>";
|
||||
action = "<CMD>NvimTreeToggle<CR>";
|
||||
options.desc = "Toggle NvimTree";
|
||||
}
|
||||
|
||||
# File
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>f";
|
||||
action = "+find/file";
|
||||
}
|
||||
{
|
||||
# Format file
|
||||
key = "<leader>fm";
|
||||
action = "<CMD>lua vim.lsp.buf.format()<CR>";
|
||||
options.desc = "Format the current buffer";
|
||||
}
|
||||
# File
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>f";
|
||||
action = "+find/file";
|
||||
}
|
||||
{
|
||||
# Format file
|
||||
key = "<leader>fm";
|
||||
action = "<CMD>lua vim.lsp.buf.format()<CR>";
|
||||
options.desc = "Format the current buffer";
|
||||
}
|
||||
|
||||
# Git
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>g";
|
||||
action = "+git";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gt";
|
||||
action = "+toggles";
|
||||
}
|
||||
{
|
||||
key = "<leader>gtb";
|
||||
action = "<CMD>Gitsigns toggle_current_line_blame<CR>";
|
||||
options.desc = "Gitsigns current line blame";
|
||||
}
|
||||
{
|
||||
key = "<leader>gtd";
|
||||
action = "<CMD>Gitsigns toggle_deleted";
|
||||
options.desc = "Gitsigns deleted";
|
||||
}
|
||||
{
|
||||
key = "<leader>gd";
|
||||
action = "<CMD>Gitsigns diffthis<CR>";
|
||||
options.desc = "Gitsigns diff this buffer";
|
||||
}
|
||||
# Git
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>g";
|
||||
action = "+git";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gt";
|
||||
action = "+toggles";
|
||||
}
|
||||
{
|
||||
key = "<leader>gtb";
|
||||
action = "<CMD>Gitsigns toggle_current_line_blame<CR>";
|
||||
options.desc = "Gitsigns current line blame";
|
||||
}
|
||||
{
|
||||
key = "<leader>gtd";
|
||||
action = "<CMD>Gitsigns toggle_deleted";
|
||||
options.desc = "Gitsigns deleted";
|
||||
}
|
||||
{
|
||||
key = "<leader>gd";
|
||||
action = "<CMD>Gitsigns diffthis<CR>";
|
||||
options.desc = "Gitsigns diff this buffer";
|
||||
}
|
||||
|
||||
# Tabs
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>t";
|
||||
action = "+tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tn";
|
||||
action = "<CMD>tabnew<CR>";
|
||||
options.desc = "Create new tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>td";
|
||||
action = "<CMD>tabclose<CR>";
|
||||
options.desc = "Close tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ts";
|
||||
action = "<CMD>tabnext<CR>";
|
||||
options.desc = "Go to the sub-sequent tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tp";
|
||||
action = "<CMD>tabprevious<CR>";
|
||||
options.desc = "Go to the previous tab";
|
||||
}
|
||||
# Tabs
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>t";
|
||||
action = "+tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tn";
|
||||
action = "<CMD>tabnew<CR>";
|
||||
options.desc = "Create new tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>td";
|
||||
action = "<CMD>tabclose<CR>";
|
||||
options.desc = "Close tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ts";
|
||||
action = "<CMD>tabnext<CR>";
|
||||
options.desc = "Go to the sub-sequent tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>tp";
|
||||
action = "<CMD>tabprevious<CR>";
|
||||
options.desc = "Go to the previous tab";
|
||||
}
|
||||
|
||||
# Terminal
|
||||
{
|
||||
# Escape terminal mode using ESC
|
||||
mode = "t";
|
||||
key = "<esc>";
|
||||
action = "<C-\\><C-n>";
|
||||
options.desc = "Escape terminal mode";
|
||||
}
|
||||
# Terminal
|
||||
{
|
||||
# Escape terminal mode using ESC
|
||||
mode = "t";
|
||||
key = "<esc>";
|
||||
action = "<C-\\><C-n>";
|
||||
options.desc = "Escape terminal mode";
|
||||
}
|
||||
|
||||
# Trouble
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>d";
|
||||
action = "+diagnostics/debug";
|
||||
}
|
||||
{
|
||||
key = "<leader>dt";
|
||||
action = "<CMD>TroubleToggle<CR>";
|
||||
options.desc = "Toggle trouble";
|
||||
}
|
||||
# Trouble
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>d";
|
||||
action = "+diagnostics/debug";
|
||||
}
|
||||
{
|
||||
key = "<leader>dt";
|
||||
action = "<CMD>TroubleToggle<CR>";
|
||||
options.desc = "Toggle trouble";
|
||||
}
|
||||
|
||||
# Rust
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>r";
|
||||
action = "+rust";
|
||||
}
|
||||
{
|
||||
# Start standalone rust-analyzer (fixes issues when opening files from nvim tree)
|
||||
mode = "n";
|
||||
key = "<leader>rs";
|
||||
action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
|
||||
options.desc = "Start standalone rust-analyzer";
|
||||
}
|
||||
];
|
||||
# Rust
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>r";
|
||||
action = "+rust";
|
||||
}
|
||||
{
|
||||
# Start standalone rust-analyzer (fixes issues when opening files from nvim tree)
|
||||
mode = "n";
|
||||
key = "<leader>rs";
|
||||
action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
|
||||
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; [
|
||||
Ionide-vim
|
||||
];
|
||||
|
|
|
@ -1,20 +1,51 @@
|
|||
{
|
||||
{ ... }: {
|
||||
plugins = {
|
||||
lsp-signature.enable = true;
|
||||
lsp-status.enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
# For Python
|
||||
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;
|
||||
|
||||
# Misc
|
||||
bashls.enable = true;
|
||||
fsautocomplete.enable = true;
|
||||
gopls.enable = true;
|
||||
nil_ls.enable = true;
|
||||
#nixd.enable = true;
|
||||
rust-analyzer = {
|
||||
|
||||
#nushell.enable = true;
|
||||
|
||||
# For Nix
|
||||
#nil_ls.enable = true;
|
||||
nixd = {
|
||||
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 = {
|
||||
"gd" = "definition";
|
||||
|
@ -24,10 +55,12 @@
|
|||
"K" = "hover";
|
||||
};
|
||||
};
|
||||
lsp-lines = {
|
||||
enable = true;
|
||||
currentLine = true;
|
||||
};
|
||||
rust-tools.enable = true;
|
||||
#lsp-lines.enable = true;
|
||||
|
||||
#rustaceanvim = {
|
||||
# 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
|
||||
|
||||
number = true;
|
||||
relativenumber = false;
|
||||
relativenumber = true;
|
||||
|
||||
autoindent = true;
|
||||
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 = {
|
||||
treesitter = {
|
||||
enable = true;
|
||||
nixGrammars = true;
|
||||
nixvimInjections = true; # enables language injection in nixvim
|
||||
indent = true;
|
||||
settings.indent.enable = true;
|
||||
grammarPackages = pkgs.vimPlugins.nvim-treesitter.passthru.allGrammars;
|
||||
};
|
||||
treesitter-context.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 = {
|
||||
enable = true;
|
||||
settings.char = ["┃"];
|
||||
settings.char = [ "┃" ];
|
||||
settings.virtcolumn = "80";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{plugins.which-key = {enable = true;};}
|
||||
{ plugins.which-key = { enable = true; }; }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
plugins.wilder = {
|
||||
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,
|
||||
pkgs,
|
||||
...
|
||||
{ config
|
||||
, 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" ''
|
||||
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"
|
||||
|
|
|
@ -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";
|
||||
cdi = "zi";
|
||||
ls = "${pkgs.eza}/bin/exa";
|
||||
cat = "${pkgs.bat}/bin/bat";
|
||||
ls = "${pkgs.lsd}/bin/lsd";
|
||||
ll = "ls -l";
|
||||
rm = "${pkgs.trash-cli}/bin/trash";
|
||||
osupdate = "${pkgs.nh}/bin/nh os switch";
|
||||
homeupdate = "${pkgs.nh}/bin/nh home switch";
|
||||
batmon = "watch -n0 upower -i /org/freedesktop/UPower/devices/battery_BAT1";
|
||||
inception = "${pkgs.pipx}/bin/pipx run copier copy --trust gh:DataChefHQ/Inception .";
|
||||
help = "echo \"No help for u lololololololol\"";
|
||||
}
|
||||
|
|
|
@ -1,30 +1,28 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myShells;
|
||||
in
|
||||
with lib; {
|
||||
imports = [
|
||||
./zsh.nix
|
||||
./fish
|
||||
./zoxide.nix
|
||||
./direnv.nix
|
||||
./starship
|
||||
];
|
||||
{ lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
with lib; {
|
||||
imports = [
|
||||
./zsh.nix
|
||||
./fish
|
||||
./nushell
|
||||
./zoxide.nix
|
||||
./direnv.nix
|
||||
./starship
|
||||
];
|
||||
|
||||
options.myShells = {
|
||||
defaultShell = with types; mkOption {type = str;};
|
||||
enable = mkEnableOption "Enables the shell customisation module.";
|
||||
options.myShells = {
|
||||
defaultShell = with types; mkOption { type = str; };
|
||||
enable = mkEnableOption "Enables the shell customisation module.";
|
||||
};
|
||||
config = {
|
||||
myShells = {
|
||||
zsh.enable = false;
|
||||
fish.enable = true;
|
||||
#nushell.enable = true;
|
||||
defaultShell = "${config.programs.fish.package}/bin/fish";
|
||||
prompts.starship.enable = true;
|
||||
};
|
||||
config = {
|
||||
myShells = {
|
||||
zsh.enable = false;
|
||||
fish.enable = true;
|
||||
defaultShell = "fish";
|
||||
prompts.starship.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{...}: {
|
||||
{ ... }: {
|
||||
programs = {
|
||||
direnv = {
|
||||
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,62 +1,65 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
{ pkgs
|
||||
, config
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.myShells.fish;
|
||||
in
|
||||
with lib; {
|
||||
options = {
|
||||
myShells.fish = {enable = mkEnableOption "Enables fish and components.";};
|
||||
with lib; {
|
||||
options = {
|
||||
myShells.fish = { enable = mkEnableOption "Enables fish and components."; };
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
shellInit = ''
|
||||
${builtins.readFile ./init/zoxide.fish}
|
||||
${builtins.readFile ./init/nh.fish}
|
||||
${builtins.readFile ./init/tailscale.fish}
|
||||
${builtins.readFile ./init/pass.fish}
|
||||
function fish_greeting
|
||||
${(pkgs.fortune.override {withOffensive = true;})}/bin/fortune -as | ${pkgs.cowsay}/bin/cowsay | ${pkgs.lolcat}/bin/lolcat
|
||||
end
|
||||
funcsave -q fish_greeting
|
||||
|
||||
${pkgs.thefuck}/bin/thefuck --alias | source
|
||||
'';
|
||||
shellAliases = import ../aliases { inherit pkgs; };
|
||||
plugins = with pkgs.fishPlugins; [
|
||||
{
|
||||
name = "z";
|
||||
src = z.src;
|
||||
}
|
||||
{
|
||||
name = "plugin-git";
|
||||
src = plugin-git.src;
|
||||
}
|
||||
{
|
||||
name = "transient-fish";
|
||||
src = transient-fish.src;
|
||||
}
|
||||
{
|
||||
name = "done";
|
||||
src = done.src;
|
||||
}
|
||||
{
|
||||
name = "gruvbox";
|
||||
src = gruvbox.src;
|
||||
}
|
||||
{
|
||||
name = "colored-man-pages";
|
||||
src = colored-man-pages.src;
|
||||
}
|
||||
{
|
||||
name = "puffer";
|
||||
src = puffer.src;
|
||||
}
|
||||
{
|
||||
name = "pisces";
|
||||
src = pisces.src;
|
||||
}
|
||||
];
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
shellInit = ''
|
||||
${builtins.readFile ./init/zoxide.fish}
|
||||
${builtins.readFile ./init/nh.fish}
|
||||
${builtins.readFile ./init/tailscale.fish}
|
||||
function fish_greeting
|
||||
${pkgs.fortune}/bin/fortune -a
|
||||
end
|
||||
funcsave -q fish_greeting
|
||||
'';
|
||||
shellAliases = import ../aliases {inherit pkgs;};
|
||||
plugins = with pkgs.fishPlugins; [
|
||||
{
|
||||
name = "z";
|
||||
src = z.src;
|
||||
}
|
||||
{
|
||||
name = "plugin-git";
|
||||
src = plugin-git.src;
|
||||
}
|
||||
{
|
||||
name = "transient-fish";
|
||||
src = transient-fish.src;
|
||||
}
|
||||
{
|
||||
name = "done";
|
||||
src = done.src;
|
||||
}
|
||||
{
|
||||
name = "gruvbox";
|
||||
src = gruvbox.src;
|
||||
}
|
||||
{
|
||||
name = "colored-man-pages";
|
||||
src = colored-man-pages.src;
|
||||
}
|
||||
{
|
||||
name = "puffer";
|
||||
src = puffer.src;
|
||||
}
|
||||
{
|
||||
name = "pisces";
|
||||
src = pisces.src;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
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)'
|
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,25 +1,26 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
{ lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.myShells.prompts.starship;
|
||||
in
|
||||
with lib; {
|
||||
options = {
|
||||
myShells.prompts.starship.enable = mkEnableOption "Enables starship prompts.";
|
||||
myShells.prompts.starship.confPath = mkOption {
|
||||
type = types.path;
|
||||
default = ./presets/default.toml;
|
||||
};
|
||||
with lib; {
|
||||
options = {
|
||||
myShells.prompts.starship.enable = mkEnableOption "Enables starship prompts.";
|
||||
myShells.prompts.starship.confPath = mkOption {
|
||||
type = types.path;
|
||||
default = ./presets/default.toml;
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = config.myShells.zsh.enable;
|
||||
enableFishIntegration = config.myShells.fish.enable;
|
||||
settings = builtins.fromTOML (builtins.readFile cfg.confPath);
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
myShells.prompts.starship.confPath = ./presets/pure-direnv.toml;
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = config.myShells.zsh.enable;
|
||||
enableFishIntegration = config.myShells.fish.enable;
|
||||
enableNushellIntegration = config.myShells.nushell.enable;
|
||||
settings = builtins.fromTOML (builtins.readFile cfg.confPath);
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
{ config
|
||||
, ...
|
||||
}: {
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
|
|
|
@ -1,36 +1,33 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.shell.zsh;
|
||||
in
|
||||
with lib; {
|
||||
options.myShells.zsh = {
|
||||
enable = mkEnableOption "Enables zsh and components.";
|
||||
};
|
||||
config = {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
shellAliases = import ./aliases {inherit pkgs;};
|
||||
dirHashes = {
|
||||
docs = "$HOME/Documents";
|
||||
dl = "$HOME/Downloads";
|
||||
dev = "$HOME/devel";
|
||||
screen = "$HOME/Pictures/Screenshots";
|
||||
};
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
"git"
|
||||
"rsync"
|
||||
"zoxide"
|
||||
];
|
||||
theme = "agnoster";
|
||||
};
|
||||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
with lib; {
|
||||
options.myShells.zsh = {
|
||||
enable = mkEnableOption "Enables zsh and components.";
|
||||
};
|
||||
config = {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
shellAliases = import ./aliases { inherit pkgs; };
|
||||
dirHashes = {
|
||||
docs = "$HOME/Documents";
|
||||
dl = "$HOME/Downloads";
|
||||
dev = "$HOME/devel";
|
||||
screen = "$HOME/Pictures/Screenshots";
|
||||
};
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
"git"
|
||||
"rsync"
|
||||
"zoxide"
|
||||
];
|
||||
theme = "agnoster";
|
||||
};
|
||||
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 = {
|
||||
enable = true;
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml";
|
||||
image = ./assets/nixos-wallpaper.jpg;
|
||||
autoEnable = true;
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark-dark.yaml";
|
||||
image = config.myWallPaperPath;
|
||||
fonts = {
|
||||
sansSerif = {
|
||||
name = "Aileron";
|
||||
package = pkgs.aileron;
|
||||
};
|
||||
/*sansSerif = {
|
||||
name = "Helvetica Neue LT Std";
|
||||
package = pkgs.helvetica-neue-lt-std;
|
||||
};*/
|
||||
monospace = {
|
||||
name = "BlexMono Nerd Font";
|
||||
package = pkgs.nerdfonts.override {fonts = ["IBMPlexMono"];};
|
||||
name = config.desktopFont.fullName;
|
||||
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