Compare commits

...

69 Commits

Author SHA1 Message Date
Ryan Yin 408d7dfd95 fix: nix.settings.auto-optimise-store, and add command 'fhs' 2023-06-11 16:35:58 +08:00
Ryan Yin de1d6fbf4c fix: i3block's pavucontrol 2023-06-10 15:56:33 +08:00
Ryan Yin e499f0ee37 feat: nix.gc.automatic = true 2023-06-09 14:58:38 +08:00
Ryan Yin 0e194466d4 feat: add tools - glow, for markdown preview in terminal 2023-06-08 06:43:01 +08:00
Ryan Yin 5da21ce346 feat: add tools - nix-output-monitor 2023-06-08 06:04:59 +08:00
Ryan Yin 0b4e365ce9 fix: typo 2023-06-05 13:34:16 -06:00
Ryan Yin 2ebbe3ae09 feat: polish README 2023-06-05 13:17:36 -06:00
Ryan Yin 2a8a0d1c62 fix: darwin 2023-06-05 11:54:48 +08:00
Ryan Yin a42c8f0aeb fix: 'programs.git' do not take effect 2023-06-05 04:31:22 +08:00
ryan4yin f083f74825 feat: enable storage optimise to reduce storage usage 2023-06-05 01:58:28 +08:00
ryan4yin 4e0774e5d8 feat: enable storage optimise to reduce storage usage 2023-06-05 01:57:49 +08:00
ryan4yin 6582721050 feat: install & remove some apps 2023-06-05 01:41:24 +08:00
ryan4yin 609c9e53ff feat: upgrade to 'nix profile' && 'nix store' 2023-06-04 23:40:12 +08:00
ryan4yin 3a141b62df feat: add flameshot and autostart it after login 2023-06-04 01:53:24 +08:00
ryan4yin 2865241acd feat: update i3block's style 2023-06-03 22:02:47 +08:00
ryan4yin c6834707f0 fix: style of cpu stats 2023-06-03 22:01:08 +08:00
ryan4yin ef16db0bcd fix: wrong cpu usage 2023-06-03 18:35:19 +08:00
ryan4yin b3b2136579 chore: remove duplicated packages 2023-06-03 18:26:48 +08:00
ryan4yin dc2d5f1c6a feat: enable transparency for i3bar 2023-06-03 18:09:00 +08:00
ryan4yin c935031234 feat: move i3blocks from bottom to top 2023-06-03 17:58:46 +08:00
ryan4yin 0a16aa1b32 feat: update README 2023-06-03 17:56:14 +08:00
ryan4yin ec485779ce feat: set hdmi0 to 1080p
feat: adjust alacritty's font size for linux
fix: errors in i3 config
feat: update i3blocks's scripts & style
2023-06-03 17:53:45 +08:00
ryan4yin 1a474ec960 feat: enable binfmt emulation of aarch64-linux for nixos-test 2023-06-02 13:14:17 +08:00
ryan4yin e6b57d9d11 fix: missing 'pkgs-stable' in home-manager 2023-06-02 13:09:10 +08:00
ryan4yin 11fb1932ac fix: nixos-test 2023-06-02 13:04:58 +08:00
ryan4yin c224f9c773 feat: enable bluetooth 2023-06-01 21:45:39 +08:00
ryan4yin 86f3503245 feat: use diffrent email & name for work 2023-06-01 18:46:20 +08:00
ryan4yin 7d99fab205 fix: create nixpkgs instance only in flake.nix, do not create it in any sub module or overlays 2023-06-01 16:32:10 +08:00
ryan4yin d38bc4ff38 fix: create nixpkgs instance only in flake.nix, do not create it in any sub module or overlays 2023-06-01 16:18:30 +08:00
ryan4yin d04f4109f2 feat: bump home-manager to branch release-23.05 2023-06-01 10:49:48 +08:00
admin 0d53bea851 fix: set users.users.<name>.home for darwin system, bump home-manager to branch release-23.05 2023-06-01 10:41:21 +08:00
admin dd2040568d fix: revert home-manager to avoid breaking changes 2023-06-01 10:08:33 +08:00
ryan4yin 89d8acd8eb fix: audio support - enable pipewire only 2023-06-01 01:32:15 +08:00
ryan4yin 3f24fa464d fix: ollision between vscode & vscode-insider - /lib/vscode/chrome_crashpad_handler 2023-05-31 21:24:27 +08:00
ryan4yin 5b99c2ceca feat: add scripts to set primary screen 2023-05-31 20:41:50 +08:00
ryan4yin df8a7e68e1 feat: update alacritty's configs 2023-05-31 17:14:02 +08:00
ryan4yin 058031ad29 feat: add alias - http-proxy 2023-05-31 16:32:09 +08:00
ryan4yin a622057fb4 feat: add vscode-insiders to give copilot-x chat a try 2023-05-31 16:22:08 +08:00
ryan4yin 20ce65210b feat: install vscode & discord on macos via nix 2023-05-31 16:22:08 +08:00
ryan4yin 203edbffea feat: change wallpaper for linux 2023-05-29 22:22:19 +08:00
ryan4yin 226a3a2596 fix: try to make firefox the default browser 2023-05-29 22:12:32 +08:00
ryan4yin 4f79b64f11 feat: add cifs into boot.supportedFilesystems 2023-05-29 18:02:53 +08:00
ryan4yin 443d15e03b feat: add nushell & media tools to darwin 2023-05-29 17:45:41 +08:00
ryan4yin 35b2b3f8be feat: add nushell & media tools to darwin 2023-05-29 17:34:58 +08:00
ryan4yin f4428b9b23 feat: add common tools - sqlite 2023-05-29 16:43:54 +08:00
ryan4yin 814c29f72b feat: set neovim as the default editor 2023-05-29 16:27:31 +08:00
ryan4yin 5fd4a788df feat: add development tools into darwin 2023-05-29 16:16:50 +08:00
ryan4yin 7f5cc5be23 feat: update packages for macOS 2023-05-29 13:13:42 +08:00
ryan4yin 3d93f5e624 fix: try to make firefox the default browser 2023-05-28 15:08:27 +08:00
ryan4yin 967b408e41 feat: add TODO 2023-05-27 16:14:30 +08:00
Ryan Yin a81cfaf9fe Merge pull request #2 from ryan4yin/dev
feat: redesign the project structure
2023-05-27 02:12:19 -06:00
ryan4yin f971ec030d feat: redesign the project structure 2023-05-27 16:10:25 +08:00
ryan4yin ab11958597 feat: adjust cursor's size and dpi scale for rofi/i3 2023-05-27 15:10:31 +08:00
ryan4yin 6707783d0a fix: Makefile - make deploy 2023-05-27 14:21:01 +08:00
ryan4yin 9ec7a76e02 feat: adjust cursor's size and dpi scale 2023-05-27 14:16:59 +08:00
ryan4yin 5a6bfc9e60 feat: update README 2023-05-26 17:26:11 +08:00
ryan4yin be5f2338f6 feat: update comments 2023-05-26 17:12:44 +08:00
Ryan Yin a880b9b20d Merge pull request #1 from ryan4yin/darwin
feat: add support for darwin, redesign the project structure.
2023-05-26 03:10:54 -06:00
ryan4yin fedcf1bafd feat: update for darwin 2023-05-26 17:01:18 +08:00
ryan4yin c694c81215 feat: migrate x11/wayland related apps into i3/hyprland folder 2023-05-26 00:19:05 +08:00
ryan4yin 5503e7bac0 fix: error in ssh config 2023-05-25 23:54:29 +08:00
ryan4yin 7c7591e167 feat: switch to x11 + i3 2023-05-25 23:45:19 +08:00
ryan4yin d86aae96ff feat: add support for darwin 2023-05-25 23:45:19 +08:00
ryan4yin ab1ecc49ed feat: add TODO 2023-05-25 23:45:13 +08:00
ryan4yin 2baeb2e284 feat: use a separate passphraseless ssh key for agenix 2023-05-25 02:53:14 +08:00
ryan4yin 2c3df9ba1e feat: enable ssh-agent and forwardAgent for homelab's machine 2023-05-25 02:28:19 +08:00
ryan4yin 4511f834af feat: add supported filesystems - ntfs/fat/... 2023-05-25 00:34:58 +08:00
ryan4yin 89653cabe4 feat: bump nixpkgs's stable version to nixos-23.05, add some useful packages 2023-05-24 23:18:12 +08:00
ryan4yin 4959da0b7e feat: add lsp - nil, add iso/qcow2 generator 2023-05-21 19:37:48 +08:00
145 changed files with 3553 additions and 1992 deletions
+2
View File
@@ -0,0 +1,2 @@
result
result/
+24 -2
View File
@@ -8,8 +8,30 @@ update:
nix flake update nix flake update
history: history:
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system nix profile history --profile /nix/var/nix/profiles/system
gc: gc:
sudo nix-collect-garbage --delete-older-than 14d # remove all generations older than 7 days
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
# garbage collect all unused nix store entries older than 14 days
sudo nix store gc --debug
darwin-set-proxy:
sudo python3 scripts/darwin_set_proxy.py
darwin: darwin-set-proxy
nix build .#darwinConfigurations.harmonica.system \
--extra-experimental-features 'nix-command flakes'
./result/sw/bin/darwin-rebuild switch --flake .
darwin-debug: darwin-set-proxy
nix build .#darwinConfigurations.harmonica.system \
--show-trace --verbose \
--extra-experimental-features 'nix-command flakes'
./result/sw/bin/darwin-rebuild switch --flake . --show-trace --verbose
.PHONY: clean
clean:
rm -rf result
+27 -6
View File
@@ -2,7 +2,6 @@
This repository is home to the nix code that builds my systems. This repository is home to the nix code that builds my systems.
## Screenshots ## Screenshots
![](./_img/screenshot_2023-05-07-21-21.webp) ![](./_img/screenshot_2023-05-07-21-21.webp)
@@ -10,19 +9,26 @@ This repository is home to the nix code that builds my systems.
## TODO ## TODO
- enable disk encryption to enhance data security - enable disk encryption to enhance data security
- make fcitx5-rime work in vscode/chrome on wayland - make fcitx5-rime work in vscode/chrome/telegram on wayland
- auto unlock with `ssh-agent` after login
- [People using ssh-agent, how do you unlock it on login? - reddit](https://www.reddit.com/r/NixOS/comments/lsbo9a/people_using_sshagent_how_do_you_unlock_it_on/)
- update scripts for i3wm, especially rofi & screenshot
- fix `xdg-open`: after set `firefox.desktop` as defaultApplication, NixOS returned error `no apps installed that can open "https://baidu.com"`
- `Xcursor.size` do not take effect in i3
## Why Nix? ## Why Nix?
Nix allows for easy to manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works forever. If someone else shares their configuration, anyone can make use of it. Nix allows for easy to manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works forever. If someone else shares their configuration, anyone can make use of it.
Want to know Nix in details? Looking for a beginner-friendly tutorial? Check out [NixOS & Nix Flakes - A Guide for Beginners](https://thiscute.world/en/posts/nixos-and-flake-basics/)! **Want to know Nix in details? Looking for a beginner-friendly tutorial? Check out [NixOS & Nix Flakes - A Guide for Beginners](https://thiscute.world/en/posts/nixos-and-flake-basics/)!**
## How to Deploy this Flake? ## How to Deploy this Flake?
>Note: you should NOT deploy this flake directly on your machine, it contains my hardware information and personal information which is not suitable for you. You may use this repo as a reference to build your own configuration. > Note: you should NOT deploy this flake directly on your machine, it contains my hardware information and personal information which is not suitable for you. You may use this repo as a reference to build your own configuration.
After installed NixOS with `nix-command` & `flake` enabled, you can deploy this flake with the following command: After installed NixOS with `nix-command` & `flake` enabled, flow the steps below to deploy this flake.
For NixOS, use the following commands:
```bash ```bash
# deploy my test configuration # deploy my test configuration
@@ -39,6 +45,16 @@ sudo nixos-rebuild switch
make deploy make deploy
``` ```
For MacOS, use the following commands:
```bash
# deploy the darwin configuration(harmonicia)
make darwin
# deploy with details
make darwin-debug
```
## Install Apps from Flatpak ## Install Apps from Flatpak
We can install apps from flathub, which has a lot of apps that are not supported well in nixpkgs. We can install apps from flathub, which has a lot of apps that are not supported well in nixpkgs.
@@ -50,6 +66,9 @@ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flat
# install apps from flathub # install apps from flathub
flatpak install netease-cloud-music-gtk flatpak install netease-cloud-music-gtk
# install 3d printer slicer - cura
flatpak install flathub com.ultimaker.cura
# or you can search apps from flathub # or you can search apps from flathub
flatpak search <keyword> flatpak search <keyword>
# search on website is also supported: https://flathub.org/ # search on website is also supported: https://flathub.org/
@@ -57,9 +76,10 @@ flatpak search <keyword>
## Other Interesting Dotfiles ## Other Interesting Dotfiles
Other configurations from where I learned and copied: Other configurations that inspired me:
- [notwidow/hyprland](https://github.com/notwidow/hyprland): hyprland configuration - [notwidow/hyprland](https://github.com/notwidow/hyprland): hyprland configuration
- [denisse-dev/dotfiles](https://github.com/denisse-dev/dotfiles)
- [notusknot/dotfiles-nix](https://github.com/notusknot/dotfiles-nix) - [notusknot/dotfiles-nix](https://github.com/notusknot/dotfiles-nix)
- [xddxdd/nixos-config](https://github.com/xddxdd/nixos-config) - [xddxdd/nixos-config](https://github.com/xddxdd/nixos-config)
- [bobbbay/dotfiles](https://github.com/bobbbay/dotfiles) - [bobbbay/dotfiles](https://github.com/bobbbay/dotfiles)
@@ -67,3 +87,4 @@ Other configurations from where I learned and copied:
- [fufexan/dotfiles](https://github.com/fufexan/dotfiles) - [fufexan/dotfiles](https://github.com/fufexan/dotfiles)
- [davidtwco/veritas](https://github.com/davidtwco/veritas) - [davidtwco/veritas](https://github.com/davidtwco/veritas)
- [NixOS-CN/NixOS-CN-telegram](https://github.com/NixOS-CN/NixOS-CN-telegram) - [NixOS-CN/NixOS-CN-telegram](https://github.com/NixOS-CN/NixOS-CN-telegram)
- [Tips&Tricks for NixOS Desktop](https://discourse.nixos.org/t/tips-tricks-for-nixos-desktop/28488/2)
Generated
+215 -43
View File
@@ -29,11 +29,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1684343812, "lastModified": 1673295039,
"narHash": "sha256-ZTEjiC8PDKeP8JRchuwcFXUNlMcyQ4U+DpyVZ3pB6Q4=", "narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "dfbdabbb3e797334172094d4f6c0ffca8c791281", "rev": "87b9d090ad39b25b2400029c64825fc2a8868943",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -43,6 +43,26 @@
"type": "github" "type": "github"
} }
}, },
"darwin_2": {
"inputs": {
"nixpkgs": [
"nixpkgs-darwin"
]
},
"locked": {
"lastModified": 1685559570,
"narHash": "sha256-MNIQvLRoq92isMLR/ordKNCl+aXNiuwBM4QyqmS8d00=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "4338bc869e9874d54a4c89539af72f16666b2abe",
"type": "github"
},
"original": {
"owner": "lnl7",
"repo": "nix-darwin",
"type": "github"
}
},
"devenv": { "devenv": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@@ -151,6 +171,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -181,11 +219,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1684596126, "lastModified": 1682203081,
"narHash": "sha256-4RZZmygeEXpuBqEXGs38ZAcWjWKGwu13Iqbxub6wuJk=", "narHash": "sha256-kRL4ejWDhi0zph/FpebFYhzqlOBrk0Pl3dzGEKSAlEw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "27ef11f0218d9018ebb2948d40133df2b1de622d", "rev": "32d3e39c491e2f91152c84f8ad8b003420eab0a1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -201,15 +239,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1684484967, "lastModified": 1685599623,
"narHash": "sha256-P3ftCqeJmDYS9LSr2gGC4XGGcp5vv8TOasJX6fVHWsw=", "narHash": "sha256-Tob4CMOVHue0D3RzguDBCtUmX5ji2PsdbQDbIOIKvsc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "b9a52ad20e58ebd003444915e35e3dd2c18fc715", "rev": "93db05480c0c0f30382d3e80779e8386dcb4f9dd",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-23.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@@ -259,15 +298,15 @@
}, },
"lib-aggregate": { "lib-aggregate": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_3",
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1681214977, "lastModified": 1685621386,
"narHash": "sha256-pBaG4iKzF/YJQA06f87IZokB15Z13DYd6zsT/wlbWfI=", "narHash": "sha256-QxSbJ/deTW8r9DCveOr5N/TpiUqBAmGXsKdqmnVNW8s=",
"owner": "nix-community", "owner": "nix-community",
"repo": "lib-aggregate", "repo": "lib-aggregate",
"rev": "19d70ca7a81956bd01a768297b84798f301e150f", "rev": "5b7f85fd4ee671b013f2c1935abf4cb5499ad3b5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -292,6 +331,27 @@
"type": "github" "type": "github"
} }
}, },
"nil": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_4",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1683653883,
"narHash": "sha256-Xg3Cux5wQDatXRvQWsVD0YPfmxfijjG8+gxYqgoT6JE=",
"owner": "oxalica",
"repo": "nil",
"rev": "18de045d7788df2343aec58df7b85c10d1f5d5dd",
"type": "github"
},
"original": {
"owner": "oxalica",
"ref": "2023-05-09",
"repo": "nil",
"type": "github"
}
},
"nix": { "nix": {
"inputs": { "inputs": {
"lowdown-src": "lowdown-src", "lowdown-src": "lowdown-src",
@@ -319,14 +379,14 @@
"nix-eval-jobs": { "nix-eval-jobs": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1682480188, "lastModified": 1685435187,
"narHash": "sha256-4LG8Vl/fLWsJg+QAb5/PvZTdLtPFsYFxuGDfEAR5szA=", "narHash": "sha256-2tSrjl16iHdG6FYMNKS+MdsIDrCWXuKQ0XRWcdbMdFg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-eval-jobs", "repo": "nix-eval-jobs",
"rev": "73ee1712faeb5db609fc9f991e2dc1de265acff5", "rev": "a0e0808280535bc22ffde7d34ecad11014edd6a9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -335,13 +395,49 @@
"type": "github" "type": "github"
} }
}, },
"nixlib": {
"locked": {
"lastModified": 1681001314,
"narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "367c0e1086a4eb4502b24d872cea2c7acdd557f4",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixos-generators": {
"inputs": {
"nixlib": "nixlib",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1685446848,
"narHash": "sha256-vEU1jynjDXwOJESHeJyABqbY/Y+DoihZq9iDVtYgrMg=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "b6114e214e5b546c4cceccd33ee6b72294a76b60",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-generators",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1684570954, "lastModified": 1677676435,
"narHash": "sha256-FX5y4Sm87RWwfu9PI71XFvuRpZLowh00FQpIJ1WfXqE=", "narHash": "sha256-6FxdcmQr5JeZqsQvfinIMr0XcTyTuR7EXX0H3ANShpQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3005f20ce0aaa58169cdee57c8aa12e5f1b6e1b3", "rev": "a08d6979dd7c82c4cef0dcc6ac45ab16051c1169",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -351,13 +447,29 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-darwin": {
"locked": {
"lastModified": 1685865905,
"narHash": "sha256-XJZ/o17eOd2sEsGif+/MQBnfa2DKmndWgJyc7CWajFc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e7603eba51f2c7820c0a182c6bbb351181caa8e7",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-23.05-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1681001314, "lastModified": 1685561605,
"narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=", "narHash": "sha256-LqEu1IWP8UWKxwwrpPtp1/p+JRCaUI0hl8e4hht5YdI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "367c0e1086a4eb4502b24d872cea2c7acdd557f4", "rev": "75aeea15ee4971c52c56bbbee84066e74d53d858",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -400,16 +512,16 @@
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1684398685, "lastModified": 1685801374,
"narHash": "sha256-TRE62m91iZ5ArVMgA+uj22Yda8JoQuuhc9uwZ+NoX+0=", "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "628d4bb6e9f4f0c30cfd9b23d3c1cdcec9d3cb5c", "rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-22.11", "ref": "nixos-23.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@@ -419,14 +531,14 @@
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"lib-aggregate": "lib-aggregate", "lib-aggregate": "lib-aggregate",
"nix-eval-jobs": "nix-eval-jobs", "nix-eval-jobs": "nix-eval-jobs",
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_7"
}, },
"locked": { "locked": {
"lastModified": 1684592015, "lastModified": 1685650687,
"narHash": "sha256-6gFt1LE/stVQFeGI263pU6O5EAeY1TPTGee1vvbkwZo=", "narHash": "sha256-RhZ2Ih8t0Q0RFfBp3+/a65ncGwaeYsDVEFWbjdv5jOU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs-wayland", "repo": "nixpkgs-wayland",
"rev": "aeb1b88206756e867e398d18e2856b60fc803e12", "rev": "217783e46fd199a033af8d488551c77b7019c752",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -469,11 +581,27 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1684570954, "lastModified": 1682929865,
"narHash": "sha256-FX5y4Sm87RWwfu9PI71XFvuRpZLowh00FQpIJ1WfXqE=", "narHash": "sha256-jxVrgnf5QNjO+XoxDxUWtN2G5xyJSGZ5SWDQFxMuHxc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3005f20ce0aaa58169cdee57c8aa12e5f1b6e1b3", "rev": "f2e9a130461950270f87630b11132323706b4d91",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1685836261,
"narHash": "sha256-rpxEPGeW4JZJcH58SQApJUtJ7w78VPtkF6Cut/Pq6Kg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "dd4982554e18b936790da07c4ea2db7c7600f283",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -483,7 +611,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_5": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1681347147, "lastModified": 1681347147,
"narHash": "sha256-B+hTioRc3Jdf4SJyeCiO0fW5ShIznJk2OTiW2vOV+mc=", "narHash": "sha256-B+hTioRc3Jdf4SJyeCiO0fW5ShIznJk2OTiW2vOV+mc=",
@@ -499,13 +627,13 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_6": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1684570954, "lastModified": 1685383865,
"narHash": "sha256-FX5y4Sm87RWwfu9PI71XFvuRpZLowh00FQpIJ1WfXqE=", "narHash": "sha256-3uQytfnotO6QJv3r04ajSXbEFMII0dUtw0uqYlZ4dbk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3005f20ce0aaa58169cdee57c8aa12e5f1b6e1b3", "rev": "5e871d8aa6f57cc8e0dc087d1c5013f6e212b4ce",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -517,11 +645,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1684585623, "lastModified": 1685880642,
"narHash": "sha256-28XEOYjrpzlVDt11Elz7db8R3HwY/4B6EspFscSRsfk=", "narHash": "sha256-jQNe2IAL7qPdwCk8HnwlfJN790YjIoRu4EfjfI6y0qk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "4e959da0346280293e4008150d48b82fe055a311", "rev": "65b4ce84312de2fec2e26315bad06278e3e4acd5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -561,15 +689,44 @@
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"darwin": "darwin_2",
"devenv": "devenv", "devenv": "devenv",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"hyprland": "hyprland", "hyprland": "hyprland",
"nixpkgs": "nixpkgs_4", "nil": "nil",
"nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs_5",
"nixpkgs-darwin": "nixpkgs-darwin",
"nixpkgs-stable": "nixpkgs-stable_2", "nixpkgs-stable": "nixpkgs-stable_2",
"nixpkgs-wayland": "nixpkgs-wayland", "nixpkgs-wayland": "nixpkgs-wayland",
"nur": "nur" "nur": "nur"
} }
}, },
"rust-overlay": {
"inputs": {
"flake-utils": [
"nil",
"flake-utils"
],
"nixpkgs": [
"nil",
"nixpkgs"
]
},
"locked": {
"lastModified": 1682907601,
"narHash": "sha256-FfUAYvRJ+6s9WWjXNPdRzuuvAeu2VHIXIbUkPJr4t14=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "5eaff055dd57128c53ae373dc96af944f5849daa",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@@ -585,6 +742,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"wlroots": { "wlroots": {
"flake": false, "flake": false,
"locked": { "locked": {
+133 -36
View File
@@ -1,18 +1,15 @@
{ {
description = "NixOS configuration of Ryan Yin"; description = "NixOS configuration of Ryan Yin";
# flake 为了确保够纯,它不依赖系统自身的 /etc/nix/nix.conf,而是在 flake.nix 中通过 nixConfig 设置 # the nixConfig here only affects the flake itself, not the system configuration!
# 但是为了确保安全性,flake 默认仅允许直接设置少数 nixConfig 参数,其他参数都需要在执行 nix 命令时指定 `--accept-flake-config`,否则会被忽略
# <https://nixos.org/manual/nix/stable/command-ref/conf-file.html>
# 如果有些包国内镜像下载不到,它仍然会走国外,这时候就得靠旁路由来解决了。
# 临时修改默认网关为旁路由: sudo ip route add default via 192.168.5.201
# sudo ip route del default via 192.168.5.201
nixConfig = { nixConfig = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
substituters = [ substituters = [
# replace official cache with a mirror located in China # replace official cache with a mirror located in China
"https://mirrors.bfsu.edu.cn/nix-channels/store" "https://mirrors.bfsu.edu.cn/nix-channels/store"
"https://cache.nixos.org/" "https://mirrors.ustc.edu.cn/nix-channels/store"
"https://cache.nixos.org"
]; ];
# nix community's cache server # nix community's cache server
@@ -29,87 +26,187 @@
]; ];
}; };
# 这是 flake.nix 的标准格式,inputs 是 flake 的依赖,outputs 是 flake 的输出
# inputs 中的每一项都被拉取、构建后,被作为参数传递给 outputs 函数
inputs = {
# flake inputs 有很多种引用方式,应用最广泛的是 github 的引用方式
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # 使用 nixos-unstable 分支 for nix flakes # This is the standard format for flake.nix. `inputs` are the dependencies of the flake,
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-22.11"; # unstable branch may be broken sometimes, use stable branch when necessary # and `outputs` function will return all the build results of the flake.
# Each item in `inputs` will be passed as a parameter to the `outputs` function after being pulled and built.
inputs = {
# There are many ways to reference flake inputs. The most widely used is github:owner/name/reference,
# which represents the GitHub repository URL + branch/commit-id/tag.
# Official NixOS package source, using nixos-unstable branch here
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.05";
# for macos
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.05-darwin";
darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs-darwin";
};
# nix users repository # nix users repository
# used to install some packages not in nixpkgs # used to install some packages not in nixpkgs
# e.g. wechat-uos/qqmusic/dingtalk # e.g. wechat-uos/qqmusic/dingtalk
nur.url = github:nix-community/NUR; nur.url = "github:nix-community/NUR";
home-manager.url = "github:nix-community/home-manager"; # home-manager, used for managing user configuration
# follows 是 inputs 中的继承语法 home-manager = {
# 这里使 home-manager 的 nixpkgs 这个 inputs 与当前 flake 的 inputs.nixpkgs 保持一致,避免依赖的 nixpkgs 版本不一致导致问题 url = "github:nix-community/home-manager/release-23.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; # The `follows` keyword in inputs is used for inheritance.
# Here, `inputs.nixpkgs` of home-manager is kept consistent with the `inputs.nixpkgs` of the current flake,
# to avoid problems caused by different versions of nixpkgs dependencies.
inputs.nixpkgs.follows = "nixpkgs";
};
# modern window compositor # modern window compositor
hyprland.url = "github:hyprwm/Hyprland/v0.25.0"; hyprland.url = "github:hyprwm/Hyprland/v0.25.0";
# community wayland nixpkgs # community wayland nixpkgs
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
# generate iso/qcow2/docker/... image from nixos configuration
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
# use devenv to manage my development environment # use devenv to manage my development environment
devenv.url = "github:cachix/devenv/v0.6.2"; devenv.url = "github:cachix/devenv/v0.6.2";
# secrets management, lock with git commit at 2023/5/15 # secrets management, lock with git commit at 2023/5/15
agenix.url = "github:ryantm/agenix/db5637d10f797bb251b94ef9040b237f4702cde3"; agenix.url = "github:ryantm/agenix/db5637d10f797bb251b94ef9040b237f4702cde3";
# nix language server, used by vscode & neovim
nil.url = "github:oxalica/nil/2023-05-09";
}; };
# outputs 的参数都是 inputs 中定义的依赖项,可以通过它们的名称来引用。 # `outputs` are all the build result of the flake.
# 不过 self 是个例外,这个特殊参数指向 outputs 自身(自引用),以及 flake 根目录 # A flake can have many use cases and different types of outputs.
# 这里的 @ 语法将函数的参数 attribute set 取了个别名,方便在内部使用 # parameters in `outputs` are defined in `inputs` and can be referenced by their names.
# However, `self` is an exception, This special parameter points to the `outputs` itself (self-reference)
# The `@` syntax here is used to alias the attribute set of the inputs's parameter, making it convenient to use inside the function.
outputs = inputs@{ outputs = inputs@{
self, self,
nixpkgs, nixpkgs,
darwin,
home-manager, home-manager,
... ...
}: { }: {
nixosConfigurations = { nixosConfigurations = {
msi-rtx4090 = nixpkgs.lib.nixosSystem { # By default, NixOS will try to refer the nixosConfiguration with its hostname.
# so the system named `msi-rtx4090` will use this configuration.
# However, the configuration name can also be specified using `sudo nixos-rebuild switch --flake /path/to/flakes/directory#<name>`.
# The `nixpkgs.lib.nixosSystem` function is used to build this configuration, the following attribute set is its parameter.
# Run `sudo nixos-rebuild switch --flake .#msi-rtx4090` in the flake's directory to deploy this configuration on any NixOS system
msi-rtx4090 = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = inputs; # The Nix module system can modularize configurations, improving the maintainability of configurations.
#
# Each parameter in the `modules` is a Nix Module, and there is a partial introduction to it in the nixpkgs manual:
# <https://nixos.org/manual/nixpkgs/unstable/#module-system-introduction>
# It is said to be partial because the documentation is not complete, only some simple introductions
# (such is the current state of Nix documentation...)
# A Nix Module can be an attribute set, or a function that returns an attribute set.
# If a Module is a function, according to the Nix Wiki description, this function can have up to four parameters:
#
# config: The configuration of the entire system
# options: All option declarations refined with all definition and declaration references.
# pkgs: The attribute set extracted from the Nix package collection and enhanced with the nixpkgs.config option.
# modulesPath: The location of the module directory of Nix.
#
# Only these four parameters can be passed by default.
# If you need to pass other parameters, you must use `specialArgs` by uncomment the following line
specialArgs = {
pkgs-stable = import inputs.nixpkgs-stable {
system = system; # refer the `system` parameter form outer scope recursively
# To use chrome, we need to allow the installation of non-free software
config.allowUnfree = true;
};
} // inputs;
modules = [ modules = [
./hosts/msi-rtx4090 ./hosts/msi-rtx4090
# home-manager 作为 nixos 的一个 module # make home-manager as a module of nixos
# 这样在 nixos-rebuild switch 时,home-manager 也会被自动部署,不需要额外执行 home-manager switch 命令 # so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch`
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
# 使用 home-manager.extraSpecialArgs 自定义传递给 ./home 的参数 # pass all inputs into home manager's all sub modules
home-manager.extraSpecialArgs = inputs; home-manager.extraSpecialArgs = specialArgs;
home-manager.users.ryan = import ./home; home-manager.users.ryan = import ./home/linux/x11.nix;
} }
]; ];
}; };
nixos-test = nixpkgs.lib.nixosSystem rec {
nixos-test = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = inputs; specialArgs = {
pkgs-stable = import inputs.nixpkgs-stable {
system = system;
config.allowUnfree = true;
};
} // inputs;
modules = [ modules = [
./hosts/nixos-test ./hosts/nixos-test
# home-manager 作为 nixos 的一个 module
# 这样在 nixos-rebuild switch 时,home-manager 也会被自动部署,不需要额外执行 home-manager switch 命令
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
# 使用 home-manager.extraSpecialArgs 自定义传递给 ./home 的参数 home-manager.extraSpecialArgs = specialArgs;
home-manager.extraSpecialArgs = inputs; home-manager.users.ryan = import ./home/linux/wayland.nix;
home-manager.users.ryan = import ./home;
} }
]; ];
}; };
}; };
# configurations for MacOS
darwinConfigurations."harmonica" = darwin.lib.darwinSystem {
system = "x86_64-darwin";
specialArgs = inputs;
modules = [
./hosts/harmonica
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs;
home-manager.users.admin = import ./home/darwin;
}
];
};
# generate qcow2 & iso image from nixos configuration
# https://github.com/nix-community/nixos-generators
# packages.x86_64-linux = {
# qcow2 = nixos-generators.nixosGenerate {
# system = "x86_64-linux";
# modules = [
# # you can include your own nixos configuration here, i.e.
# # ./configuration.nix
# ];
# format = "qcow";
# # you can also define your own custom formats
# # customFormats = { "myFormat" = <myFormatModule>; ... };
# # format = "myFormat";
# };
# iso = nixos-generators.nixosGenerate {
# system = "x86_64-linux";
# modules = [
# # you can include your own nixos configuration here, i.e.
# # ./configuration.nix
# ];
# format = "iso";
# };
# };
}; };
} }
+98
View File
@@ -0,0 +1,98 @@
{config, pkgs, ...}:
{
home.packages = with pkgs; [
neofetch
nnn # terminal file manager
# archives
zip
xz
unzip
p7zip
# utils
ripgrep # recursively searches directories for a regex pattern
jq # A lightweight and flexible command-line JSON processor
yq-go # yaml processer https://github.com/mikefarah/yq
exa # A modern replacement for ls
fzf # A command-line fuzzy finder
# networking tools
mtr # A network diagnostic tool
iperf3
ldns # replacement of dig, it provide the command `drill`
aria2 # A lightweight multi-protocol & multi-source command-line download utility
socat # replacement of openbsd-netcat
nmap # A utility for network discovery and security auditing
# misc
cowsay
file
which
tree
gnused
gnutar
gawk
zstd
caddy
gnupg
# nix related
#
# it provides the command `nom` works just like `nix
# with more details log output
nix-output-monitor
# productivity
hugo # static site generator
glow # markdown previewer in terminal
];
programs = {
# A terminal multiplexer
tmux = {
enable = true;
};
# a cat(1) clone with syntax highlighting and Git integration.
bat = {
enable = true;
config = {
pager = "less -FR";
theme = "Catppuccin-mocha";
};
themes = {
Catppuccin-mocha = builtins.readFile (pkgs.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/bat/main/Catppuccin-mocha.tmTheme";
hash = "sha256-qMQNJGZImmjrqzy7IiEkY5IhvPAMZpq0W6skLLsng/w=";
});
};
};
# skim provides a single executable: sk.
# Basically anywhere you would want to use grep, try sk instead.
skim = {
enable = true;
enableBashIntegration = true;
};
};
programs.bash = {
enable = true;
enableCompletion = true;
bashrcExtra = ''
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
'';
};
home.shellAliases = {
k = "kubectl";
vim = "nvim";
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
httpproxy = "export https_proxy=http://127.0.0.1:7890; export http_proxy=http://127.0.0.1:7890;";
};
}
+13
View File
@@ -0,0 +1,13 @@
{config, pkgs, ...}:
{
imports = [
./nushell
./core.nix
./development.nix
./git.nix
./media.nix
./starship.nix
];
}
+117
View File
@@ -0,0 +1,117 @@
{config, pkgs, nil, ...}:
{
home.packages = with pkgs; [
nil.packages."${pkgs.system}".default # nix language server
# IDE
jetbrains.pycharm-community
jetbrains.idea-community
# cloud native
skopeo
docker-compose
dive # explore docker layers
kubectl
kubernetes-helm
terraform
# terraformer # generate terraform configs from existing cloud resources
pulumi
pulumictl
k9s
# istioctl
# cloud provider
awscli
aws-iam-authenticator
eksctl
# DO NOT install build tools for C/C++, set it per project by devShell instead
gnumake # used by this repo, to simplify the deployment
clang-tools
clang-analyzer
# lldb
# cmake
# autoconf
# automake
# bison
# cppcheck
# fakeroot
# flex
# gettext
# groff
# libtool
# m4
# patch
# pkgconf
# texinfo
# binutils
# Golang
delve
go
go-outline
go-tools
go2nix
gomodifytags
gopls
gotests
impl
# Rust
rustup
# python
(python310.withPackages(ps: with ps; [
ipython
pandas
requests
pyquery
]))
# db related
dbeaver
mycli
pgcli
mongosh
sqlite
# embedded development
minicom
# other languages
# julia
zig
# elixir
# solidity
# java
# adoptopenjdk-openj9-bin-17
# other tools
k6 # load testing tool
mitmproxy # http/https proxy tool
protobuf # protocol buffer compiler
];
programs = {
# modern vim
neovim = {
enable = true;
extraConfig = ''
set number relativenumber
'';
};
direnv = {
enable = true;
nix-direnv.enable = true;
enableZshIntegration = true;
};
};
# GitHub CLI tool
programs.gh = {
enable = true;
};
}
+61
View File
@@ -0,0 +1,61 @@
{
config,
lib,
pkgs,
...
}: {
# `programs.git` will generate the config file: ~/.config/git/config
# to make git use this config file, `~/.gitconfig` should not exist!
#
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
rm -f ~/.gitconfig
'';
programs.git = {
enable = true;
lfs.enable = true;
userName = "Ryan Yin";
userEmail = "xiaoyin_c@qq.com";
includes = [
{
# use diffrent email & name for work
path = "~/work/.gitconfig";
condition = "gitdir:~/work/";
}
];
extraConfig = {
pull = {
rebase = true;
};
# replace https with ssh
url = {
"ssh://git@github.com/" = {
insteadOf = "https://github.com/";
};
"ssh://git@gitlab.com/" = {
insteadOf = "https://gitlab.com/";
};
"ssh://git@bitbucket.com/" = {
insteadOf = "https://bitbucket.com/";
};
};
};
# signing = {
# key = "xxx";
# signByDefault = true;
# };
delta = {
enable = true;
options = {
features = "side-by-side";
};
};
};
}
+16
View File
@@ -0,0 +1,16 @@
{
pkgs,
config,
...
}:
# processing audio/video
{
home.packages = with pkgs; [
ffmpeg-full
# images
viu # terminal image viewer
imagemagick
graphviz
];
}
+7
View File
@@ -0,0 +1,7 @@
{
programs.nushell = {
enable = true;
# configFile.source = ./config.nu;
# envFile.source = ./env.nu;
};
}
@@ -1,6 +1,10 @@
{config, ...}: { {config, ...}: {
programs.starship = { programs.starship = {
enable = true; enable = true;
enableBashIntegration = true;
enableNushellIntegration = true;
settings = { settings = {
character = { character = {
success_symbol = "[](bold green)"; success_symbol = "[](bold green)";
+730
View File
@@ -0,0 +1,730 @@
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
import:
# all alacritty themes can be found at
# https://github.com/alacritty/alacritty-theme
- ~/.config/alacritty/theme_github_dark.yml
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
window:
# Window dimensions (changes require restart)
#
# Number of lines/columns (not pixels) in the terminal. Both lines and columns
# must be non-zero for this to take effect. The number of columns must be at
# least `2`, while using a value of `0` for columns and lines will fall back
# to the window manager's recommended size
#dimensions:
# columns: 0
# lines: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
padding:
x: 5
y: 5
# Spread additional padding evenly around the terminal content.
dynamic_padding: true
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background and no title bar buttons
#decorations: full
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
opacity: 0.98
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
startup_mode: Windowed
# Window title
title: Alacritty
# Allow terminal applications to change Alacritty's window title.
dynamic_title: true
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# Decorations theme variant
#
# Override the variant of the System theme/GTK theme/Wayland client side
# decorations. Commonly supported values are `Dark`, `Light`, and `None` for
# auto pick-up. Set this to `None` to use the default theme variant.
#decorations_theme_variant: None
# Resize increments
#
# Prefer resizing window by discrete steps equal to cell dimensions.
#resize_increments: false
# Make `Option` key behave as `Alt` (macOS only):
# - OnlyLeft
# - OnlyRight
# - Both
# - None (default)
#option_as_alt: None
scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
bold:
family: JetBrainsMono Nerd Font
italic:
family: JetBrainsMono Nerd Font
normal:
family: JetBrainsMono Nerd Font
bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: JetBrainsMono Nerd Font
# Point size
size: 14
# Offset is the extra space around each character. `offset.y` can be thought
# of as modifying the line spacing, and `offset.x` as modifying the letter
# spacing.
#offset:
# x: 0
# y: 0
# Glyph offset determines the locations of the glyphs within their cells with
# the default being at the bottom. Increasing `x` moves the glyph to the
# right, increasing `y` moves the glyph upward.
#glyph_offset:
# x: 0
# y: 0
# Use built-in font for box drawing characters.
#
# If `true`, Alacritty will use a custom built-in font for box drawing
# characters (Unicode points 2500 - 259f).
#
#builtin_box_drawing: true
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
# Bell
#
# The bell is rung every time the BEL control character is received.
#bell:
# Visual Bell Animation
#
# Animation effect for flashing the screen when the visual bell is rung.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#animation: EaseOutExpo
# Duration of the visual bell flash in milliseconds. A `duration` of `0` will
# disable the visual bell animation.
#duration: 0
# Visual bell animation color.
#color: '#ffffff'
# Bell Command
#
# This program is executed whenever the bell is rung.
#
# When set to `command: None`, no command will be executed.
#
# Example:
# command:
# program: notify-send
# args: ["Hello, World!"]
#
#command: None
#selection:
# This string contains all characters that are used as separators for
# "semantic words" in Alacritty.
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
#cursor:
# Cursor style
#style:
# Cursor shape
#
# Values for `shape`:
# - ▇ Block
# - _ Underline
# - | Beam
#shape: Block
# Cursor blinking state
#
# Values for `blinking`:
# - Never: Prevent the cursor from ever blinking
# - Off: Disable blinking by default
# - On: Enable blinking by default
# - Always: Force the cursor to always blink
#blinking: Off
# Vi mode cursor style
#
# If the vi mode cursor style is `None` or not specified, it will fall back to
# the style of the active value of the normal cursor.
#
# See `cursor.style` for available options.
#vi_mode_style: None
# Cursor blinking interval in milliseconds.
#blink_interval: 750
# Time after which cursor stops blinking, in seconds.
#
# Specifying '0' will disable timeout for blinking.
#blink_timeout: 5
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Thickness of the cursor relative to the cell width as floating point number
# from `0.0` to `1.0`.
#thickness: 0.15
# Live config reload (changes require restart)
live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g.
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
# shell.
#
# Default:
# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset
# - (Windows) powershell
# shell:
# program: /bin/bash
# args:
# - --login
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# Offer IPC using `alacritty msg` (unix only)
#ipc_socket: true
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
# Hints
#
# Terminal hints can be used to find text or hyperlink in the visible part of
# the terminal and pipe it to other applications.
#hints:
# Keys used for the hint labels.
#alphabet: "jfkdls;ahgurieowpq"
# List with all available hints
#
# Each hint must have any of `regex` or `hyperlinks` field and either an
# `action` or a `command` field. The fields `mouse`, `binding` and
# `post_processing` are optional.
#
# The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be
# highlighted.
#
# The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and
# `mouse.mods` accept the same values as they do in the `key_bindings` section.
#
# The `mouse.enabled` field controls if the hint should be underlined while
# the mouse with all `mouse.mods` keys held or the vi mode cursor is above it.
#
# If the `post_processing` field is set to `true`, heuristics will be used to
# shorten the match if there are characters likely not to be part of the hint
# (e.g. a trailing `.`). This is most useful for URIs and applies only to
# `regex` matches.
#
# Values for `action`:
# - Copy
# Copy the hint's text to the clipboard.
# - Paste
# Paste the hint's text to the terminal or search.
# - Select
# Select the hint's text.
# - MoveViModeCursor
# Move the vi mode cursor to the beginning of the hint.
#enabled:
# - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\
# [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
# hyperlinks: true
# command: xdg-open
# post_processing: true
# mouse:
# enabled: true
# mods: None
# binding:
# key: U
# mods: Control|Shift
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty
# captures the mouse, the `Shift` modifier is automatically added as a
# requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings for actions not exclusive to mouse mode)
#
# - Mouse exclusive actions:
#
# - ExpandSelection
# Expand the selection to the current mouse cursor location.
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Right, action: ExpandSelection }
# - { mouse: Right, mods: Control, action: ExpandSelection }
# - { mouse: Middle, mode: ~Vi, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/winit/*/winit/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - ToggleViMode
# - SearchForward
# Start searching toward the right of the search origin.
# - SearchBackward
# Start searching toward the left of the search origin.
# - Copy
# - Paste
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollHalfPageUp
# - ScrollHalfPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# Remove the terminal's scrollback history.
# - Hide
# Hide the Alacritty window.
# - Minimize
# Minimize the Alacritty window.
# - Quit
# Quit Alacritty.
# - ToggleFullscreen
# - ToggleMaximized
# - SpawnNewInstance
# Spawn a new instance of Alacritty.
# - CreateNewWindow
# Create a new Alacritty window from the current process.
# - ClearLogNotice
# Clear Alacritty's UI warning and error notice.
# - ClearSelection
# Remove the active selection.
# - ReceiveChar
# - None
#
# - Vi mode exclusive actions:
#
# - Open
# Perform the action of the first matching hint under the vi mode cursor
# with `mouse.enabled` set to `true`.
# - ToggleNormalSelection
# - ToggleLineSelection
# - ToggleBlockSelection
# - ToggleSemanticSelection
# Toggle semantic selection based on `selection.semantic_escape_chars`.
# - CenterAroundViCursor
# Center view around vi mode cursor
#
# - Vi mode exclusive cursor motion actions:
#
# - Up
# One line up.
# - Down
# One line down.
# - Left
# One character left.
# - Right
# One character right.
# - First
# First column, or beginning of the line when already at the first column.
# - Last
# Last column, or beginning of the line when already at the last column.
# - FirstOccupied
# First non-empty cell in this terminal row, or first non-empty cell of
# the line when already at the first cell of the row.
# - High
# Top of the screen.
# - Middle
# Center of the screen.
# - Low
# Bottom of the screen.
# - SemanticLeft
# Start of the previous semantically separated word.
# - SemanticRight
# Start of the next semantically separated word.
# - SemanticLeftEnd
# End of the previous semantically separated word.
# - SemanticRightEnd
# End of the next semantically separated word.
# - WordLeft
# Start of the previous whitespace separated word.
# - WordRight
# Start of the next whitespace separated word.
# - WordLeftEnd
# End of the previous whitespace separated word.
# - WordRightEnd
# End of the next whitespace separated word.
# - Bracket
# Character matching the bracket at the cursor's location.
# - SearchNext
# Beginning of the next match.
# - SearchPrevious
# Beginning of the previous match.
# - SearchStart
# Start of the match to the left of the vi mode cursor.
# - SearchEnd
# End of the match to the right of the vi mode cursor.
#
# - Search mode exclusive actions:
# - SearchFocusNext
# Move the focus to the next search match.
# - SearchFocusPrevious
# Move the focus to the previous search match.
# - SearchConfirm
# - SearchCancel
# - SearchClear
# Reset the search regex.
# - SearchDeleteWord
# Delete the last word in the search regex.
# - SearchHistoryPrevious
# Go to the previous regex in the search history.
# - SearchHistoryNext
# Go to the next regex in the search history.
#
# - macOS exclusive actions:
# - ToggleSimpleFullscreen
# Enter fullscreen without occupying another space.
#
# - Linux/BSD exclusive actions:
#
# - CopySelection
# Copy from the selection buffer.
# - PasteSelection
# Paste from the selection buffer.
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Search
# - Alt
# - Vi
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# in the order they were defined in.
#key_bindings:
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp }
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop }
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
# Vi Mode
#- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode }
#- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom }
#- { key: Escape, mode: Vi|~Search, action: ClearSelection }
#- { key: I, mode: Vi|~Search, action: ToggleViMode }
#- { key: I, mode: Vi|~Search, action: ScrollToBottom }
#- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode }
#- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp }
#- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown }
#- { key: G, mode: Vi|~Search, action: ScrollToTop }
#- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom }
#- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp }
#- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown }
#- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp }
#- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown }
#- { key: Y, mode: Vi|~Search, action: Copy }
#- { key: Y, mode: Vi|~Search, action: ClearSelection }
#- { key: Copy, mode: Vi|~Search, action: ClearSelection }
#- { key: V, mode: Vi|~Search, action: ToggleNormalSelection }
#- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection }
#- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection }
#- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection }
#- { key: Return, mode: Vi|~Search, action: Open }
#- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor }
#- { key: K, mode: Vi|~Search, action: Up }
#- { key: J, mode: Vi|~Search, action: Down }
#- { key: H, mode: Vi|~Search, action: Left }
#- { key: L, mode: Vi|~Search, action: Right }
#- { key: Up, mode: Vi|~Search, action: Up }
#- { key: Down, mode: Vi|~Search, action: Down }
#- { key: Left, mode: Vi|~Search, action: Left }
#- { key: Right, mode: Vi|~Search, action: Right }
#- { key: Key0, mode: Vi|~Search, action: First }
#- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last }
#- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied }
#- { key: H, mods: Shift, mode: Vi|~Search, action: High }
#- { key: M, mods: Shift, mode: Vi|~Search, action: Middle }
#- { key: L, mods: Shift, mode: Vi|~Search, action: Low }
#- { key: B, mode: Vi|~Search, action: SemanticLeft }
#- { key: W, mode: Vi|~Search, action: SemanticRight }
#- { key: E, mode: Vi|~Search, action: SemanticRightEnd }
#- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft }
#- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight }
#- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd }
#- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket }
#- { key: Slash, mode: Vi|~Search, action: SearchForward }
#- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward }
#- { key: N, mode: Vi|~Search, action: SearchNext }
#- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious }
# Search Mode
#- { key: Return, mode: Search|Vi, action: SearchConfirm }
#- { key: Escape, mode: Search, action: SearchCancel }
#- { key: C, mods: Control, mode: Search, action: SearchCancel }
#- { key: U, mods: Control, mode: Search, action: SearchClear }
#- { key: W, mods: Control, mode: Search, action: SearchDeleteWord }
#- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious }
#- { key: N, mods: Control, mode: Search, action: SearchHistoryNext }
#- { key: Up, mode: Search, action: SearchHistoryPrevious }
#- { key: Down, mode: Search, action: SearchHistoryNext }
#- { key: Return, mode: Search|~Vi, action: SearchFocusNext }
#- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious }
# (Windows, Linux, and BSD only)
#- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste }
#- { key: C, mods: Control|Shift, action: Copy }
#- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward }
#- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward }
#- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Plus, mods: Control, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Control, action: IncreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (macOS only)
#- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory }
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Plus, mods: Command, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection }
#- { key: H, mods: Command, action: Hide }
#- { key: H, mods: Command|Alt, action: HideOtherApplications }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: N, mods: Command, action: CreateNewWindow }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#- { key: F, mods: Command, mode: ~Search, action: SearchForward }
#- { key: B, mods: Command, mode: ~Search, action: SearchBackward }
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - Off
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Renderer override.
# - glsl3
# - gles2
# - gles2_pure
#renderer: None
# Print all received window events.
#print_events: false
# Highlight window damage information.
#highlight_damage: false
+10
View File
@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
programs.alacritty = {
enable = true;
};
xdg.configFile."alacritty/alacritty.yml".source = ./alacritty.yml;
xdg.configFile."alacritty/theme_github_dark.yml".source = ./theme_github_dark.yml;
}
@@ -0,0 +1,32 @@
# github Alacritty Colors
colors:
# Default colors
primary:
background: '0x24292e'
foreground: '0xd1d5da'
# Normal colors
normal:
black: '0x586069'
red: '0xea4a5a'
green: '0x34d058'
yellow: '0xffea7f'
blue: '0x2188ff'
magenta: '0xb392f0'
cyan: '0x39c5cf'
white: '0xd1d5da'
# Bright colors
bright:
black: '0x959da5'
red: '0xf97583'
green: '0x85e89d'
yellow: '0xffea7f'
blue: '0x79b8ff'
magenta: '0xb392f0'
cyan: '0x56d4dd'
white: '0xfafbfc'
indexed_colors:
- { index: 16, color: '0xd18616' }
- { index: 17, color: '0xf97583' }
+59
View File
@@ -0,0 +1,59 @@
# Install those apps using brew, instead of nix
# because they are not available in nixpkgs with the support of darwin
# ==> Brew Casks
# jdk-mission-control
# anki firefox iina openinterminal-lite
# insomnia orbstack
# clashx google-chrome
# google-cloud-sdk telegram wireshark
{pkgs, ...}:
{
# MacOS specific configuration
home.packages = with pkgs; [
mpv
discord
];
# stable version of vscode
programs.vscode = {
enable = true;
};
programs.ssh = {
enable = true;
# all my ssh private key are generated by `ssh-keygen -t ed25519 -C "ryan@nickname"`
# the config's format:
# Host — given the pattern used to match against the host name given on the command line.
# HostName — specify nickname or abbreviation for host
# IdentityFile — the location of your SSH key authentication file for the account.
# format in details:
# https://www.ssh.com/academy/ssh/config
extraConfig = ''
Host 192.168.*
# allow to securely use local SSH agent to authenticate on the remote machine.
# It has the same effect as adding cli option `ssh -A user@host`
ForwardAgent yes
# romantic holds my homelab~
IdentityFile ~/.ssh/romantic
# Specifies that ssh should only use the identity file explicitly configured above
# required to prevent sending default identity files first.
IdentitiesOnly yes
Host github.com
Hostname github.com
# github is controlled by gluttony~
IdentityFile ~/.ssh/harmonica
# Specifies that ssh should only use the identity file explicitly configured above
# required to prevent sending default identity files first.
IdentitiesOnly yes
'';
# use ssh-agent so we only need to input passphrase once
# run `ssh-add /path/to/key` for every identity file
# check imported keys by `ssh-add -l`
# TODO `ssh-add` can only add keys temporary, use gnome-keyring to unlock all keys after login.
};
}
+37
View File
@@ -0,0 +1,37 @@
{ pkgs, ... }:
{
imports = [
../common/nushell
../common/core.nix
../common/git.nix
../common/development.nix
../common/media.nix
../common/starship.nix
./alacritty
./core.nix
];
# Home Manager needs a bit of information about you and the
# paths it should manage.
home = {
username = "admin";
# set homeDirectory make build fail
homeDirectory = "/Users/admin";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
stateVersion = "22.11";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}
-179
View File
@@ -1,179 +0,0 @@
# i3blocks config file changed for EndeavourOS-i3 setup
# source is available here:
# https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/i3blocks.conf
# Maintainer: joekamprad [joekamprad@endeavouros.com]
# Former Visual Designer: Florent Valetti [@FLVAL EndeavourOS]
# created for i3wm setup on EndeavourOS
# https://endeavouros.com
# cheatsheet for icon fonts used on the block-bar:
# https://fontawesome.com/v4.7/cheatsheet/
# --> to update this run the following command:
# wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/i3blocks.conf -P ~/.config/i3/
# Please see man i3blocks for a complete reference!
# The man page is also hosted at http://vivien.github.io/i3blocks
# List of valid properties:
#
# align
# color
# command
# full_text
# instance
# interval
# label
# min_width
# name
# separator
# separator_block_width
# short_text
# signal
# urgent
# Global properties
#
# The top properties below are applied to every block, but can be overridden.
separator=false
markup=pango
#[Weather]
#command=~/.config/i3/scripts/openweather
# or:
#command=~/.config/i3/scripts/openweather-city
#interval=1800
#color=#7275b3
[terminal]
full_text= 
color=#807dfe
command=i3-msg -q exec alacritty
[browser]
full_text= 
color=#ff7f81
command=i3-msg -q exec firefox
[files]
full_text= 
color=#7f3fbf
command=i3-msg -q exec thunar ~/
#[mail]
#full_text= 
#color=#dbcb75
#command=i3-msg -q exec thunderbird
[simple-2]
full_text=: :
color=#717171
# Disk usage
#
# The directory defaults to $HOME if the instance is not specified.
# The script may be called with a optional argument to set the alert
# (defaults to 10 for 10%).
[disk]
label=
instance=/
command=~/.config/i3/scripts/disk
interval=30
# Memory usage
#
# The type defaults to "mem" if the instance is not specified.
[memory]
label=
command=~/.config/i3/scripts/memory
interval=2
[cpu_usage]
label=
command=~/.config/i3/scripts/cpu_usage
#min_width=CPU: 100.00%
interval=2
[CPU-temperature]
label=
command=~/.config/i3/scripts/temperature
interval=30
#T_WARN=70
#T_CRIT=90
#SENSOR_CHIP=""
# where SENSOR_CHIP can be find with sensors output
# can be used also for GPU temperature or other temperature sensors lm-sensors detects.
# showing name of connected network (enable for wifi use)
#[net]
#label=
#command=echo "$(LANG=C nmcli d | grep connected | awk '{print $4}')"
#interval=30
[bandwidth]
command=~/.config/i3/scripts/bandwidth2
interval=persist
# Battery indicator
# [battery]
# command=~/.config/i3/scripts/battery2
# # for alternative battery script change to battery1
# # change this to battery-pinebook-pro if you are running on pinebook-pro
# label=
# interval=30
[simple-2]
full_text=: :
color=#717171
[pavucontrol]
full_text=
command=pavucontrol
[volume-pulseaudio]
command=~/.config/i3/scripts/volume
instance=Master
interval=1
# display keyboard layout name
# for keyboard layouts switcher
# see i3 config file
# this needs xkblayout-state installed from the AUR:
# https://aur.archlinux.org/packages/xkblayout-state-git
#[keyboard-layout]
#command=~/.config/i3/scripts/keyboard-layout
#interval=2
[keybindings]
full_text=
command=~/.config/i3/scripts/keyhint
# power-profiles-daemon implementation:
# needs package power-profiles-daemon installed and the service running see here:
# https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon
#set power-profile
[ppd_menu]
full_text=
command=~/.config/i3/scripts/power-profiles
color=#407437
#Show the current power-profile
[ppd-status]
command=~/.config/i3/scripts/ppd-status
interval=5
[time]
#label=
command=date '+%a %d %b %H:%M:%S'
interval=1
[shutdown_menu]
full_text=
command=~/.config/i3/scripts/powermenu
[simple-2]
full_text=: :
color=#717171
-18
View File
@@ -1,18 +0,0 @@
#!/usr/bin/env bash
#simple Shellscript for i3blocks on Pinebook pro
#05012020 geri123@gmx.net Gerhard S.
#battery-symbols: on Manjaro you need the awesome-terminal-fonts package installed!
PERCENT=$(cat /sys/class/power_supply/cw2015-battery/capacity)
STATUS=$(cat /sys/class/power_supply/cw2015-battery/status)
case $((
$PERCENT >= 0 && $PERCENT <= 20 ? 1 :
$PERCENT > 20 && $PERCENT <= 40 ? 2 :
$PERCENT > 40 && $PERCENT <= 60 ? 3 :
$PERCENT > 60 && $PERCENT <= 80 ? 4 : 5)) in
#
(1) echo $STATUS:"" :$PERCENT%;;
(2) echo $STATUS:"" :$PERCENT%;;
(3) echo $STATUS:"" :$PERCENT%;;
(4) echo $STATUS:"" :$PERCENT%;;
(5) echo $STATUS:"" :$PERCENT%;;
esac
-114
View File
@@ -1,114 +0,0 @@
#!/usr/bin/perl
#
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
#
# Licensed under the terms of the GNU GPL v3, or any later version.
#
# This script is meant to use with i3blocks. It parses the output of the "acpi"
# command (often provided by a package of the same name) to read the status of
# the battery, and eventually its remaining time (to full charge or discharge).
#
# The color will gradually change for a percentage below 85%, and the urgency
# (exit code 33) is set if there is less that 5% remaining.
# Edited by Andreas Lindlbauer <endeavouros.mousily@aleeas.com>
use strict;
use warnings;
use utf8;
# otherwise we get in console "Wide character in print at"
binmode(STDOUT, ':utf8');
# my $acpi;
my $upower;
my $percent;
my $bat_state;
my $status;
my $ac_adapt;
my $full_text;
my $short_text;
my $label = '😅';
my $bat_number = $ENV{BLOCK_INSTANCE} || 0;
open (UPOWER, "upower -i /org/freedesktop/UPower/devices/battery_BAT$bat_number | grep 'percentage' |") or die;
$upower = <UPOWER>;
close(UPOWER);
# fail on unexpected output
if ($upower !~ /: (\d+)%/) {
die "$upower\n";
}
$percent = $1;
$full_text = "$percent%";
open (BAT_STATE, "upower -i /org/freedesktop/UPower/devices/battery_BAT$bat_number | grep 'state' |") or die;
$bat_state = <BAT_STATE>;
close(BAT_STATE);
if ($bat_state !~ /: (\w+)/) {
die "$bat_state\n";
}
$status = $1;
if ($status eq 'discharging') {
$full_text .= ' ';
} elsif ($status eq 'charging') {
$full_text .= ' ';
} elsif ($status eq 'Unknown') {
open (AC_ADAPTER, "acpi -a |") or die;
$ac_adapt = <AC_ADAPTER>;
close(AC_ADAPTER);
if ($ac_adapt =~ /: ([\w-]+)/) {
$ac_adapt = $1;
if ($ac_adapt eq 'on-line') {
$full_text .= ' CHR';
} elsif ($ac_adapt eq 'off-line') {
$full_text .= ' DIS';
}
}
}
$short_text = $full_text;
if ($percent < 20) {
$label = '';
} elsif ($percent < 45) {
$label = '';
} elsif ($percent < 70) {
$label = '';
} elsif ($percent < 95) {
$label = '';
} else {
$label = '';
}
# print text
print " ${label}";
print " $full_text\n";
print " ${label}";
print " $short_text\n";
# consider color and urgent flag only on discharge
if ($status eq 'discharging') {
if ($percent < 20) {
print "#FF0000\n";
} elsif ($percent < 40) {
print "#FFAE00\n";
} elsif ($percent < 60) {
print "#FFF600\n";
} elsif ($percent < 85) {
print "#A8FF00\n";
}
if ($percent < 5) {
exit(33);
}
}
exit(0);
-106
View File
@@ -1,106 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2016 James Murphy
# Licensed under the GPL version 2 only
#
# A battery indicator blocklet script for i3blocks
from subprocess import check_output
import os
import re
config = dict(os.environ)
status = check_output(['acpi'], universal_newlines=True)
if not status:
# stands for no battery found
color = config.get("color_10", "red")
fulltext = "<span color='{}'><span font='FontAwesome'>\uf00d \uf240</span></span>".format(color)
percentleft = 100
else:
# if there is more than one battery in one laptop, the percentage left is
# available for each battery separately, although state and remaining
# time for overall block is shown in the status of the first battery
batteries = status.split("\n")
state_batteries=[]
commasplitstatus_batteries=[]
percentleft_batteries=[]
time = ""
for battery in batteries:
if battery!='':
state_batteries.append(battery.split(": ")[1].split(", ")[0])
commasplitstatus = battery.split(", ")
if not time:
time = commasplitstatus[-1].strip()
# check if it matches a time
time = re.match(r"(\d+):(\d+)", time)
if time:
time = ":".join(time.groups())
timeleft = " ({})".format(time)
else:
timeleft = ""
p = int(commasplitstatus[1].rstrip("%\n"))
if p>0:
percentleft_batteries.append(p)
commasplitstatus_batteries.append(commasplitstatus)
state = state_batteries[0]
commasplitstatus = commasplitstatus_batteries[0]
if percentleft_batteries:
percentleft = int(sum(percentleft_batteries)/len(percentleft_batteries))
else:
percentleft = 0
# stands for charging
color = config.get("color_charging", "yellow")
FA_LIGHTNING = "<span color='{}'><span font='FontAwesome'>\uf0e7</span></span>".format(color)
# stands for plugged in
FA_PLUG = "<span font='FontAwesome'>\uf1e6</span>"
# stands for using battery
FA_BATTERY = "<span font='FontAwesome'>\uf240</span>"
# stands for unknown status of battery
FA_QUESTION = "<span font='FontAwesome'>\uf128</span>"
if state == "Discharging":
fulltext = FA_BATTERY + " "
elif state == "Full":
fulltext = FA_PLUG + " "
timeleft = ""
elif state == "Unknown":
fulltext = FA_QUESTION + " " + FA_BATTERY + " "
timeleft = ""
else:
fulltext = FA_LIGHTNING + " " + FA_PLUG + " "
def color(percent):
if percent < 10:
# exit code 33 will turn background red
return config.get("color_10", "#FFFFFF")
if percent < 20:
return config.get("color_20", "#FF3300")
if percent < 30:
return config.get("color_30", "#FF6600")
if percent < 40:
return config.get("color_40", "#FF9900")
if percent < 50:
return config.get("color_50", "#FFCC00")
if percent < 60:
return config.get("color_60", "#FFFF00")
if percent < 70:
return config.get("color_70", "#FFFF33")
if percent < 80:
return config.get("color_80", "#FFFF66")
return config.get("color_full", "#FFFFFF")
form = '<span color="{}">{}%</span>'
fulltext += form.format(color(percentleft), percentleft)
#fulltext += timeleft
print(fulltext)
print(fulltext)
if percentleft < 10:
exit(33)
-62
View File
@@ -1,62 +0,0 @@
#!/usr/bin/env perl
#
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
# Copyright 2014 Andreas Guldstrand <andreas.guldstrand@gmail.com>
#
# Licensed under the terms of the GNU GPL v3, or any later version.
use strict;
use warnings;
use utf8;
use Getopt::Long;
# default values
my $t_warn = $ENV{T_WARN} // 50;
my $t_crit = $ENV{T_CRIT} // 80;
my $cpu_usage = -1;
my $decimals = $ENV{DECIMALS} // 0;
my $label = $ENV{LABEL} // "";
sub help {
print "Usage: cpu_usage [-w <warning>] [-c <critical>] [-d <decimals>]\n";
print "-w <percent>: warning threshold to become yellow\n";
print "-c <percent>: critical threshold to become red\n";
print "-d <decimals>: Use <decimals> decimals for percentage (default is $decimals) \n";
exit 0;
}
GetOptions("help|h" => \&help,
"w=i" => \$t_warn,
"c=i" => \$t_crit,
"d=i" => \$decimals,
);
# Get CPU usage
$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is
open (MPSTAT, 'mpstat 1 1 |') or die;
while (<MPSTAT>) {
if (/^.*\s+(\d+\.\d+)[\s\x00]?$/) {
$cpu_usage = 100 - $1; # 100% - %idle
last;
}
}
close(MPSTAT);
$cpu_usage eq -1 and die 'Can\'t find CPU information';
# Print short_text, full_text
print "${label}";
printf "%02.${decimals}f%%\n", $cpu_usage;
print "${label}";
printf "%02.${decimals}f%%\n", $cpu_usage;
# Print color, if needed
if ($cpu_usage >= $t_crit) {
print "#FF0000\n";
exit 33;
} elsif ($cpu_usage >= $t_warn) {
print "#FFFC00\n";
}
exit 0;
-48
View File
@@ -1,48 +0,0 @@
#!/usr/bin/env bash
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
DIR="${DIR:-$BLOCK_INSTANCE}"
DIR="${DIR:-$HOME}"
ALERT_LOW="${ALERT_LOW:-$1}"
ALERT_LOW="${ALERT_LOW:-10}" # color will turn red under this value (default: 10%)
LOCAL_FLAG="-l"
if [ "$1" = "-n" ] || [ "$2" = "-n" ]; then
LOCAL_FLAG=""
fi
df -h -P $LOCAL_FLAG "$DIR" | awk -v label="$LABEL" -v alert_low=$ALERT_LOW '
/\/.*/ {
# full text
print label $4
# short text
print label $4
use=$5
# no need to continue parsing
exit 0
}
END {
gsub(/%$/,"",use)
if (100 - use < alert_low) {
# color
print "#FF0000"
}
}
'
-5
View File
@@ -1,5 +0,0 @@
#!/usr/bin/env bash
KBD=$(/usr/bin/xkblayout-state print '%s')
echo $KBD
-25
View File
@@ -1,25 +0,0 @@
#!/bin/bash
Main() {
source /usr/share/endeavouros/scripts/eos-script-lib-yad || return 1
local command=(
eos_yad --title="EndeavourOS i3-wm keybindings:" --no-buttons --geometry=400x345-15-400 --list
--column=key: --column=description: --column=command:
"ESC" "close this app" ""
"=" "modkey" "(set mod Mod4)"
"+enter" "open a terminal" ""
"+Shift+n" "new empty workspace" ""
"+w" "open Browser" ""
"+n" "open Filebrowser" ""
"+d" "app menu" ""
"+q" "close focused app" ""
"Print-key" "screenshot" ""
"+Shift+e" "logout menu" ""
"F1" "open keybinding helper" ""
)
"${command[@]}"
}
Main "$@"
-6
View File
@@ -1,6 +0,0 @@
I3_CONFIG=$HOME/.config/i3/config
mod_key=$(sed -nre 's/^set \$mod (.*)/\1/p' ${I3_CONFIG})
grep "^bindsym" ${I3_CONFIG} \
| sed "s/-\(-\w\+\)\+//g;s/\$mod/${mod_key}/g;s/Mod1/Alt/g;s/exec //;s/bindsym //;s/^\s\+//;s/^\([^ ]\+\) \(.\+\)$/\2: \1/;s/^\s\+//" \
| tr -s ' ' \
| rofi -dmenu -theme ~/.config/rofi/rofikeyhint.rasi
-69
View File
@@ -1,69 +0,0 @@
#!/usr/bin/env bash
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TYPE="${BLOCK_INSTANCE:-mem}"
awk -v type=$TYPE '
/^MemTotal:/ {
mem_total=$2
}
/^MemFree:/ {
mem_free=$2
}
/^Buffers:/ {
mem_free+=$2
}
/^Cached:/ {
mem_free+=$2
}
/^SwapTotal:/ {
swap_total=$2
}
/^SwapFree:/ {
swap_free=$2
}
END {
if (type == "swap") {
free=swap_free/1024/1024
used=(swap_total-swap_free)/1024/1024
total=swap_total/1024/1024
} else {
free=mem_free/1024/1024
used=(mem_total-mem_free)/1024/1024
total=mem_total/1024/1024
}
pct=0
if (total > 0) {
pct=used/total*100
}
# full text
# printf("%.1fG/%.1fG (%.f%%)\n", used, total, pct)
# short text
printf("%.f%%\n", pct)
# color
if (pct > 90) {
print("#FF0000")
} else if (pct > 80) {
print("#FFAE00")
} else if (pct > 70) {
print("#FFF600")
}
}
' /proc/meminfo
-93
View File
@@ -1,93 +0,0 @@
#!/usr/bin/env bash
# Edited by Andreas Lindlbauer <endeavouros.mousily@aleeas.com>
temps=("#0600FF" "#0500FF" "#0400FF" "#0300FF" "#0200FF" "#0100FF" "#0000FF" "#0002FF" "#0012FF" "#0022FF" "#0032FF" "#0044FF" "#0054FF" "#0064FF" "#0074FF" "#0084FF" "#0094FF" "#00A4FF" "#00B4FF" "#00C4FF" "#00D4FF" "#00E4FF" "#00FFF4" "#00FFD0" "#00FFA8" "#00FF83" "#00FF5C" "#00FF36" "#00FF10" "#17FF00" "#3EFF00" "#65FF00" "#B0FF00" "#FDFF00" "#FFF000" "#FFDC00" "#FFC800" "#FFB400" "#FFA000" "#FF8C00" "#FF7800" "#FF6400" "#FF5000" "#FF3C00" "#FF2800" "#FF1400" "#FF0000")
command -v jq >/dev/null 2>&1 || { echo >&2 "Program 'jq' required but it is not installed.
Aborting."; exit 1; }
command -v wget >/dev/null 2>&1 || { echo >&2 "Program 'wget' required but is not installed.
Aborting."; exit 1; }
# To use this script you need to create an API key here https://home.openweathermap.org
# You need to put your Open Weather APIKEY here:
APIKEY="keykeykey"
# And get your Latitute and Longitudes to put in here:
LAT="XX.XXXX"
LON="XX.XXXX"
URL="http://api.openweathermap.org/data/2.5/onecall?lat=${LAT}&lon=${LON}&units=metric&exclude=minutely,hourly,daily&APPID=${APIKEY}"
WEATHER_RESPONSE=$(wget -qO- "${URL}")
WEATHER_CONDITION=$(echo "$WEATHER_RESPONSE" | jq '.current.weather[0].main' | sed 's/"//g')
WEATHER_TEMP=$(echo "$WEATHER_RESPONSE" | jq '.current.feels_like')
WEATHER_INT=${WEATHER_TEMP%.*}
TIME_NOW=$( echo "$WEATHER_RESPONSE" | jq '.current.dt')
SUNRISE=$( echo "$WEATHER_RESPONSE" | jq '.current.sunrise')
SUNSET=$( echo "$WEATHER_RESPONSE" | jq '.current.sunset')
DESCRIPTION=$( echo "$WEATHER_RESPONSE" | jq '.current.weather[0].description' | sed 's/"//g')
WEATHER_ALERT=$( echo "$WEATHER_RESPONSE" | jq '.alerts[0].event' | sed 's/"//g')
DAYTIME="n"
if [[ "$TIME_NOW" > "$SUNRISE" ]] && [[ "$TIME_NOW" < "$SUNSET" ]]; then
DAYTIME="d"
fi
case $WEATHER_CONDITION in
'Clouds')
if [ "$DAYTIME" == "d" ]; then
WEATHER_ICON=""
else
WEATHER_ICON=""
fi
;;
'Rain')
WEATHER_ICON=""
;;
'Drizzle')
if [ "$DAYTIME" == "d" ]; then
WEATHER_ICON=""
else
WEATHER_ICON=""
fi
;;
'Thunderstorm')
WEATHER_ICON=""
;;
'Snow')
WEATHER_ICON=""
;;
'Clear')
if [ "$DAYTIME" == "d" ]; then
WEATHER_ICON=""
else
WEATHER_ICON=""
fi
;;
*)
WEATHER_ICON="🌫"
;;
esac
WEATHER_COLOR="#FFFFFF"
if [ "$WEATHER_INT" -lt "-11" ]; then
WEATHER_COLOR="#0000FF"
elif [ "$WEATHER_INT" -gt 35 ]; then
WEATHER_COLOR="#FF0000"
else
WEATHER_INT=$(( WEATHER_INT + 11 ))
WEATHER_COLOR="${temps[$WEATHER_INT]}"
fi
full_text="${WEATHER_ICON} ${WEATHER_TEMP}°C: ${DESCRIPTION} "
if [ "$WEATHER_ALERT" != "null" ]; then
WARN_START=$(echo "$WEATHER_RESPONSE" | jq '.alerts[0].start')
WARN_END=$(echo "$WEATHER_RESPONSE" | jq '.alerts[0].end')
WARN_START=$(date -d @"$WARN_START" +%a_%k:%M)
WARN_END=$(date -d @"$WARN_END" +%a_%k:%M)
full_text="${WEATHER_ICON} ${WEATHER_TEMP}°C: ${DESCRIPTION}  ${WEATHER_ALERT} from ${WARN_START} to ${WARN_END}  "
fi
echo "${full_text}"
echo "${WEATHER_TEMP}°C "
echo "${WEATHER_COLOR}"
-43
View File
@@ -1,43 +0,0 @@
#!/usr/bin/env bash
command -v jq >/dev/null 2>&1 || { echo >&2 "Program 'jq' required but it is not installed.
Aborting."; exit 1; }
command -v wget >/dev/null 2>&1 || { echo >&2 "Program 'wget' required but is not installed.
Aborting."; exit 1; }
# To use this script you need to create an API key here https://home.openweathermap.org
# You need to put your Open Weather APIKEY here:
APIKEY="keykey"
# find your City ID here: https://openweathermap.org/
# search for your city and copy the ID from the URL inside the browser.
CITY_ID="idid"
URL="http://api.openweathermap.org/data/2.5/weather?id=${CITY_ID}&units=metric&APPID=${APIKEY}"
WEATHER_RESPONSE=$(wget -qO- "${URL}")
WEATHER_CONDITION=$(echo $WEATHER_RESPONSE | jq '.weather[0].main' | sed 's/"//g')
WEATHER_TEMP=$(echo $WEATHER_RESPONSE | jq '.main.temp')
WIND_DIR=$( echo "$WEATHER_RESPONSE" | jq '.wind.deg')
WIND_SPEED=$( echo "$WEATHER_RESPONSE" | jq '.wind.speed')
WIND_SPEED=$(awk "BEGIN {print 60*60*$WIND_SPEED/1000}")
WIND_DIR=$(awk "BEGIN {print int(($WIND_DIR % 360)/22.5)}")
DIR_ARRAY=( N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW N )
WIND_DIR=${DIR_ARRAY[WIND_DIR]}
case $WEATHER_CONDITION in
'Clouds')
WEATHER_ICON=""
;;
'Rain')
WEATHER_ICON=""
;;
'Snow')
WEATHER_ICON=""
;;
*)
WEATHER_ICON=""
;;
esac
echo "${WEATHER_ICON} ${WEATHER_TEMP}°C: ${WIND_SPEED} km/h ${WIND_DIR}"
-5
View File
@@ -1,5 +0,0 @@
# Weather
[Weather]
command=~/.config/i3/scripts/openweather
interval=1800
color=#7275b3
-11
View File
@@ -1,11 +0,0 @@
#!/usr/bin/env bash
#
# power-profiles-daemon implementation:
# needs package power-profiles-daemon installed and the service running see here:
# https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon
# used in i3-blocks: ~/.config/i3/i3blocks.conf together with: ~/.config/i3/scripts/power-profiles
# script to show current power profile
current_profile=$(powerprofilesctl get)
echo "$current_profile"
-86
View File
@@ -1,86 +0,0 @@
#!/usr/bin/env perl
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
# Copyright 2014 Andreas Guldstrand <andreas.guldstrand@gmail.com>
# Copyright 2014 Benjamin Chretien <chretien at lirmm dot fr>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Edited by Andreas Lindlbauer <endeavouros.mousily@aleeas.com>
use strict;
use warnings;
use utf8;
use Getopt::Long;
binmode(STDOUT, ":utf8");
# default values
my $t_warn = $ENV{T_WARN} || 70;
my $t_crit = $ENV{T_CRIT} || 90;
my $chip = $ENV{SENSOR_CHIP} || "";
my $temperature = -9999;
my $label = "😀 ";
sub help {
print "Usage: temperature [-w <warning>] [-c <critical>] [--chip <chip>]\n";
print "-w <percent>: warning threshold to become yellow\n";
print "-c <percent>: critical threshold to become red\n";
print "--chip <chip>: sensor chip\n";
exit 0;
}
GetOptions("help|h" => \&help,
"w=i" => \$t_warn,
"c=i" => \$t_crit,
"chip=s" => \$chip);
# Get chip temperature
open (SENSORS, "sensors -u $chip |") or die;
while (<SENSORS>) {
if (/^\s+temp1_input:\s+[\+]*([\-]*\d+\.\d)/) {
$temperature = $1;
last;
}
}
close(SENSORS);
$temperature eq -9999 and die 'Cannot find temperature';
if ($temperature < 45) {
$label = '';
} elsif ($temperature < 55) {
$label = '';
} elsif ($temperature < 65) {
$label = '';
} elsif ($temperature < 75) {
$label = '';
} else {
$label = '';
}
# Print short_text, full_text
print "${label}";
print " $temperature°C\n";
print "${label}";
print " $temperature°C\n";
# Print color, if needed
if ($temperature >= $t_crit) {
print "#FF0000\n";
exit 33;
} elsif ($temperature >= $t_warn) {
print "#FFFC00\n";
}
exit 0;
-93
View File
@@ -1,93 +0,0 @@
#!/usr/bin/env bash
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# Copyright (C) 2014 Alexander Keller <github@nycroth.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# original source: https://github.com/vivien/i3blocks-contrib/tree/master/volume
# check the readme: https://github.com/vivien/i3blocks-contrib/blob/master/volume/README.md
#------------------------------------------------------------------------
# The second parameter overrides the mixer selection
# For PulseAudio users, eventually use "pulse"
# For Jack/Jack2 users, use "jackplug"
# For ALSA users, you may use "default" for your primary card
# or you may use hw:# where # is the number of the card desired
if [[ -z "$MIXER" ]] ; then
MIXER="default"
if command -v pulseaudio >/dev/null 2>&1 && pulseaudio --check ; then
# pulseaudio is running, but not all installations use "pulse"
if amixer -D pulse info >/dev/null 2>&1 ; then
MIXER="pulse"
fi
fi
[ -n "$(lsmod | grep jack)" ] && MIXER="jackplug"
MIXER="${2:-$MIXER}"
fi
# The instance option sets the control to report and configure
# This defaults to the first control of your selected mixer
# For a list of the available, use `amixer -D $Your_Mixer scontrols`
if [[ -z "$SCONTROL" ]] ; then
SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols |
sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" |
head -n1
)}"
fi
# The first parameter sets the step to change the volume by (and units to display)
# This may be in in % or dB (eg. 5% or 3dB)
if [[ -z "$STEP" ]] ; then
STEP="${1:-5%}"
fi
# AMIXER(1):
# "Use the mapped volume for evaluating the percentage representation like alsamixer, to be
# more natural for human ear."
NATURAL_MAPPING=${NATURAL_MAPPING:-0}
if [[ "$NATURAL_MAPPING" != "0" ]] ; then
AMIXER_PARAMS="-M"
fi
#------------------------------------------------------------------------
capability() { # Return "Capture" if the device is a capture device
amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL |
sed -n "s/ Capabilities:.*cvolume.*/Capture/p"
}
volume() {
amixer $AMIXER_PARAMS -D $MIXER get $SCONTROL $(capability)
}
format() {
perl_filter='if (/.*\[(\d+%)\] (\[(-?\d+.\d+dB)\] )?\[(on|off)\]/)'
perl_filter+='{CORE::say $4 eq "off" ? "MUTE" : "'
# If dB was selected, print that instead
perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1')
perl_filter+='"; exit}'
output=$(perl -ne "$perl_filter")
echo "$LABEL$output"
}
#------------------------------------------------------------------------
case $BLOCK_BUTTON in
3) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute
4) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase
5) amixer $AMIXER_PARAMS -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease
esac
volume | format
-25
View File
@@ -1,25 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (C) 2021 Andreas Lindlbauer
# Licensed under the terms of EUPLv1.2.
#
# i3blocks blocklet script to monitor the (nord)vpn connection
vpnstatus="📢"
nordvpn_output=$(nordvpn status | cat -v | head -1 | sed -e 's/\^M-^M ^M//g' )
if [ "${nordvpn_output}" = "Status: Connected" ]; then
vpnstatus="🥸"
elif [ "${nordvpn_output}" = "A new version of NordVPN is available! Please update the application." ]; then
nordvpn_output=$(nordvpn status | cat -v | head -2 | tail -1 | sed -e 's/\^M-^M ^M//g' )
if [ "${nordvpn_output}" = "Status: Connected" ]; then
vpnstatus="🥴"
elif [ "${nordvpn_output}" = "Status: Disconnected" ]; then
vpnstatus="📢"
fi
elif [ "${nordvpn_output}" = "Status: Disconnected" ]; then
vpnstatus="📢"
elif [[ "$nordvpn_output" == *\/* ]] || [[ "$nordvpn_output" == *\\* ]]; then
vpnstatus="Something's very wrong"
fi
echo "$vpnstatus"
+730
View File
@@ -0,0 +1,730 @@
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
import:
# all alacritty themes can be found at
# https://github.com/alacritty/alacritty-theme
- ~/.config/alacritty/theme_github_dark.yml
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
window:
# Window dimensions (changes require restart)
#
# Number of lines/columns (not pixels) in the terminal. Both lines and columns
# must be non-zero for this to take effect. The number of columns must be at
# least `2`, while using a value of `0` for columns and lines will fall back
# to the window manager's recommended size
#dimensions:
# columns: 0
# lines: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
padding:
x: 5
y: 5
# Spread additional padding evenly around the terminal content.
dynamic_padding: true
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background and no title bar buttons
#decorations: full
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
opacity: 0.98
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
startup_mode: Windowed
# Window title
title: Alacritty
# Allow terminal applications to change Alacritty's window title.
dynamic_title: true
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# Decorations theme variant
#
# Override the variant of the System theme/GTK theme/Wayland client side
# decorations. Commonly supported values are `Dark`, `Light`, and `None` for
# auto pick-up. Set this to `None` to use the default theme variant.
#decorations_theme_variant: None
# Resize increments
#
# Prefer resizing window by discrete steps equal to cell dimensions.
#resize_increments: false
# Make `Option` key behave as `Alt` (macOS only):
# - OnlyLeft
# - OnlyRight
# - Both
# - None (default)
#option_as_alt: None
scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
bold:
family: JetBrainsMono Nerd Font
italic:
family: JetBrainsMono Nerd Font
normal:
family: JetBrainsMono Nerd Font
bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: JetBrainsMono Nerd Font
# Point size
size: 12
# Offset is the extra space around each character. `offset.y` can be thought
# of as modifying the line spacing, and `offset.x` as modifying the letter
# spacing.
#offset:
# x: 0
# y: 0
# Glyph offset determines the locations of the glyphs within their cells with
# the default being at the bottom. Increasing `x` moves the glyph to the
# right, increasing `y` moves the glyph upward.
#glyph_offset:
# x: 0
# y: 0
# Use built-in font for box drawing characters.
#
# If `true`, Alacritty will use a custom built-in font for box drawing
# characters (Unicode points 2500 - 259f).
#
#builtin_box_drawing: true
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
# Bell
#
# The bell is rung every time the BEL control character is received.
#bell:
# Visual Bell Animation
#
# Animation effect for flashing the screen when the visual bell is rung.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#animation: EaseOutExpo
# Duration of the visual bell flash in milliseconds. A `duration` of `0` will
# disable the visual bell animation.
#duration: 0
# Visual bell animation color.
#color: '#ffffff'
# Bell Command
#
# This program is executed whenever the bell is rung.
#
# When set to `command: None`, no command will be executed.
#
# Example:
# command:
# program: notify-send
# args: ["Hello, World!"]
#
#command: None
#selection:
# This string contains all characters that are used as separators for
# "semantic words" in Alacritty.
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
#cursor:
# Cursor style
#style:
# Cursor shape
#
# Values for `shape`:
# - ▇ Block
# - _ Underline
# - | Beam
#shape: Block
# Cursor blinking state
#
# Values for `blinking`:
# - Never: Prevent the cursor from ever blinking
# - Off: Disable blinking by default
# - On: Enable blinking by default
# - Always: Force the cursor to always blink
#blinking: Off
# Vi mode cursor style
#
# If the vi mode cursor style is `None` or not specified, it will fall back to
# the style of the active value of the normal cursor.
#
# See `cursor.style` for available options.
#vi_mode_style: None
# Cursor blinking interval in milliseconds.
#blink_interval: 750
# Time after which cursor stops blinking, in seconds.
#
# Specifying '0' will disable timeout for blinking.
#blink_timeout: 5
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Thickness of the cursor relative to the cell width as floating point number
# from `0.0` to `1.0`.
#thickness: 0.15
# Live config reload (changes require restart)
live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g.
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
# shell.
#
# Default:
# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset
# - (Windows) powershell
# shell:
# program: /bin/bash
# args:
# - --login
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# Offer IPC using `alacritty msg` (unix only)
#ipc_socket: true
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
# Hints
#
# Terminal hints can be used to find text or hyperlink in the visible part of
# the terminal and pipe it to other applications.
#hints:
# Keys used for the hint labels.
#alphabet: "jfkdls;ahgurieowpq"
# List with all available hints
#
# Each hint must have any of `regex` or `hyperlinks` field and either an
# `action` or a `command` field. The fields `mouse`, `binding` and
# `post_processing` are optional.
#
# The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be
# highlighted.
#
# The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and
# `mouse.mods` accept the same values as they do in the `key_bindings` section.
#
# The `mouse.enabled` field controls if the hint should be underlined while
# the mouse with all `mouse.mods` keys held or the vi mode cursor is above it.
#
# If the `post_processing` field is set to `true`, heuristics will be used to
# shorten the match if there are characters likely not to be part of the hint
# (e.g. a trailing `.`). This is most useful for URIs and applies only to
# `regex` matches.
#
# Values for `action`:
# - Copy
# Copy the hint's text to the clipboard.
# - Paste
# Paste the hint's text to the terminal or search.
# - Select
# Select the hint's text.
# - MoveViModeCursor
# Move the vi mode cursor to the beginning of the hint.
#enabled:
# - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\
# [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
# hyperlinks: true
# command: xdg-open
# post_processing: true
# mouse:
# enabled: true
# mods: None
# binding:
# key: U
# mods: Control|Shift
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty
# captures the mouse, the `Shift` modifier is automatically added as a
# requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings for actions not exclusive to mouse mode)
#
# - Mouse exclusive actions:
#
# - ExpandSelection
# Expand the selection to the current mouse cursor location.
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Right, action: ExpandSelection }
# - { mouse: Right, mods: Control, action: ExpandSelection }
# - { mouse: Middle, mode: ~Vi, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/winit/*/winit/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - ToggleViMode
# - SearchForward
# Start searching toward the right of the search origin.
# - SearchBackward
# Start searching toward the left of the search origin.
# - Copy
# - Paste
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollHalfPageUp
# - ScrollHalfPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# Remove the terminal's scrollback history.
# - Hide
# Hide the Alacritty window.
# - Minimize
# Minimize the Alacritty window.
# - Quit
# Quit Alacritty.
# - ToggleFullscreen
# - ToggleMaximized
# - SpawnNewInstance
# Spawn a new instance of Alacritty.
# - CreateNewWindow
# Create a new Alacritty window from the current process.
# - ClearLogNotice
# Clear Alacritty's UI warning and error notice.
# - ClearSelection
# Remove the active selection.
# - ReceiveChar
# - None
#
# - Vi mode exclusive actions:
#
# - Open
# Perform the action of the first matching hint under the vi mode cursor
# with `mouse.enabled` set to `true`.
# - ToggleNormalSelection
# - ToggleLineSelection
# - ToggleBlockSelection
# - ToggleSemanticSelection
# Toggle semantic selection based on `selection.semantic_escape_chars`.
# - CenterAroundViCursor
# Center view around vi mode cursor
#
# - Vi mode exclusive cursor motion actions:
#
# - Up
# One line up.
# - Down
# One line down.
# - Left
# One character left.
# - Right
# One character right.
# - First
# First column, or beginning of the line when already at the first column.
# - Last
# Last column, or beginning of the line when already at the last column.
# - FirstOccupied
# First non-empty cell in this terminal row, or first non-empty cell of
# the line when already at the first cell of the row.
# - High
# Top of the screen.
# - Middle
# Center of the screen.
# - Low
# Bottom of the screen.
# - SemanticLeft
# Start of the previous semantically separated word.
# - SemanticRight
# Start of the next semantically separated word.
# - SemanticLeftEnd
# End of the previous semantically separated word.
# - SemanticRightEnd
# End of the next semantically separated word.
# - WordLeft
# Start of the previous whitespace separated word.
# - WordRight
# Start of the next whitespace separated word.
# - WordLeftEnd
# End of the previous whitespace separated word.
# - WordRightEnd
# End of the next whitespace separated word.
# - Bracket
# Character matching the bracket at the cursor's location.
# - SearchNext
# Beginning of the next match.
# - SearchPrevious
# Beginning of the previous match.
# - SearchStart
# Start of the match to the left of the vi mode cursor.
# - SearchEnd
# End of the match to the right of the vi mode cursor.
#
# - Search mode exclusive actions:
# - SearchFocusNext
# Move the focus to the next search match.
# - SearchFocusPrevious
# Move the focus to the previous search match.
# - SearchConfirm
# - SearchCancel
# - SearchClear
# Reset the search regex.
# - SearchDeleteWord
# Delete the last word in the search regex.
# - SearchHistoryPrevious
# Go to the previous regex in the search history.
# - SearchHistoryNext
# Go to the next regex in the search history.
#
# - macOS exclusive actions:
# - ToggleSimpleFullscreen
# Enter fullscreen without occupying another space.
#
# - Linux/BSD exclusive actions:
#
# - CopySelection
# Copy from the selection buffer.
# - PasteSelection
# Paste from the selection buffer.
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Search
# - Alt
# - Vi
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# in the order they were defined in.
#key_bindings:
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp }
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop }
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
# Vi Mode
#- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode }
#- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom }
#- { key: Escape, mode: Vi|~Search, action: ClearSelection }
#- { key: I, mode: Vi|~Search, action: ToggleViMode }
#- { key: I, mode: Vi|~Search, action: ScrollToBottom }
#- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode }
#- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp }
#- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown }
#- { key: G, mode: Vi|~Search, action: ScrollToTop }
#- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom }
#- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp }
#- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown }
#- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp }
#- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown }
#- { key: Y, mode: Vi|~Search, action: Copy }
#- { key: Y, mode: Vi|~Search, action: ClearSelection }
#- { key: Copy, mode: Vi|~Search, action: ClearSelection }
#- { key: V, mode: Vi|~Search, action: ToggleNormalSelection }
#- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection }
#- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection }
#- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection }
#- { key: Return, mode: Vi|~Search, action: Open }
#- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor }
#- { key: K, mode: Vi|~Search, action: Up }
#- { key: J, mode: Vi|~Search, action: Down }
#- { key: H, mode: Vi|~Search, action: Left }
#- { key: L, mode: Vi|~Search, action: Right }
#- { key: Up, mode: Vi|~Search, action: Up }
#- { key: Down, mode: Vi|~Search, action: Down }
#- { key: Left, mode: Vi|~Search, action: Left }
#- { key: Right, mode: Vi|~Search, action: Right }
#- { key: Key0, mode: Vi|~Search, action: First }
#- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last }
#- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied }
#- { key: H, mods: Shift, mode: Vi|~Search, action: High }
#- { key: M, mods: Shift, mode: Vi|~Search, action: Middle }
#- { key: L, mods: Shift, mode: Vi|~Search, action: Low }
#- { key: B, mode: Vi|~Search, action: SemanticLeft }
#- { key: W, mode: Vi|~Search, action: SemanticRight }
#- { key: E, mode: Vi|~Search, action: SemanticRightEnd }
#- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft }
#- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight }
#- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd }
#- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket }
#- { key: Slash, mode: Vi|~Search, action: SearchForward }
#- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward }
#- { key: N, mode: Vi|~Search, action: SearchNext }
#- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious }
# Search Mode
#- { key: Return, mode: Search|Vi, action: SearchConfirm }
#- { key: Escape, mode: Search, action: SearchCancel }
#- { key: C, mods: Control, mode: Search, action: SearchCancel }
#- { key: U, mods: Control, mode: Search, action: SearchClear }
#- { key: W, mods: Control, mode: Search, action: SearchDeleteWord }
#- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious }
#- { key: N, mods: Control, mode: Search, action: SearchHistoryNext }
#- { key: Up, mode: Search, action: SearchHistoryPrevious }
#- { key: Down, mode: Search, action: SearchHistoryNext }
#- { key: Return, mode: Search|~Vi, action: SearchFocusNext }
#- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious }
# (Windows, Linux, and BSD only)
#- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste }
#- { key: C, mods: Control|Shift, action: Copy }
#- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward }
#- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward }
#- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Plus, mods: Control, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Control, action: IncreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (macOS only)
#- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory }
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Plus, mods: Command, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection }
#- { key: H, mods: Command, action: Hide }
#- { key: H, mods: Command|Alt, action: HideOtherApplications }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: N, mods: Command, action: CreateNewWindow }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#- { key: F, mods: Command, mode: ~Search, action: SearchForward }
#- { key: B, mods: Command, mode: ~Search, action: SearchBackward }
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - Off
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Renderer override.
# - glsl3
# - gles2
# - gles2_pure
#renderer: None
# Print all received window events.
#print_events: false
# Highlight window damage information.
#highlight_damage: false
+10
View File
@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
programs.alacritty = {
enable = true;
};
xdg.configFile."alacritty/alacritty.yml".source = ./alacritty.yml;
xdg.configFile."alacritty/theme_github_dark.yml".source = ./theme_github_dark.yml;
}
@@ -0,0 +1,32 @@
# github Alacritty Colors
colors:
# Default colors
primary:
background: '0x24292e'
foreground: '0xd1d5da'
# Normal colors
normal:
black: '0x586069'
red: '0xea4a5a'
green: '0x34d058'
yellow: '0xffea7f'
blue: '0x2188ff'
magenta: '0xb392f0'
cyan: '0x39c5cf'
white: '0xd1d5da'
# Bright colors
bright:
black: '0x959da5'
red: '0xf97583'
green: '0x85e89d'
yellow: '0xffea7f'
blue: '0x79b8ff'
magenta: '0xb392f0'
cyan: '0x56d4dd'
white: '0xfafbfc'
indexed_colors:
- { index: 16, color: '0xd18616' }
- { index: 17, color: '0xf97583' }
+36
View File
@@ -0,0 +1,36 @@
{config, pkgs, nil, ...}:
{
home.packages = with pkgs; [
nil.packages."${pkgs.system}".default # nix language server
# GUI IDE
insomnia # REST client
# need to run `conda-install` before using it
# need to run `conda-shell` before using command `conda`
# conda is not available for MacOS
conda
];
programs = {
# modern vim
neovim = {
enable = true;
extraConfig = ''
set number relativenumber
'';
};
direnv = {
enable = true;
nix-direnv.enable = true;
enableZshIntegration = true;
};
};
# GitHub CLI tool
programs.gh = {
enable = true;
};
}
@@ -1,34 +1,26 @@
{config, ...}: let {config, ...}:
let
d = config.xdg.dataHome; d = config.xdg.dataHome;
c = config.xdg.configHome; c = config.xdg.configHome;
cache = config.xdg.cacheHome; cache = config.xdg.cacheHome;
in rec { in rec {
imports = [
./nushell
./common.nix
./starship.nix
./terminals.nix
];
programs.bash = {
enable = true;
enableCompletion = true;
bashrcExtra = ''
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
'';
};
# add environment variables # add environment variables
systemd.user.sessionVariables = { systemd.user.sessionVariables = {
# clean up ~ # clean up ~
LESSHISTFILE = cache + "/less/history"; LESSHISTFILE = cache + "/less/history";
LESSKEY = c + "/less/lesskey"; LESSKEY = c + "/less/lesskey";
WINEPREFIX = d + "/wine"; WINEPREFIX = d + "/wine";
XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority";
# set this variable make i3 failed to start
# related issue:
# https://github.com/sddm/sddm/issues/871
# XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority";
# set default applications # set default applications
BROWSER = "firefox"; BROWSER = "firefox";
TERMINAL = "alacritty"; TERMINAL = "alacritty";
TERM = "xterm-256color";
# enable scrolling in git diff # enable scrolling in git diff
DELTA_PAGER = "less -R"; DELTA_PAGER = "less -R";
@@ -37,8 +29,4 @@ in rec {
}; };
home.sessionVariables = systemd.user.sessionVariables; home.sessionVariables = systemd.user.sessionVariables;
home.shellAliases = {
k = "kubectl";
};
} }
+39
View File
@@ -0,0 +1,39 @@
{
pkgs,
...
}: {
programs.ssh = {
enable = true;
# all my ssh private key are generated by `ssh-keygen -t ed25519 -C "ryan@nickname"`
# the config's format:
# Host — given the pattern used to match against the host name given on the command line.
# HostName — specify nickname or abbreviation for host
# IdentityFile — the location of your SSH key authentication file for the account.
# format in details:
# https://www.ssh.com/academy/ssh/config
extraConfig = ''
Host 192.168.*
# allow to securely use local SSH agent to authenticate on the remote machine.
# It has the same effect as adding cli option `ssh -A user@host`
ForwardAgent yes
# romantic holds my homelab~
IdentityFile ~/.ssh/romantic
# Specifies that ssh should only use the identity file explicitly configured above
# required to prevent sending default identity files first.
IdentitiesOnly yes
Host github.com
# github is controlled by gluttony~
IdentityFile ~/.ssh/gluttony
# Specifies that ssh should only use the identity file explicitly configured above
# required to prevent sending default identity files first.
IdentitiesOnly yes
'';
# use ssh-agent so we only need to input passphrase once
# run `ssh-add /path/to/key` for every identity file
# check imported keys by `ssh-add -l`
# TODO `ssh-add` can only add keys temporary, use gnome-keyring to unlock all keys after login.
};
}
+40
View File
@@ -0,0 +1,40 @@
{pkgs, config, ...}:
{
# Linux Only Packages, not available on Darwin
home.packages = with pkgs; [
btop # replacement of htop/nmon
htop
iotop
nmon
## networking tools
wireguard-tools # manage wireguard vpn manually, via wg-quick
iftop
# misc
libnotify
# system call monitoring
strace
ltrace # library call monitoring
lsof
# system tools
ethtool
sysstat
lm_sensors # for `sensors` command
cifs-utils # for mounting windows shares
];
# auto mount usb drives
services = {
udiskie.enable = true;
};
services = {
# syncthing.enable = true;
};
}
+90
View File
@@ -0,0 +1,90 @@
# XDG stands for "Cross-Desktop Group", with X used to mean "cross".
# It's a bunch of specifications from freedesktop.org intended to standardize desktops and
# other GUI applications on various systems (primarily Unix-like) to be interoperable:
# https://www.freedesktop.org/wiki/Specifications/
{config, pkgs, ...}:
{
home.packages = with pkgs; [
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
xdg-user-dirs
];
xdg = {
enable = true;
cacheHome = config.home.homeDirectory + "/.local/cache";
# manage $XDG_CONFIG_HOME/mimeapps.list
# xdg search all desktop entries from $XDG_DATA_DIRS, check it by command:
# echo $XDG_DATA_DIRS
# the system-level desktop entries can be list by command:
# ls -l /run/current-system/sw/share/applications/
# the user-level desktop entries can be list by command(user ryan):
# ls /etc/profiles/per-user/ryan/share/applications/
mimeApps = {
enable = true;
defaultApplications =
let
browser = ["firefox.desktop"];
in
{
"application/json" = browser;
"application/pdf" = browser; # TODO: pdf viewer
"text/html" = browser;
"text/xml" = browser;
"application/xml" = browser;
"application/xhtml+xml" = browser;
"application/xhtml_xml" = browser;
"application/rdf+xml" = browser;
"application/rss+xml" = browser;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xht" = browser;
"application/x-extension-xhtml" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/unknown" = browser;
"x-scheme-handler/discord" = ["discord.desktop"];
"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
"audio/*" = ["mpv.desktop"];
"video/*" = ["mpv.dekstop"];
"image/*" = ["imv.desktop"];
};
associations.removed =
let
browser = ["google-chrome.desktop"];
in
{
"text/html" = browser;
"text/xml" = browser;
"application/xml" = browser;
"application/xhtml+xml" = browser;
"application/xhtml_xml" = browser;
"application/rdf+xml" = browser;
"application/rss+xml" = browser;
"image/gif" = browser;
"image/jpeg" = browser;
"image/png" = browser;
"image/webp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"application/pdf" = browser;
};
};
userDirs = {
enable = true;
createDirectories = true;
extraConfig = {
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
};
};
};
}
+24
View File
@@ -0,0 +1,24 @@
{
pkgs,
config,
...
}:
{
home.packages = with pkgs; [
# creative
# blender # 3d modeling
# gimp # image editing, I prefer using figma in browser instead of this one
inkscape # vector graphics
krita # digital painting
musescore # music notation
reaper # audio production
# this app consumes a lot of storage, so do not install it currently
# kicad # 3d printing, eletrical engineering
];
programs = {
# live streaming
obs-studio.enable = true;
};
}
+28
View File
@@ -0,0 +1,28 @@
{ pkgs, ... }:
{
imports = [
./creative.nix
./media.nix
];
home.packages = with pkgs; [
# networking
wireshark
# e-book viewer(.epub/.mobi/...)
# do not support .pdf
foliate
# instant messaging
telegram-desktop
discord
qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
# remote desktop(rdp connect)
remmina
freerdp # required by remmina
# misc
flameshot
];
}
@@ -5,32 +5,20 @@
}: }:
# media - control and enjoy audio/video # media - control and enjoy audio/video
{ {
# imports = [
# ];
home.packages = with pkgs; [ home.packages = with pkgs; [
# audio control # audio control
pavucontrol pavucontrol
playerctl playerctl
pulsemixer pulsemixer
ffmpeg-full
# images
viu # terminal image viewer
imv # simple image viewer imv # simple image viewer
imagemagick
graphviz
# creative nvtop
blender # 3d modeling
gimp # image editing
inkscape # vector graphics
krita # digital painting
# 3d printing, eletrical engineering
kicad
# video/audio tools
libva-utils
vdpauinfo
vulkan-tools
glxinfo
]; ];
programs = { programs = {
@@ -39,8 +27,6 @@
defaultProfiles = ["gpu-hq"]; defaultProfiles = ["gpu-hq"];
scripts = [pkgs.mpvScripts.mpris]; scripts = [pkgs.mpvScripts.mpris];
}; };
obs-studio.enable = true;
}; };
services = { services = {
@@ -29,6 +29,5 @@
XMODIFIERS = "@im=fcitx"; XMODIFIERS = "@im=fcitx";
INPUT_METHOD = "fcitx"; INPUT_METHOD = "fcitx";
IMSETTINGS_MODULE = "fcitx"; IMSETTINGS_MODULE = "fcitx";
}; };
} }
@@ -4,6 +4,10 @@
lib, lib,
... ...
}: { }: {
imports = [
./wayland-apps.nix
];
# hyprland configs, based on https://github.com/notwidow/hyprland # hyprland configs, based on https://github.com/notwidow/hyprland
home.file.".config/hypr" = { home.file.".config/hypr" = {
source = ./hypr-conf; source = ./hypr-conf;
@@ -34,11 +38,17 @@
"WLR_EGL_NO_MODIFIRES" = "1"; "WLR_EGL_NO_MODIFIRES" = "1";
}; };
# set cursor size and dpi for 4k monitor
# this is for xwayland # this is for xwayland
# set dpi for 4k monitor
xresources.properties = { xresources.properties = {
"Xcursor.size" = 16; "Xft.dpi" = 162;
"Xft.dpi" = 160; };
# set Xcursor.theme & Xcursor.size in ~/.Xresources automatically
home.pointerCursor = {
name = "Qogir-dark";
package = pkgs.qogir-theme;
size = 64;
}; };
} }
@@ -3,7 +3,7 @@ gtk-theme-name=Arc-Dark
gtk-icon-theme-name=Qogir-dark gtk-icon-theme-name=Qogir-dark
gtk-font-name=Noto Sans 10 gtk-font-name=Noto Sans 10
gtk-cursor-theme-name=Qogir-dark gtk-cursor-theme-name=Qogir-dark
gtk-cursor-theme-size=0 gtk-cursor-theme-size=64
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=0 gtk-button-images=0
@@ -6,7 +6,7 @@ gtk-theme-name="Arc-Dark"
gtk-icon-theme-name="Qogir-dark" gtk-icon-theme-name="Qogir-dark"
gtk-font-name="Noto Sans 10" gtk-font-name="Noto Sans 10"
gtk-cursor-theme-name="Qogir-dark" gtk-cursor-theme-name="Qogir-dark"
gtk-cursor-theme-size=0 gtk-cursor-theme-size=64
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=0 gtk-button-images=0

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

@@ -1,20 +1,10 @@
{ {
pkgs, pkgs,
nixpkgs-stable, pkgs-stable,
config,
... ...
}: let }:
pkgs-stable = import nixpkgs-stable {
system = pkgs.system;
config.allowUnfree = true;
};
in {
home.packages = with pkgs-stable; [
firefox-wayland # firefox with wayland support
# firefox
];
{
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it. # TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
programs = { programs = {
@@ -38,6 +28,12 @@
]; ];
}; };
firefox = {
enable = true;
enableGnomeExtensions = false;
package = pkgs-stable.firefox-wayland; # firefox with wayland support
};
vscode = { vscode = {
enable = true; enable = true;
# use the stable version # use the stable version
+34 -176
View File
@@ -14,20 +14,8 @@ font pango: Noto Sans Regular 10
# set the mod key to the winkey: # set the mod key to the winkey:
set $mod Mod4 set $mod Mod4
#####################
# workspace layout: #
#####################
# default i3 tiling mode:
workspace_layout default workspace_layout default
# i3 stacking layout:
# Each window will be fullscreen and tabbed top to bottom.
#workspace_layout stacking
# i3 tabbed layout:
# Each new window will open fullscreen as a tab (left to right)
#workspace_layout tabbed
############################## ##############################
# extra options for windows: # # extra options for windows: #
@@ -36,19 +24,10 @@ workspace_layout default
#border indicator on windows: #border indicator on windows:
new_window pixel 1 new_window pixel 1
# thin borders
# hide_edge_borders both
# Set inner/outer gaps # Set inner/outer gaps
gaps inner 6 gaps inner 6
gaps outer 3 gaps outer 3
# show window title bars (not officially supported with i3gaps)
#default_border normal
# window title alignment
#title_align center
# Use Mouse+$mod to drag floating windows to their wanted position # Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod floating_modifier $mod
@@ -80,18 +59,6 @@ bindcode $mod+80 workspace 8
bindcode $mod+81 workspace 9 bindcode $mod+81 workspace 9
bindcode $mod+90 workspace 10 bindcode $mod+90 workspace 10
# switch to workspace with numlock numpad keys
bindcode $mod+Mod2+87 workspace $ws1
bindcode $mod+Mod2+88 workspace $ws2
bindcode $mod+Mod2+89 workspace $ws3
bindcode $mod+Mod2+83 workspace $ws4
bindcode $mod+Mod2+84 workspace $ws5
bindcode $mod+Mod2+85 workspace $ws6
bindcode $mod+Mod2+79 workspace $ws7
bindcode $mod+Mod2+80 workspace $ws8
bindcode $mod+Mod2+81 workspace $ws9
bindcode $mod+Mod2+90 workspace $ws10
# move focused container to workspace # move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1 bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2 bindsym $mod+Shift+2 move container to workspace $ws2
@@ -104,55 +71,10 @@ bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9 bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10 bindsym $mod+Shift+0 move container to workspace $ws10
# move focused container to workspace with numpad keys
bindcode $mod+Shift+Mod2+87 move container to workspace $ws1
bindcode $mod+Shift+Mod2+88 move container to workspace $ws2
bindcode $mod+Shift+Mod2+89 move container to workspace $ws3
bindcode $mod+Shift+Mod2+83 move container to workspace $ws4
bindcode $mod+Shift+Mod2+84 move container to workspace $ws5
bindcode $mod+Shift+Mod2+85 move container to workspace $ws6
bindcode $mod+Shift+Mod2+79 move container to workspace $ws7
bindcode $mod+Shift+Mod2+80 move container to workspace $ws8
bindcode $mod+Shift+Mod2+81 move container to workspace $ws9
bindcode $mod+Shift+Mod2+90 move container to workspace $ws10
# move focused container to workspace with numpad keys
bindcode $mod+Shift+87 move container to workspace $ws1
bindcode $mod+Shift+88 move container to workspace $ws2
bindcode $mod+Shift+89 move container to workspace $ws3
bindcode $mod+Shift+83 move container to workspace $ws4
bindcode $mod+Shift+84 move container to workspace $ws5
bindcode $mod+Shift+85 move container to workspace $ws6
bindcode $mod+Shift+79 move container to workspace $ws7
bindcode $mod+Shift+80 move container to workspace $ws8
bindcode $mod+Shift+81 move container to workspace $ws9
bindcode $mod+Shift+90 move container to workspace $ws10
# resize window (you can also use the mouse for that): # resize window (you can also use the mouse for that):
#mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window's width.
# Pressing right will grow the window's width.
# Pressing up will shrink the window's height.
# Pressing down will grow the window's height.
# bindsym j resize shrink width 10 px or 10 ppt
# bindsym k resize grow height 10 px or 10 ppt
# bindsym l resize shrink height 10 px or 10 ppt
# bindsym ntilde resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
# bindsym Left resize shrink width 10 px or 10 ppt
# bindsym Down resize grow height 10 px or 10 ppt
# bindsym Up resize shrink height 10 px or 10 ppt
# bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape
# bindsym Return mode "default"
# bindsym Escape mode "default"
#}
bindsym $mod+r mode "resize" bindsym $mod+r mode "resize"
###################################### ######################################
# keybindings for different actions: # # keybindings for different actions: #
###################################### ######################################
@@ -268,6 +190,7 @@ bindsym Print exec scrot ~/%Y-%m-%d-%T-screenshot.png && notify-send "Screenshot
# Power Profiles menu switcher (rofi) # Power Profiles menu switcher (rofi)
bindsym $mod+Shift+p exec ~/.config/i3/scripts/power-profiles bindsym $mod+Shift+p exec ~/.config/i3/scripts/power-profiles
########################################## ##########################################
# configuration for workspace behaviour: # # configuration for workspace behaviour: #
########################################## ##########################################
@@ -288,11 +211,8 @@ set $ws10 "10"
# use workspaces on different displays: # use workspaces on different displays:
# where you have to replace VGA-0/HDMI-0 with the names for your displays # where you have to replace VGA-0/HDMI-0 with the names for your displays
# you can get from xrandr command # you can get from xrandr command
#workspace $ws1 output VGA-0 workspace $ws1 output DP-2
#workspace $ws2 output VGA-0 workspace $ws6 output HDMI-0
#workspace $ws3 output HDMI-0
#workspace $ws4 output HDMI-0
#workspace $ws5 output HDMI-0
# bind program to workspace and focus to them on startup: # bind program to workspace and focus to them on startup:
assign [class="Terminal"] $ws1 assign [class="Terminal"] $ws1
@@ -308,6 +228,7 @@ for_window [class=Thunar] focus
for_window [class=Thunderbird] focus for_window [class=Thunderbird] focus
for_window [class=TelegramDesktop] focus for_window [class=TelegramDesktop] focus
############## ##############
# compositor # # compositor #
############## ##############
@@ -327,6 +248,7 @@ exec_always --no-startup-id picom -b
# for custom config: # for custom config:
#exec_always --no-startup-id picom --config ~/.config/picom.conf #exec_always --no-startup-id picom --config ~/.config/picom.conf
############################################# #############################################
# autostart applications/services on login: # # autostart applications/services on login: #
############################################# #############################################
@@ -337,12 +259,9 @@ exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
# dex execute .desktop files + apps using /etc/xdg/autostart. # dex execute .desktop files + apps using /etc/xdg/autostart.
exec --no-startup-id dex --autostart --environment i3 exec --no-startup-id dex --autostart --environment i3
# num lock activated
#exec --no-startup-id numlockx on
# start a script to setup displays # start a script to setup displays
# uncomment the next line, use arandr to setup displays and save the file as monitor: # use arandr to setup displays and save the file as monitor
# exec --no-startup-id ~/.screenlayout/monitor.sh exec --no-startup-id ~/.screenlayout/monitor.sh
# set wallpaper # set wallpaper
# exec --no-startup-id sleep 2 && nitrogen --restore # exec --no-startup-id sleep 2 && nitrogen --restore
@@ -351,64 +270,33 @@ exec --no-startup-id sleep 1 && feh --bg-fill ~/.config/i3/wallpaper.png
# set powersavings for display: # set powersavings for display:
exec --no-startup-id xset s 480 dpms 600 600 600 exec --no-startup-id xset s 480 dpms 600 600 600
# disable power saving (for example if using xscreensaver)
#exec --no-startup-id xset -dpms
# use xautolock to use autosuspend rules for mobile devices
# https://wiki.archlinux.org/title/Session_lock#xautolock
#exec --no-startup-id xautolock -time 60 -locker "systemctl suspend"
# xscreensaver
# https://www.jwz.org/xscreensaver
#exec --no-startup-id xscreensaver --no-splash
# Desktop notifications # Desktop notifications
# dunst config used ~/.config/dunst/dunstrc
# set alternative config if needed:
#exec --no-startup-id /usr/bin/dunst --config ~/.config/dunst/dunstrc #exec --no-startup-id /usr/bin/dunst --config ~/.config/dunst/dunstrc
# may yneed to run dbus-launch explicitly:
#exec --no-startup-id dbus-launch /usr/bin/dunst
exec --no-startup-id /usr/bin/dunst exec --no-startup-id /usr/bin/dunst
# screenshot tool
exec --no-startup-id flameshot
# autotiling script # autotiling script
# https://github.com/nwg-piotr/autotiling # https://github.com/nwg-piotr/autotiling
# `yay -S autotiling ; (it is in AUR) exec_always --no-startup-id autotiling
#exec_always --no-startup-id autotiling
# Autostart apps as you like # Autostart apps as you like
#exec --no-startup-id sleep 2 && Terminal exec --no-startup-id sleep 1 && Terminal
#exec --no-startup-id sleep 3 && thunar
###############
# system tray #
###############
# if you do not use dex: exec --no-startup-id dex --autostart --environment i3
# you need to have tray apps started manually one by one:
# start blueberry app for managing bluetooth devices from tray:
#exec --no-startup-id blueberry-tray
# networkmanager-applet
#exec --no-startup-id nm-applet
################## ##################
# floating rules # # floating rules #
################## ##################
# set floating (nontiling) for apps needing it # set floating (nontiling) for apps needing it
for_window [class="Yad" instance="yad"] floating enable
for_window [class="Galculator" instance="galculator"] floating enable for_window [class="Galculator" instance="galculator"] floating enable
for_window [class="Blueberry.py" instance="blueberry.py"] floating enable
# set floating (nontiling) for special apps # set floating (nontiling) for special apps
for_window [class="Xsane" instance="xsane"] floating enable for_window [class="Xsane" instance="xsane"] floating enable
for_window [class="Pavucontrol" instance="pavucontrol"] floating enable for_window [class="Pavucontrol" instance="pavucontrol"] floating enable
for_window [class="qt5ct" instance="qt5ct"] floating enable for_window [class="qt5ct" instance="qt5ct"] floating enable
for_window [class="Blueberry.py" instance="blueberry.py"] floating enable
for_window [class="Bluetooth-sendto" instance="bluetooth-sendto"] floating enable for_window [class="Bluetooth-sendto" instance="bluetooth-sendto"] floating enable
for_window [class="Pamac-manager"] floating enable
for_window [window_role="About"] floating enable for_window [window_role="About"] floating enable
# set border of floating window # set border of floating window
@@ -421,6 +309,7 @@ for_window [class="urxvt"] border pixel 1
# set position of floating window # set position of floating window
#for_window [class=".*"] move position center #for_window [class=".*"] move position center
###################################### ######################################
# color settings for bar and windows # # color settings for bar and windows #
###################################### ######################################
@@ -445,6 +334,7 @@ client.unfocused $darkblue $darkblue $grey $darkgrey $darkgrey
client.focused_inactive $darkblue $darkblue $grey $black $black client.focused_inactive $darkblue $darkblue $grey $black $black
client.urgent $urgentred $urgentred $white $yellowbrown $yellowbrown client.urgent $urgentred $urgentred $white $yellowbrown $yellowbrown
############################################ ############################################
# bar settings (input comes from i3blocks) # # bar settings (input comes from i3blocks) #
############################################ ############################################
@@ -454,24 +344,29 @@ client.urgent $urgentred $urgentred $white $yellowbrown $yellowbrown
bar { bar {
font pango: Noto Sans Regular 10 font pango: Noto Sans Regular 10
status_command i3blocks -c ~/.config/i3/i3blocks.conf status_command i3blocks -c ~/.config/i3/i3blocks.conf
position bottom position top
# i3bar_command i3bar --transparency # you can add different bars for multidisplay setups on each display by using `output`
# it could be that you have no primary display set: set one (xrandr --output <output> --primary) output DP-2
# reference: https://i3wm.org/docs/userguide.html#_tray_output
# enable transparency for i3bar
i3bar_command i3bar --transparency
# it could be that you have no primary display set: set one (xrandr --output <output> --primary)
# reference: https://i3wm.org/docs/userguide.html#_tray_output
#tray_output primary #tray_output primary
tray_padding 0 tray_padding 0
# When strip_workspace_numbers is set to yes, # When strip_workspace_numbers is set to yes,
# any workspace that has a name of the form # any workspace that has a name of the form
# “[n][:][NAME]” will display only the name. # “[n][:][NAME]” will display only the name.
strip_workspace_numbers yes strip_workspace_numbers yes
##strip_workspace_name no ##strip_workspace_name no
colors { colors {
separator $purple separator $purple
background $darkgrey background $darkgrey
statusline $white statusline $white
# border bg txt indicator # border bg txt indicator
focused_workspace $mediumgrey $grey $darkgrey $purple focused_workspace $mediumgrey $grey $darkgrey $purple
active_workspace $lightblue $mediumgrey $darkgrey $purple active_workspace $lightblue $mediumgrey $darkgrey $purple
inactive_workspace $darkgrey $darkgrey $grey $purple inactive_workspace $darkgrey $darkgrey $grey $purple
@@ -479,37 +374,6 @@ strip_workspace_numbers yes
} }
} }
# you can add different bars for multidisplay setups on each display:
# set output HDMI-0 to the display you want the bar, --transparency can be set.
# Transparency needs rgba color codes to be used where the last two letters are the transparency factor see here:
# https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4
# #08052be6 --> e6=90%
# bar {
# font pango: Noto Sans Regular 10
# status_command i3blocks -c ~/.config/i3/i3blocks-2.conf
# i3bar_command i3bar --transparency
# output HDMI-0
# position bottom
#
# When strip_workspace_numbers is set to yes,
# any workspace that has a name of the form
# “[n][:][NAME]” will display only the name.
#strip_workspace_numbers yes
##strip_workspace_name no
#
# colors {
# separator $purple
# background $darkbluetrans
# statusline $white
# border bg txt indicator
# focused_workspace $lighterblue $lighterblue $darkblue $purple
# active_workspace $lightdblue $lightdblue $darkblue $purple
# inactive_workspace $darkblue $darkblue $lightdblue $purple
# urgent_workspace $urgentred $urgentred $white $purple
# }
#}
##################################### #####################################
# Application menu handled by rofi: # # Application menu handled by rofi: #
##################################### #####################################
@@ -517,21 +381,15 @@ strip_workspace_numbers yes
## rofi bindings fancy application menu ($mod+d /F9 optional disabled) ## rofi bindings fancy application menu ($mod+d /F9 optional disabled)
bindsym $mod+d exec rofi -modi drun -show drun \ bindsym $mod+d exec rofi -modi drun -show drun \
-config ~/.config/rofi/rofidmenu.rasi -config ~/.config/rofi/rofidmenu.rasi \
-dpi 162
#bindsym F9 exec rofi -modi drun -show drun \
# -config ~/.config/rofi/rofidmenu.rasi
## rofi bindings for window menu ($mod+t /F10 optional disabled) ## rofi bindings for window menu ($mod+t /F10 optional disabled)
bindsym $mod+t exec rofi -show window \ bindsym $mod+t exec rofi -show window \
-config ~/.config/rofi/rofidmenu.rasi -config ~/.config/rofi/rofidmenu.rasi \
-dpi 162
#bindsym F10 exec rofi -show window \
# -config ~/.config/rofi/rofidmenu.rasi
## rofi bindings to manage clipboard (install rofi-greenclip from the AUR) ## rofi bindings to manage clipboard (install rofi-greenclip from the AUR)
#exec --no-startup-id greenclip daemon>/dev/null #exec --no-startup-id greenclip daemon>/dev/null
#bindsym $mod+c exec --no-startup-id rofi -modi "clipboard:greenclip print" -show clipboard \ #bindsym $mod+c exec --no-startup-id rofi -modi "clipboard:greenclip print" -show clipboard \
# -config ~/.config/rofi/rofidmenu.rasi # -config ~/.config/rofi/rofidmenu.rasi
@@ -7,6 +7,10 @@
# i3 配置,基于 https://github.com/endeavouros-team/endeavouros-i3wm-setup # i3 配置,基于 https://github.com/endeavouros-team/endeavouros-i3wm-setup
# 直接从当前文件夹中读取配置文件作为配置内容 # 直接从当前文件夹中读取配置文件作为配置内容
imports = [
./x11-apps.nix
];
# wallpaper, binary file # wallpaper, binary file
home.file.".config/i3/wallpaper.png".source = ../wallpapers/wallpaper.png; home.file.".config/i3/wallpaper.png".source = ../wallpapers/wallpaper.png;
home.file.".config/i3/config".source = ./config; home.file.".config/i3/config".source = ./config;
@@ -19,6 +23,16 @@
executable = true; # make all scripts executable executable = true; # make all scripts executable
}; };
# rofi is a application launcher and dmenu replacement
home.file.".config/rofi" = {
source = ./rofi-conf;
# copy the scripts directory recursively
recursive = true;
};
# xrandr - set primary screen
home.file.".screenlayout/monitor.sh".source = ./dual-monitor-4k-1080p.sh;
# allow fontconfig to discover fonts and configurations installed through home.packages # allow fontconfig to discover fonts and configurations installed through home.packages
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
@@ -28,10 +42,18 @@
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; "__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
}; };
# set cursor size and dpi for 4k monitor # set dpi for 4k monitor
xresources.properties = { xresources.properties = {
"Xcursor.size" = 16; # dpi for Xorg's font
"Xft.dpi" = 160; "Xft.dpi" = 162;
# or set a generic dpi
"*.dpi" = 162;
}; };
# set Xcursor.theme & Xcursor.size in ~/.Xresources automatically
home.pointerCursor = {
name = "Qogir-dark";
package = pkgs.qogir-theme;
size = 64;
};
} }
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
xrandr \
--output HDMI-0 --mode 1920x1080 --pos 3840x0 --rotate normal \
--output DP-0 --off \
--output DP-1 --off \
--output DP-2 --primary --mode 3840x2160 --pos 0x0 --rotate normal \
--output DP-3 --off \
--output DP-4 --off \
--output DP-5 --off
+143
View File
@@ -0,0 +1,143 @@
#
# _ _____ _ _ _
# (_)___ /| |__ | | ___ ___| | _____
# | | |_ \| '_ \| |/ _ \ / __| |/ / __|
# | |___) | |_) | | (_) | (__| <\__ \
# |_|____/|_.__/|_|\___/ \___|_|\_\___/
#
# Official repository for community contributed blocklets:
# https://github.com/vivien/i3blocks-contrib
#
# NOTE: every command's ouput should end with a newline character (\n), otherwise the block may not be displayed correctly.
# Global properties
# The top properties below are applied to every block, but can be overridden.
separator=false
markup=pango
[terminal]
full_text= 
color=#807dfe
command=i3-msg -q exec alacritty
[browser]
full_text= 
color=#ff7f81
command=i3-msg -q exec firefox
[files]
full_text= 
color=#7f3fbf
command=i3-msg -q exec thunar ~/
[simple-2]
full_text=: :
color=#717171
# Disk usage
#
# The directory defaults to $HOME if the instance is not specified.
# The script may be called with a optional argument to set the alert
# (defaults to 10 for 10%).
[disk]
command=df -h / | awk '/\//{ printf(" %4s/%s \n", $4, $2) }'
interval=30
label=<span color="#50fa7b"> </span>
border=#50fa7b
border_top=1
border_right=0
border_bottom=0
border_left=0
# Memory usage
#
# The type defaults to "mem" if the instance is not specified.
[memory]
command=free -h | awk '/Mem:/ { printf(" %5s/%s \n", $3, $2) }'
interval=2
label=<span color="#f1fa8c"> </span>
border=#f1fa8c
border_top=1
border_right=0
border_bottom=0
border_left=0
[cpu_stats]
command=(mpstat 1 1 | grep Average | awk '{ printf "%04.1f<span color=\"#ff5555\">%</span>", (100 - $12) }') && (sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*' -o | awk '{ printf "%s<span color=\"#ff5555\">°C</span>\n", $2 }')
interval=2
label=<span color="#ff5555"><b>CPU: </b></span>
border=#ff5555
border_top=1
border_right=0
border_bottom=0
border_left=0
[nvidia_gpu_stats]
command=nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | awk '{ printf "%02i<span color=\"#ffb86c\">%</span>", $0}' && nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits | awk '{ printf "+%i<span color=\"#ffb86c\">°C</span>\n", $0}'
label=<span color="#ffb86c"><b>GPU: </b></span>
interval=5
border=#ffb86c
border_top=1
border_right=0
border_bottom=0
border_left=0
# https://github.com/vivien/i3blocks-contrib/blob/master/bandwidth3/README.md
[bandwidth]
command=~/.config/i3/scripts/bandwidth
label=<span color="#ff79c6"></span>
interval=persist
border=#ff79c6
border_top=1
border_right=0
border_bottom=0
border_left=0
[pavucontrol]
full_text=
command=pavucontrol
border=#ffffff
border_top=1
border_right=0
border_bottom=0
border_left=0
[date]
command=date
interval=60
label=<span color="#ff5555"> </span>
border=#ff5555
border_top=1
border_right=0
border_bottom=0
border_left=0
# power-profiles-daemon implementation:
# needs package power-profiles-daemon installed and the service running see here:
# https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon
[ppd_menu]
full_text=
command=~/.config/i3/scripts/power-profiles
color=#50fa7b
#Show the current power-profile
[ppd-status]
command=powerprofilesctl get
interval=5
[shutdown_menu]
full_text=
command=~/.config/i3/scripts/powermenu
[simple-2]
full_text=: :
color=#717171

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