Compare commits

...

141 commits

Author SHA1 Message Date
2ac1e0c90d
feat: changed desktop environment to KDE 2025-07-18 21:16:40 +08:00
ca8bd5829a
chore: change timezone to Asia/Shanghai 2025-07-18 14:24:03 +08:00
84b17122d5
chore: update feat lock 2025-05-29 19:08:59 +03:00
f965e8b989
feat: firefox-devedition -> librewolf
switching to librewolf - my preferred OSS flavour of firefox.
2025-05-29 19:08:44 +03:00
7e2c5f2c7c
chore: redecorating with stylix 2025-05-29 19:08:09 +03:00
20029c971a
feat: integrate mpd-mpris
allow mpd mpris
2025-05-29 19:07:54 +03:00
dfdd271350
feat: thunderbird autostart
autostart: thunderbird - for productivity
2025-05-29 19:07:33 +03:00
ca7192d41f
chore: freshen up with a new font
font: from jetbrainsmono to 0xproto, better style
2025-05-29 19:07:11 +03:00
6d47209757
chore: add back virtualisation and remove specs
virt: add virt-manager back
specs: removed - no more use for them
hw: removed filesystem term due to chance in fs structure
2025-05-29 19:06:33 +03:00
edf1ab243e
chore: prune unused files 2025-05-29 19:04:07 +03:00
20f6439cc7
feat: use helix editor alongside neovim 2025-05-29 19:03:57 +03:00
bab224d4d1
feat: trolling 2025-05-29 19:03:18 +03:00
7a072d580c
feat: add more packages 2025-05-29 19:02:22 +03:00
b487953311
feat: update home-manager configuration 2025-04-13 13:32:53 +03:00
afc232ca26
fix: temporary fix for random display names 2025-03-05 12:04:15 +02:00
bbff8e9d20
feat: stylix-maxxing and removing uwsm 2025-03-01 12:06:56 +02:00
b2d8783e83
feat: switch to waybar 2025-02-28 14:14:15 +02:00
19e72eedb7
feat: redesign, with onedark theme 2025-02-26 13:53:41 +02:00
00f5075f17
feat: add many many features 2025-02-23 00:36:14 +02:00
bb120b4e3d
feat: a bunch of misc updates 2025-02-07 18:18:23 +02:00
db83134e6b
feat(prompt): change shell prompt 2025-01-18 17:45:17 +02:00
23871a3c73
feat(hyprland): hyprexpo 2025-01-18 17:44:50 +02:00
19fddf28fa
chore: update nixos config location 2025-01-18 15:54:47 +02:00
5e6352671a
chore: update .envrc 2025-01-18 15:51:19 +02:00
08566ea0ee
feat(scripts): update git-check script 2025-01-18 15:51:05 +02:00
1bef468795
chore(bump): bump flake.lock 2025-01-17 16:49:50 +02:00
66bf7da2b3
feat(shell): make cowsay colourful 2025-01-17 16:48:58 +02:00
dfeaa9b84a
chore(pkgs): move packages to dir 2025-01-17 16:48:41 +02:00
ef09316160
feat(nixvim): tagbar wrapping and lsp
diag: changed to trouble from lsp-lines
tagbar: added to see outline of programs
wrapping: added
2025-01-14 23:25:03 +02:00
1a57d0a196
chore(font): font change 2025-01-14 23:22:44 +02:00
003d990eac
fix: remove control overload
removed because overloading causes escape called from capslock to
misfire
2025-01-12 19:02:52 +02:00
1a1cabb034
fix: update autocrlf 2025-01-10 22:33:29 +02:00
449c0e59d9
fix: git autofix CRLF 2025-01-10 22:28:22 +02:00
b6216a3f53
chore: update README 2025-01-10 21:27:29 +02:00
e56dc0238f
test: trying foot dpi-unaware 2025-01-10 21:27:23 +02:00
362b20477d
feat(runner): change app runner to wmenu 2025-01-10 21:27:09 +02:00
f1d727cedd
revert: remove plymouth
plymouth: removed because it was too bothersome
2025-01-10 21:26:14 +02:00
ae1dbae7c9
feat(hyprland): hyprland music controls 2025-01-10 21:25:34 +02:00
57c4933610
chore: do some stuff
devenv: scripts and nixpkgs-fmt
hyprland: enable UWSM support
2025-01-08 22:46:31 +02:00
5175a6d9f3
feat(style): test new stylix theme 2025-01-08 21:11:31 +02:00
395bb04422
chore(clean): no more spotify 2025-01-08 14:30:41 +02:00
281ae7f645
Merge branch 'main' of gitlab.com:stvnliu/nixos-configuration 2025-01-08 14:28:28 +02:00
ef9cd89daa
Merge branch 'main' of gitlab.com:stvnliu/nixos-configuration 2025-01-08 14:27:42 +02:00
8efff299f3
Merge branch 'main' of gitlab.com:stvnliu/nixos-configuration 2025-01-08 14:26:50 +02:00
a81feaf5fa
chore(clean): deadnix pruning 2025-01-08 14:26:19 +02:00
ff5b7aa636
chore(clean): deadnix pruning 2025-01-08 14:24:09 +02:00
ecaf5df80a
chore(fmt): use nixpkgs-fmt 2025-01-08 14:13:31 +02:00
7d88765f5d
feat(home-manager): service defs and fmt
fmt: reformatted using nixpkgs-fmt prettifier
mpd: created configuration
hypr: add window rules
commons: add usingMusicPlayerDaemon variable
2025-01-08 14:12:29 +02:00
2d4b39c72f
chore(flake): bump lock file 2025-01-08 14:04:33 +02:00
fd12988a0f
Merge branch 'main' of gitlab.com:stvnliu/nixos-configuration 2025-01-04 20:16:53 +02:00
75870c32aa
chore: update README 2025-01-04 20:15:44 +02:00
0347814073
chore: update README 2025-01-04 20:12:51 +02:00
19330c1c88
chore: deploy: change nix host to param 2025-01-04 20:12:37 +02:00
f63fb76d78
chore: bump flake.lock 2025-01-04 19:34:08 +02:00
4c07b4d0a4
feat: UNTESTED: quick and dirty deploy script 2025-01-01 03:57:15 +02:00
71b70ecb3a
chore: attach binds to common variables file 2025-01-01 03:45:58 +02:00
528ef530c0
chore: clean wechat-uos license 2025-01-01 03:39:27 +02:00
a0966bfdac
chore: correct indents in script file 2025-01-01 03:35:35 +02:00
7962850c82
fix: resolve hyprland-qtutils dep error 2024-12-28 08:41:11 +02:00
444e364d7e
feat: change application launcher to walker 2024-12-28 08:40:45 +02:00
dc9f623785
chore: bump flake lock; resolve hyprfocus 2024-12-26 15:19:47 +02:00
2dc89a3284
chore: comments 2024-12-23 16:42:24 +02:00
333ca504a6
chore: rename to new script name 2024-12-23 16:37:11 +02:00
ff3be101f9
feat: improve script 2024-12-23 16:36:19 +02:00
2e0927fc93
feat: update git-clean syntax 2024-12-23 16:23:22 +02:00
51f3ed41cc
feat: add new git check clean script 2024-12-23 11:02:41 +02:00
54bc34d7dc
chore: bootloader: remove arch linux
since we have a windows dual-boot configuration now
2024-12-23 11:01:43 +02:00
7ff3a0adbe
chore: pruning
remove nushell associations
2024-12-17 00:53:24 +02:00
64e476798d
feat: experimenting with custom local hosts 2024-12-17 00:53:10 +02:00
77f1155518
chore: remove blender
blender removed because of costly recompilation due to CUDA support
2024-12-17 00:52:51 +02:00
ec800c7394
chore: change gtk icon theme 2024-12-17 00:52:17 +02:00
b6d7635ce0
feat: change notification daemon
use sway notification center (much more modern)
2024-12-17 00:52:03 +02:00
b60c28d972
chore: spring cleaning
purge unused files
fmt according to alejandra syntax
2024-12-17 00:51:29 +02:00
72381b3f46
chore: change terminal and app font size 2024-12-17 00:49:40 +02:00
01a503477d
chore: bump flake lock 2024-12-17 00:49:15 +02:00
2262b4c1ff
feat: change some misc stuff and trim filetree 2024-12-08 13:54:37 +02:00
fbbe078673
fix: another failed attempt at making tmux run nvim 2024-12-07 22:28:40 +02:00
3c656a3c03
chore: change some stylix stuff 2024-12-07 22:28:03 +02:00
df966578e4
feat: starship integration and theme change
theme of starship changed to pure preset
integrated starship into nushell
2024-12-07 19:25:24 +02:00
73b4ab6874
chore: stub for default environment variables
This is needed because nushell uses $env.* for environment, doesn't work
with sessionVariables apparently
2024-12-07 19:24:53 +02:00
a2bf84b09e
feat: tmux configuration
script: added script to create tmux workspace
tmux-config: sets dynamic variable defaultshell to tmux
2024-12-07 19:23:58 +02:00
712e45ca58
fix: resolve problematic batmon alias 2024-12-07 19:23:10 +02:00
583cdd7b00
feat: add nushell integration config 2024-12-07 19:22:53 +02:00
03a2702281
feat: tree-sitter grammar for nushell 2024-12-07 19:21:52 +02:00
08def86724
feat: tmux scripting 2024-12-07 13:04:09 +02:00
f301f81c09
chore: change some things in the config 2024-12-07 00:53:04 +02:00
c09a6b2010
feat: change pinentry package to gnome 2024-12-07 00:42:38 +02:00
32e62e90f3
feat: some changes
blender: added CUDA support
documentation: enabled development (kernel) documentation
2024-12-06 22:06:34 +02:00
05e141db88
feat: various nixos fixes and improvements
bluetooth: trying to disable handsfree mode (wip)
fonts: conform to new font pkg naming
2024-12-03 22:39:30 +02:00
da68374b71
feat: various home-manager option improvements
nixpkgs-home-manager: fix: some insecure packages
hyprland: move autoruns in hypr-specific file
2024-12-03 22:38:29 +02:00
24c2411160
chore: bump flake.lock 2024-12-03 22:37:35 +02:00
4272896370
feat: stylix: change theme -> nord; wallpaper 2024-12-03 22:37:27 +02:00
b74b1ba3e4
feat: improve nixvim configuration 2024-12-03 22:35:06 +02:00
4694410cc8
feat: add funny cheatsheets and stuff
chore: fix manpager issue
2024-11-24 18:19:00 +02:00
6eb3bb0b70
feat: add some new flake inputs for other nixpkgs
lix: remove lix module
ghc: fix nixvim installGhc trace
libreoffice: switch to binary distribution
2024-11-24 13:08:08 +02:00
06fa623eef
chore: bump all locks 2024-11-24 13:07:42 +02:00
78d5115aac
feat: some config refining and blender 2024-11-21 18:39:35 +02:00
178e199bb7
chore: fixup 2024-11-14 20:48:21 +02:00
b7c4404575
feat: nixvim lsp: pylsp -> pylyzer 2024-11-14 19:11:24 +02:00
932fa37cfa
chore: bump flake.lock 2024-11-14 14:10:21 +02:00
9475ec1a21
chore: random fixups 2024-11-10 16:34:31 +02:00
c5ff41998e
chore: bump devenv lock file 2024-11-02 11:22:29 +02:00
a641d4fafe
feat: add rust error explanation binding 2024-11-02 11:17:38 +02:00
3c9a9d42cf
chore: fix some errors and update lock file
Nixvim: switch to Rustaceanvim
Pkgs: add lazygit
2024-11-01 22:06:20 +02:00
ba450b88ef
feat: font; qt theme; foot program
font: Change from Monocraft to JetBrains
qt: Change theme to Fusion (doesn't look like it works)
foot: enable proper home-manger foot server support
2024-10-26 12:47:26 +03:00
a82a005ed2
chore: update monitor configuration 2024-10-22 18:49:05 +03:00
d15dd3bb76
feat: trying out this new terminal font 2024-10-22 18:40:40 +03:00
655687c683
chore: bump flake lock 2024-10-22 18:19:56 +03:00
079708804e
feat: add some extra stuff and fixing tmux 2024-10-22 18:19:29 +03:00
db6ad0b031
feat: keyd config CapsLock -> Escape 2024-10-11 22:16:49 +03:00
20af7fa881
feat: implement UNIX Pass password manager 2024-10-11 21:46:19 +03:00
f03fa22c2d
chore: update README 2024-10-07 10:14:20 +03:00
4060060af5
feat: change git signingkey to GPG key 2024-10-07 10:06:25 +03:00
62c6c836e3
feat: pass and import plugins config 2024-10-06 23:43:37 +03:00
9724c8e4f4
chore: prune config of unused files 2024-10-06 15:22:20 +03:00
9975cd7d64
chore: fmt and bump lock 2024-10-06 11:00:48 +03:00
1c5f8de412
feat: allow tearing for cs2 2024-10-06 11:00:20 +03:00
e5f49cd89f
feat: add vscode 2024-10-06 10:59:46 +03:00
54281863cd
feat: inherit stylix spotify theme; stop suspend 2024-10-03 20:23:40 +03:00
f9e7c190b6
chore: update flake.lock 2024-10-03 20:22:59 +03:00
4a99257e90
feat: nvidia logind seatd gamescope config update
Nvidia: added Dynamic Boost and fixed PRIME BusIDs
Gamescope: added capSysNice definition
Fcitx5: change names to resolve eval warning
Logind: Delayed processing of power key press (600ms)
2024-10-02 17:36:18 +03:00
83c26c1e31
chore: split off package and program opts 2024-10-02 17:33:00 +03:00
a29235acb6
feat: further structure hyprland configuration
Added special keybind definition files
Created new hyprland-specific config dir
2024-10-02 17:32:17 +03:00
d4059b5e9a
chore: cleanup unwanted files 2024-10-02 17:31:00 +03:00
74635a6c6d
feat: update wallpaper and references to image 2024-10-02 17:30:27 +03:00
33edc82a6b
chore: resolve warning messages
Updated program option definitions to resolve build warnings
2024-10-02 17:27:52 +03:00
908db14e1c
chore: pop stashed change 2024-09-26 16:55:59 +03:00
0608d646c5
feat: add extra power-saving profile 2024-09-26 16:51:22 +03:00
a479e4633c
chore: move some packages out of main home.nix 2024-09-26 16:50:23 +03:00
4f6d4cba4a
chore: bump flake.lock and refactor flake.nix 2024-09-26 16:49:28 +03:00
236c4b8ed2
feat: spicetify add lyricsPlus to app display 2024-09-23 10:21:52 +03:00
dad3573f27
feat: add pipewire noise cancellation config 2024-09-22 21:49:52 +03:00
3685cf5abe
feat: update desktop apps configuration
LibreOffice: bump versiont to newest
Firefox: change to firefox-devedition
Programs: reorganise config into special programs dir
2024-09-22 21:48:35 +03:00
1747a5ad81
chore: bump flake.lock 2024-09-22 21:47:44 +03:00
dde872db67
feat: created AGS configuration for multiple bars
AGS config using multiple monitor ids
GRUB extra boot menu entries
Fix issue with Foot terminal starting
2024-09-19 19:53:40 +03:00
1f80786864
Merge branch 'main' into ags-config 2024-09-19 10:25:58 +03:00
09e506c6a6
feat: changes to kanshi nvidia hyprland
Bumped flake inputs to latest
2024-09-19 10:24:14 +03:00
466f0992f1
feat: add misc style changes
Steam: added gamescopeSession and gamemoderun support
Hyprland: added additional formatting options
2024-09-07 23:38:54 +03:00
d125eca445
feat: change grimblast default to copysave 2024-09-01 09:39:31 +03:00
99493bc1ce
Merge branch 'main' into ags-config 2024-09-01 09:28:12 +03:00
5558d0d761
feat: customization options for AGS 2024-08-27 18:32:37 +08:00
133 changed files with 4168 additions and 1322 deletions

2
.envrc
View file

@ -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

View file

@ -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`
- 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.18.5`
- version: `nix-env (Nix) 2.24.11`
- channels(root): `"nixos"`
- nixpkgs: `/nix/store/4cpakzyvfw1rmm9v5i3387x6jd2h1v86-source`
- 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

View file

@ -1,12 +1,22 @@
{ config, pkgs, lib, ... }:
let
monitorMaxBrightness = "255";
# monitorMinBrightness = "32";
stylixBG = config.lib.stylix.colors.base00;
stylixFG = config.lib.stylix.colors.base07;
stylixPrimaryBG = config.lib.stylix.colors.base12;
in
{
config,
pkgs,
lib,
...
}: {
# Type definitions for nix variables used in this configuration
options = with lib;
with types; {
usingMusicPlayerDaemon = mkOption { type = bool; };
defaultApplications = {
fileManager = mkOption { type = str; };
appLauncher = mkOption { type = str; };
terminal = mkOption { type = str; };
};
myWallPaperPath = mkOption { type = path; };
myUserName = mkOption { type = str; };
myHostName = mkOption { type = str; };
myWallPaperPathString = mkOption { type = str; };
@ -15,21 +25,48 @@
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
View 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

View file

@ -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": {

View file

@ -1,10 +1,4 @@
{
pkgs,
lib,
config,
inputs,
...
}: {
{ pkgs, ... }: {
# https://devenv.sh/basics/
env.GREET = "devenv";
cachix.enable = false;
@ -15,9 +9,10 @@
# 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

File diff suppressed because it is too large Load diff

View file

@ -2,35 +2,41 @@
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
outputs = { self, nixpkgs, home-manager, stylix, spicetify-nix, ... }@inputs:
let
inherit (self) outputs;
myHostName = "nixos-msi";
stevenUserName = "stvnliu";
in {
in
{
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
@ -38,6 +44,7 @@
specialArgs = { inherit inputs outputs; };
modules = [
./nixos/configuration.nix
#lix-module.nixosModules.default
];
};
};
@ -45,14 +52,17 @@
# 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
"${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
inputs.stylix.homeManagerModules.stylix
inputs.spicetify-nix.homeManagerModules.default
spicetify-nix.homeManagerModules.default
];
};
};

View file

@ -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 { }

View 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 };

View 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 };

View file

@ -0,0 +1,3 @@
function MonitorWidget() {
}

View 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) }))
})

View file

@ -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"

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

View file

@ -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 ];
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" = { };
};
};
};
}

View file

@ -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
];
}

View 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";
}
# { }
# { }
# { }
]

View file

@ -1,46 +1,26 @@
# 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 ];
});
@ -48,6 +28,13 @@
];
# 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,66 +46,43 @@
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";
};
};
};
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";

View file

@ -1,11 +1,7 @@
{
pkgs,
config,
lib,
...
{ ...
}: {
imports = [
./hyprland.nix
./hyprland
./hyprpaper.nix
./hypridle.nix
./hyprlock.nix

View file

@ -1,6 +1,8 @@
{pkgs, ...}: let
{ ... }:
let
timeoutSeconds = 600;
in {
in
{
services.hypridle = {
enable = true;
settings = {

View file

@ -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;};
};
# ...
}

View 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)
*/
)

View 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
};
# ...
}

View 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"
]

View 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;"
];
};
}

View 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)$"
]

View 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%"
]

View file

@ -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 = [
{
background = [{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}
];
}];
input-field = [
{
size = "200, 50";
input-field = [{
size = "400, 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>'\';
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;
}
];
}];
};
};
}

View file

@ -1,7 +1,5 @@
{
pkgs,
config,
...
{ config
, ...
}: {
services.hyprpaper = {
enable = true;
@ -10,6 +8,8 @@
splash = false;
preload = [ config.myWallPaperPathString ];
wallpaper = [ ",${config.myWallPaperPathString}" ];
#preload = [/home/stvnliu/Downloads/mao-zedong.jpg];
#wallpaper = [",/home/stvnliu/Downloads/mao-zedong.jpg"];
};
};
}

View file

@ -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";
};
}

View file

@ -1,10 +1,9 @@
{
pkgs,
lib,
...
}: let
{ ...
}:
let
defaultTimeoutMillis = 5 * 1000;
in {
in
{
services.mako = {
enable = true;
defaultTimeout = defaultTimeoutMillis;

View file

@ -1,6 +1,6 @@
{
plugins.auto-save = {
enable = true;
enableAutoSave = true;
settings.enabled = true;
};
}

View file

@ -2,31 +2,37 @@
{
plugins = {
luasnip.enable = true;
/*
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"; }
@ -36,9 +42,7 @@
}
{ name = "nvim_lua"; }
{ name = "path"; }
{name = "copilot";}
];
formatting = {
fields = [ "abbr" "kind" "menu" ];
format =

View file

@ -0,0 +1,6 @@
{
plugins.coq-nvim = {
enable = true;
installArtifacts = true;
};
}

View file

@ -0,0 +1,8 @@
[
{
mode = "n";
key = "<leader>ree";
action = "<CMD>RustLsp explainError<CR>";
options.desc = "Explain this Rust error (custom)";
}
]

View file

@ -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,13 +20,27 @@
./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 = [
performance = {
byteCompileLua.enable = true;
combinePlugins = {
enable = true;
/*standalonePlugins = [
"nvim-treesitter"
];*/
};
};
keymaps =
[
# Global
# Default mode is "" which means normal-visual-op
{
@ -149,5 +160,6 @@
action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
options.desc = "Start standalone rust-analyzer";
}
];
]
++ (import ./custom/binds.nix);
}

View file

@ -0,0 +1,3 @@
{
plugins.web-devicons.enable = true;
}

View file

@ -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;
}

View file

@ -0,0 +1,12 @@
{
plugins.lspkind = {
enable = true;
symbolMap = {
Copilot = " ";
};
extraOptions = {
maxwidth = 50;
ellipsis_char = "...";
};
};
}

View file

@ -3,7 +3,7 @@
updatetime = 100; # Faster completion
number = true;
relativenumber = false;
relativenumber = true;
autoindent = true;
clipboard = "unnamedplus";

View 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 = "󰡭 ";
};
};
};
}

View file

@ -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;

View file

@ -0,0 +1,6 @@
{ ... }: {
plugins = {
zen-mode = { enable = true; };
twilight = { enable = true; };
};
}

View file

@ -0,0 +1,6 @@
{ ... }:
{
plugins.wrapping = {
enable = true;
};
}

View 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
];
}

View file

@ -0,0 +1,9 @@
{ pkgs
, ...
}: {
home.packages = with pkgs; [
wget
vscodium-fhs
devenv
];
}

View 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";
};*/
}

View file

@ -0,0 +1,4 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ bottles zeroad ];
}

View file

@ -0,0 +1,4 @@
{ inputs, ... }:
{
home.packages = [ inputs.hyprswitch.packages.x86_64-linux.default ];
}

View file

@ -0,0 +1,13 @@
{ pkgs
, ...
}: {
home.packages = with pkgs; [
libreoffice
kdePackages.okular
evolution
evolution-ews
# proton mail
protonmail-bridge
protonmail-bridge-gui
];
}

View file

@ -0,0 +1,9 @@
{ pkgs
, ...
}: {
home.packages = with pkgs; [
openvpn
inetutils
nmap
];
}

View 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
];
}

View file

@ -0,0 +1,4 @@
{ pkgs, ... }: {
home.packages = with pkgs; [ vscodium-fhs ];
xdg.desktopEntries.codium = { };
}

View file

@ -0,0 +1,5 @@
{ pkgs
, ...
}: {
home.packages = with pkgs; [ wl-clipboard ];
}

View file

@ -0,0 +1,10 @@
{ ...
}: {
imports = [
./git.nix
./rofi.nix
./tmux.nix
./foot.nix
#./walker.nix
];
}

View 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;
};
}

View 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;
};
}

View 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";
}

View file

@ -0,0 +1,6 @@
{ ...
}: {
programs.rofi = {
enable = true;
};
}

View 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'";
}
];
};
}

View 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.
};
}

View file

@ -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;
})
];
}

View 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
''

View file

@ -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
''

View 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}
''

View file

@ -0,0 +1,10 @@
{ ...
}: {
imports = [
./swaync.nix
./mpd.nix
# DEPRECATED due to switch to KDE
#./waybar.nix
];
}

View 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; };
};
}

View file

@ -0,0 +1,6 @@
{ ...
}: {
services.swaync = {
enable = true;
};
}

View file

@ -0,0 +1,8 @@
{ ... }: {
programs.waybar = {
enable = true;
systemd = { enable = true; };
style = "${import ./waybar_style.nix { }}";
settings = import ./waybar_config.nix;
};
}

View 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"
'';
};
*/
};
}

View file

@ -0,0 +1,4 @@
{ ... }: ''
* {
font-family: JetBrainsMono Nerd Font;
}''

View file

@ -1,10 +1,14 @@
{ 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\"";
}

View file

@ -1,15 +1,12 @@
{
pkgs,
lib,
config,
...
}: let
cfg = config.myShells;
in
{ lib
, config
, ...
}:
with lib; {
imports = [
./zsh.nix
./fish
./nushell
./zoxide.nix
./direnv.nix
./starship
@ -23,7 +20,8 @@ in
myShells = {
zsh.enable = false;
fish.enable = true;
defaultShell = "fish";
#nushell.enable = true;
defaultShell = "${config.programs.fish.package}/bin/fish";
prompts.starship.enable = true;
};
};

View file

@ -0,0 +1,4 @@
{ ...
}: {
EDITOR = "nvim";
}

View file

@ -1,9 +1,9 @@
{
pkgs,
config,
lib,
...
}: let
{ pkgs
, config
, lib
, ...
}:
let
cfg = config.myShells.fish;
in
with lib; {
@ -17,10 +17,13 @@ in
${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}/bin/fortune -a
${(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; [

View 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)'

View 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;
};
};
};
}

View 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
}
}]
}
}

View file

@ -1,9 +1,8 @@
{
lib,
pkgs,
config,
...
}: let
{ lib
, config
, ...
}:
let
cfg = config.myShells.prompts.starship;
in
with lib; {
@ -15,10 +14,12 @@ in
};
};
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);
};
};

View file

@ -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"

View file

@ -1,8 +1,5 @@
{
pkgs,
config,
lib,
...
{ config
, ...
}: {
programs.zoxide = {
enable = true;

View file

@ -1,11 +1,8 @@
{
pkgs,
lib,
config,
...
}: let
cfg = config.shell.zsh;
in
{ pkgs
, lib
, config
, ...
}:
with lib; {
options.myShells.zsh = {
enable = mkEnableOption "Enables zsh and components.";

View file

@ -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
];
};
}

View file

@ -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;
};
};
}

View file

@ -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";
};
};
}

View file

@ -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";
};
}

View file

@ -3,6 +3,6 @@
"openssl-1.1.1w"
];
home.packages = with pkgs; [
(wechat-uos.override {uosLicense = ./license.tar.gz;})
wechat-uos
];
}

View file

@ -1,6 +1,7 @@
{pkgs, ...}: {
{ ... }: {
xdg = {
enable = true;
userDirs.enable = true;
mimeApps = {
enable = true;
defaultApplications = {

View file

@ -1,5 +0,0 @@
{pkgs, ...}: {
environment.systemPackages = [
pkgs.ags
];
}

97
nixos/bootloader.nix Normal file
View file

@ -0,0 +1,97 @@
{ pkgs
, ...
}:
let
xenlism-grub-themes = pkgs.stdenv.mkDerivation {
pname = "xenlism-grub-themes";
version = "1.0";
src = pkgs.fetchFromGitHub {
owner = "xenlism";
repo = "Grub-themes";
rev = "40ac048df9aacfc053c515b97fcd24af1a06762f";
hash = "sha256-ProTKsFocIxWAFbYgQ46A+GVZ7mUHXxZrvdiPJqZJ6I=";
};
installPhase = "cp -r xenlism-grub-1080p-nixos/Xenlism-Nixos $out";
};
in
{
environment.systemPackages = with pkgs; [ hack-font ];
#fileSystems."/mnt/winsys" = {
# device = "/dev/nvme0n1p5";
# fsType = "ntfs-3g";
# options = [ "rw" "uid=1000" ];
#};
#fileSystems."/mnt/windata" = {
# device = "/dev/nvme0n1p3";
# fsType = "ntfs-3g";
# options = [ "rw" "uid=1000" ];
#};
boot = {
/*plymouth = {
enable = true;
theme = "rings";
themePackages = with pkgs; [
# By default we would install all themes
(adi1090x-plymouth-themes.override { selected_themes = [ "rings" ]; })
];
};*/
# Enable "Silent Boot"
consoleLogLevel = 0;
initrd.verbose = false;
kernelParams = [
"quiet"
"splash"
"boot.shell_on_fail"
"loglevel=3"
"rd.systemd.show_status=false"
"rd.udev.log_level=3"
"udev.log_priority=3"
];
# Hide the OS choice for bootloaders.
# It's still possible to open the bootloader list by pressing any key
# It will just not appear on screen unless a key is pressed
supportedFilesystems = [ "ntfs" ];
loader = {
#timeout = 0;
efi = { canTouchEfiVariables = true; };
grub = {
enable = true;
efiSupport = true;
device = "nodev";
fsIdentifier = "label";
devices = [ "nodev" ];
extraConfig = ''
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}'';
extraEntries = ''
menuentry "UEFI Firmware Settings" {
fwsetup
}
menuentry "Reboot" {
reboot
}
menuentry "Poweroff" {
halt
}
'';
useOSProber = true;
configurationLimit = 10;
fontSize = 32;
theme = xenlism-grub-themes;
};
};
};
}

View file

@ -1,30 +1,64 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
...
}: {
{ inputs, lib, config, pkgs, ... }: {
imports = [
../common/variables.nix
./greetd.nix
./grub.nix
./bootloader.nix
./nvidia.nix
./fonts.nix
./services/laptop.preset.nix
./virtualisation.nix
#./dwm
#./spec.nix
./hardware-configuration.nix
#./custom-hosts.nix
];
environment.variables = {
# Virtual cam settings: see https://wiki.nixos.org/wiki/OBS_Studio#Using_the_Virtual_Camera
environment.sessionVariables = {
GDK_SCALE = config.displayScale;
FLAKE = config.myConfigLocation;
GTK_IM_MODULE = lib.mkForce "";
MANPAGER = "nvim +Man!";
NVD_BACKEND = "direct";
NIXOS_OZONE_WL = "1";
# GTK_IM_MODULE = lib.mkForce "";
};
/* services.jellyfin = {
enable = true;
openFirewall = true;
};
*/
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
services.keyd = {
enable = true;
keyboards = {
default = {
ids = [ "*" ];
settings = {
main = {
capslock = "esc";
esc = "capslock";
};
};
extraConfig = "";
};
};
};
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-gnome3;
enableSSHSupport = true;
};
programs.gamescope = {
enable = true;
capSysNice = true;
};
security.pam.services.hyprlock = { };
i18n.inputMethod = {
enabled = "fcitx5";
type = "fcitx5";
enable = true;
fcitx5.addons = with pkgs; [
fcitx5-mozc
fcitx5-gtk
@ -34,26 +68,24 @@
#enabled = "ibus";
#ibus.engines = with pkgs.ibus-engines; [rime];
};
#programs.hyprland = { enable = true; };
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = { General = { Disable = "Handsfree,Headset"; }; };
};
specialisation = {
in-china.configuration = {
networking.proxy = {
default = "http://127.0.0.1:7897/";
noProxy = "127.0.0.1,localhost,internal.domain";
};
};
};
#specialisation = {
# in-china.configuration = {
# networking.proxy = {
# default = "http://127.0.0.1:7897/";
# noProxy = "127.0.0.1,localhost,internal.domain";
# };
# };
#};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
config = {
common.default = ["gtk"];
};
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
config = { common.default = [ "gtk" ]; };
};
systemd.user.services.mpris-proxy = {
description = "Mpris proxy";
@ -61,7 +93,8 @@
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
programs.steam = {
programs = {
steam = {
enable = true;
remotePlay.openFirewall =
true; # Open ports in the firewall for Steam Remote Play
@ -69,20 +102,43 @@
true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall =
true; # Open ports in the firewall for Steam Local Network Game Transfers
extraCompatPackages = with pkgs; [ proton-ge-bin ];
};
gamemode.enable = true;
};
boot = {
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
'';
kernelPackages = pkgs.linuxPackages_zen;
supportedFilesystems = [ "ntfs" ];
};
documentation = {
enable = true;
dev.enable = true;
doc.enable = true;
man.enable = true;
};
security.polkit.enable = true;
environment.systemPackages = with pkgs; [
man-pages-posix
man-pages
(pass-wayland.withExtensions (exts: [ exts.pass-otp exts.pass-import ]))
gparted
zed-editor
libsForQt5.qt5.qtquickcontrols2
libsForQt5.qt5.qtgraphicaleffects
/* (blender.override {
cudaSupport = true;
})
*/
trash-cli
#inputs.hyprswitch.packages.x86_64-linux.default
];
# turned off because timedatectl doesn't like it
time.hardwareClockInLocalTime = false;
time.timeZone = "Europe/Athens";
time.timeZone = "Asia/Shanghai";
services = {
#displayManager.sddm = {
# enable = true;
@ -90,6 +146,8 @@
# theme = "${import ./sddm-theme.nix {inherit pkgs;}}";
#};
#automatic-timezoned.enable = true;
pcscd.enable = true;
openssh = {
enable = true;
settings = {
@ -104,36 +162,52 @@
# enable = true;
# wrapperFeatures.gtk = true;
#};
programs.hyprland.enable = true; # enables Hyprland DM.
nixpkgs = {
overlays = [ ];
config = {allowUnfree = true;};
config = {
cudaSupport = true;
allowUnfree = true;
permittedInsecurePackages = [ "dotnet-core-combined" ];
};
};
nix = let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
nix =
let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
settings = {
experimental-features = "nix-command flakes";
flake-registry = "";
# flake-registry = "";
nix-path = config.nix.nixPath;
};
extraOptions = ''
trusted-users = root stvnliu
'';
channel.enable = false;
registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
systemd.network.wait-online.enable = false;
networking = {
hostName = "${config.myHostName}";
networkmanager.enable = true;
useNetworkd = lib.mkDefault true;
useDHCP = lib.mkDefault true;
};
users.users = {
"${config.myUserName}" = {
initialPassword = "stevenpassword";
isNormalUser = true;
openssh.authorizedKeys.keys = [ ];
packages = with pkgs; [nh gparted];
packages = with pkgs; [ nh ];
extraGroups = [ "wheel" "input" "networkmanager" ];
};
"xi_jinping" = {
initialPassword = "bingchilling";
isNormalUser = true;
packages = with pkgs; [ git ];
extraGroups = [ "input" ];
};
};
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";

20
nixos/custom-hosts.nix Normal file
View file

@ -0,0 +1,20 @@
{ ...
}:
let
rootDomainName = "stvnliu.me";
subdomains = [
"git"
"kellnr"
"www"
"blog"
"files"
"code"
"chat"
];
in
{
networking.extraHosts = ''
# home IP mapping
192.168.1.100 ${rootDomainName} ${builtins.concatStringsSep " " (map (x: x + "." + rootDomainName) subdomains)}
'';
}

26
nixos/droidcam.nix Normal file
View file

@ -0,0 +1,26 @@
# /etc/nixos/configuration.nix
{ config, pkgs, ... }:
{
# Virtual cam settings: see https://wiki.nixos.org/wiki/OBS_Studio#Using_the_Virtual_Camera
boot.extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
];
boot.extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
'';
security.polkit.enable = true;
# Install OBS Studio with droidcam-obs
users.users.foo = {
packages = with pkgs; [
# ...
(wrapOBS {
plugins = with obs-studio-plugins; [
droidcam-obs
];
})
# ...
];
};
}

22
nixos/dwm/default.nix Normal file
View file

@ -0,0 +1,22 @@
{ pkgs, }: {
#options = {
#dwm.enable = lib.mkEnableOption "Enables dwm.";
#};
environment.systemPackages = with pkgs; [ st dmenu slstatus pamixer ];
programs.dconf.enable = true;
services.xserver = {
enable = true;
windowManager = {
dwm = {
enable = true;
package = pkgs.dwm.override {
patches = [
./patches/config-20240325.diff
./patches/dwm-flextile-20210722-138b405.diff
./patches/dwm-systray-6.4.diff
];
};
};
};
};
}

View file

@ -0,0 +1,100 @@
diff --git a/config.def.h b/config.def.h
index 1c0b587..8595a71 100644
--- a/config.def.h
+++ b/config.def.h
@@ -49,7 +49,10 @@ static const Layout layouts[] = {
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
- { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
+ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \
+ { ALTMOD, KEY, focusnthmon, {.i = TAG } }, \
+ { ALTMOD|ShiftMask, KEY, tagnthmon, {.i = TAG } },
+
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
diff --git a/dwm.c b/dwm.c
index b0b3466..96fa0bd 100644
--- a/dwm.c
+++ b/dwm.c
@@ -161,6 +161,7 @@ static void destroynotify(XEvent *e);
static void detach(Client *c);
static void detachstack(Client *c);
static Monitor *dirtomon(int dir);
+static Monitor *numtomon(int num);
static void drawbar(Monitor *m);
static void drawbars(void);
static void enternotify(XEvent *e);
@@ -168,6 +169,7 @@ static void expose(XEvent *e);
static void focus(Client *c);
static void focusin(XEvent *e);
static void focusmon(const Arg *arg);
+static void focusnthmon(const Arg *arg);
static void focusstack(const Arg *arg);
static Atom getatomprop(Client *c, Atom prop);
static int getrootptr(int *x, int *y);
@@ -209,6 +211,7 @@ static void sigchld(int unused);
static void spawn(const Arg *arg);
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
+static void tagnthmon(const Arg *arg);
static void tile(Monitor *);
static void togglebar(const Arg *arg);
static void togglefloating(const Arg *arg);
@@ -693,6 +696,18 @@ dirtomon(int dir)
return m;
}
+Monitor *
+numtomon(int num)
+{
+ Monitor *m = NULL;
+ int i = 0;
+
+ for(m = mons, i=0; m->next && i < num; m = m->next){
+ i++;
+ }
+ return m;
+}
+
void
drawbar(Monitor *m)
{
@@ -830,6 +845,21 @@ focusmon(const Arg *arg)
focus(NULL);
}
+void
+focusnthmon(const Arg *arg)
+{
+ Monitor *m;
+
+ if (!mons->next)
+ return;
+
+ if ((m = numtomon(arg->i)) == selmon)
+ return;
+ unfocus(selmon->sel, 0);
+ selmon = m;
+ focus(NULL);
+}
+
void
focusstack(const Arg *arg)
{
@@ -1671,6 +1701,14 @@ tagmon(const Arg *arg)
sendmon(selmon->sel, dirtomon(arg->i));
}
+void
+tagnthmon(const Arg *arg)
+{
+ if (!selmon->sel || !mons->next)
+ return;
+ sendmon(selmon->sel, numtomon(arg->i));
+}
+
void
tile(Monitor *m)
{

Some files were not shown because too many files have changed in this diff Show more