Compare commits
98 Commits
48e46b465f
...
nixos
| Author | SHA1 | Date | |
|---|---|---|---|
|
b86cc94d23
|
|||
|
95825c6ff1
|
|||
|
3e7e404d4c
|
|||
|
bb4c77208d
|
|||
|
1f53cd2efb
|
|||
|
d9f8c16011
|
|||
|
4335805701
|
|||
|
|
4a18ae77fc | ||
|
|
5ebf3c9c5e | ||
|
|
f4e5628238 | ||
|
|
bf00621b02 | ||
|
|
ec8d9fafdd | ||
|
539b46393e
|
|||
|
|
e686aef94e | ||
|
54c45411fe
|
|||
|
|
23d6f855ee | ||
|
|
346c304427 | ||
|
0bab44bf04
|
|||
|
5579bf49c3
|
|||
|
11a8dfebff
|
|||
| c2a1654be8 | |||
|
6d431bdf9d
|
|||
|
5dc4e6d3c0
|
|||
|
5c1c326baf
|
|||
| 4e5b555498 | |||
|
895a495b3f
|
|||
|
7e4a6ac8fe
|
|||
|
cd52be2620
|
|||
|
34b2c4d015
|
|||
|
|
943956f119 | ||
|
|
27f3b76ab7 | ||
|
|
4decf54e13 | ||
|
|
abd567a8a5 | ||
|
5785832cbe
|
|||
|
0eacdcdc27
|
|||
|
0890c49887
|
|||
|
fb94547fa2
|
|||
|
c10e121604
|
|||
|
8a87dc6c93
|
|||
|
5db9d23792
|
|||
|
1651bb9356
|
|||
|
a9d4f6de5a
|
|||
|
404f35c0b9
|
|||
|
9baf54ef33
|
|||
|
5a9ff77a29
|
|||
|
87a6c1a862
|
|||
|
43660ff173
|
|||
|
fe6d79edb5
|
|||
|
da4309e2e0
|
|||
|
e1e72965f9
|
|||
|
0979956f16
|
|||
|
28c9799f60
|
|||
|
f9e29ce77f
|
|||
|
f4a8493dce
|
|||
|
e097c9d25f
|
|||
|
58ab2f07a7
|
|||
|
e1faa10e24
|
|||
|
f9ed56123d
|
|||
|
30934f006c
|
|||
|
31bec468c8
|
|||
|
6c1400e295
|
|||
|
8d3bbe9d75
|
|||
|
4f96bcda1d
|
|||
|
0ecd267fa8
|
|||
|
c590fb01dc
|
|||
|
d9a9d110de
|
|||
|
09f2e19683
|
|||
|
8b12178bfc
|
|||
|
4f0f6021e5
|
|||
|
00ead02ff1
|
|||
|
5e54dfded8
|
|||
|
|
eac8c77797 | ||
|
|
3aab004b55 | ||
|
270d7c2fe4
|
|||
|
4c87e635ab
|
|||
|
129fa4973f
|
|||
|
075ee51920
|
|||
|
aeb370f299
|
|||
|
edf8d639b3
|
|||
|
090c069a11
|
|||
|
f230a60a73
|
|||
|
ca1ea8f701
|
|||
|
570bafce6a
|
|||
|
8fd337d099
|
|||
|
7737bc5137
|
|||
|
f44ddb256b
|
|||
|
3d2befc555
|
|||
|
194f03c578
|
|||
|
d0a53ea9a3
|
|||
|
c1134662a9
|
|||
|
afbfff8e96
|
|||
|
87fcf277f5
|
|||
|
5af717ac53
|
|||
|
f6f228f990
|
|||
|
c86fb8b6d3
|
|||
|
00ea23f65c
|
|||
|
a882cc48b4
|
|||
|
684b9a41cc
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@
|
|||||||
*~
|
*~
|
||||||
*.html
|
*.html
|
||||||
result
|
result
|
||||||
|
.sass-cache
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#Catpuccin Mocha
|
#Catpuccin Mocha
|
||||||
let
|
let
|
||||||
colors = rec{
|
colors = rec {
|
||||||
rosewater = "#F5E0DC";
|
rosewater = "#F5E0DC";
|
||||||
flamingo = "#F2CDCD";
|
flamingo = "#F2CDCD";
|
||||||
pink = "#F5C2E7";
|
pink = "#F5C2E7";
|
||||||
@@ -37,5 +37,9 @@ in
|
|||||||
rec {
|
rec {
|
||||||
default = with builtins; mapAttrs (_: color: substring 1 6 color) colors; # hex without hash
|
default = with builtins; mapAttrs (_: color: substring 1 6 color) colors; # hex without hash
|
||||||
hex = colors; # hex with hash
|
hex = colors; # hex with hash
|
||||||
argb = { a ? "ff" }: builtins.mapAttrs (_:color: a + color) default; # ARGB
|
argb =
|
||||||
|
{
|
||||||
|
a ? "ff",
|
||||||
|
}:
|
||||||
|
builtins.mapAttrs (_: color: a + color) default; # ARGB
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
{ inputs, self, ... }:
|
{ inputs, self, ... }:
|
||||||
{
|
{
|
||||||
config._module.args.globalArgs = {
|
config._module.args.globalArgs = {
|
||||||
_module.args = {
|
inherit inputs self;
|
||||||
inherit inputs self;
|
flake = self;
|
||||||
flake = self;
|
conf = {
|
||||||
conf = {
|
colors = import ./colors.nix;
|
||||||
colors = import ./colors.nix;
|
network = import ./network.nix;
|
||||||
network = import ./network.nix;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,14 @@
|
|||||||
marisa = "${ipPrefix}.2";
|
marisa = "${ipPrefix}.2";
|
||||||
satori = "${ipPrefix}.3";
|
satori = "${ipPrefix}.3";
|
||||||
hina = "${ipPrefix}.4";
|
hina = "${ipPrefix}.4";
|
||||||
|
okina = "${ipPrefix}.5";
|
||||||
|
suwako = "${ipPrefix}.6";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
domain = {
|
domain = {
|
||||||
natto = "weirdnatto.in";
|
natto = "weirdnatto.in";
|
||||||
|
amneesh = "amneesh.com";
|
||||||
|
chutiya = "chutiya.online";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
916
flake.lock
generated
916
flake.lock
generated
File diff suppressed because it is too large
Load Diff
112
flake.nix
112
flake.nix
@@ -1,45 +1,13 @@
|
|||||||
{
|
{
|
||||||
description = "dotfiles";
|
description = "dotfiles";
|
||||||
|
|
||||||
inputs = {
|
outputs =
|
||||||
nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable;
|
inputs@{ self, ... }:
|
||||||
stable.url = github:nixos/nixpkgs/release-23.11;
|
|
||||||
flake-parts.url = github:hercules-ci/flake-parts;
|
|
||||||
home-manager = {
|
|
||||||
url = github:nix-community/home-manager;
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
mailserver = {
|
|
||||||
url = gitlab:simple-nixos-mailserver/nixos-mailserver;
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
filehost = {
|
|
||||||
url = github:natto1784/simpler-filehost;
|
|
||||||
# inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
nix-gaming.url = github:fufexan/nix-gaming;
|
|
||||||
nbfc = {
|
|
||||||
url = github:nbfc-linux/nbfc-linux;
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
emacs-overlay.url = github:nix-community/emacs-overlay;
|
|
||||||
nvim-overlay = {
|
|
||||||
url = github:nix-community/neovim-nightly-overlay;
|
|
||||||
};
|
|
||||||
hyprland = {
|
|
||||||
type = "git";
|
|
||||||
url = "https://github.com/hyprwm/Hyprland";
|
|
||||||
submodules = true;
|
|
||||||
};
|
|
||||||
hyprland-contrib = {
|
|
||||||
url = github:hyprwm/contrib;
|
|
||||||
};
|
|
||||||
agenix.url = github:ryantm/agenix;
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = inputs@{ self, ... }:
|
|
||||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
];
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./hosts
|
./hosts
|
||||||
@@ -48,18 +16,70 @@
|
|||||||
./conf
|
./conf
|
||||||
];
|
];
|
||||||
|
|
||||||
perSystem = { system, pkgs, ... }:
|
perSystem =
|
||||||
|
{ system, pkgs, ... }:
|
||||||
rec {
|
rec {
|
||||||
formatter = pkgs.nixpkgs-fmt;
|
formatter = pkgs.nixfmt-tree;
|
||||||
devShells.default = with pkgs; mkShell {
|
devShells.default =
|
||||||
packages = [
|
with pkgs;
|
||||||
nixd
|
mkShell {
|
||||||
formatter
|
packages = [
|
||||||
];
|
nixd
|
||||||
};
|
formatter
|
||||||
|
];
|
||||||
|
};
|
||||||
_module.args.pkgs = import inputs.nixpkgs {
|
_module.args.pkgs = import inputs.nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
|
stable.url = "github:nixos/nixpkgs/release-24.05";
|
||||||
|
|
||||||
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
mailserver = {
|
||||||
|
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
filehost = {
|
||||||
|
url = "github:natto1784/yamaf";
|
||||||
|
};
|
||||||
|
|
||||||
|
nix-gaming.url = "github:fufexan/nix-gaming";
|
||||||
|
|
||||||
|
nbfc = {
|
||||||
|
url = "github:nbfc-linux/nbfc-linux";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
||||||
|
|
||||||
|
nvim-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
||||||
|
|
||||||
|
hyprland = {
|
||||||
|
type = "git";
|
||||||
|
url = "https://github.com/hyprwm/Hyprland";
|
||||||
|
submodules = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
hyprland-contrib = {
|
||||||
|
url = "github:hyprwm/contrib";
|
||||||
|
};
|
||||||
|
|
||||||
|
agenix.url = "github:ryantm/agenix";
|
||||||
|
|
||||||
|
ags.url = "github:Aylur/ags/v1";
|
||||||
|
|
||||||
|
nixgl.url = "github:nix-community/nixGL";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
8
home/README
Normal file
8
home/README
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
natto : default user for okina (desktop - NixOS Unstable)
|
||||||
|
natto-laptop : default user for satori (laptop - NixOS Unstable)
|
||||||
|
bat : default user for remilia (Oracle VM - NixOS Unstable)
|
||||||
|
spin : default user for hina (Oracle VM - NixOS Unstable)
|
||||||
|
spark : default user for marisa (RPi4 - NixOS Unstable)
|
||||||
|
kero : default user for suwako (ARM OracleVM - NixOS Unstable)
|
||||||
|
amneesh : default user for nightbug (Workplace PC - Arch Linux)
|
||||||
|
|
||||||
37
home/amneesh/default.nix
Normal file
37
home/amneesh/default.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
home = {
|
||||||
|
homeDirectory = "/home/amneesh";
|
||||||
|
username = "amneesh";
|
||||||
|
stateVersion = "24.05";
|
||||||
|
};
|
||||||
|
|
||||||
|
targets.genericLinux.enable = true;
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./pkgs.nix
|
||||||
|
./nixgl.nix
|
||||||
|
./screen.nix
|
||||||
|
./wayvnc.nix
|
||||||
|
|
||||||
|
# From personal
|
||||||
|
../natto/ags
|
||||||
|
../natto/emacs.nix
|
||||||
|
../natto/browser.nix
|
||||||
|
../natto/dunst.nix
|
||||||
|
../natto/gtk.nix
|
||||||
|
../natto/cursor.nix
|
||||||
|
../natto/wayland.nix
|
||||||
|
../natto/hypridle.nix
|
||||||
|
../natto/hyprlock.nix
|
||||||
|
../natto/hyprpaper.nix
|
||||||
|
../natto/hyprland.nix
|
||||||
|
../natto/tofi.nix
|
||||||
|
../natto/foot.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
29
home/amneesh/nixgl.nix
Normal file
29
home/amneesh/nixgl.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (inputs) nixgl;
|
||||||
|
inherit (inputs.hyprland.packages.${pkgs.system}) hyprland;
|
||||||
|
inherit (config.lib.nixGL) wrap;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
nixGL = {
|
||||||
|
packages = nixgl.packages;
|
||||||
|
defaultWrapper = "mesa";
|
||||||
|
offloadWrapper = "nvidiaPrime";
|
||||||
|
installScripts = [
|
||||||
|
"mesa"
|
||||||
|
"nvidiaPrime"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# hyprland
|
||||||
|
wayland.windowManager.hyprland.package = lib.mkForce (wrap hyprland);
|
||||||
|
|
||||||
|
# hypridle
|
||||||
|
services.hypridle.package = lib.mkForce (wrap pkgs.hypridle);
|
||||||
|
}
|
||||||
29
home/amneesh/pkgs.nix
Normal file
29
home/amneesh/pkgs.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
|
||||||
|
xdg.mime.enable = true;
|
||||||
|
programs = {
|
||||||
|
bash.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
cmake
|
||||||
|
corkscrew
|
||||||
|
dtc
|
||||||
|
file
|
||||||
|
htop
|
||||||
|
llvmPackages.clang
|
||||||
|
(nattovim.override { nvimPackage = inputs.nvim-overlay.packages.${pkgs.system}.neovim; })
|
||||||
|
meson
|
||||||
|
ninja
|
||||||
|
thunderbird
|
||||||
|
wget
|
||||||
|
xfce.thunar
|
||||||
|
libreoffice
|
||||||
|
git-repo
|
||||||
|
];
|
||||||
|
}
|
||||||
12
home/amneesh/screen.nix
Normal file
12
home/amneesh/screen.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home = {
|
||||||
|
packages = [ pkgs.screen ];
|
||||||
|
|
||||||
|
file = {
|
||||||
|
".screenrc".text = ''
|
||||||
|
defscrollback 10000
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
13
home/amneesh/wayvnc.nix
Normal file
13
home/amneesh/wayvnc.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
services.wayvnc = rec {
|
||||||
|
enable = true;
|
||||||
|
autoStart = enable;
|
||||||
|
settings = {
|
||||||
|
address = "0.0.0.0";
|
||||||
|
port = 5900;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
4
home/common/direnv/default.nix
Normal file
4
home/common/direnv/default.nix
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.direnv.enable = true;
|
||||||
|
}
|
||||||
20
home/common/fonts/default.nix
Normal file
20
home/common/fonts/default.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
fira-code
|
||||||
|
fira-mono
|
||||||
|
monoid
|
||||||
|
font-awesome
|
||||||
|
material-icons
|
||||||
|
material-design-icons
|
||||||
|
lohit-fonts.devanagari
|
||||||
|
lohit-fonts.gurmukhi
|
||||||
|
office-code-pro
|
||||||
|
eb-garamond
|
||||||
|
noto-fonts-cjk-sans
|
||||||
|
takao
|
||||||
|
liberation_ttf
|
||||||
|
];
|
||||||
|
|
||||||
|
fonts.fontconfig.enable = true;
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
options.natto.laptop = lib.mkOption {
|
options.isLaptop = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ config, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
size = 30000;
|
size = 30000;
|
||||||
save = size;
|
save = size;
|
||||||
};
|
};
|
||||||
enableAutosuggestions = true;
|
autosuggestion.enable = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
syntaxHighlighting.enable = true;
|
syntaxHighlighting.enable = true;
|
||||||
prezto = {
|
prezto = {
|
||||||
@@ -16,9 +16,13 @@
|
|||||||
prompt.theme = "pure";
|
prompt.theme = "pure";
|
||||||
autosuggestions.color = "fg=yellow,bold";
|
autosuggestions.color = "fg=yellow,bold";
|
||||||
utility.safeOps = false;
|
utility.safeOps = false;
|
||||||
|
extraConfig = lib.mkBefore ''
|
||||||
|
export GREP_COLORS="mt=01;31"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
initExtra = ''
|
initContent = lib.mkAfter ''
|
||||||
unsetopt extendedGlob
|
unsetopt extendedGlob
|
||||||
|
[[ -f ~/.zsh_custom ]] && source ~/.zsh_custom
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
145
home/default.nix
145
home/default.nix
@@ -1,79 +1,122 @@
|
|||||||
{ self, inputs, globalArgs, ... }:
|
{
|
||||||
|
self,
|
||||||
|
inputs,
|
||||||
|
globalArgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
commonModules = [
|
common = [
|
||||||
./modules/zsh.nix
|
{ programs.home-manager.enable = true; }
|
||||||
./modules/programs.nix
|
./common/zsh
|
||||||
globalArgs
|
./common/direnv
|
||||||
|
./common/laptop.nix
|
||||||
|
inputs.agenix.homeManagerModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
mkPkgs = system: import inputs.nixpkgs {
|
mkPkgs =
|
||||||
inherit system;
|
system: overlays:
|
||||||
config = {
|
import inputs.nixpkgs {
|
||||||
allowUnfree = true;
|
inherit system;
|
||||||
allowBroken = true;
|
config = {
|
||||||
allowInsecure = true;
|
allowUnfree = true;
|
||||||
|
allowBroken = true;
|
||||||
|
allowInsecure = true;
|
||||||
|
};
|
||||||
|
overlays = overlays ++ [ self.overlays.default ];
|
||||||
};
|
};
|
||||||
overlays = [ self.overlays.default ];
|
|
||||||
};
|
extraSpecialArgs = globalArgs;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.homeConfigurations =
|
flake.homeConfigurations = {
|
||||||
let
|
natto-laptop = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
inherit extraSpecialArgs;
|
||||||
nattoModules = [
|
modules = [
|
||||||
./natto
|
./natto
|
||||||
./modules/laptop.nix
|
./common/fonts
|
||||||
inputs.hyprland.homeManagerModules.default
|
{ isLaptop = true; }
|
||||||
inputs.agenix.homeManagerModules.default
|
]
|
||||||
] ++ commonModules;
|
++ common;
|
||||||
in
|
pkgs = mkPkgs "x86_64-linux" [ ];
|
||||||
{
|
};
|
||||||
natto-laptop = inputs.home-manager.lib.homeManagerConfiguration {
|
|
||||||
modules = nattoModules ++ [
|
|
||||||
{ natto.laptop = true; }
|
|
||||||
];
|
|
||||||
pkgs = mkPkgs "x86_64-linux";
|
|
||||||
};
|
|
||||||
|
|
||||||
natto = inputs.home-manager.lib.homeManagerConfiguration {
|
natto = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
modules = nattoModules;
|
inherit extraSpecialArgs;
|
||||||
pkgs = mkPkgs "x86_64-linux";
|
modules = [
|
||||||
};
|
./natto
|
||||||
|
./common/fonts
|
||||||
|
]
|
||||||
|
++ common;
|
||||||
|
pkgs = mkPkgs "x86_64-linux" [ ];
|
||||||
|
};
|
||||||
|
|
||||||
}
|
spark = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
inherit extraSpecialArgs;
|
||||||
// {
|
modules = [
|
||||||
spark = inputs.home-manager.lib.homeManagerConfiguration {
|
{
|
||||||
modules = [{
|
|
||||||
home = {
|
home = {
|
||||||
homeDirectory = "/home/spark";
|
homeDirectory = "/home/spark";
|
||||||
username = "spark";
|
username = "spark";
|
||||||
stateVersion = "23.05";
|
stateVersion = "23.05";
|
||||||
};
|
};
|
||||||
}] ++ commonModules;
|
}
|
||||||
pkgs = self.legacyPackages.aarch64-linux;
|
]
|
||||||
};
|
++ common;
|
||||||
|
pkgs = mkPkgs "aarch64-linux" [ ];
|
||||||
|
};
|
||||||
|
|
||||||
bat = inputs.home-manager.lib.homeManagerConfiguration {
|
bat = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
modules = [{
|
inherit extraSpecialArgs;
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
home = {
|
home = {
|
||||||
homeDirectory = "/home/bat";
|
homeDirectory = "/home/bat";
|
||||||
username = "bat";
|
username = "bat";
|
||||||
stateVersion = "23.05";
|
stateVersion = "23.05";
|
||||||
};
|
};
|
||||||
}] ++ commonModules;
|
}
|
||||||
pkgs = self.legacyPackages.x86_64-linux;
|
]
|
||||||
};
|
++ common;
|
||||||
|
pkgs = mkPkgs "x86_64-linux" [ ];
|
||||||
|
};
|
||||||
|
|
||||||
spin = inputs.home-manager.lib.homeManagerConfiguration {
|
spin = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
modules = [{
|
inherit extraSpecialArgs;
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
home = {
|
home = {
|
||||||
homeDirectory = "/home/spin";
|
homeDirectory = "/home/spin";
|
||||||
username = "spin";
|
username = "spin";
|
||||||
stateVersion = "23.05";
|
stateVersion = "23.05";
|
||||||
};
|
};
|
||||||
}] ++ commonModules;
|
}
|
||||||
pkgs = self.legacyPackages.x86_64-linux;
|
]
|
||||||
};
|
++ common;
|
||||||
|
pkgs = mkPkgs "x86_64-linux" [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
kero = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
inherit extraSpecialArgs;
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
home = {
|
||||||
|
homeDirectory = "/home/kero";
|
||||||
|
username = "kero";
|
||||||
|
stateVersion = "24.05";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]
|
||||||
|
++ common;
|
||||||
|
pkgs = mkPkgs "aarch64-linux" [ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
amneesh = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
inherit extraSpecialArgs;
|
||||||
|
modules = [
|
||||||
|
./amneesh
|
||||||
|
]
|
||||||
|
++ common;
|
||||||
|
pkgs = mkPkgs "x86_64-linux" [ (import ./overlays/standalone.nix) ];
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
programs = {
|
|
||||||
home-manager.enable = true;
|
|
||||||
password-store.enable = true;
|
|
||||||
direnv.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
11
home/natto/ags/README.md
Normal file
11
home/natto/ags/README.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# My AGS configuration
|
||||||
|
Currently has a bar, a media box, an unstyled calendar and a settings(?) menu.
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
- Works only on 1.8.2 (current)
|
||||||
|
- audio: requires pipewire-pulse
|
||||||
|
- mpris: requires gvfs for art
|
||||||
|
- hyprland: requires hyprland (🤯)
|
||||||
|
- battery: requires upower
|
||||||
|
- system-tray: requires libdbusmenu-gtk3
|
||||||
|
- systemd: for power commands
|
||||||
31
home/natto/ags/config.js
Normal file
31
home/natto/ags/config.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import Bar from "./windows/bar/index.js";
|
||||||
|
import Settings from "./windows/settings/index.js";
|
||||||
|
import MusicBox from "./windows/music-box/index.js";
|
||||||
|
import Calendar from "./windows/calendar.js";
|
||||||
|
|
||||||
|
const configDir = App.configDir;
|
||||||
|
|
||||||
|
const scssStyle = `${configDir}/style.scss`;
|
||||||
|
const cssStyle = `${configDir}/style.css`;
|
||||||
|
|
||||||
|
const compileSass = () => {
|
||||||
|
Utils.exec(`scss ${scssStyle} ${cssStyle}`);
|
||||||
|
console.log("sass compiled to css");
|
||||||
|
};
|
||||||
|
|
||||||
|
compileSass();
|
||||||
|
|
||||||
|
Utils.monitorFile(`${configDir}/styles`, () => {
|
||||||
|
console.log("change detected in style");
|
||||||
|
compileSass();
|
||||||
|
App.resetCss();
|
||||||
|
App.applyCss(cssStyle);
|
||||||
|
console.log("new style applied");
|
||||||
|
});
|
||||||
|
|
||||||
|
App.config({
|
||||||
|
style: "./style.css",
|
||||||
|
windows: [Bar(), MusicBox(), Settings(), Calendar()],
|
||||||
|
});
|
||||||
|
|
||||||
|
export {};
|
||||||
6
home/natto/ags/constants.js
Normal file
6
home/natto/ags/constants.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export const WindowNames = {
|
||||||
|
BAR: "bar",
|
||||||
|
SETTINGS: "settings",
|
||||||
|
MUSIC_BOX: "music-box",
|
||||||
|
CALENDAR: "calendar",
|
||||||
|
};
|
||||||
66
home/natto/ags/default.nix
Normal file
66
home/natto/ags/default.nix
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.programs.ags;
|
||||||
|
|
||||||
|
deps =
|
||||||
|
with pkgs;
|
||||||
|
[
|
||||||
|
sass
|
||||||
|
gawk
|
||||||
|
bash
|
||||||
|
procps
|
||||||
|
coreutils
|
||||||
|
imagemagick
|
||||||
|
systemd
|
||||||
|
config.wayland.windowManager.hyprland.package
|
||||||
|
]
|
||||||
|
++ lib.optional config.isLaptop brightnessctl;
|
||||||
|
|
||||||
|
configDir = lib.cleanSourceWith {
|
||||||
|
src = ./.;
|
||||||
|
filter =
|
||||||
|
name: _:
|
||||||
|
let
|
||||||
|
baseName = baseNameOf (toString name);
|
||||||
|
in
|
||||||
|
!(lib.hasSuffix ".nix" baseName);
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.ags.homeManagerModules.default
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.ags = {
|
||||||
|
enable = true;
|
||||||
|
# package = pkgs.ags_1;
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."ags" = {
|
||||||
|
source = configDir;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services.ags = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Aylur's Gtk Shell";
|
||||||
|
PartOf = [
|
||||||
|
"tray.target"
|
||||||
|
"graphical-session.target"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
Service = {
|
||||||
|
Environment = "PATH=${lib.makeBinPath deps}";
|
||||||
|
ExecStart = "${cfg.package}/bin/ags";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = 10;
|
||||||
|
};
|
||||||
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
5
home/natto/ags/style.scss
Normal file
5
home/natto/ags/style.scss
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
@import "styles/global.scss";
|
||||||
|
@import "styles/bar.scss";
|
||||||
|
@import "styles/music-box.scss";
|
||||||
|
@import "styles/settings.scss";
|
||||||
|
@import "styles/calendar.scss";
|
||||||
40
home/natto/ags/styles/bar.scss
Normal file
40
home/natto/ags/styles/bar.scss
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
.bar {
|
||||||
|
background: $background;
|
||||||
|
|
||||||
|
.hyprland {
|
||||||
|
background: none;
|
||||||
|
|
||||||
|
button.focused {
|
||||||
|
transition-duration: 0;
|
||||||
|
color: $mauve;
|
||||||
|
box-shadow: 0 0 0 9999px rgba($mauve, 0.08) inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
button.unfocused {
|
||||||
|
background: none;
|
||||||
|
color: $flamingo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.music {
|
||||||
|
.music-title {
|
||||||
|
color: $sapphire;
|
||||||
|
}
|
||||||
|
|
||||||
|
.music-controls button {
|
||||||
|
color: $yellow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.network .network-icon {
|
||||||
|
color: $lavender;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-wrapper {
|
||||||
|
color: $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tray-button {
|
||||||
|
color: $flamingo;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
home/natto/ags/styles/calendar.scss
Normal file
8
home/natto/ags/styles/calendar.scss
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
.calendar {
|
||||||
|
.calendar-unwrapped {
|
||||||
|
margin-top: 10px;
|
||||||
|
border: 2px solid $mauve;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: rgba($base, 0.9);
|
||||||
|
}
|
||||||
|
}
|
||||||
57
home/natto/ags/styles/global.scss
Normal file
57
home/natto/ags/styles/global.scss
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
$rosewater: #f5e0dc;
|
||||||
|
$flamingo: #f2cdcd;
|
||||||
|
$pink: #f5c2e7;
|
||||||
|
$mauve: #cba6f7;
|
||||||
|
$red: #f38ba8;
|
||||||
|
$maroon: #eba0ac;
|
||||||
|
$peach: #fab387;
|
||||||
|
$yellow: #f9e2af;
|
||||||
|
$green: #a6e3a1;
|
||||||
|
$teal: #94e2d5;
|
||||||
|
$sky: #89dceb;
|
||||||
|
$sapphire: #74c7ec;
|
||||||
|
$blue: #89b4fa;
|
||||||
|
$lavender: #b4befe;
|
||||||
|
$text: #cdd6f4;
|
||||||
|
$subtext1: #bac2de;
|
||||||
|
$subtext0: #a6adc8;
|
||||||
|
$overlay2: #9399b2;
|
||||||
|
$overlay1: #7f849c;
|
||||||
|
$overlay0: #6c7086;
|
||||||
|
$surface2: #585b70;
|
||||||
|
$surface1: #45475a;
|
||||||
|
$surface0: #313244;
|
||||||
|
$base: #1e1e2e;
|
||||||
|
$mantle: #181825;
|
||||||
|
$crust: #11111b;
|
||||||
|
|
||||||
|
$background: $base;
|
||||||
|
$foreground: $text;
|
||||||
|
|
||||||
|
* {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
background: none;
|
||||||
|
border-radius: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
icon {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar,
|
||||||
|
.music-box,
|
||||||
|
.calendar,
|
||||||
|
.settings {
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: "Fira Mono";
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
.hyprland {
|
||||||
|
font-size: 18px;
|
||||||
|
font-family: "Lohit Gurmukhi";
|
||||||
|
}
|
||||||
|
}
|
||||||
79
home/natto/ags/styles/music-box.scss
Normal file
79
home/natto/ags/styles/music-box.scss
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
.music-box {
|
||||||
|
.music-box-unwrapped {
|
||||||
|
margin-top: 15px;
|
||||||
|
.music-player {
|
||||||
|
background: $base;
|
||||||
|
border: 2px solid $mauve;
|
||||||
|
border-radius: 13px;
|
||||||
|
.cover-art {
|
||||||
|
margin: 2em;
|
||||||
|
border-radius: 13px;
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
.music-details {
|
||||||
|
$shadow: 0px 0px 10px rgba(black, 0.8);
|
||||||
|
padding: 2em;
|
||||||
|
.title {
|
||||||
|
font-size: 30px;
|
||||||
|
color: $pink;
|
||||||
|
text-shadow: $shadow;
|
||||||
|
}
|
||||||
|
.icon-wrapper {
|
||||||
|
.icon {
|
||||||
|
font-size: 24px;
|
||||||
|
color: $yellow;
|
||||||
|
}
|
||||||
|
.artist {
|
||||||
|
color: $yellow;
|
||||||
|
text-shadow: $shadow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.length-label,
|
||||||
|
.position-label {
|
||||||
|
text-shadow: $shadow;
|
||||||
|
}
|
||||||
|
.music-controls {
|
||||||
|
border-radius: 20px 8px 20px 8px;
|
||||||
|
padding: 5px;
|
||||||
|
margin: 0px 10px;
|
||||||
|
background: rgba($base, 0.5);
|
||||||
|
button {
|
||||||
|
font-size: 30px;
|
||||||
|
&:hover {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scale trough {
|
||||||
|
min-height: 10px;
|
||||||
|
margin: 0 15px;
|
||||||
|
|
||||||
|
highlight {
|
||||||
|
background-image: linear-gradient(to right, $sapphire, $blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
slider {
|
||||||
|
border-radius: 4px;
|
||||||
|
background: $background;
|
||||||
|
margin: -10px -10px;
|
||||||
|
transition: 0.1s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border: 2px $mauve solid;
|
||||||
|
box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
box-shadow:
|
||||||
|
0 0 0 1px inset,
|
||||||
|
0 0 0 8px rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
116
home/natto/ags/styles/settings.scss
Normal file
116
home/natto/ags/styles/settings.scss
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
.settings {
|
||||||
|
.settings-unwrapped {
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
border: 2px solid $mauve;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: $base;
|
||||||
|
|
||||||
|
.metrics {
|
||||||
|
& > * {
|
||||||
|
background-color: rgba(255, 255, 255, 0.03);
|
||||||
|
border-radius: 4px;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
.metric-progress {
|
||||||
|
min-width: 40px;
|
||||||
|
min-height: 40px;
|
||||||
|
font-size: 4px;
|
||||||
|
margin: 4px;
|
||||||
|
.metric-icon {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.cpu-metric {
|
||||||
|
color: $mauve;
|
||||||
|
}
|
||||||
|
.memory-metric {
|
||||||
|
color: $flamingo;
|
||||||
|
}
|
||||||
|
.disk-metric {
|
||||||
|
color: $pink;
|
||||||
|
}
|
||||||
|
.battery-metric {
|
||||||
|
color: $yellow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-col {
|
||||||
|
.sliders {
|
||||||
|
$icon-size: 15px;
|
||||||
|
$scale-height: 20px;
|
||||||
|
|
||||||
|
margin: 10px;
|
||||||
|
scale trough {
|
||||||
|
min-height: $scale-height;
|
||||||
|
min-width: 160px;
|
||||||
|
border-radius: 3px;
|
||||||
|
|
||||||
|
highlight {
|
||||||
|
all: unset;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
slider {
|
||||||
|
$slider-height: $scale-height + 5px;
|
||||||
|
|
||||||
|
min-width: $slider-height;
|
||||||
|
min-height: $slider-height;
|
||||||
|
border-radius: $slider-height;
|
||||||
|
background: $text;
|
||||||
|
box-shadow: 0 2px 0 0 rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.volume {
|
||||||
|
.volume-icon {
|
||||||
|
font-size: $icon-size;
|
||||||
|
color: $green;
|
||||||
|
}
|
||||||
|
|
||||||
|
scale trough highlight {
|
||||||
|
background-color: $green;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.brightness {
|
||||||
|
.brightness-icon {
|
||||||
|
font-size: $icon-size;
|
||||||
|
color: $yellow;
|
||||||
|
}
|
||||||
|
|
||||||
|
scale trough highlight {
|
||||||
|
background-color: $yellow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-col-temps {
|
||||||
|
.temperature {
|
||||||
|
color: $blue;
|
||||||
|
}
|
||||||
|
.temperature-hot {
|
||||||
|
color: $red;
|
||||||
|
}
|
||||||
|
.weather {
|
||||||
|
color: $rosewater;
|
||||||
|
}
|
||||||
|
& > * {
|
||||||
|
margin: 0px 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.power-menu {
|
||||||
|
margin: 20px;
|
||||||
|
button {
|
||||||
|
&:hover {
|
||||||
|
color: $red;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
home/natto/ags/tsconfig.json
Normal file
18
home/natto/ags/tsconfig.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"lib": [
|
||||||
|
"ES2022"
|
||||||
|
],
|
||||||
|
"allowJs": true,
|
||||||
|
"checkJs": false,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitAny": false,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"typeRoots": [
|
||||||
|
"./types"
|
||||||
|
],
|
||||||
|
"skipLibCheck": true
|
||||||
|
}
|
||||||
|
}
|
||||||
42
home/natto/ags/utils/music.js
Normal file
42
home/natto/ags/utils/music.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import GLib from "gi://GLib";
|
||||||
|
|
||||||
|
export const lengthStr = (length) => {
|
||||||
|
if (length < 0) return "0:00";
|
||||||
|
|
||||||
|
const min = Math.floor(length / 60);
|
||||||
|
const sec = Math.floor(length % 60);
|
||||||
|
const sec0 = sec < 10 ? "0" : "";
|
||||||
|
return `${min}:${sec0}${sec}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const blurBg = (cover) => {
|
||||||
|
if (!cover) return "";
|
||||||
|
|
||||||
|
const cachePath = Utils.CACHE_DIR + "/media";
|
||||||
|
const blurPath = cachePath + "/blur";
|
||||||
|
const bgPath = blurPath + cover.substring(cachePath.length);
|
||||||
|
|
||||||
|
if (!GLib.file_test(bgPath, GLib.FileTest.EXISTS)) {
|
||||||
|
Utils.ensureDirectory(blurPath);
|
||||||
|
Utils.exec(
|
||||||
|
`convert ${cover} -scale 10% -blur 0x2 -resize 1000% ${bgPath}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return `
|
||||||
|
background-image: url('${bgPath}');
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
background-size: cover;
|
||||||
|
`;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const findPlayer = (players) => {
|
||||||
|
const active = players.find((p) => p.playBackStatus === "Playing");
|
||||||
|
|
||||||
|
if (active) return active;
|
||||||
|
|
||||||
|
for (const p of players) if (p) return p;
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
};
|
||||||
41
home/natto/ags/utils/popup.js
Normal file
41
home/natto/ags/utils/popup.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
export const Padding = (name, { hexpand = true, vexpand = true } = {}) =>
|
||||||
|
Widget.EventBox({
|
||||||
|
hexpand,
|
||||||
|
vexpand,
|
||||||
|
can_focus: false,
|
||||||
|
setup: (w) => w.on("button-press-event", () => App.closeWindow(name)),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const Revealer = ({
|
||||||
|
name,
|
||||||
|
child,
|
||||||
|
transition = "slide_down",
|
||||||
|
transitionDuration = 200,
|
||||||
|
}) =>
|
||||||
|
Widget.Box({
|
||||||
|
css: "padding: 1px;",
|
||||||
|
child: Widget.Revealer({
|
||||||
|
transition,
|
||||||
|
transitionDuration,
|
||||||
|
child: Widget.Box({
|
||||||
|
child,
|
||||||
|
}),
|
||||||
|
setup: (self) =>
|
||||||
|
self.hook(App, (_, window, visible) => {
|
||||||
|
if (window === name) self.reveal_child = visible;
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default ({ name, layout, ...props }) =>
|
||||||
|
Widget.Window({
|
||||||
|
name,
|
||||||
|
setup: (w) => w.keybind("Escape", () => App.closeWindow(name)),
|
||||||
|
visible: false,
|
||||||
|
keymode: "on-demand",
|
||||||
|
exclusivity: "normal",
|
||||||
|
layer: "top",
|
||||||
|
anchor: ["top", "bottom", "right", "left"],
|
||||||
|
child: layout,
|
||||||
|
...props,
|
||||||
|
});
|
||||||
5
home/natto/ags/utils/text.js
Normal file
5
home/natto/ags/utils/text.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export const shrinkText = (str, n) => {
|
||||||
|
let newStr = str.substring(0, n);
|
||||||
|
if (str.length > n) newStr = newStr + "...";
|
||||||
|
return newStr;
|
||||||
|
};
|
||||||
19
home/natto/ags/windows/bar/bluetooth.js
Normal file
19
home/natto/ags/windows/bar/bluetooth.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
const bluetooth = await Service.import("bluetooth");
|
||||||
|
|
||||||
|
export default () =>
|
||||||
|
Widget.Icon({
|
||||||
|
setup: (self) =>
|
||||||
|
self.hook(
|
||||||
|
bluetooth,
|
||||||
|
(self) => {
|
||||||
|
self.tooltipText = bluetooth.connected_devices
|
||||||
|
.map(({ name }) => name)
|
||||||
|
.join("\n");
|
||||||
|
self.visible = bluetooth.connected_devices.length > 0;
|
||||||
|
},
|
||||||
|
"notify::connected-devices",
|
||||||
|
),
|
||||||
|
icon: bluetooth
|
||||||
|
.bind("enabled")
|
||||||
|
.as((on) => `bluetooth-${on ? "active" : "disabled"}-symbolic`),
|
||||||
|
});
|
||||||
38
home/natto/ags/windows/bar/hyprland.js
Normal file
38
home/natto/ags/windows/bar/hyprland.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
const hyprland = await Service.import("hyprland");
|
||||||
|
|
||||||
|
const gurmukhiNums = {
|
||||||
|
1: "੧",
|
||||||
|
2: "੨",
|
||||||
|
3: "੩",
|
||||||
|
4: "੪",
|
||||||
|
5: "੫",
|
||||||
|
6: "੬",
|
||||||
|
7: "੭",
|
||||||
|
8: "੮",
|
||||||
|
9: "੯",
|
||||||
|
10: "੦",
|
||||||
|
};
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const activeId = hyprland.active.workspace.bind("id");
|
||||||
|
const workspaces = hyprland.bind("workspaces").as((ws) =>
|
||||||
|
ws
|
||||||
|
.sort((a, b) => a.id - b.id)
|
||||||
|
.map(({ id }) =>
|
||||||
|
Widget.Button({
|
||||||
|
onClicked: () => hyprland.messageAsync(`dispatch workspace ${id}`),
|
||||||
|
child: Widget.Label(gurmukhiNums[id]),
|
||||||
|
className: activeId.as(
|
||||||
|
(i) => `${i === id ? "focused" : "unfocused"}`,
|
||||||
|
),
|
||||||
|
cursor: "pointer",
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return Widget.Box({
|
||||||
|
css: "padding: 1px;",
|
||||||
|
className: "hyprland",
|
||||||
|
children: workspaces,
|
||||||
|
});
|
||||||
|
};
|
||||||
56
home/natto/ags/windows/bar/index.js
Normal file
56
home/natto/ags/windows/bar/index.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import Hyprland from "./hyprland.js";
|
||||||
|
import Music from "./music.js";
|
||||||
|
import Tray from "./tray.js";
|
||||||
|
import Time from "./time.js";
|
||||||
|
import Network from "./network.js";
|
||||||
|
import Bluetooth from "./bluetooth.js";
|
||||||
|
import Settings from "./settings.js";
|
||||||
|
|
||||||
|
import { WindowNames } from "../../constants.js";
|
||||||
|
|
||||||
|
const { BAR } = WindowNames;
|
||||||
|
|
||||||
|
const Left = () => {
|
||||||
|
return Widget.Box({
|
||||||
|
className: "bar-left",
|
||||||
|
spacing: 8,
|
||||||
|
children: [Hyprland()],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const Center = (monitor) => {
|
||||||
|
return Widget.Box({
|
||||||
|
className: "bar-center",
|
||||||
|
spacing: 8,
|
||||||
|
children: [Music(monitor)],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const Right = (monitor) => {
|
||||||
|
return Widget.Box({
|
||||||
|
className: "bar-right",
|
||||||
|
hpack: "end",
|
||||||
|
spacing: 10,
|
||||||
|
children: [
|
||||||
|
Tray(),
|
||||||
|
Bluetooth(),
|
||||||
|
Network(),
|
||||||
|
Time(monitor),
|
||||||
|
Settings(monitor),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export default (monitor = 0) =>
|
||||||
|
Widget.Window({
|
||||||
|
name: `${BAR}-${monitor}`,
|
||||||
|
className: BAR,
|
||||||
|
monitor,
|
||||||
|
anchor: ["top", "left", "right"],
|
||||||
|
exclusivity: "exclusive",
|
||||||
|
child: Widget.CenterBox({
|
||||||
|
startWidget: Left(),
|
||||||
|
centerWidget: Center(monitor),
|
||||||
|
endWidget: Right(monitor),
|
||||||
|
}),
|
||||||
|
});
|
||||||
65
home/natto/ags/windows/bar/music.js
Normal file
65
home/natto/ags/windows/bar/music.js
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import Controls from "../music-box/music-controls.js";
|
||||||
|
import { shrinkText } from "../../utils/text.js";
|
||||||
|
import { findPlayer } from "../../utils/music.js";
|
||||||
|
import { WindowNames } from "../../constants.js";
|
||||||
|
|
||||||
|
const mpris = await Service.import("mpris");
|
||||||
|
const players = mpris.bind("players");
|
||||||
|
|
||||||
|
/** @param {import('types/service/mpris').MprisPlayer} player */
|
||||||
|
const Player = (player, monitor) => {
|
||||||
|
const revealer = Widget.Revealer({
|
||||||
|
revealChild: false,
|
||||||
|
transitionDuration: 300,
|
||||||
|
transition: "slide_left",
|
||||||
|
child: Controls(player),
|
||||||
|
});
|
||||||
|
|
||||||
|
return Widget.EventBox({
|
||||||
|
visible: player.bus_name === findPlayer(mpris.players).bus_name,
|
||||||
|
cursor: "pointer",
|
||||||
|
setup: (self) => {
|
||||||
|
self.on("leave-notify-event", () => {
|
||||||
|
revealer.reveal_child = false;
|
||||||
|
});
|
||||||
|
self.on("enter-notify-event", () => {
|
||||||
|
revealer.reveal_child = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Widget.Box({
|
||||||
|
className: "music",
|
||||||
|
children: [
|
||||||
|
Widget.Button({
|
||||||
|
onClicked: () =>
|
||||||
|
App.toggleWindow(`${WindowNames.MUSIC_BOX}-${monitor}`),
|
||||||
|
className: "music-title",
|
||||||
|
child: Widget.Label().hook(player, (self) => {
|
||||||
|
self.tooltip_text = player.track_title;
|
||||||
|
self.label = shrinkText(self.tooltip_text, 50);
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
revealer,
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
.hook(
|
||||||
|
mpris,
|
||||||
|
(self, bus_name) => {
|
||||||
|
self.visible = player.bus_name === bus_name;
|
||||||
|
},
|
||||||
|
"player-changed",
|
||||||
|
)
|
||||||
|
.hook(
|
||||||
|
mpris,
|
||||||
|
(self) => {
|
||||||
|
self.visible = player === findPlayer(mpris.players);
|
||||||
|
},
|
||||||
|
"player-closed",
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default (monitor) =>
|
||||||
|
Widget.Box({
|
||||||
|
visible: players.as((p) => p.length > 0),
|
||||||
|
children: players.as((ps) => ps.map((p) => Player(p, monitor))),
|
||||||
|
});
|
||||||
40
home/natto/ags/windows/bar/network.js
Normal file
40
home/natto/ags/windows/bar/network.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
const network = await Service.import("network");
|
||||||
|
|
||||||
|
const WifiIndicator = () =>
|
||||||
|
Widget.Box({
|
||||||
|
tooltipText: network.wifi.bind("state").as((s) => `State: ${s}`),
|
||||||
|
children: [
|
||||||
|
Widget.Icon({
|
||||||
|
className: "network-icon",
|
||||||
|
icon: network.wifi.bind("icon_name"),
|
||||||
|
}),
|
||||||
|
Widget.Label({
|
||||||
|
visible: network.wifi.bind("ssid"),
|
||||||
|
label: network.wifi.bind("ssid"),
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const WiredIndicator = () =>
|
||||||
|
Widget.Icon({
|
||||||
|
className: "network-icon",
|
||||||
|
tooltipText: network.wired.bind("internet").as((a) => `Internet: ${a}`),
|
||||||
|
icon: network.wired.bind("icon_name"),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default () =>
|
||||||
|
Widget.Stack({
|
||||||
|
className: "network",
|
||||||
|
children: {
|
||||||
|
wifi: WifiIndicator(),
|
||||||
|
wired: WiredIndicator(),
|
||||||
|
},
|
||||||
|
shown: Utils.merge(
|
||||||
|
[network.bind("primary"), network.wired.bind("state")],
|
||||||
|
(primary, wired) => {
|
||||||
|
if (primary) return primary;
|
||||||
|
if (wired == "activated") return "wired";
|
||||||
|
return "wifi";
|
||||||
|
},
|
||||||
|
),
|
||||||
|
});
|
||||||
8
home/natto/ags/windows/bar/settings.js
Normal file
8
home/natto/ags/windows/bar/settings.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { WindowNames } from "../../constants.js";
|
||||||
|
|
||||||
|
export default (monitor) =>
|
||||||
|
Widget.Button({
|
||||||
|
child: Widget.Icon("open-menu-symbolic"),
|
||||||
|
onPrimaryClick: () =>
|
||||||
|
App.toggleWindow(`${WindowNames.SETTINGS}-${monitor}`),
|
||||||
|
});
|
||||||
42
home/natto/ags/windows/bar/time.js
Normal file
42
home/natto/ags/windows/bar/time.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
const time = Variable("", {
|
||||||
|
poll: [1000, 'date "+%H:%M:%S"'],
|
||||||
|
});
|
||||||
|
|
||||||
|
const getDate = () => " " + Utils.exec('date "+%a, %b %e"');
|
||||||
|
const date = Variable(getDate());
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const revealer = Widget.Revealer({
|
||||||
|
revealChild: false,
|
||||||
|
transitionDuration: 300,
|
||||||
|
transition: "slide_left",
|
||||||
|
child: Widget.Label({
|
||||||
|
label: date.bind(),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
return Widget.EventBox({
|
||||||
|
cursor: "pointer",
|
||||||
|
setup: (self) => {
|
||||||
|
self.on("leave-notify-event", () => {
|
||||||
|
revealer.reveal_child = false;
|
||||||
|
});
|
||||||
|
self.on("enter-notify-event", () => {
|
||||||
|
date.value = getDate();
|
||||||
|
revealer.reveal_child = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Widget.Button({
|
||||||
|
className: "date-wrapper",
|
||||||
|
onPrimaryClick: () => App.toggleWindow("calendar-0"),
|
||||||
|
child: Widget.Box({
|
||||||
|
children: [
|
||||||
|
Widget.Label({
|
||||||
|
label: time.bind(),
|
||||||
|
}),
|
||||||
|
revealer,
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
};
|
||||||
17
home/natto/ags/windows/bar/tray.js
Normal file
17
home/natto/ags/windows/bar/tray.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
const systemtray = await Service.import("systemtray");
|
||||||
|
|
||||||
|
const SysTrayItem = (item) =>
|
||||||
|
Widget.Button({
|
||||||
|
className: "system-tray-item",
|
||||||
|
child: Widget.Icon().bind("icon", item, "icon"),
|
||||||
|
tooltipMarkup: item.bind("tooltip_markup"),
|
||||||
|
onPrimaryClick: (_, event) => item.activate(event),
|
||||||
|
onSecondaryClick: (_, event) => item.openMenu(event),
|
||||||
|
cursor: "pointer",
|
||||||
|
});
|
||||||
|
|
||||||
|
export default () =>
|
||||||
|
Widget.Box({
|
||||||
|
className: "system-tray-unwrapped",
|
||||||
|
children: systemtray.bind("items").as((i) => i.map(SysTrayItem)),
|
||||||
|
});
|
||||||
37
home/natto/ags/windows/calendar.js
Normal file
37
home/natto/ags/windows/calendar.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import Popup, { Padding, Revealer } from "../utils/popup.js";
|
||||||
|
import { WindowNames } from "../constants.js";
|
||||||
|
|
||||||
|
const Tray = Widget.Calendar({
|
||||||
|
className: "calendar-unwrapped",
|
||||||
|
showDayNames: true,
|
||||||
|
showHeading: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default (monitor = 0) => {
|
||||||
|
const { CALENDAR } = WindowNames;
|
||||||
|
const name = `${CALENDAR}-${monitor}`;
|
||||||
|
|
||||||
|
return Popup({
|
||||||
|
name,
|
||||||
|
className: CALENDAR,
|
||||||
|
monitor,
|
||||||
|
layout: Widget.Box({
|
||||||
|
children: [
|
||||||
|
Padding(name),
|
||||||
|
Widget.Box({
|
||||||
|
hexpand: false,
|
||||||
|
vertical: true,
|
||||||
|
children: [
|
||||||
|
Revealer({
|
||||||
|
name,
|
||||||
|
child: Tray,
|
||||||
|
transition: "slide_down",
|
||||||
|
transitionDuration: 400,
|
||||||
|
}),
|
||||||
|
Padding(name),
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
};
|
||||||
183
home/natto/ags/windows/music-box/index.js
Normal file
183
home/natto/ags/windows/music-box/index.js
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
// Mostly taken from https://github.com/Aylur/ags/blob/11150225e62462bcd431d1e55185e810190a730a/example/media-widget/Media.js
|
||||||
|
|
||||||
|
import Popup, { Padding, Revealer } from "../../utils/popup.js";
|
||||||
|
import { shrinkText } from "../../utils/text.js";
|
||||||
|
import { lengthStr, blurBg } from "../../utils/music.js";
|
||||||
|
import { findPlayer } from "../../utils/music.js";
|
||||||
|
import { WindowNames } from "../../constants.js";
|
||||||
|
import Controls from "./music-controls.js";
|
||||||
|
|
||||||
|
const FALLBACK_ICON = "audio-x-generic-symbolic";
|
||||||
|
const { MUSIC_BOX } = WindowNames;
|
||||||
|
|
||||||
|
const mpris = await Service.import("mpris");
|
||||||
|
|
||||||
|
const Player = (player) => {
|
||||||
|
const img = Widget.Box({
|
||||||
|
visible: player.bind("cover_path"),
|
||||||
|
className: "cover-art",
|
||||||
|
vpack: "start",
|
||||||
|
css: player
|
||||||
|
.bind("cover_path")
|
||||||
|
.as(
|
||||||
|
(p) =>
|
||||||
|
(p ? "min-width: 200px; min-height: 200px;" : "") +
|
||||||
|
`background-image: url('${p}');`,
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
|
const title = Widget.Label({
|
||||||
|
className: "title",
|
||||||
|
wrap: true,
|
||||||
|
hpack: "start",
|
||||||
|
label: player.bind("track_title").as((t) => shrinkText(t, 40)),
|
||||||
|
});
|
||||||
|
|
||||||
|
const artist = Widget.Label({
|
||||||
|
className: "artist",
|
||||||
|
wrap: true,
|
||||||
|
hpack: "start",
|
||||||
|
label: player.bind("track_artists").as((a) => shrinkText(a.join(", "), 80)),
|
||||||
|
});
|
||||||
|
|
||||||
|
const positionSlider = Widget.Slider({
|
||||||
|
className: "position",
|
||||||
|
drawValue: false,
|
||||||
|
onChange: ({ value }) => (player.position = value * player.length),
|
||||||
|
visible: player.bind("length").as((l) => l > 0),
|
||||||
|
setup: (self) => {
|
||||||
|
const update = () => {
|
||||||
|
if (self.dragging) return;
|
||||||
|
|
||||||
|
const value = player.position / player.length;
|
||||||
|
self.value = value > 0 ? value : 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
self
|
||||||
|
.hook(player, update)
|
||||||
|
.hook(player, update, "position")
|
||||||
|
.poll(1000, update);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const positionLabel = Widget.Label({
|
||||||
|
ypad: 0,
|
||||||
|
hpack: "start",
|
||||||
|
className: "position-label",
|
||||||
|
setup: (self) => {
|
||||||
|
const update = (_, time) => {
|
||||||
|
self.label = lengthStr(time || player.position);
|
||||||
|
self.visible = player.length > 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
self.hook(player, update, "position");
|
||||||
|
self.poll(1000, update);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const lengthLabel = Widget.Label({
|
||||||
|
ypad: 0,
|
||||||
|
hpack: "end",
|
||||||
|
className: "length-label",
|
||||||
|
visible: player.bind("length").as((l) => l > 0),
|
||||||
|
label: player.bind("length").as(lengthStr),
|
||||||
|
});
|
||||||
|
|
||||||
|
const icon = Widget.Icon({
|
||||||
|
className: "icon",
|
||||||
|
hexpand: true,
|
||||||
|
hpack: "end",
|
||||||
|
vpack: "start",
|
||||||
|
tooltipText: player.identity || "",
|
||||||
|
icon: player.bind("entry").as((entry) => {
|
||||||
|
const name = `${entry}-symbolic`;
|
||||||
|
return Utils.lookUpIcon(name) ? name : FALLBACK_ICON;
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
return Widget.Box(
|
||||||
|
{
|
||||||
|
className: "music-player",
|
||||||
|
visible: player.bus_name === findPlayer(mpris.players).bus_name,
|
||||||
|
css: player.bind("cover_path").as(blurBg),
|
||||||
|
},
|
||||||
|
img,
|
||||||
|
Widget.CenterBox({
|
||||||
|
className: "music-details",
|
||||||
|
vertical: true,
|
||||||
|
hexpand: true,
|
||||||
|
spacing: 25,
|
||||||
|
startWidget: Widget.Box(
|
||||||
|
{
|
||||||
|
vertical: true,
|
||||||
|
spacing: 6,
|
||||||
|
},
|
||||||
|
title,
|
||||||
|
Widget.Box({
|
||||||
|
className: "icon-wrapper",
|
||||||
|
spacing: 10,
|
||||||
|
children: [artist, icon],
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
centerWidget: positionSlider,
|
||||||
|
endWidget: Widget.CenterBox({
|
||||||
|
spacing: 6,
|
||||||
|
startWidget: positionLabel,
|
||||||
|
centerWidget: Controls(player),
|
||||||
|
endWidget: lengthLabel,
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.hook(
|
||||||
|
mpris,
|
||||||
|
(self, bus_name) => {
|
||||||
|
self.visible = player.bus_name === bus_name;
|
||||||
|
},
|
||||||
|
"player-changed",
|
||||||
|
)
|
||||||
|
.hook(
|
||||||
|
mpris,
|
||||||
|
(self) => {
|
||||||
|
self.visible = player.bus_name === findPlayer(mpris.players).bus_name;
|
||||||
|
},
|
||||||
|
"player-closed",
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const PlayerBox = () =>
|
||||||
|
Widget.Box({
|
||||||
|
className: `${MUSIC_BOX}-unwrapped`,
|
||||||
|
vertical: true,
|
||||||
|
css: "padding: 1px;",
|
||||||
|
children: mpris.bind("players").as((ps) => ps.map(Player)),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default (monitor = 0) => {
|
||||||
|
const name = `${MUSIC_BOX}-${monitor}`;
|
||||||
|
|
||||||
|
return Popup({
|
||||||
|
name,
|
||||||
|
className: MUSIC_BOX,
|
||||||
|
monitor,
|
||||||
|
layout: Widget.Box({
|
||||||
|
children: [
|
||||||
|
Padding(name), // left
|
||||||
|
Widget.Box({
|
||||||
|
hexpand: false,
|
||||||
|
vexpand: false,
|
||||||
|
vertical: true,
|
||||||
|
children: [
|
||||||
|
Revealer({
|
||||||
|
name,
|
||||||
|
child: PlayerBox(),
|
||||||
|
transition: "slide_down",
|
||||||
|
transitionDuration: 400,
|
||||||
|
}),
|
||||||
|
Padding(name), // down
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
Padding(name), // right
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
};
|
||||||
47
home/natto/ags/windows/music-box/music-controls.js
Normal file
47
home/natto/ags/windows/music-box/music-controls.js
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
const PLAY_ICON = "media-playback-start-symbolic";
|
||||||
|
const PAUSE_ICON = "media-playback-pause-symbolic";
|
||||||
|
const PREV_ICON = "go-previous-symbolic";
|
||||||
|
const NEXT_ICON = "go-next-symbolic";
|
||||||
|
|
||||||
|
export default (player) => {
|
||||||
|
const playPause = Widget.Button({
|
||||||
|
class_name: "play-pause",
|
||||||
|
on_clicked: () => player.playPause(),
|
||||||
|
visible: player.bind("can_play"),
|
||||||
|
cursor: "pointer",
|
||||||
|
child: Widget.Icon({
|
||||||
|
icon: player.bind("play_back_status").transform((s) => {
|
||||||
|
switch (s) {
|
||||||
|
case "Playing":
|
||||||
|
return PAUSE_ICON;
|
||||||
|
case "Paused":
|
||||||
|
case "Stopped":
|
||||||
|
return PLAY_ICON;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
const prev = Widget.Button({
|
||||||
|
yalign: 0.5,
|
||||||
|
onClicked: () => player.previous(),
|
||||||
|
visible: player.bind("can_go_prev"),
|
||||||
|
child: Widget.Icon(PREV_ICON),
|
||||||
|
cursor: "pointer",
|
||||||
|
});
|
||||||
|
|
||||||
|
const next = Widget.Button({
|
||||||
|
onClicked: () => player.next(),
|
||||||
|
visible: player.bind("can_go_next"),
|
||||||
|
child: Widget.Icon(NEXT_ICON),
|
||||||
|
cursor: "pointer",
|
||||||
|
});
|
||||||
|
|
||||||
|
return Widget.CenterBox({
|
||||||
|
vertical: true,
|
||||||
|
centerWidget: Widget.Box({
|
||||||
|
className: "music-controls",
|
||||||
|
children: [prev, playPause, next],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
};
|
||||||
69
home/natto/ags/windows/settings/audio.js
Normal file
69
home/natto/ags/windows/settings/audio.js
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
const audio = await Service.import("audio");
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const isSpeaker = Variable(true);
|
||||||
|
|
||||||
|
/** @param {'speaker' | 'microphone'} type */
|
||||||
|
const VolumeSlider = (type = "speaker") =>
|
||||||
|
Widget.Slider({
|
||||||
|
hexpand: true,
|
||||||
|
drawValue: false,
|
||||||
|
onChange: ({ value }) => (audio[type].volume = value),
|
||||||
|
value: audio[type].bind("volume"),
|
||||||
|
});
|
||||||
|
|
||||||
|
const speakerSlider = VolumeSlider("speaker");
|
||||||
|
const micSlider = VolumeSlider("microphone");
|
||||||
|
|
||||||
|
const speakerIndicator = Widget.Button({
|
||||||
|
on_clicked: () => (audio.speaker.is_muted = !audio.speaker.is_muted),
|
||||||
|
child: Widget.Icon().hook(audio.speaker, (self) => {
|
||||||
|
self.className = "volume-icon";
|
||||||
|
const vol = audio.speaker.volume * 100;
|
||||||
|
let icon = [
|
||||||
|
[101, "overamplified"],
|
||||||
|
[67, "high"],
|
||||||
|
[34, "medium"],
|
||||||
|
[1, "low"],
|
||||||
|
[0, "muted"],
|
||||||
|
].find(([threshold]) => threshold <= vol)?.[1];
|
||||||
|
|
||||||
|
if (audio.speaker.is_muted) icon = "muted";
|
||||||
|
|
||||||
|
self.icon = `audio-volume-${icon}-symbolic`;
|
||||||
|
self.tooltip_text = `Volume ${Math.floor(vol)}%`;
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
const micIndicator = Widget.Button({
|
||||||
|
on_clicked: () => (audio.microphone.is_muted = !audio.microphone.is_muted),
|
||||||
|
child: Widget.Icon().hook(audio.microphone, (self) => {
|
||||||
|
self.className = "volume-icon";
|
||||||
|
const vol = audio.microphone.volume * 100;
|
||||||
|
let icon = [
|
||||||
|
[67, "high"],
|
||||||
|
[34, "medium"],
|
||||||
|
[1, "low"],
|
||||||
|
[0, "muted"],
|
||||||
|
].find(([threshold]) => threshold <= vol)?.[1];
|
||||||
|
|
||||||
|
if (audio.microphone.is_muted) icon = "muted";
|
||||||
|
|
||||||
|
self.icon = `microphone-sensitivity-${icon}-symbolic`;
|
||||||
|
self.tooltip_text = `Volume ${Math.floor(vol)}%`;
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
return Widget.EventBox({
|
||||||
|
cursor: "pointer",
|
||||||
|
className: "volume",
|
||||||
|
onSecondaryClick: () => (isSpeaker.value = !isSpeaker.value),
|
||||||
|
child: Widget.Stack({
|
||||||
|
children: {
|
||||||
|
speaker: Widget.Box({}, speakerSlider, speakerIndicator),
|
||||||
|
microphone: Widget.Box({}, micSlider, micIndicator),
|
||||||
|
},
|
||||||
|
shown: isSpeaker.bind().as((s) => (s ? "speaker" : "microphone")),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
};
|
||||||
48
home/natto/ags/windows/settings/backlight.js
Normal file
48
home/natto/ags/windows/settings/backlight.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
const hasBacklight = Variable(Utils.exec("ls /sys/class/backlight"));
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const getBrightness = () => {
|
||||||
|
try {
|
||||||
|
return (
|
||||||
|
Number(Utils.exec("brightnessctl get")) /
|
||||||
|
Number(Utils.exec("brightnessctl max"))
|
||||||
|
);
|
||||||
|
} catch {
|
||||||
|
console.log("settings/backlight: failed to get brightness");
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
const setBrightness = (b) => {
|
||||||
|
if (b < 0.05) b = 0.05;
|
||||||
|
else if (b > 1) b = 1;
|
||||||
|
|
||||||
|
Utils.exec(`brightnessctl set ${b * 100}%`);
|
||||||
|
};
|
||||||
|
const brightness = Variable(getBrightness());
|
||||||
|
|
||||||
|
const Slider = Widget.Slider({
|
||||||
|
hexpand: true,
|
||||||
|
drawValue: false,
|
||||||
|
onChange: ({ value }) => setBrightness(value),
|
||||||
|
value: brightness.bind(),
|
||||||
|
});
|
||||||
|
|
||||||
|
const Indicator = Widget.Button({
|
||||||
|
on_clicked: brightness.bind().as((b) => () => {
|
||||||
|
if (b <= 0.5) brightness.value = 1;
|
||||||
|
else brightness.value = 0.5;
|
||||||
|
}),
|
||||||
|
child: Widget.Icon().hook(brightness, (self) => {
|
||||||
|
self.className = "brightness-icon";
|
||||||
|
self.icon = `display-brightness-symbolic`;
|
||||||
|
self.tooltip_text = `Brightness: ${Math.floor(brightness.value * 100)}%`;
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
return Widget.Box({
|
||||||
|
className: "brightness",
|
||||||
|
visible: hasBacklight.bind().as((b) => !!b),
|
||||||
|
children: [Slider, Indicator],
|
||||||
|
});
|
||||||
|
};
|
||||||
72
home/natto/ags/windows/settings/index.js
Normal file
72
home/natto/ags/windows/settings/index.js
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
import Popup, { Padding, Revealer } from "../../utils/popup.js";
|
||||||
|
import { WindowNames } from "../../constants.js";
|
||||||
|
import Audio from "./audio.js";
|
||||||
|
import Backlight from "./backlight.js";
|
||||||
|
import {
|
||||||
|
cpuMetric,
|
||||||
|
memoryMetric,
|
||||||
|
diskMetric,
|
||||||
|
batteryMetric,
|
||||||
|
} from "./metrics.js";
|
||||||
|
import Temperature from "./temperature.js";
|
||||||
|
import Weather from "./weather.js";
|
||||||
|
import PowerMenu from "./power-menu.js";
|
||||||
|
|
||||||
|
const metrics = Widget.Box({
|
||||||
|
className: "metrics",
|
||||||
|
vertical: true,
|
||||||
|
children: [cpuMetric, memoryMetric, diskMetric, batteryMetric],
|
||||||
|
});
|
||||||
|
|
||||||
|
const sliders = Widget.Box({
|
||||||
|
className: "sliders",
|
||||||
|
vertical: true,
|
||||||
|
children: [Audio(), Backlight()],
|
||||||
|
});
|
||||||
|
|
||||||
|
const settingsCol = Widget.CenterBox({
|
||||||
|
className: "settings-col",
|
||||||
|
vertical: true,
|
||||||
|
spacing: 8,
|
||||||
|
startWidget: sliders,
|
||||||
|
centerWidget: Widget.CenterBox({
|
||||||
|
className: "settings-col-temps",
|
||||||
|
startWidget: Temperature(),
|
||||||
|
endWidget: Weather(),
|
||||||
|
}),
|
||||||
|
endWidget: PowerMenu(),
|
||||||
|
});
|
||||||
|
|
||||||
|
const settings = Widget.Box({
|
||||||
|
className: "settings-unwrapped",
|
||||||
|
children: [metrics, settingsCol],
|
||||||
|
});
|
||||||
|
|
||||||
|
export default (monitor = 0) => {
|
||||||
|
const { SETTINGS } = WindowNames;
|
||||||
|
const name = `${SETTINGS}-${monitor}`;
|
||||||
|
|
||||||
|
return Popup({
|
||||||
|
name,
|
||||||
|
className: SETTINGS,
|
||||||
|
monitor,
|
||||||
|
layout: Widget.Box({
|
||||||
|
children: [
|
||||||
|
Padding(name),
|
||||||
|
Widget.Box({
|
||||||
|
hexpand: false,
|
||||||
|
vertical: true,
|
||||||
|
children: [
|
||||||
|
Revealer({
|
||||||
|
name,
|
||||||
|
child: settings,
|
||||||
|
transition: "slide_down",
|
||||||
|
transitionDuration: 400,
|
||||||
|
}),
|
||||||
|
Padding(name),
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
};
|
||||||
104
home/natto/ags/windows/settings/metrics.js
Normal file
104
home/natto/ags/windows/settings/metrics.js
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
const battery = await Service.import("battery");
|
||||||
|
|
||||||
|
const divide = ([total, free]) => free / total;
|
||||||
|
|
||||||
|
const cpuValue = Variable(0, {
|
||||||
|
poll: [
|
||||||
|
2000,
|
||||||
|
"top -b -n 1",
|
||||||
|
(out) =>
|
||||||
|
divide([
|
||||||
|
100,
|
||||||
|
out
|
||||||
|
.split("\n")
|
||||||
|
.find((line) => line.includes("Cpu(s)"))
|
||||||
|
.split(/\s+/)[1]
|
||||||
|
.replace(",", "."),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const memoryValue = Variable([0, 0], {
|
||||||
|
poll: [
|
||||||
|
2000,
|
||||||
|
"free",
|
||||||
|
(out) => {
|
||||||
|
const data = out
|
||||||
|
.split("\n")
|
||||||
|
.find((line) => line.includes("Mem:"))
|
||||||
|
.split(/\s+/)
|
||||||
|
.splice(1, 2);
|
||||||
|
return [(data[1] / (1024 * 1024)).toFixed(2), divide(data)];
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const diskValue = Variable(["0G", "0%"], {
|
||||||
|
poll: [
|
||||||
|
120000,
|
||||||
|
"df -kh /",
|
||||||
|
(out) => out.split("\n")[1].split(/\s+/).splice(3, 2),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const mkMetric = ({
|
||||||
|
className,
|
||||||
|
tooltipText,
|
||||||
|
value,
|
||||||
|
label,
|
||||||
|
icon,
|
||||||
|
visible = true,
|
||||||
|
}) =>
|
||||||
|
Widget.Box(
|
||||||
|
{
|
||||||
|
spacing: 10,
|
||||||
|
className,
|
||||||
|
tooltipText,
|
||||||
|
visible,
|
||||||
|
},
|
||||||
|
Widget.CircularProgress({
|
||||||
|
className: "metric-progress",
|
||||||
|
child: Widget.Icon({
|
||||||
|
icon,
|
||||||
|
className: "metric-icon",
|
||||||
|
}),
|
||||||
|
value,
|
||||||
|
}),
|
||||||
|
Widget.Label({
|
||||||
|
wrap: true,
|
||||||
|
label,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
export const cpuMetric = mkMetric({
|
||||||
|
className: "cpu-metric",
|
||||||
|
tooltipText: cpuValue.bind().as((c) => `CPU: ${(c * 100).toFixed(2)}%`),
|
||||||
|
value: cpuValue.bind(),
|
||||||
|
label: cpuValue.bind().as((c) => `${(c * 100).toFixed(2)}%`),
|
||||||
|
icon: "cpu-symbolic",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const memoryMetric = mkMetric({
|
||||||
|
className: "memory-metric",
|
||||||
|
tooltipText: memoryValue.bind().as((m) => `RAM :${m[0]}G`),
|
||||||
|
value: memoryValue.bind().as((m) => m[1]),
|
||||||
|
label: memoryValue.bind().as((m) => `${m[0]}G`),
|
||||||
|
icon: "memory-symbolic",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const diskMetric = mkMetric({
|
||||||
|
className: "disk-metric",
|
||||||
|
tooltipText: diskValue.bind().as((d) => `Free Space :${d[0]}`),
|
||||||
|
value: diskValue.bind().as((d) => Number(d[1]) / 100),
|
||||||
|
label: diskValue.bind().as((d) => d[1]),
|
||||||
|
icon: "drive-harddisk-symbolic",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const batteryMetric = mkMetric({
|
||||||
|
className: "battery-metric",
|
||||||
|
tooltipText: battery.bind("percent").as((p) => `Battery: ${p}%`),
|
||||||
|
value: battery.bind("percent").as((p) => (p > 0 ? p / 100 : 0)),
|
||||||
|
label: battery.bind("percent").as((p) => `${p}%`),
|
||||||
|
icon: battery.bind("icon_name"),
|
||||||
|
visible: battery.bind("available"),
|
||||||
|
});
|
||||||
94
home/natto/ags/windows/settings/power-menu.js
Normal file
94
home/natto/ags/windows/settings/power-menu.js
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
export default () => {
|
||||||
|
const isLocked = Variable(true);
|
||||||
|
const power = Variable("poweroff");
|
||||||
|
const suspend = Variable("sleep");
|
||||||
|
|
||||||
|
const cursor = "pointer";
|
||||||
|
|
||||||
|
const unlockButton = Widget.Button({
|
||||||
|
onPrimaryClick: () => {
|
||||||
|
isLocked.value = false;
|
||||||
|
},
|
||||||
|
tooltipText: "Unock power menu",
|
||||||
|
child: Widget.Icon("system-lock-screen-symbolic"),
|
||||||
|
cursor,
|
||||||
|
});
|
||||||
|
|
||||||
|
const lockButton = Widget.Button({
|
||||||
|
onPrimaryClick: () => {
|
||||||
|
isLocked.value = true;
|
||||||
|
},
|
||||||
|
tooltipText: "Lock power menu",
|
||||||
|
child: Widget.Icon("system-lock-screen-symbolic"),
|
||||||
|
cursor,
|
||||||
|
});
|
||||||
|
|
||||||
|
const poweroffButton = Widget.Button({
|
||||||
|
onPrimaryClick: () => {
|
||||||
|
Utils.exec("poweroff");
|
||||||
|
},
|
||||||
|
onSecondaryClick: () => (power.value = "reboot"),
|
||||||
|
tooltipText: "Shutdown",
|
||||||
|
child: Widget.Icon("system-shutdown-symbolic"),
|
||||||
|
cursor,
|
||||||
|
});
|
||||||
|
|
||||||
|
const rebootButton = Widget.Button({
|
||||||
|
onPrimaryClick: () => {
|
||||||
|
Utils.exec("reboot");
|
||||||
|
},
|
||||||
|
onSecondaryClick: () => (power.value = "poweroff"),
|
||||||
|
tooltipText: "Reboot",
|
||||||
|
child: Widget.Icon("system-reboot-symbolic"),
|
||||||
|
cursor,
|
||||||
|
});
|
||||||
|
|
||||||
|
const sleepButton = Widget.Button({
|
||||||
|
onPrimaryClick: () => {
|
||||||
|
Utils.exec("systemctl suspend");
|
||||||
|
},
|
||||||
|
onSecondaryClick: () => (suspend.value = "hibernate"),
|
||||||
|
tooltipText: "Sleep",
|
||||||
|
child: Widget.Icon("weather-clear-night-symbolic"),
|
||||||
|
cursor,
|
||||||
|
});
|
||||||
|
|
||||||
|
const hibernateButton = Widget.Button({
|
||||||
|
onPrimaryClick: () => {
|
||||||
|
Utils.exec("systemctl hibernate");
|
||||||
|
},
|
||||||
|
onSecondaryClick: () => (suspend.value = "sleep"),
|
||||||
|
tooltipText: "Hibernate",
|
||||||
|
child: Widget.Icon("computer-symbolic"),
|
||||||
|
cursor,
|
||||||
|
});
|
||||||
|
|
||||||
|
const powerStack = Widget.Stack({
|
||||||
|
children: {
|
||||||
|
poweroff: poweroffButton,
|
||||||
|
reboot: rebootButton,
|
||||||
|
},
|
||||||
|
shown: power.bind(),
|
||||||
|
});
|
||||||
|
|
||||||
|
const suspendStack = Widget.Stack({
|
||||||
|
children: {
|
||||||
|
sleep: sleepButton,
|
||||||
|
hibernate: hibernateButton,
|
||||||
|
},
|
||||||
|
shown: suspend.bind(),
|
||||||
|
});
|
||||||
|
|
||||||
|
return Widget.Stack({
|
||||||
|
className: "power-menu",
|
||||||
|
children: {
|
||||||
|
locked: Widget.CenterBox({ centerWidget: unlockButton }),
|
||||||
|
unlocked: Widget.CenterBox({
|
||||||
|
startWidget: powerStack,
|
||||||
|
centerWidget: lockButton,
|
||||||
|
endWidget: suspendStack,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
shown: isLocked.bind().as((l) => (l ? "locked" : "unlocked")),
|
||||||
|
});
|
||||||
|
};
|
||||||
62
home/natto/ags/windows/settings/temperature.js
Normal file
62
home/natto/ags/windows/settings/temperature.js
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
export default () => {
|
||||||
|
const getThermalZone = () => {
|
||||||
|
try {
|
||||||
|
return Utils.exec([
|
||||||
|
"bash",
|
||||||
|
"-c",
|
||||||
|
`awk '{print FILENAME ":" $0}' /sys/class/thermal/thermal_zone*/type`,
|
||||||
|
])
|
||||||
|
.split("\n")
|
||||||
|
.find((line) => line.includes("x86_pkg_temp"))
|
||||||
|
.split(":")[0]
|
||||||
|
.slice(0, -4);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
console.log("settings/temperature: cannot get thermal zone");
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
const thermalZone = Variable(getThermalZone());
|
||||||
|
|
||||||
|
const tempValue = thermalZone.value
|
||||||
|
? Variable(0, {
|
||||||
|
poll: [
|
||||||
|
5000,
|
||||||
|
() => {
|
||||||
|
try {
|
||||||
|
return (
|
||||||
|
Utils.readFile(`${thermalZone.value}/temp`) / 1000
|
||||||
|
).toFixed(2);
|
||||||
|
} catch {
|
||||||
|
console.log(
|
||||||
|
"settings/temperature: specified thermal zone does not exist",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
: Variable(undefined);
|
||||||
|
|
||||||
|
return Widget.CenterBox({
|
||||||
|
vertical: true,
|
||||||
|
visible: thermalZone.bind().as((t) => !!t),
|
||||||
|
centerWidget: Widget.Box(
|
||||||
|
{
|
||||||
|
vertical: true,
|
||||||
|
spacing: 8,
|
||||||
|
tooltipText: tempValue.bind().as((t) => `CPU Temperature: ${t}°C`),
|
||||||
|
className: tempValue
|
||||||
|
.bind()
|
||||||
|
.as((t) => `temperature${t > 65 ? "-hot" : ""}`),
|
||||||
|
},
|
||||||
|
Widget.Icon({
|
||||||
|
icon: "sensors-temperature-symbolic",
|
||||||
|
}),
|
||||||
|
Widget.Label({
|
||||||
|
label: tempValue.bind().as((t) => `${t}°C`),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
});
|
||||||
|
};
|
||||||
78
home/natto/ags/windows/settings/weather.js
Normal file
78
home/natto/ags/windows/settings/weather.js
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
const conditionIcons = {
|
||||||
|
Clear: "clear",
|
||||||
|
Sunny: "clear",
|
||||||
|
"Partly Cloudy": "few-clouds",
|
||||||
|
Cloudy: "overcast",
|
||||||
|
Overcast: "overcast",
|
||||||
|
"Light Rain": "showers-scattered",
|
||||||
|
Drizzle: "showers-scattered",
|
||||||
|
Rain: "showers",
|
||||||
|
"Heavy Rain": "showers",
|
||||||
|
Showers: "showers",
|
||||||
|
Thunderstorm: "storm",
|
||||||
|
Snow: "snow",
|
||||||
|
"Light Snow": "snow",
|
||||||
|
"Heavy Snow": "snow",
|
||||||
|
Mist: "fog",
|
||||||
|
Fog: "fog",
|
||||||
|
Haze: "fog",
|
||||||
|
Dust: "fog",
|
||||||
|
Smoke: "fog",
|
||||||
|
Sand: "fog",
|
||||||
|
Wind: "windy",
|
||||||
|
Tornado: "tornado",
|
||||||
|
undefined: "clear",
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchWeather = async () => {
|
||||||
|
return await Utils.fetch("http://wttr.in/?format=j1")
|
||||||
|
.then((res) => res.json())
|
||||||
|
.then((j) => j["current_condition"][0])
|
||||||
|
.catch((e) => {
|
||||||
|
console.error(e);
|
||||||
|
console.log("settings/weather: error fetching weather data");
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const data = Variable(undefined, {
|
||||||
|
poll: [600000, async () => await fetchWeather()],
|
||||||
|
});
|
||||||
|
|
||||||
|
return Widget.Box(
|
||||||
|
{
|
||||||
|
vertical: true,
|
||||||
|
visible: data.bind().as((d) => !!d),
|
||||||
|
className: "weather",
|
||||||
|
},
|
||||||
|
Widget.Icon({
|
||||||
|
icon: data.bind().as((d) => {
|
||||||
|
const condition = d?.["weatherDesc"]?.[0]?.["value"]?.split(/[\s,]+/)?.[0];
|
||||||
|
return `weather-${conditionIcons[condition]}-symbolic`;
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
Widget.Label({
|
||||||
|
label: data.bind().as((d) => {
|
||||||
|
const conditions = d?.["weatherDesc"]?.map((w) => w["value"]) || [];
|
||||||
|
|
||||||
|
return conditions.join(" ");
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
Widget.Label({
|
||||||
|
label: data.bind().as((d) => {
|
||||||
|
const temperature = d?.["temp_C"];
|
||||||
|
const feelsLike = d?.["FeelsLikeC"];
|
||||||
|
|
||||||
|
return `${temperature}°C (${feelsLike}°C)`;
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
Widget.Label({
|
||||||
|
label: data.bind().as((d) => {
|
||||||
|
const humidity = d?.["humidity"];
|
||||||
|
const precipitation = d?.["precipMM"];
|
||||||
|
|
||||||
|
return `${humidity}%, ${precipitation}mm`;
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
};
|
||||||
18
home/natto/browser.nix
Normal file
18
home/natto/browser.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
firefox = {
|
||||||
|
enable = true;
|
||||||
|
profiles.natto = {
|
||||||
|
name = "natto";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
chromium = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.ungoogled-chromium;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
home.sessionVariables = {
|
||||||
|
BROWSER = "firefox";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
#+TITLE: My Emacs Configuration
|
#+TITLE: My Emacs Configuration
|
||||||
#+AUTHOR: Amneesh Singh
|
#+AUTHOR: natto1784
|
||||||
#+PROPERTY: header-args:emacs-lisp :tangle yes
|
#+PROPERTY: header-args :emacs-lisp :tangle yes
|
||||||
|
|
||||||
* Settings
|
* Settings
|
||||||
** Setting the default face
|
** Setting the default face
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
; -*- lexical-binding: t; -*-
|
; -*- lexical-binding: t; -*-
|
||||||
(set-frame-font "Fira Code 13" nil t)
|
(set-frame-font "Fira Code 13" nil t)
|
||||||
;(add-to-list 'default-frame-alist '(font . "Fira Code-13"))
|
(add-to-list 'default-frame-alist '(font . "Fira Code-13"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Some mode settings based on personal preferences
|
** Some mode settings based on personal preferences
|
||||||
@@ -20,12 +20,10 @@
|
|||||||
(fringe-mode 0)
|
(fringe-mode 0)
|
||||||
(global-display-line-numbers-mode 1)
|
(global-display-line-numbers-mode 1)
|
||||||
(xterm-mouse-mode 1)
|
(xterm-mouse-mode 1)
|
||||||
|
(electric-pair-mode)
|
||||||
(setq ring-bell-function 'ignore
|
(setq ring-bell-function 'ignore
|
||||||
gc-cons-threshold most-positive-fixnum
|
gc-cons-threshold most-positive-fixnum
|
||||||
initial-major-mode 'fundamental-mode)
|
initial-major-mode 'fundamental-mode)
|
||||||
(unless (display-graphic-p)
|
|
||||||
(require 'evil-terminal-cursor-changer)
|
|
||||||
(evil-terminal-cursor-changer-activate))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Setting some variables
|
** Setting some variables
|
||||||
@@ -36,7 +34,9 @@
|
|||||||
scroll-step 1
|
scroll-step 1
|
||||||
display-line-numbers-type 'relative
|
display-line-numbers-type 'relative
|
||||||
confirm-kill-processes nil
|
confirm-kill-processes nil
|
||||||
inhibit-startup-screen t)
|
inhibit-startup-screen t
|
||||||
|
isearch-lazy-count t
|
||||||
|
lazy-count-prefix-format "[%s/%s] ")
|
||||||
(setq-default tab-width 2
|
(setq-default tab-width 2
|
||||||
indent-tabs-mode nil)
|
indent-tabs-mode nil)
|
||||||
#+end_src
|
#+end_src
|
||||||
@@ -54,11 +54,13 @@
|
|||||||
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
|
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
|
||||||
(package-initialize)
|
(package-initialize)
|
||||||
(require 'use-package)
|
(require 'use-package)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
*** Profiling
|
||||||
|
#+begin_src emacs-lisp
|
||||||
(use-package benchmark-init
|
(use-package benchmark-init
|
||||||
:ensure t
|
|
||||||
:config
|
:config
|
||||||
;; To disable collection of benchmark data after init is done.
|
(add-hook 'after-init-hook 'benchmark-init/deactivate) )
|
||||||
(add-hook 'after-init-hook 'benchmark-init/deactivate))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Visual packages
|
** Visual packages
|
||||||
@@ -74,34 +76,59 @@
|
|||||||
(use-package catppuccin-theme
|
(use-package catppuccin-theme
|
||||||
:config
|
:config
|
||||||
(load-theme 'catppuccin t)
|
(load-theme 'catppuccin t)
|
||||||
(setq dark-theme t))
|
:custom
|
||||||
|
(dark-theme t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Configure Selectrum
|
*** Indent guides
|
||||||
Enable selectrum
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package selectrum
|
(use-package highlight-indent-guides
|
||||||
:config
|
:config
|
||||||
(selectrum-mode +1))
|
(setq highlight-indent-guides-method 'column)
|
||||||
|
:hook
|
||||||
|
(prog-mode . highlight-indent-guides-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Add selectrum-prescient
|
** Minibuffer
|
||||||
|
Enable vertico
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package selectrum-prescient
|
(use-package vertico
|
||||||
|
:init
|
||||||
|
(vertico-mode)
|
||||||
|
:bind (:map vertico-map
|
||||||
|
("C-j" . vertico-next)
|
||||||
|
("C-k" . vertico-previous)))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Save history over restarts
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package savehist
|
||||||
|
:init
|
||||||
|
(savehist-mode))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Marginalia for description
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package marginalia
|
||||||
|
:after vertico
|
||||||
:config
|
:config
|
||||||
(selectrum-prescient-mode +1)
|
(marginalia-mode 1))
|
||||||
(prescient-persist-mode +1))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Orderless
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
(use-package orderless
|
(use-package orderless
|
||||||
:after selectrum
|
:after vertico
|
||||||
:config
|
:config
|
||||||
(setq completion-styles '(orderless basic))
|
(setq completion-styles '(orderless basic)))
|
||||||
(savehist-mode)
|
#+end_src
|
||||||
(setq orderless-skip-highlighting (lambda () selectrum-is-active)
|
|
||||||
selectrum-highlight-candidates-function #'orderless-highlight-matches))
|
Consult
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package consult
|
||||||
|
:bind (("M-s M-g" . consult-grep)
|
||||||
|
("M-s M-f" . consult-find)
|
||||||
|
("M-s M-b" . consult-buffer)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Evil
|
** Evil
|
||||||
@@ -122,6 +149,7 @@ Add selectrum-prescient
|
|||||||
(use-package evil
|
(use-package evil
|
||||||
:init
|
:init
|
||||||
(setq-default evil-shift-width 2)
|
(setq-default evil-shift-width 2)
|
||||||
|
(setq evil-want-keybinding nil)
|
||||||
:config
|
:config
|
||||||
(evil-set-initial-state 'vterm-mode 'insert)
|
(evil-set-initial-state 'vterm-mode 'insert)
|
||||||
(evil-set-undo-system 'undo-tree)
|
(evil-set-undo-system 'undo-tree)
|
||||||
@@ -130,6 +158,21 @@ Add selectrum-prescient
|
|||||||
(evil-mode 1))
|
(evil-mode 1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
*** Evil related packages
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package evil-collection
|
||||||
|
:after evil
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(evil-collection-init))
|
||||||
|
|
||||||
|
(use-package evil-terminal-cursor-changer
|
||||||
|
:after evil
|
||||||
|
:if (not (display-graphic-p))
|
||||||
|
:config
|
||||||
|
(evil-terminal-cursor-changer-activate))
|
||||||
|
(use-package evil-anzu :after evil)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
*** Configure undo tree
|
*** Configure undo tree
|
||||||
To undo and redo easily like vi
|
To undo and redo easily like vi
|
||||||
@@ -141,36 +184,33 @@ To undo and redo easily like vi
|
|||||||
(global-undo-tree-mode 1))
|
(global-undo-tree-mode 1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Miscellaneous evil related packages
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(use-package evil-terminal-cursor-changer)
|
|
||||||
(use-package evil-anzu
|
|
||||||
:after evil)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
** Treemacs
|
** Treemacs
|
||||||
*** Configure treemacs
|
*** Configure treemacs
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package treemacs)
|
(use-package treemacs
|
||||||
#+end_src
|
:defer t
|
||||||
|
:config
|
||||||
|
(treemacs-project-follow-mode))
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
(use-package treemacs-evil :after treemacs)
|
||||||
(use-package treemacs-evil :defer t)
|
(use-package treemacs-projectile :after treemacs)
|
||||||
(use-package treemacs-magit :defer t)
|
(use-package treemacs-all-the-icons :after treemacs)
|
||||||
(use-package treemacs-projectile :defer t)
|
|
||||||
(use-package treemacs-all-the-icons :defer t)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** LSP
|
** LSP
|
||||||
*** Configure lsp-mode
|
*** Configure lsp-mode
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package lsp-mode
|
(use-package lsp-mode
|
||||||
:commands lsp)
|
:defer t
|
||||||
|
:commands lsp
|
||||||
|
:init (setq lsp-enable-on-type-formatting nil)
|
||||||
|
:hook (prog-mode . lsp-deferred))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Configure lsp-ui
|
*** Configure lsp-ui
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package lsp-ui
|
(use-package lsp-ui
|
||||||
|
:defer t
|
||||||
:init
|
:init
|
||||||
(setq lsp-ui-doc-delay 1.0
|
(setq lsp-ui-doc-delay 1.0
|
||||||
lsp-ui-doc-show-with-mouse t
|
lsp-ui-doc-show-with-mouse t
|
||||||
@@ -178,22 +218,22 @@ To undo and redo easily like vi
|
|||||||
lsp-ui-doc-show-with-cursor t)
|
lsp-ui-doc-show-with-cursor t)
|
||||||
:config
|
:config
|
||||||
(lsp-ui-peek-enable 1)
|
(lsp-ui-peek-enable 1)
|
||||||
(lsp-ui-doc-enable 1))
|
(lsp-ui-doc-enable 1)
|
||||||
#+end_src
|
:hook (lsp-mode . lsp-ui-mode))
|
||||||
|
|
||||||
*** Language specific LSP packages
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(use-package lsp-haskell)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Configure flycheck
|
*** Configure flycheck
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package flycheck)
|
(use-package flycheck
|
||||||
|
:defer t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Configure dap-mode
|
*** Configure dap-mode
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package dap-mode)
|
(use-package dap-mode
|
||||||
|
:defer t
|
||||||
|
:hook ((lsp-mode . dap-mode)
|
||||||
|
(lsp-mode . dap-ui-mode)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Company
|
** Company
|
||||||
@@ -205,7 +245,7 @@ For autocomplete
|
|||||||
:config
|
:config
|
||||||
(add-to-list 'company-backends 'company-dabbrev)
|
(add-to-list 'company-backends 'company-dabbrev)
|
||||||
(setq company-backends (append '(company-files) (remove 'company-files company-backends)))
|
(setq company-backends (append '(company-files) (remove 'company-files company-backends)))
|
||||||
(company-mode 1))
|
:hook (after-init . global-company-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Configure company-quickhelp
|
*** Configure company-quickhelp
|
||||||
@@ -230,40 +270,56 @@ For autocomplete
|
|||||||
** Direnv
|
** Direnv
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package direnv
|
(use-package direnv
|
||||||
:defer t
|
|
||||||
:config
|
:config
|
||||||
(direnv-mode))
|
(direnv-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** STM32
|
** Languages
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package stm32-emacs)
|
(use-package dts-mode
|
||||||
#+end_src
|
:mode ("\\.dts\\'" "\\.dtsi\\'" "\\.overlay\\'"))
|
||||||
|
(use-package lsp-haskell
|
||||||
** Lang support
|
:mode "\\.hs\\'")
|
||||||
#+begin_src emacs-lisp
|
(use-package lsp-latex
|
||||||
(use-package haskell-mode)
|
:mode "\\.tex\\'")
|
||||||
(use-package lsp-latex)
|
(use-package rustic
|
||||||
(use-package rustic)
|
:mode "\\.rs\\'")
|
||||||
(use-package typescript-mode)
|
(use-package typescript-mode
|
||||||
(use-package yuck-mode)
|
:mode ("\\.ts\\'" "\\.tsx\\'"))
|
||||||
(use-package wgsl-mode)
|
(use-package wgsl-mode
|
||||||
|
:mode "\\.wgsl\\'")
|
||||||
(use-package nix-mode
|
(use-package nix-mode
|
||||||
:mode "\\.nix\\'")
|
:mode "\\.nix\\'")
|
||||||
(use-package hcl-mode
|
(use-package hcl-mode
|
||||||
:mode
|
:mode
|
||||||
"\\.hcl\\'"
|
"\\.hcl\\'"
|
||||||
"\\.nomad\\'")
|
"\\.nomad\\'")
|
||||||
(use-package go-mode)
|
(use-package go-mode
|
||||||
|
:mode "\\.go\\'")
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Magit
|
** Git
|
||||||
|
magit for git operations
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package magit :defer t)
|
(use-package magit :defer t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* VTerm
|
blamer for git blame
|
||||||
** Configure vterm
|
#+begin_src emacs-lisp
|
||||||
|
(use-package blamer
|
||||||
|
:defer 20
|
||||||
|
:custom
|
||||||
|
(blamer-idle-time 0.3)
|
||||||
|
(blamer-min-offset 70)
|
||||||
|
:config
|
||||||
|
(global-blamer-mode 1)
|
||||||
|
:init
|
||||||
|
(setq blamer-show-avatar-p nil
|
||||||
|
blamer-max-commit-message-length 72))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** VTerm
|
||||||
|
*** Configure vterm
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package vterm
|
(use-package vterm
|
||||||
:config
|
:config
|
||||||
@@ -288,72 +344,120 @@ For autocomplete
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Centaur Tabs
|
** Centaur Tabs
|
||||||
#+begin_src emacs-lisp
|
Do not use centaur tabs for now
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package centaur-tabs
|
(use-package centaur-tabs
|
||||||
|
:defer t
|
||||||
|
:custom
|
||||||
|
(centaur-tabs-style "rounded")
|
||||||
|
(centaur-tabs-height 18)
|
||||||
|
(centaur-tabs-set-modified-marker t)
|
||||||
|
(centaur-tabs-set-icons t)
|
||||||
:config
|
:config
|
||||||
(setq centaur-tabs-style "rounded"
|
(centaur-tabs-mode t)
|
||||||
centaur-tabs-height 18
|
|
||||||
centaur-tabs-set-modified-marker t
|
|
||||||
centaur-tabs-set-icons t)
|
|
||||||
(centaur-tabs-group-by-projectile-project)
|
(centaur-tabs-group-by-projectile-project)
|
||||||
(centaur-tabs-mode nil)
|
|
||||||
(set-face-attribute 'tab-line nil :inherit 'centaur-tabs-unselected)
|
(set-face-attribute 'tab-line nil :inherit 'centaur-tabs-unselected)
|
||||||
(centaur-tabs-headline-match))
|
(centaur-tabs-headline-match)
|
||||||
|
:bind
|
||||||
|
(:map evil-normal-state-map
|
||||||
|
("M-," . centaur-tabs-forward)
|
||||||
|
("M-." . centaur-tabs-backward))
|
||||||
|
(:map evil-motion-state-map
|
||||||
|
("M-," . centaur-tabs-forward)
|
||||||
|
("M-." . centaur-tabs-backward)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Misc packages
|
** Misc packages
|
||||||
#+begin_src emacs-lisp
|
*** Icons
|
||||||
|
For installing icons
|
||||||
|
#+begin_src emacs-lisp
|
||||||
(use-package all-the-icons
|
(use-package all-the-icons
|
||||||
|
:defer t
|
||||||
:if (display-graphic-p))
|
:if (display-graphic-p))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
(use-package elcord :defer t)
|
*** Projectile
|
||||||
|
For tracking project root
|
||||||
|
#+begin_src emacs-lisp
|
||||||
(use-package projectile
|
(use-package projectile
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map)
|
(define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map)
|
||||||
(projectile-mode +1))
|
(projectile-mode +1))
|
||||||
|
|
||||||
(use-package rainbow-mode :defer t)
|
|
||||||
|
|
||||||
(use-package rainbow-delimiters
|
|
||||||
:hook (prog-mode . rainbow-delimiters-mode))
|
|
||||||
|
|
||||||
(use-package flex-autopair)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Org
|
*** Rainbow
|
||||||
|
For highlighting colors
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package rainbow-mode :defer t)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
*** Rainbow delimiters
|
||||||
|
To make distinguishing parens easier
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package rainbow-delimiters
|
||||||
|
:hook (prog-mode . rainbow-delimiters-mode))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
*** Olivetti
|
||||||
|
When you want write prose or something similar
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package olivetti
|
||||||
|
:defer t
|
||||||
|
:diminish olivetti-mode
|
||||||
|
:custom
|
||||||
|
(olivetti-body-width 100)
|
||||||
|
(olivetti-minimum-body-width 50)
|
||||||
|
(olivetti-style 'fancy)
|
||||||
|
(olivetti-recall-visual-line-mode-entry-state t)
|
||||||
|
:config
|
||||||
|
(defvar-local my/olivetti--saved-line-numbers nil
|
||||||
|
"Stores the previous value of `display-line-numbers` before enabling Olivetti.")
|
||||||
|
|
||||||
|
(defun my/olivetti-toggle-line-numbers ()
|
||||||
|
"Hide line numbers when entering Olivetti, restore when exiting."
|
||||||
|
(if olivetti-mode
|
||||||
|
(progn
|
||||||
|
(setq my/olivetti--saved-line-numbers display-line-numbers)
|
||||||
|
(setq display-line-numbers nil))
|
||||||
|
(setq display-line-numbers my/olivetti--saved-line-numbers)))
|
||||||
|
|
||||||
|
(add-hook 'olivetti-mode-hook #'my/olivetti-toggle-line-numbers))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
** Org
|
||||||
** Add org-mode
|
** Add org-mode
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org
|
(use-package org
|
||||||
:after evil
|
|
||||||
:defer t
|
:defer t
|
||||||
|
:after evil
|
||||||
:config
|
:config
|
||||||
(setq evil-want-C-i-jump nil
|
|
||||||
org-adapt-indentation t
|
|
||||||
org-src-fontify-natively t
|
|
||||||
org-src-strip-leading-and-trailing-blank-lines t
|
|
||||||
org-src-preserve-indentation t
|
|
||||||
org-src-tab-acts-natively t)
|
|
||||||
(define-key org-mode-map (kbd "RET") 'org-return-and-maybe-indent)
|
(define-key org-mode-map (kbd "RET") 'org-return-and-maybe-indent)
|
||||||
(evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle))
|
(evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle)
|
||||||
|
:custom
|
||||||
|
(evil-want-C-i-jump nil)
|
||||||
|
(org-adapt-indentation t)
|
||||||
|
(org-src-fontify-natively t)
|
||||||
|
(org-src-strip-leading-and-trailing-blank-lines t)
|
||||||
|
(org-src-preserve-indentation t)
|
||||||
|
(org-src-tab-acts-natively t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Add org-bullets
|
** Add org-bullets
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-bullets
|
(use-package org-bullets
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:hook ((org-mode . org-bullets-mode)))
|
||||||
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Babel and exports
|
** Babel and exports
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package htmlize :defer t)
|
(use-package htmlize :defer t)
|
||||||
(add-to-list 'org-latex-packages-alist '("" "minted"))
|
|
||||||
(setq org-latex-listings 'minted)
|
|
||||||
|
|
||||||
(setq org-latex-pdf-process
|
(setq org-latex-listings 'minted
|
||||||
|
org-latex-packages-alist '(("" "minted"))
|
||||||
|
org-latex-pdf-process
|
||||||
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
|
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
|
||||||
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
|
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
|
||||||
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
|
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
|
||||||
@@ -363,30 +467,36 @@ For autocomplete
|
|||||||
|
|
||||||
(org-babel-do-load-languages
|
(org-babel-do-load-languages
|
||||||
'org-babel-load-languages
|
'org-babel-load-languages
|
||||||
'((awk . t)
|
'((python . t)
|
||||||
(python . t)
|
|
||||||
(C . t)
|
(C . t)
|
||||||
(shell . t)
|
|
||||||
(sql . t)
|
(sql . t)
|
||||||
(latex . t)))
|
(latex . t)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Mode specific hooks
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(add-hook 'c-mode-hook 'lsp)
|
|
||||||
(add-hook 'c++-mode-hook 'lsp)
|
|
||||||
(add-hook 'haskell-mode-hook #'lsp)
|
|
||||||
(add-hook 'haskell-literate-mode-hook #'lsp)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Random eye candy stuff
|
* Random eye candy stuff
|
||||||
|
* Mode line
|
||||||
* Custom mode line
|
** Doom modeline
|
||||||
switched to doom modeline after using my own modeline for a while
|
Switched to doom modeline after using my own modeline for a while
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package doom-modeline
|
(use-package doom-modeline
|
||||||
|
:init (doom-modeline-mode 1))
|
||||||
|
#+end_src
|
||||||
|
Also show columns
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(column-number-mode 1)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Nyan Mode
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package nyan-mode
|
||||||
:ensure t
|
:ensure t
|
||||||
:hook (after-init . doom-modeline-mode))
|
:init
|
||||||
|
(when (display-graphic-p)
|
||||||
|
(nyan-mode 1))
|
||||||
|
:custom
|
||||||
|
(nyan-animate-nyancat t)
|
||||||
|
:config
|
||||||
|
(nyan-start-animation))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Pop-up terminal
|
* Pop-up terminal
|
||||||
@@ -415,32 +525,35 @@ Stolen from [[https://www.reddit.com/r/emacs/comments/ft84xy/run_shell_command_i
|
|||||||
(vterm-send-return)))
|
(vterm-send-return)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Compilation shortcuts for standalone files
|
* LLMs
|
||||||
|
** gptel
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun candrun ()
|
(use-package gptel
|
||||||
(let ((full buffer-file-name)
|
:defer t
|
||||||
(file (file-name-sans-extension buffer-file-name)))
|
:config
|
||||||
(pcase (file-name-extension full)
|
(setq gptel-model 'claude-sonnet-4-20250514
|
||||||
("c" (concat "gcc " full " -lm -pthread -o " file " && " file " && rm " file))
|
gptel-backend (gptel-make-anthropic "Claude"
|
||||||
("java" (concat "java " full))
|
:stream t
|
||||||
("py" (concat "python " full))
|
:protocol "https"
|
||||||
("cpp" (concat "g++ " full " -o " file " && " file " && rm " file))
|
:key (getenv "ANTHROPIC_API_KEY")
|
||||||
("hs" (concat "runhaskell " full))
|
:host (getenv "ANTHROPIC_API_BASE_DOMAIN")))
|
||||||
("sh" (concat "sh " full))
|
(setq gptel-default-mode 'org-mode)
|
||||||
("js" (concat "node " full))
|
:bind (("C-c g" . gptel)))
|
||||||
("ts" (concat "tsc " full " && node " file ".js && rm " file ".js" ))
|
|
||||||
("rs" (concat "rustc " full " -o " file " && " file " && rm " file)))))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Custom Functions
|
** Aidermacs
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun detach-process ()
|
(use-package aidermacs
|
||||||
"Run processes but detached from the parent"
|
:defer t
|
||||||
(interactive)
|
:bind (("C-c a" . aidermacs-transient-menu))
|
||||||
(let ((command (read-string "Enter command:")))
|
:custom
|
||||||
(call-process-shell-command (concat command " &") nil 0)))
|
; See the Configuration section below
|
||||||
|
(aidermacs-default-chat-mode 'architect)
|
||||||
|
(aidermacs-default-model "sonnet"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
* Keybinds
|
* Keybinds
|
||||||
** General
|
** General
|
||||||
*** Colemak translations
|
*** Colemak translations
|
||||||
@@ -455,7 +568,8 @@ not using this anymore
|
|||||||
|
|
||||||
*** Misc binds
|
*** Misc binds
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package general)
|
(use-package general
|
||||||
|
:ensure t)
|
||||||
|
|
||||||
(setq evil-states
|
(setq evil-states
|
||||||
'(visual normal motion))
|
'(visual normal motion))
|
||||||
@@ -475,21 +589,19 @@ not using this anymore
|
|||||||
:keymaps '(global override vterm-mode-map)
|
:keymaps '(global override vterm-mode-map)
|
||||||
:states evil-states
|
:states evil-states
|
||||||
"M-o" 'treemacs
|
"M-o" 'treemacs
|
||||||
"M-S-v" 'split-window-vertically
|
"M-s-v" 'split-window-vertically
|
||||||
"M-S-h" 'split-window-horizontally
|
"M-s-h" 'split-window-horizontally
|
||||||
"M-h" 'windmove-left
|
"M-h" 'windmove-left
|
||||||
"M-j" 'windmove-down
|
"M-j" 'windmove-down
|
||||||
"M-k" 'windmove-up
|
"M-k" 'windmove-up
|
||||||
"M-l" 'windmove-right
|
"M-l" 'windmove-right
|
||||||
"M-C-h" 'shrink-window-horizontally
|
"M-C-h" 'shrink-window-horizontally
|
||||||
"M-C-j" 'enlarge-window-horizontally
|
"M-C-l" 'enlarge-window-horizontally
|
||||||
"M-C-k" 'shrink-window
|
"M-C-j" 'shrink-window
|
||||||
"M-C-l" 'enlarge-window
|
"M-C-k" 'enlarge-window
|
||||||
"M-," 'centaur-tabs-backward
|
|
||||||
"M-." 'centaur-tabs-forward
|
|
||||||
"C-q" 'delete-window
|
"C-q" 'delete-window
|
||||||
"M-C-S-q" 'kill-buffer-and-window
|
"M-C-S-q" 'kill-buffer-and-window
|
||||||
"M-w" 'centaur-tabs--kill-this-buffer-dont-ask
|
"M-w" (lambda () (interactive) (kill-buffer (current-buffer)))
|
||||||
"M-S-w" 'kill-window)
|
"M-S-w" 'kill-window)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@@ -500,11 +612,11 @@ not using this anymore
|
|||||||
:keymaps '(global override vterm-mode-map)
|
:keymaps '(global override vterm-mode-map)
|
||||||
:states evil-states
|
:states evil-states
|
||||||
"<f4>" (lambda () (interactive) (vterm t))
|
"<f4>" (lambda () (interactive) (vterm t))
|
||||||
"C-<f1>" 'vterm-toggle-cd
|
"C-S-t" 'vterm-toggle-cd
|
||||||
"<f1>" 'vterm-toggle
|
"C-t" 'vterm-toggle
|
||||||
"<f5>" (lambda () (interactive) (run-in-vterm (candrun))))
|
"<f1>" 'vterm-toggle)
|
||||||
(general-define-key
|
(general-define-key
|
||||||
:keymaps 'vterm-mode-map
|
:keymaps 'vterm-mode-map
|
||||||
"<f2>" 'vterm-toggle-forward
|
"<f3>" 'vterm-toggle-forward
|
||||||
"<f3>" 'vterm-toggle-backward)))
|
"<f2>" 'vterm-toggle-backward)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|||||||
@@ -1,2 +1,8 @@
|
|||||||
(delete-file (expand-file-name "~/.emacs.d/config.el"))
|
(defconst config-org (expand-file-name "config.org" user-emacs-directory))
|
||||||
(org-babel-load-file (expand-file-name "~/.emacs.d/config.org"))
|
(defconst config-el (expand-file-name "config.el" user-emacs-directory))
|
||||||
|
|
||||||
|
(unless (file-exists-p config-el)
|
||||||
|
(require 'org)
|
||||||
|
(org-babel-tangle-file config-org config-el))
|
||||||
|
|
||||||
|
(load-file config-el)
|
||||||
|
|||||||
@@ -1,176 +0,0 @@
|
|||||||
monitor=eDP-1, preferred, auto, 1, bitdepth, 10
|
|
||||||
monitor=HDMI-A-1, preferred, auto, 1
|
|
||||||
workspace=eDP-1, 1
|
|
||||||
workspace=HDMI-A-1, 10
|
|
||||||
|
|
||||||
input {
|
|
||||||
kb_layout = us
|
|
||||||
kb_variant = colemak_dh
|
|
||||||
kb_model =
|
|
||||||
kb_options =
|
|
||||||
kb_rules =
|
|
||||||
|
|
||||||
follow_mouse = 1
|
|
||||||
|
|
||||||
touchpad {
|
|
||||||
natural_scroll = yes
|
|
||||||
scroll_factor = 0.4
|
|
||||||
}
|
|
||||||
|
|
||||||
repeat_delay = 300
|
|
||||||
accel_profile = flat
|
|
||||||
}
|
|
||||||
|
|
||||||
general {
|
|
||||||
gaps_in = 5
|
|
||||||
gaps_out = 10
|
|
||||||
border_size = 2
|
|
||||||
|
|
||||||
# home-manager is going to override these
|
|
||||||
col.active_border = rgba(b4befeee) rgba(f5c2e7ff) 135deg
|
|
||||||
col.inactive_border = rgba(595959ff)
|
|
||||||
|
|
||||||
layout = dwindle
|
|
||||||
}
|
|
||||||
|
|
||||||
decoration {
|
|
||||||
rounding = 1
|
|
||||||
inactive_opacity = 0.8
|
|
||||||
drop_shadow = true
|
|
||||||
|
|
||||||
blur {
|
|
||||||
enabled = true
|
|
||||||
size = 5
|
|
||||||
new_optimizations = true
|
|
||||||
xray = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
animations {
|
|
||||||
enabled = yes
|
|
||||||
|
|
||||||
bezier =overshot,0.01, 0.9, 0.1, 1.05
|
|
||||||
bezier =easeoutexpo,0.16, 1, 0.3, 1
|
|
||||||
|
|
||||||
animation = windows, 1, 7, overshot, popin 50%
|
|
||||||
animation = windowsOut, 1, 7, easeoutexpo, popin 50%
|
|
||||||
animation = border, 1, 10, default
|
|
||||||
animation = fade, 1, 7, default
|
|
||||||
animation = workspaces, 1, 6, overshot
|
|
||||||
}
|
|
||||||
|
|
||||||
dwindle {
|
|
||||||
pseudotile = yes
|
|
||||||
preserve_split = yes
|
|
||||||
}
|
|
||||||
|
|
||||||
master {
|
|
||||||
new_is_master = false
|
|
||||||
}
|
|
||||||
|
|
||||||
gestures {
|
|
||||||
workspace_swipe = off
|
|
||||||
}
|
|
||||||
|
|
||||||
misc {
|
|
||||||
no_direct_scanout = true
|
|
||||||
disable_hyprland_logo = true
|
|
||||||
}
|
|
||||||
|
|
||||||
windowrule=float, ^.*(iwgtk)$
|
|
||||||
|
|
||||||
$mainMod=SUPER
|
|
||||||
|
|
||||||
binde=$mainMod, RETURN, exec, foot
|
|
||||||
bindr=SUPER, D, exec, pkill tofi || tofi-drun | xargs hyprctl dispatch exec --
|
|
||||||
bindr=SUPER SHIFT, D, exec, pkill tofi || tofi-run --require-match=false | xargs hyprctl dispatch exec --
|
|
||||||
|
|
||||||
$playerctl=playerctl -p 'playerctld,%any'
|
|
||||||
|
|
||||||
bind=$mainMod, P, exec, $playerctl play-pause
|
|
||||||
bind=, XF86AudioPlay, exec, $playerctl play-pause
|
|
||||||
bind=, XF86AudioNext, exec, $playerctl position 5+
|
|
||||||
bind=, XF86AudioPrev, exec, $playerctl position 5-
|
|
||||||
bind=$mainMod, XF86AudioNext, exec, $playerctl next
|
|
||||||
bind=$mainMod, XF86AudioPrev, exec, $playerctl previous
|
|
||||||
binde=, XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
|
|
||||||
binde=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
|
|
||||||
bind=, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
|
|
||||||
|
|
||||||
binde=, XF86MonBrightnessUp, exec, light -A 5
|
|
||||||
binde=, XF86MonBrightnessDown, exec, light -U 5
|
|
||||||
|
|
||||||
bind=$mainMod SHIFT, F1, exec, setxkbmap us colemak_dh
|
|
||||||
bind=$mainMod SHIFT, F2, exec, setxkbmap us basic
|
|
||||||
bind=$mainMod SHIFT, F3, exec, setxkbmap in deva
|
|
||||||
bind=$mainMod SHIFT, F4, exec, setxkbmap in guru
|
|
||||||
bind=$mainMod SHIFT, F5, exec, setxkbmap colemak dhz
|
|
||||||
|
|
||||||
bind=, PRINT, exec, grimblast --notify copysave screen
|
|
||||||
bind=SHIFT, PRINT, exec, grimblast --notify copysave area
|
|
||||||
|
|
||||||
binde=$mainMod SHIFT, Q, killactive,
|
|
||||||
bind=$mainMod ALT, f, exit,
|
|
||||||
bind=$mainMod SHIFT, t, pseudo,
|
|
||||||
bind=$mainMod, f, fullscreen,
|
|
||||||
bind=$mainMod, t, togglefloating,
|
|
||||||
|
|
||||||
bindm=SUPER, mouse:272, movewindow
|
|
||||||
bindm=SUPER, mouse:273, resizewindow
|
|
||||||
|
|
||||||
bind=$mainMod, left, movefocus, l
|
|
||||||
bind=$mainMod, h, movefocus, l
|
|
||||||
bind=$mainMod, right, movefocus, r
|
|
||||||
bind=$mainMod, l, movefocus, r
|
|
||||||
bind=$mainMod, up, movefocus, u
|
|
||||||
bind=$mainMod, k, movefocus, u
|
|
||||||
bind=$mainMod, down, movefocus, d
|
|
||||||
bind=$mainMod, j, movefocus, d
|
|
||||||
|
|
||||||
binde=$mainMod SHIFT, left, movewindow, l
|
|
||||||
binde=$mainMod SHIFT, h, movewindow, l
|
|
||||||
binde=$mainMod SHIFT, right, movewindow, r
|
|
||||||
binde=$mainMod SHIFT, l, movewindow, r
|
|
||||||
binde=$mainMod SHIFT, up, movewindow, u
|
|
||||||
binde=$mainMod SHIFT, k, movewindow, u
|
|
||||||
binde=$mainMod SHIFT, down, movewindow, d
|
|
||||||
binde=$mainMod SHIFT, j, movewindow, d
|
|
||||||
|
|
||||||
binde=SHIFT ALT, left, resizeactive, -10 0
|
|
||||||
binde=SHIFT ALT, h, resizeactive, -10 0
|
|
||||||
binde=SHIFT ALT, right, resizeactive, 10 0
|
|
||||||
binde=SHIFT ALT, l, resizeactive, 10 0
|
|
||||||
binde=SHIFT ALT, up, resizeactive, 0 -10
|
|
||||||
binde=SHIFT ALT, k, resizeactive, 0 -10
|
|
||||||
binde=SHIFT ALT, down, resizeactive, 0 10
|
|
||||||
binde=SHIFT ALT, j, resizeactive, 0 10
|
|
||||||
|
|
||||||
bind=$mainMod, 1, workspace, 1
|
|
||||||
bind=$mainMod, 2, workspace, 2
|
|
||||||
bind=$mainMod, 3, workspace, 3
|
|
||||||
bind=$mainMod, 4, workspace, 4
|
|
||||||
bind=$mainMod, 5, workspace, 5
|
|
||||||
bind=$mainMod, 6, workspace, 6
|
|
||||||
bind=$mainMod, 7, workspace, 7
|
|
||||||
bind=$mainMod, 8, workspace, 8
|
|
||||||
bind=$mainMod, 9, workspace, 9
|
|
||||||
bind=$mainMod, 0, workspace, 10
|
|
||||||
|
|
||||||
bind=$mainMod SHIFT, 1, movetoworkspacesilent, 1
|
|
||||||
bind=$mainMod SHIFT, 2, movetoworkspacesilent, 2
|
|
||||||
bind=$mainMod SHIFT, 3, movetoworkspacesilent, 3
|
|
||||||
bind=$mainMod SHIFT, 4, movetoworkspacesilent, 4
|
|
||||||
bind=$mainMod SHIFT, 5, movetoworkspacesilent, 5
|
|
||||||
bind=$mainMod SHIFT, 6, movetoworkspacesilent, 6
|
|
||||||
bind=$mainMod SHIFT, 7, movetoworkspacesilent, 7
|
|
||||||
bind=$mainMod SHIFT, 8, movetoworkspacesilent, 8
|
|
||||||
bind=$mainMod SHIFT, 9, movetoworkspacesilent, 9
|
|
||||||
bind=$mainMod SHIFT, 0, movetoworkspacesilent, 10
|
|
||||||
|
|
||||||
bind=$mainMod SHIFT, comma, focusmonitor, -1
|
|
||||||
bind=$mainMod SHIFT, period, focusmonitor, +1
|
|
||||||
|
|
||||||
bind=CTRL ALT, r, pass, ^(com\.obsproject\.Studio)$
|
|
||||||
|
|
||||||
exec-once=eww open bar
|
|
||||||
exec-once=swaybg -i ~/Wallpapers/current.*
|
|
||||||
13
home/natto/cursor.nix
Normal file
13
home/natto/cursor.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.pointerCursor = {
|
||||||
|
package = pkgs.catppuccin-cursors.mochaFlamingo;
|
||||||
|
name = "catppuccin-mocha-flamingo-cursors";
|
||||||
|
size = 32;
|
||||||
|
x11 = {
|
||||||
|
enable = true;
|
||||||
|
defaultCursor = "crosshair";
|
||||||
|
};
|
||||||
|
gtk.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
home = {
|
home = {
|
||||||
homeDirectory = "/home/natto";
|
homeDirectory = "/home/natto";
|
||||||
@@ -8,17 +8,32 @@
|
|||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./email.nix
|
./email.nix
|
||||||
./programs.nix
|
./pass.nix
|
||||||
./eww
|
./browser.nix
|
||||||
# ./xsession.nix
|
./pdf.nix
|
||||||
./wayland.nix
|
./mpv.nix
|
||||||
./pkgs.nix
|
./pkgs.nix
|
||||||
./stuff.nix
|
./stuff.nix
|
||||||
./emacs.nix
|
|
||||||
./gtk.nix
|
./gtk.nix
|
||||||
./dunst.nix
|
./dunst.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
./music.nix
|
./music.nix
|
||||||
./zsh.nix
|
./zsh.nix
|
||||||
|
./games.nix
|
||||||
|
./cursor.nix
|
||||||
|
./emacs.nix
|
||||||
|
|
||||||
|
# when xserver
|
||||||
|
# ./xsession.nix
|
||||||
|
|
||||||
|
# when wayland
|
||||||
|
./wayland.nix
|
||||||
|
./hyprpaper.nix
|
||||||
|
./hyprlock.nix
|
||||||
|
./hypridle.nix
|
||||||
|
./hyprland.nix
|
||||||
|
./foot.nix
|
||||||
|
./tofi.nix
|
||||||
|
./ags
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
services = {
|
services = {
|
||||||
dunst = {
|
dunst = {
|
||||||
enable = true;
|
enable = true;
|
||||||
iconTheme = with config.gtk.iconTheme; { inherit name package; };
|
iconTheme = with config.gtk.iconTheme; {
|
||||||
|
inherit name package;
|
||||||
|
};
|
||||||
settings = with conf.colors.hex; {
|
settings = with conf.colors.hex; {
|
||||||
global = {
|
global = {
|
||||||
mouse_left_click = "close_current";
|
mouse_left_click = "close_current";
|
||||||
|
|||||||
@@ -1,29 +1,13 @@
|
|||||||
{ config, pkgs, inputs, ... }:
|
{ pkgs, inputs, ... }:
|
||||||
let
|
let
|
||||||
mymacs = config: # with inputs.emacs-overlay.packages.${pkgs.system}; already resolved with overlay
|
emacs = pkgs.emacs-git-pgtk;
|
||||||
with pkgs; emacsWithPackagesFromUsePackage {
|
configFile = ./config/emacs/config.org;
|
||||||
inherit config;
|
enable = true;
|
||||||
package = emacs-pgtk;
|
|
||||||
alwaysEnsure = true;
|
|
||||||
alwaysTangle = true;
|
|
||||||
extraEmacsPackages = epkgs: with epkgs; [
|
|
||||||
use-package
|
|
||||||
(epkgs.tree-sitter-langs.withPlugins (_: epkgs.tree-sitter-langs.plugins))
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
nixpkgs.overlays = [ inputs.emacs-overlay.overlays.default ];
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
file = with config; {
|
|
||||||
"config.org" = {
|
|
||||||
source = ./config/emacs/config.org;
|
|
||||||
target = "${home.homeDirectory}/.emacs.d/config.org";
|
|
||||||
};
|
|
||||||
"init.el" = {
|
|
||||||
source = ./config/emacs/init.el;
|
|
||||||
target = "${home.homeDirectory}/.emacs.d/init.el";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
shellAliases = rec {
|
shellAliases = rec {
|
||||||
e = "emacs";
|
e = "emacs";
|
||||||
enw = e + " -nw";
|
enw = e + " -nw";
|
||||||
@@ -33,8 +17,33 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.emacs = {
|
programs.emacs = {
|
||||||
enable = true;
|
inherit enable;
|
||||||
package = mymacs ./config/emacs/config.org;
|
package = pkgs.emacsWithPackagesFromUsePackage {
|
||||||
|
config = configFile;
|
||||||
|
package = emacs;
|
||||||
|
alwaysEnsure = true;
|
||||||
|
alwaysTangle = true;
|
||||||
|
defaultInitFile = true;
|
||||||
|
extraEmacsPackages = epkgs: with epkgs; [
|
||||||
|
use-package
|
||||||
|
(tree-sitter-langs.withPlugins (_: tree-sitter-langs.plugins))
|
||||||
|
];
|
||||||
|
|
||||||
|
override = final: prev: {
|
||||||
|
evil = prev.melpaPackages.evil.overrideAttrs(_: {
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "natto1784";
|
||||||
|
repo = "evil";
|
||||||
|
rev = "isearch-lazy-count";
|
||||||
|
sha256 = "sha256-YqXoqPqOWRvszzktb0MYHMe590mzTQxCMgBloy3MHkQ=";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
services.emacs.enable = true;
|
services.emacs = {
|
||||||
|
inherit enable;
|
||||||
|
defaultEditor = true;
|
||||||
|
};
|
||||||
|
systemd.user.services.emacs.Service.Environment = "COLORTERM=truecolor";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,45 +1,94 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
conf,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
key = "53EC089EF230E47A83BA8F8195949BD4B853F559";
|
|
||||||
host = "mail.weirdnatto.in";
|
|
||||||
realName = "Amneesh Singh";
|
realName = "Amneesh Singh";
|
||||||
address = "natto@weirdnatto.in";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
accounts.email = {
|
accounts.email = {
|
||||||
accounts = {
|
accounts = {
|
||||||
natto = rec {
|
natto =
|
||||||
inherit address realName;
|
let
|
||||||
primary = true;
|
domain = conf.network.addresses.domain.natto;
|
||||||
userName = address;
|
address = "natto@${domain}";
|
||||||
gpg = {
|
host = "mail.${domain}";
|
||||||
inherit key;
|
in
|
||||||
signByDefault = true;
|
{
|
||||||
|
inherit realName address;
|
||||||
|
primary = true;
|
||||||
|
userName = address;
|
||||||
|
gpg = {
|
||||||
|
key = "3C4BDBE7BBF45B52C14EA193007257B05FCC86A8";
|
||||||
|
signByDefault = true;
|
||||||
|
};
|
||||||
|
imap = {
|
||||||
|
inherit host;
|
||||||
|
tls.enable = true;
|
||||||
|
};
|
||||||
|
imapnotify.enable = true;
|
||||||
|
smtp = {
|
||||||
|
inherit host;
|
||||||
|
tls.enable = true;
|
||||||
|
};
|
||||||
|
mbsync = {
|
||||||
|
enable = true;
|
||||||
|
create = "both";
|
||||||
|
};
|
||||||
|
passwordCommand = "pass show email/${address}";
|
||||||
|
neomutt = {
|
||||||
|
enable = true;
|
||||||
|
extraMailboxes = [
|
||||||
|
"Sent"
|
||||||
|
"Drafts"
|
||||||
|
"Trash"
|
||||||
|
"Junk"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
imap = {
|
|
||||||
inherit host;
|
amneesh =
|
||||||
tls.enable = true;
|
let
|
||||||
|
domain = conf.network.addresses.domain.amneesh;
|
||||||
|
address = "me@${domain}";
|
||||||
|
host = "mail.${domain}";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit address realName;
|
||||||
|
userName = address;
|
||||||
|
|
||||||
|
gpg = {
|
||||||
|
key = "0C2FDA374F2D48D9F9F0F7788EAAB36980C424C2";
|
||||||
|
signByDefault = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
imap = {
|
||||||
|
inherit host;
|
||||||
|
tls.enable = true;
|
||||||
|
};
|
||||||
|
imapnotify.enable = true;
|
||||||
|
smtp = {
|
||||||
|
inherit host;
|
||||||
|
tls.enable = true;
|
||||||
|
};
|
||||||
|
mbsync = {
|
||||||
|
enable = true;
|
||||||
|
create = "both";
|
||||||
|
};
|
||||||
|
passwordCommand = "pass show email/${address}";
|
||||||
|
neomutt = {
|
||||||
|
enable = true;
|
||||||
|
extraMailboxes = [
|
||||||
|
"Sent"
|
||||||
|
"Drafts"
|
||||||
|
"Junk"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
imapnotify.enable = true;
|
|
||||||
smtp = {
|
|
||||||
inherit host;
|
|
||||||
tls.enable = true;
|
|
||||||
};
|
|
||||||
mbsync = {
|
|
||||||
enable = true;
|
|
||||||
create = "both";
|
|
||||||
};
|
|
||||||
passwordCommand = "pass show email/${address}";
|
|
||||||
neomutt = {
|
|
||||||
enable = true;
|
|
||||||
extraMailboxes = [
|
|
||||||
"Sent"
|
|
||||||
"Drafts"
|
|
||||||
"Trash"
|
|
||||||
"Junk"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
@@ -51,18 +100,17 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.neomutt;
|
package = pkgs.neomutt;
|
||||||
sort = "reverse-date";
|
sort = "reverse-date";
|
||||||
extraConfig =
|
extraConfig = lib.concatMapStringsSep "\n" builtins.readFile [
|
||||||
lib.concatMapStringsSep
|
./config/neomutt/neomuttrc
|
||||||
"\n"
|
./config/neomutt/theme
|
||||||
builtins.readFile
|
];
|
||||||
[
|
|
||||||
./config/neomutt/neomuttrc
|
|
||||||
./config/neomutt/theme
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
home = {
|
home = {
|
||||||
packages = with pkgs; [ mailcap w3m ];
|
packages = with pkgs; [
|
||||||
|
mailcap
|
||||||
|
w3m
|
||||||
|
];
|
||||||
file = {
|
file = {
|
||||||
mailcap = {
|
mailcap = {
|
||||||
source = ./config/mailcap;
|
source = ./config/mailcap;
|
||||||
|
|||||||
@@ -1,15 +1,21 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
programs.eww = {
|
programs.eww = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.eww-wayland;
|
package = pkgs.eww;
|
||||||
configDir = lib.cleanSourceWith {
|
configDir = lib.cleanSourceWith {
|
||||||
src = ./.;
|
src = ./.;
|
||||||
filter = name: _:
|
filter =
|
||||||
|
name: _:
|
||||||
let
|
let
|
||||||
baseName = baseNameOf (toString name);
|
baseName = baseNameOf (toString name);
|
||||||
in
|
in
|
||||||
!(lib.hasSuffix ".nix" baseName);
|
!(lib.hasSuffix ".nix" baseName);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -22,8 +28,21 @@
|
|||||||
let
|
let
|
||||||
deps = [
|
deps = [
|
||||||
config.programs.eww.package
|
config.programs.eww.package
|
||||||
config.wayland.windowManager.hyprland.package
|
]
|
||||||
] ++ (import ./bar pkgs);
|
++ lib.optional config.wayland.windowManager.hyprland.enable config.wayland.windowManager.hyprland.package
|
||||||
|
++ (with pkgs; [
|
||||||
|
coreutils
|
||||||
|
bash
|
||||||
|
jq
|
||||||
|
less
|
||||||
|
gawk
|
||||||
|
socat
|
||||||
|
playerctl
|
||||||
|
networkmanager
|
||||||
|
iwgtk
|
||||||
|
wireplumber
|
||||||
|
])
|
||||||
|
++ lib.optional config.laptop pkgs.light;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
@@ -34,4 +53,3 @@
|
|||||||
Install.WantedBy = [ "graphical-session.target" ];
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
34
home/natto/foot.nix
Normal file
34
home/natto/foot.nix
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{ conf, ... }:
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
foot = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
main = {
|
||||||
|
font = "Fira Mono:style=Regular:pixelsize=18";
|
||||||
|
font-bold = "Fira Mono:style=Bold:pixelsize=18";
|
||||||
|
};
|
||||||
|
scrollback.lines = 10000;
|
||||||
|
colors = with conf.colors.default; {
|
||||||
|
inherit foreground background;
|
||||||
|
regular0 = surface1;
|
||||||
|
regular1 = red;
|
||||||
|
regular2 = green;
|
||||||
|
regular3 = yellow;
|
||||||
|
regular4 = blue;
|
||||||
|
regular5 = pink;
|
||||||
|
regular6 = teal;
|
||||||
|
regular7 = subtext1;
|
||||||
|
bright0 = surface2;
|
||||||
|
bright1 = red;
|
||||||
|
bright2 = green;
|
||||||
|
bright3 = yellow;
|
||||||
|
bright4 = blue;
|
||||||
|
bright5 = pink;
|
||||||
|
bright6 = teal;
|
||||||
|
bright7 = subtext0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
13
home/natto/games.nix
Normal file
13
home/natto/games.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# Wine and games and stuff
|
||||||
|
wineWowPackages.stable
|
||||||
|
steam
|
||||||
|
winetricks
|
||||||
|
# lutris
|
||||||
|
# inputs.nix-gaming.packages.${pkgs.system}.osu-lazer-bin
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.mangohud.enable = true;
|
||||||
|
}
|
||||||
@@ -12,5 +12,6 @@
|
|||||||
age.secrets.gitconfig = {
|
age.secrets.gitconfig = {
|
||||||
file = ./secrets/gitconfig.age;
|
file = ./secrets/gitconfig.age;
|
||||||
path = "${config.home.homeDirectory}/.gitconfig";
|
path = "${config.home.homeDirectory}/.gitconfig";
|
||||||
|
symlink = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
theme = {
|
theme = {
|
||||||
name = "Catppuccin-Mocha-Standard-Teal-Dark";
|
name = "catppuccin-mocha-teal-standard";
|
||||||
package = pkgs.catppuccin-gtk.override {
|
package = pkgs.catppuccin-gtk.override {
|
||||||
accents = [ "teal" ];
|
accents = [ "teal" ];
|
||||||
variant = "mocha";
|
variant = "mocha";
|
||||||
|
|||||||
29
home/natto/hypridle.nix
Normal file
29
home/natto/hypridle.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
lock = "${pkgs.systemd}/bin/loginctl lock-session";
|
||||||
|
timeout = 300;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# screen idle
|
||||||
|
services.hypridle = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
general = {
|
||||||
|
before_sleep_cmd = lock;
|
||||||
|
lock_cmd = "pgrep hyprlock || ${config.programs.hyprlock.package}/bin/hyprlock";
|
||||||
|
};
|
||||||
|
|
||||||
|
listener = [
|
||||||
|
{
|
||||||
|
timeout = timeout;
|
||||||
|
on-timeout = lock;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
207
home/natto/hyprland.nix
Normal file
207
home/natto/hyprland.nix
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
conf,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
wayland = {
|
||||||
|
windowManager = {
|
||||||
|
hyprland = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
||||||
|
|
||||||
|
portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
|
||||||
|
|
||||||
|
xwayland = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
monitor = ", highrr, auto, 1";
|
||||||
|
|
||||||
|
input = {
|
||||||
|
kb_layout = "us,us";
|
||||||
|
kb_variant = "colemak_dh";
|
||||||
|
kb_model = "";
|
||||||
|
kb_options = "grp:rctrl_toggle";
|
||||||
|
kb_rules = "";
|
||||||
|
repeat_delay = 300;
|
||||||
|
accel_profile = "flat";
|
||||||
|
follow_mouse = true;
|
||||||
|
|
||||||
|
touchpad = {
|
||||||
|
natural_scroll = true;
|
||||||
|
scroll_factor = 0.4;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
general = with conf.colors.argb { a = "ee"; }; {
|
||||||
|
gaps_in = 5;
|
||||||
|
gaps_out = 10;
|
||||||
|
border_size = 2;
|
||||||
|
layout = "dwindle";
|
||||||
|
"col.active_border" = "0x${mauve} 0x${flamingo} 135deg";
|
||||||
|
"col.inactive_border" = "0x${surface0}";
|
||||||
|
};
|
||||||
|
|
||||||
|
decoration = {
|
||||||
|
rounding = 1;
|
||||||
|
inactive_opacity = 0.8;
|
||||||
|
|
||||||
|
shadow = {
|
||||||
|
enabled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
blur = {
|
||||||
|
enabled = true;
|
||||||
|
size = 8;
|
||||||
|
new_optimizations = true;
|
||||||
|
xray = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
animations = {
|
||||||
|
enabled = true;
|
||||||
|
|
||||||
|
bezier = [
|
||||||
|
"overshot,0.01,0.9,0.1,1.05"
|
||||||
|
"easeoutexpo,0.16,1,0.3,1"
|
||||||
|
];
|
||||||
|
|
||||||
|
animation = [
|
||||||
|
"windows,1,7,overshot,popin 50%"
|
||||||
|
"windowsOut,1,7,easeoutexpo,popin 50%"
|
||||||
|
"border,1,10,default"
|
||||||
|
"fade,1,7,default"
|
||||||
|
"workspaces,1,6,overshot"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
cursor = {
|
||||||
|
no_hardware_cursors = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
dwindle = {
|
||||||
|
pseudotile = true;
|
||||||
|
preserve_split = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
misc = {
|
||||||
|
disable_hyprland_logo = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
"$mod" = "SUPER";
|
||||||
|
|
||||||
|
bind =
|
||||||
|
let
|
||||||
|
playerctl = "playerctl -p 'playerctld,%any'";
|
||||||
|
in
|
||||||
|
[
|
||||||
|
# Hyprland operations
|
||||||
|
"$mod ALT, f, exit,"
|
||||||
|
"$mod SHIFT, t, pseudo,"
|
||||||
|
"$mod, f, fullscreen,"
|
||||||
|
"$mod, t, togglefloating,"
|
||||||
|
"$mod, left, movefocus, l"
|
||||||
|
"$mod, h, movefocus, l"
|
||||||
|
"$mod, right, movefocus, r"
|
||||||
|
"$mod, l, movefocus, r"
|
||||||
|
"$mod, up, movefocus, u"
|
||||||
|
"$mod, k, movefocus, u"
|
||||||
|
"$mod, down, movefocus, d"
|
||||||
|
"$mod, j, movefocus, d"
|
||||||
|
"$mod, 1, workspace, 1"
|
||||||
|
"$mod, 2, workspace, 2"
|
||||||
|
"$mod, 3, workspace, 3"
|
||||||
|
"$mod, 4, workspace, 4"
|
||||||
|
"$mod, 5, workspace, 5"
|
||||||
|
"$mod, 6, workspace, 6"
|
||||||
|
"$mod, 7, workspace, 7"
|
||||||
|
"$mod, 8, workspace, 8"
|
||||||
|
"$mod, 9, workspace, 9"
|
||||||
|
"$mod, 0, workspace, 10"
|
||||||
|
"$mod SHIFT, 1, movetoworkspacesilent, 1"
|
||||||
|
"$mod SHIFT, 2, movetoworkspacesilent, 2"
|
||||||
|
"$mod SHIFT, 3, movetoworkspacesilent, 3"
|
||||||
|
"$mod SHIFT, 4, movetoworkspacesilent, 4"
|
||||||
|
"$mod SHIFT, 5, movetoworkspacesilent, 5"
|
||||||
|
"$mod SHIFT, 6, movetoworkspacesilent, 6"
|
||||||
|
"$mod SHIFT, 7, movetoworkspacesilent, 7"
|
||||||
|
"$mod SHIFT, 8, movetoworkspacesilent, 8"
|
||||||
|
"$mod SHIFT, 9, movetoworkspacesilent, 9"
|
||||||
|
"$mod SHIFT, 0, movetoworkspacesilent, 10"
|
||||||
|
"$mod SHIFT, comma, focusmonitor, -1"
|
||||||
|
"$mod SHIFT, period, focusmonitor, +1"
|
||||||
|
|
||||||
|
# Launchers
|
||||||
|
"$mod, RETURN, exec, foot"
|
||||||
|
"$mod, D, exec, pkill tofi || tofi-drun | xargs hyprctl dispatch exec --"
|
||||||
|
"$mod SHIFT, D, exec, pkill tofi || tofi-run --require-match=false | xargs hyprctl dispatch exec --"
|
||||||
|
|
||||||
|
# Media
|
||||||
|
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
|
||||||
|
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||||
|
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||||
|
|
||||||
|
# Backlight
|
||||||
|
", XF86MonBrightnessUp, exec, light -A 5"
|
||||||
|
", XF86MonBrightnessDown, exec, light -U 5"
|
||||||
|
|
||||||
|
# XWayland Keymaps
|
||||||
|
"$mod SHIFT, F1, exec, setxkbmap us colemak_dh"
|
||||||
|
"$mod SHIFT, F2, exec, setxkbmap us basic"
|
||||||
|
|
||||||
|
# Screenshot
|
||||||
|
", PRINT, exec, grimblast --notify copysave screen"
|
||||||
|
"SHIFT, PRINT, exec, grimblast --notify copysave area"
|
||||||
|
|
||||||
|
# Playerctl
|
||||||
|
"$mod, P, exec, ${playerctl} play-pause"
|
||||||
|
", XF86AudioPlay, exec, ${playerctl} play-pause"
|
||||||
|
", XF86AudioNext, exec, ${playerctl} position 5+"
|
||||||
|
", XF86AudioPrev, exec, ${playerctl} position 5-"
|
||||||
|
"$mod, XF86AudioNext, exec, ${playerctl} next"
|
||||||
|
"$mod, XF86AudioPrev, exec, ${playerctl} previous"
|
||||||
|
];
|
||||||
|
|
||||||
|
binde = [
|
||||||
|
# Hyprland operations
|
||||||
|
"$mod SHIFT, Q, killactive,"
|
||||||
|
"$mod SHIFT, left, movewindow, l"
|
||||||
|
"$mod SHIFT, h, movewindow, l"
|
||||||
|
"$mod SHIFT, right, movewindow, r"
|
||||||
|
"$mod SHIFT, l, movewindow, r"
|
||||||
|
"$mod SHIFT, up, movewindow, u"
|
||||||
|
"$mod SHIFT, k, movewindow, u"
|
||||||
|
"$mod SHIFT, down, movewindow, d"
|
||||||
|
"$mod SHIFT, j, movewindow, d"
|
||||||
|
"SHIFT ALT, left, resizeactive, -10 0"
|
||||||
|
"SHIFT ALT, h, resizeactive, -10 0"
|
||||||
|
"SHIFT ALT, right, resizeactive, 10 0"
|
||||||
|
"SHIFT ALT, l, resizeactive, 10 0"
|
||||||
|
"SHIFT ALT, up, resizeactive, 0 -10"
|
||||||
|
"SHIFT ALT, k, resizeactive, 0 -10"
|
||||||
|
"SHIFT ALT, down, resizeactive, 0 10"
|
||||||
|
"SHIFT ALT, j, resizeactive, 0 10"
|
||||||
|
];
|
||||||
|
|
||||||
|
bindm = [
|
||||||
|
# Mouse
|
||||||
|
"$mod, mouse:272, movewindow"
|
||||||
|
"$mod, mouse:273, resizewindow"
|
||||||
|
"$mod ALT, mouse:272, resizewindow"
|
||||||
|
];
|
||||||
|
|
||||||
|
exec-once = [
|
||||||
|
(with config.home.pointerCursor; "hyprctl setcursor ${name} ${toString size} ")
|
||||||
|
]
|
||||||
|
++ (with config.programs; lib.optional eww.enable "${eww.package}/bin/eww open bar");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
80
home/natto/hyprlock.nix
Normal file
80
home/natto/hyprlock.nix
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
conf,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
programs.hyprlock = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = with conf.colors.argb { a = "ee"; }; {
|
||||||
|
general = {
|
||||||
|
hide_cursor = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
background = [
|
||||||
|
{
|
||||||
|
monitor = "";
|
||||||
|
path = "screenshot";
|
||||||
|
blur_passes = 2;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
input-field = [
|
||||||
|
{
|
||||||
|
monitor = "";
|
||||||
|
size = "300, 60";
|
||||||
|
outline_thickness = 4;
|
||||||
|
valign = "center";
|
||||||
|
halign = "center";
|
||||||
|
|
||||||
|
font_color = "0x${text}";
|
||||||
|
outer_color = "0x${mauve}";
|
||||||
|
inner_color = "0x${surface0}";
|
||||||
|
check_color = "0x${blue}";
|
||||||
|
fail_color = "0x${red}";
|
||||||
|
capslock_color = "0x${yellow}";
|
||||||
|
|
||||||
|
fade_on_empty = false;
|
||||||
|
hide_input = false;
|
||||||
|
placeholder_text = "Logged in as <b>$USER</b>";
|
||||||
|
fail_text = "Fail! <b>($ATTEMPTS)</b>";
|
||||||
|
|
||||||
|
dots_spacing = 0.2;
|
||||||
|
dots_center = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
label = [
|
||||||
|
{
|
||||||
|
monitor = "";
|
||||||
|
text = "Layout: $LAYOUT";
|
||||||
|
font_size = 25;
|
||||||
|
color = "0x${text}";
|
||||||
|
position = "30, -30";
|
||||||
|
valign = "top";
|
||||||
|
halign = "left";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
monitor = "";
|
||||||
|
text = "$TIME";
|
||||||
|
font_size = 90;
|
||||||
|
color = "0x${text}";
|
||||||
|
position = "-30, 0";
|
||||||
|
valign = "top";
|
||||||
|
halign = "right";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
monitor = "";
|
||||||
|
text = "cmd[update:3600000] date +\"%A, %d %B %Y\"";
|
||||||
|
font_size = 25;
|
||||||
|
color = "0x${text}";
|
||||||
|
position = "-30, -150";
|
||||||
|
valign = "top";
|
||||||
|
halign = "right";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
18
home/natto/hyprpaper.nix
Normal file
18
home/natto/hyprpaper.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
services.hyprpaper = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings =
|
||||||
|
let
|
||||||
|
wallpaper = "${config.home.homeDirectory}/wallpaper.png";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
preload = [ "${wallpaper}" ];
|
||||||
|
wallpaper = [ ", ${wallpaper}" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
13
home/natto/mpv.nix
Normal file
13
home/natto/mpv.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
mpv = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
force-window = true;
|
||||||
|
keep-open = true;
|
||||||
|
save-position-on-quit = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -37,8 +37,6 @@ in
|
|||||||
host = "localhost";
|
host = "localhost";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
playerctld.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services = {
|
systemd.user.services = {
|
||||||
@@ -68,12 +66,12 @@ in
|
|||||||
|
|
||||||
home = {
|
home = {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
|
spotify
|
||||||
|
mpc_cli
|
||||||
(ncmpcpp.override {
|
(ncmpcpp.override {
|
||||||
visualizerSupport = true;
|
visualizerSupport = true;
|
||||||
clockSupport = true;
|
clockSupport = true;
|
||||||
})
|
})
|
||||||
mpc_cli
|
|
||||||
playerctl
|
|
||||||
(tauon.override {
|
(tauon.override {
|
||||||
withDiscordRPC = true;
|
withDiscordRPC = true;
|
||||||
})
|
})
|
||||||
@@ -88,5 +86,8 @@ in
|
|||||||
age.secrets.mpdasrc = {
|
age.secrets.mpdasrc = {
|
||||||
file = ./secrets/mpdasrc.age;
|
file = ./secrets/mpdasrc.age;
|
||||||
path = "${home}/.config/mpdasrc";
|
path = "${home}/.config/mpdasrc";
|
||||||
|
symlink = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.playerctld.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
6
home/natto/pass.nix
Normal file
6
home/natto/pass.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
password-store.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
18
home/natto/pdf.nix
Normal file
18
home/natto/pdf.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
zathura = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = builtins.readFile ./config/zathura/zathurarc;
|
||||||
|
options = {
|
||||||
|
recolor = true;
|
||||||
|
recolor-lightcolor = "rgba(0,0,0,0)";
|
||||||
|
default-bg = "rgba(0,0,0,0.8)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
sioyek = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,98 +1,54 @@
|
|||||||
{ config, flake, inputs, pkgs, ... }:
|
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
flake,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
home.packages =
|
||||||
|
with pkgs;
|
||||||
|
[
|
||||||
|
# A/V, codec and media stuff
|
||||||
|
ffmpeg-full
|
||||||
|
wireplumber
|
||||||
|
pulseaudio
|
||||||
|
pavucontrol
|
||||||
|
imagemagick
|
||||||
|
|
||||||
# A/V, codec and media stuff
|
# Utils
|
||||||
ffmpeg-full
|
neofetch
|
||||||
wireplumber
|
rage
|
||||||
pulseaudio
|
curl
|
||||||
pavucontrol
|
yt-dlp
|
||||||
spotify
|
p7zip
|
||||||
imagemagick
|
unrar
|
||||||
|
vim
|
||||||
|
(flake.packages.${system}.customscripts)
|
||||||
|
cachix
|
||||||
|
steam-run
|
||||||
|
|
||||||
# Utils
|
# GUI
|
||||||
neofetch
|
vesktop
|
||||||
rage
|
(xfce.thunar.override {
|
||||||
curl
|
thunarPlugins = with xfce; [
|
||||||
yt-dlp
|
thunar-media-tags-plugin
|
||||||
p7zip
|
thunar-volman
|
||||||
unrar
|
thunar-archive-plugin
|
||||||
vim
|
];
|
||||||
jmtpfs
|
})
|
||||||
(flake.packages.${pkgs.system}.customscripts)
|
xfce.xfconf
|
||||||
translate-shell
|
xfce.tumbler
|
||||||
powertop
|
qbittorrent
|
||||||
cachix
|
hexchat
|
||||||
undervolt
|
dunst
|
||||||
w3m
|
zenity
|
||||||
steam-run
|
|
||||||
|
|
||||||
# GUI utils
|
# Misc
|
||||||
slack
|
mailcap
|
||||||
(discord.override {
|
libsForQt5.qtstyleplugins
|
||||||
nss = nss_latest;
|
]
|
||||||
})
|
++ lib.optionals config.isLaptop [
|
||||||
webcord
|
powertop
|
||||||
(xfce.thunar.override {
|
undervolt
|
||||||
thunarPlugins = with xfce; [
|
];
|
||||||
thunar-media-tags-plugin
|
|
||||||
thunar-volman
|
|
||||||
thunar-archive-plugin
|
|
||||||
];
|
|
||||||
})
|
|
||||||
xfce.xfconf
|
|
||||||
xfce.tumbler
|
|
||||||
qbittorrent
|
|
||||||
hexchat
|
|
||||||
luajit
|
|
||||||
dunst
|
|
||||||
authy
|
|
||||||
gnome.zenity
|
|
||||||
|
|
||||||
# Wine and games and stuff
|
|
||||||
lutris
|
|
||||||
wineWowPackages.stable
|
|
||||||
steam
|
|
||||||
lutris
|
|
||||||
winetricks
|
|
||||||
flake.packages.${pkgs.system}.tlauncher
|
|
||||||
mangohud
|
|
||||||
# inputs.nix-gaming.packages.${pkgs.system}.osu-lazer-bin
|
|
||||||
|
|
||||||
# Programming and dev stuff
|
|
||||||
(texlive.combine {
|
|
||||||
inherit (texlive)
|
|
||||||
scheme-small
|
|
||||||
babel
|
|
||||||
lm
|
|
||||||
graphics-def
|
|
||||||
url
|
|
||||||
mhchem
|
|
||||||
wrapfig
|
|
||||||
capt-of
|
|
||||||
minted
|
|
||||||
fvextra
|
|
||||||
xstring
|
|
||||||
catchfile
|
|
||||||
framed
|
|
||||||
upquote
|
|
||||||
pdfsync
|
|
||||||
tocloft
|
|
||||||
enumitem
|
|
||||||
multirow
|
|
||||||
tcolorbox;
|
|
||||||
})
|
|
||||||
python3Packages.pygments
|
|
||||||
inform7
|
|
||||||
ghc
|
|
||||||
nodejs
|
|
||||||
rust-bin.nightly.latest.default
|
|
||||||
openjdk
|
|
||||||
|
|
||||||
# Misc
|
|
||||||
anki
|
|
||||||
tor-browser-bundle-bin
|
|
||||||
mailcap
|
|
||||||
libsForQt5.qtstyleplugins
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
{ pkgs, config, conf, ... }:
|
|
||||||
{
|
|
||||||
programs = {
|
|
||||||
firefox = {
|
|
||||||
enable = true;
|
|
||||||
profiles.natto = {
|
|
||||||
name = "natto";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
chromium = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.ungoogled-chromium;
|
|
||||||
};
|
|
||||||
zathura = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = builtins.readFile ./config/zathura/zathurarc;
|
|
||||||
options = {
|
|
||||||
recolor = true;
|
|
||||||
recolor-lightcolor = "rgba(0,0,0,0)";
|
|
||||||
default-bg = "rgba(0,0,0,0.8)";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
sioyek = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
go.enable = true;
|
|
||||||
foot = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
main = {
|
|
||||||
font = "Fira Mono:style=Regular:pixelsize=18";
|
|
||||||
font-bold = "Fira Mono:style=Bold:pixelsize=18";
|
|
||||||
};
|
|
||||||
scrollback.lines = 4000;
|
|
||||||
colors = with conf.colors.default; {
|
|
||||||
inherit foreground background;
|
|
||||||
regular0 = surface1;
|
|
||||||
regular1 = red;
|
|
||||||
regular2 = green;
|
|
||||||
regular3 = yellow;
|
|
||||||
regular4 = blue;
|
|
||||||
regular5 = pink;
|
|
||||||
regular6 = teal;
|
|
||||||
regular7 = subtext1;
|
|
||||||
bright0 = surface2;
|
|
||||||
bright1 = red;
|
|
||||||
bright2 = green;
|
|
||||||
bright3 = yellow;
|
|
||||||
bright4 = blue;
|
|
||||||
bright5 = pink;
|
|
||||||
bright6 = teal;
|
|
||||||
bright7 = subtext0;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
mpv = {
|
|
||||||
enable = true;
|
|
||||||
config = {
|
|
||||||
force-window = true;
|
|
||||||
keep-open = true;
|
|
||||||
save-position-on-quit = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
home.sessionVariables = {
|
|
||||||
BROWSER = "firefox";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -1,4 +1,10 @@
|
|||||||
{ config, lib, pkgs, ... }: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
xdg = {
|
xdg = {
|
||||||
enable = true;
|
enable = true;
|
||||||
userDirs.enable = true;
|
userDirs.enable = true;
|
||||||
@@ -7,29 +13,20 @@
|
|||||||
age.identityPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
|
age.identityPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
pointerCursor = {
|
|
||||||
package = pkgs.catppuccin-cursors.mochaFlamingo;
|
|
||||||
name = "Catppuccin-Mocha-Flamingo-Cursors";
|
|
||||||
size = 32;
|
|
||||||
x11 = {
|
|
||||||
enable = true;
|
|
||||||
defaultCursor = "crosshair";
|
|
||||||
};
|
|
||||||
gtk.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
LV2_PATH = lib.makeSearchPath "lib/lv2" (with pkgs; [ calf ]);
|
|
||||||
QT_X11_NO_MITSHM = "1";
|
QT_X11_NO_MITSHM = "1";
|
||||||
HM_CONF_DIR = "/etc/nixos";
|
HM_CONF_DIR = "/etc/nixos";
|
||||||
QT_QPA_PLATFORMTHEME = "gtk2";
|
QT_QPA_PLATFORMTHEME = "gtk2";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
i18n = {
|
i18n = {
|
||||||
inputMethod = {
|
inputMethod = {
|
||||||
enabled = "fcitx5";
|
enable = true;
|
||||||
fcitx5.addons = with pkgs; [ fcitx5-m17n fcitx5-mozc ];
|
type = "fcitx5";
|
||||||
|
fcitx5.addons = with pkgs; [
|
||||||
|
fcitx5-m17n
|
||||||
|
fcitx5-mozc
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
37
home/natto/tofi.nix
Normal file
37
home/natto/tofi.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
conf,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
home.file.tofi = {
|
||||||
|
source = pkgs.writeText "tofi-config" (
|
||||||
|
pkgs.lib.generators.toKeyValue { } (
|
||||||
|
with conf.colors.default;
|
||||||
|
{
|
||||||
|
# https://github.com/philj56/tofi/blob/master/themes/fullscreen
|
||||||
|
width = "100%";
|
||||||
|
height = "100%";
|
||||||
|
border-width = 0;
|
||||||
|
outline-width = 0;
|
||||||
|
padding-left = "35%";
|
||||||
|
padding-top = "35%";
|
||||||
|
result-spacing = 25;
|
||||||
|
num-results = 5;
|
||||||
|
font = "Fira Mono";
|
||||||
|
font-size = 15;
|
||||||
|
text-color = foreground;
|
||||||
|
selection-color = rosewater;
|
||||||
|
selection-match-color = red;
|
||||||
|
background-color = "#000A";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
target = "${config.xdg.configHome}/tofi/config";
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
tofi
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,57 +1,11 @@
|
|||||||
{ pkgs, config, conf, inputs, ... }:
|
{ pkgs, inputs, ... }:
|
||||||
{
|
{
|
||||||
wayland = {
|
|
||||||
windowManager = {
|
|
||||||
sway = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
hyprland = {
|
|
||||||
enable = true;
|
|
||||||
xwayland = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
extraConfig = (builtins.readFile ./config/hypr/hyprland.conf)
|
|
||||||
+ (with config.home.pointerCursor; ''
|
|
||||||
exec-once=hyprctl setcursor ${name} ${toString size}
|
|
||||||
'')
|
|
||||||
+ (with conf.colors.argb { a = "ee"; };''
|
|
||||||
general {
|
|
||||||
col.active_border = 0x${mauve} 0x${flamingo} 135deg
|
|
||||||
col.inactive_border = 0x${surface0}
|
|
||||||
}
|
|
||||||
'');
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
home.file.tofi = {
|
|
||||||
source = pkgs.writeText "tofi-config" (pkgs.lib.generators.toKeyValue { } (with conf.colors.default; {
|
|
||||||
# https://github.com/philj56/tofi/blob/master/themes/fullscreen
|
|
||||||
width = "100%";
|
|
||||||
height = "100%";
|
|
||||||
border-width = 0;
|
|
||||||
outline-width = 0;
|
|
||||||
padding-left = "35%";
|
|
||||||
padding-top = "35%";
|
|
||||||
result-spacing = 25;
|
|
||||||
num-results = 5;
|
|
||||||
font = "Fira Mono";
|
|
||||||
font-size = 15;
|
|
||||||
text-color = foreground;
|
|
||||||
selection-color = rosewater;
|
|
||||||
selection-match-color = red;
|
|
||||||
background-color = "#000A";
|
|
||||||
}));
|
|
||||||
target = "${config.xdg.configHome}/tofi/config";
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
tofi
|
|
||||||
imv
|
|
||||||
grim
|
grim
|
||||||
slurp
|
slurp
|
||||||
inputs.hyprland-contrib.packages.${pkgs.system}.grimblast
|
inputs.hyprland-contrib.packages.${pkgs.system}.grimblast
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
|
swayimg
|
||||||
swaybg
|
swaybg
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
{ pkgs, config, flake, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
flake,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
xsession = {
|
xsession = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ let
|
|||||||
secretPath = "${config.home.homeDirectory}/.zshenv_secret";
|
secretPath = "${config.home.homeDirectory}/.zshenv_secret";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.zsh.initExtra = lib.mkForce ''
|
programs.zsh.initContent = lib.mkAfter ''
|
||||||
. ${secretPath};
|
. ${secretPath};
|
||||||
unsetopt extendedGlob
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
age.secrets.zshenv_secret = {
|
age.secrets.zshenv_secret = {
|
||||||
file = ./secrets/zshenv_secret;
|
file = ./secrets/zshenv_secret;
|
||||||
path = secretPath;
|
path = secretPath;
|
||||||
|
symlink = false;
|
||||||
mode = "660";
|
mode = "660";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
13
home/overlays/standalone.nix
Normal file
13
home/overlays/standalone.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
final: prev:
|
||||||
|
let
|
||||||
|
pam = prev.pam.overrideAttrs (oa: {
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace modules/module-meson.build \
|
||||||
|
--replace "sbindir / 'unix_chkpwd'" "'/usr/bin/unix_chkpwd'"
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
in
|
||||||
|
{
|
||||||
|
hyprlock = prev.hyprlock.override { inherit pam; };
|
||||||
|
swaylock = prev.swaylock.override { inherit pam; };
|
||||||
|
}
|
||||||
@@ -3,3 +3,4 @@
|
|||||||
+ marisa is my Raspberry Pi 4 (B)
|
+ marisa is my Raspberry Pi 4 (B)
|
||||||
+ remilia is my cloud VM
|
+ remilia is my cloud VM
|
||||||
+ hina is another cloud VM I use for ZNC
|
+ hina is another cloud VM I use for ZNC
|
||||||
|
+ suwako is an ARM cloud VM
|
||||||
|
|||||||
4
hosts/common/programs/adb/default.nix
Normal file
4
hosts/common/programs/adb/default.nix
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.adb.enable = true;
|
||||||
|
}
|
||||||
4
hosts/common/programs/dconf/default.nix
Normal file
4
hosts/common/programs/dconf/default.nix
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.dconf.enable = true;
|
||||||
|
}
|
||||||
16
hosts/common/programs/doas/default.nix
Normal file
16
hosts/common/programs/doas/default.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
security = {
|
||||||
|
doas = {
|
||||||
|
enable = true;
|
||||||
|
extraRules = [
|
||||||
|
{
|
||||||
|
groups = [ "wheel" ];
|
||||||
|
keepEnv = true;
|
||||||
|
persist = true;
|
||||||
|
setEnv = [ "PATH" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
4
hosts/common/programs/git/default.nix
Normal file
4
hosts/common/programs/git/default.nix
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.git.enable = true;
|
||||||
|
}
|
||||||
9
hosts/common/programs/gnupg/default.nix
Normal file
9
hosts/common/programs/gnupg/default.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.gnupg = {
|
||||||
|
agent = {
|
||||||
|
enableSSHSupport = true;
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
config = {
|
config = {
|
||||||
allowBroken = true;
|
allowBroken = true;
|
||||||
|
allowUnfree = true;
|
||||||
};
|
};
|
||||||
overlays = [
|
overlays = [
|
||||||
self.overlays.default
|
self.overlays.default
|
||||||
@@ -15,14 +16,15 @@
|
|||||||
'';
|
'';
|
||||||
settings = {
|
settings = {
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
trusted-users = [ "root" "natto" ];
|
trusted-users = [
|
||||||
|
"root"
|
||||||
|
"@wheel"
|
||||||
|
];
|
||||||
substituters = [
|
substituters = [
|
||||||
"https://nix-gaming.cachix.org"
|
|
||||||
"https://nix-community.cachix.org"
|
"https://nix-community.cachix.org"
|
||||||
# "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
|
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
|
||||||
];
|
];
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
13
hosts/common/programs/zsh/default.nix
Normal file
13
hosts/common/programs/zsh/default.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
histSize = 30000;
|
||||||
|
enableBashCompletion = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
autosuggestions = {
|
||||||
|
enable = true;
|
||||||
|
highlightStyle = "fg=yellow,bold";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
21
hosts/common/security/default.nix
Normal file
21
hosts/common/security/default.nix
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
conf,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
domain = conf.network.addresses.domain.natto;
|
||||||
|
nginx = config.services.nginx;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
security = {
|
||||||
|
acme = lib.mkIf nginx.enable {
|
||||||
|
acceptTerms = true;
|
||||||
|
certs = lib.mapAttrs (n: _: { email = "natto@${domain}"; }) (
|
||||||
|
lib.filterAttrs (_: v: v.enableACME) nginx.virtualHosts
|
||||||
|
);
|
||||||
|
};
|
||||||
|
pki.certificateFiles = [ ../../../cert.pem ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
{ lib, config, pkgs, ... }: {
|
{ ... }:
|
||||||
# sound stuff
|
{
|
||||||
sound.enable = true;
|
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
alsa = {
|
alsa = {
|
||||||
@@ -1,17 +1,11 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
#let
|
|
||||||
# compiledLayout = pkgs.runCommand "keyboard-layout" {} ''
|
|
||||||
# ${pkgs.xorg.xkbcomp}/bin/xkbcomp ${./colemak-dh.xkb} $out
|
|
||||||
# '';
|
|
||||||
#in
|
|
||||||
{
|
{
|
||||||
services = {
|
services = {
|
||||||
libinput = {
|
libinput = {
|
||||||
enable = true;
|
enable = true;
|
||||||
mouse = {
|
mouse = {
|
||||||
accelSpeed = "0";
|
accelSpeed = "0";
|
||||||
# accelProfile = "flat";
|
|
||||||
};
|
};
|
||||||
touchpad = {
|
touchpad = {
|
||||||
middleEmulation = false;
|
middleEmulation = false;
|
||||||
@@ -22,13 +16,9 @@
|
|||||||
};
|
};
|
||||||
xserver = {
|
xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
displayManager = {
|
displayManager.startx.enable = true;
|
||||||
startx = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
xkb.layout = "us";
|
xkb.layout = "us";
|
||||||
xkb.variant = "colemak_dh"; # trying to ditch DHz now
|
xkb.variant = "colemak_dh";
|
||||||
autoRepeatDelay = 320;
|
autoRepeatDelay = 320;
|
||||||
autoRepeatInterval = 30;
|
autoRepeatInterval = 30;
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
#Taken from https://github.com/MagicRB/dotfiles/blob/master/nix/nixos-modules/vault-agent.nix
|
#Taken from https://github.com/MagicRB/dotfiles/blob/master/nix/nixos-modules/vault-agent.nix
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.services.vault-agent;
|
cfg = config.services.vault-agent;
|
||||||
@@ -59,48 +64,49 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable
|
config = mkIf cfg.enable ({
|
||||||
({
|
users = {
|
||||||
users = {
|
users = {
|
||||||
users = {
|
"${cfg.userName}" = {
|
||||||
"${cfg.userName}" = {
|
group = cfg.groupName;
|
||||||
group = cfg.groupName;
|
uid = cfg.uid;
|
||||||
uid = cfg.uid;
|
isSystemUser = true;
|
||||||
isSystemUser = true;
|
description = "Vault-Agent User";
|
||||||
description = "Vault-Agent User";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
groups = {
|
|
||||||
"${cfg.groupName}" = {
|
|
||||||
gid = cfg.gid;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
systemd.tmpfiles.rules = mkIf (cfg.secretsDir != null) [
|
groups = {
|
||||||
"d ${cfg.secretsDir} 6755 vault-agent ${cfg.groupName} 0"
|
"${cfg.groupName}" = {
|
||||||
];
|
gid = cfg.gid;
|
||||||
systemd.services.vault-agent = {
|
};
|
||||||
description = "Vault Agent";
|
};
|
||||||
wantedBy = [ "multi-user.target" ];
|
};
|
||||||
wants = [ "network-online.target" ];
|
systemd.tmpfiles.rules = mkIf (cfg.secretsDir != null) [
|
||||||
after = [ "network-online.target" ];
|
"d ${cfg.secretsDir} 6755 vault-agent ${cfg.groupName} 0"
|
||||||
path = (with pkgs; [
|
];
|
||||||
|
systemd.services.vault-agent = {
|
||||||
|
description = "Vault Agent";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
path = (
|
||||||
|
with pkgs;
|
||||||
|
[
|
||||||
glibc
|
glibc
|
||||||
]);
|
]
|
||||||
serviceConfig = {
|
);
|
||||||
User = cfg.userName;
|
serviceConfig = {
|
||||||
Group = cfg.groupName;
|
User = cfg.userName;
|
||||||
ExecReload = "${pkgs.busybox}/bin/kill -HUP $MAINPID";
|
Group = cfg.groupName;
|
||||||
ExecStart = "${cfg.package}/bin/vault agent -config=${json.generate "vault.json" cfg.settings}";
|
ExecReload = "${pkgs.busybox}/bin/kill -HUP $MAINPID";
|
||||||
KillMode = "process";
|
ExecStart = "${cfg.package}/bin/vault agent -config=${json.generate "vault.json" cfg.settings}";
|
||||||
KillSignal = "SIGINT";
|
KillMode = "process";
|
||||||
Restart = "on-failure";
|
KillSignal = "SIGINT";
|
||||||
TimeoutStopSec = "30s";
|
Restart = "on-failure";
|
||||||
RestartSec = 2;
|
TimeoutStopSec = "30s";
|
||||||
ConfigurationDirectory = "vault-agent";
|
RestartSec = 2;
|
||||||
ConfigurationDirectoryMode = "0600";
|
ConfigurationDirectory = "vault-agent";
|
||||||
};
|
ConfigurationDirectoryMode = "0600";
|
||||||
};
|
};
|
||||||
});
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
26
hosts/common/x86builder.nix
Normal file
26
hosts/common/x86builder.nix
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
nix = {
|
||||||
|
extraOptions = ''
|
||||||
|
builders-use-substitutes = true
|
||||||
|
'';
|
||||||
|
buildMachines = [
|
||||||
|
{
|
||||||
|
hostName = "okina";
|
||||||
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
];
|
||||||
|
maxJobs = 4;
|
||||||
|
speedFactor = 2;
|
||||||
|
supportedFeatures = [
|
||||||
|
"nixos-test"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
"kvm"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
distributedBuilds = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -3,17 +3,23 @@ let
|
|||||||
inherit (inputs) nixpkgs;
|
inherit (inputs) nixpkgs;
|
||||||
|
|
||||||
commonModules = [
|
commonModules = [
|
||||||
./nvim.nix
|
{
|
||||||
globalArgs
|
_module.args = globalArgs;
|
||||||
|
}
|
||||||
|
./common/programs/neovim
|
||||||
|
./common/programs/nix
|
||||||
|
./common/programs/zsh
|
||||||
|
./common/programs/gnupg
|
||||||
|
./common/programs/git
|
||||||
|
./common/programs/doas
|
||||||
|
./common/security
|
||||||
];
|
];
|
||||||
desktopModules = [
|
desktopModules = [
|
||||||
./xorg.nix
|
./common/programs/adb
|
||||||
./wayland.nix
|
./common/programs/dconf
|
||||||
./nix.nix
|
./common/services/xserver
|
||||||
./desktop-pkgs.nix
|
./common/services/pipewire
|
||||||
./sound.nix
|
|
||||||
];
|
];
|
||||||
serverModules = [ ./minimal.nix ];
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.nixosConfigurations = {
|
flake.nixosConfigurations = {
|
||||||
@@ -43,8 +49,7 @@ in
|
|||||||
modules = [
|
modules = [
|
||||||
./marisa
|
./marisa
|
||||||
]
|
]
|
||||||
++ commonModules
|
++ commonModules;
|
||||||
++ serverModules;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#Oracle Cloud VM
|
#Oracle Cloud VM
|
||||||
@@ -52,11 +57,10 @@ in
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./remilia
|
./remilia
|
||||||
./x86builder.nix
|
./common/x86builder.nix
|
||||||
inputs.mailserver.nixosModules.mailserver
|
inputs.mailserver.nixosModules.mailserver
|
||||||
]
|
]
|
||||||
++ commonModules
|
++ commonModules;
|
||||||
++ serverModules;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#Oracle Cloud VM
|
#Oracle Cloud VM
|
||||||
@@ -64,10 +68,19 @@ in
|
|||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./hina
|
./hina
|
||||||
./x86builder.nix
|
./common/x86builder.nix
|
||||||
]
|
]
|
||||||
++ commonModules
|
++ commonModules;
|
||||||
++ serverModules;
|
};
|
||||||
|
|
||||||
|
#Oracle Cloud VM
|
||||||
|
suwako = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "aarch64-linux";
|
||||||
|
modules = [
|
||||||
|
./suwako
|
||||||
|
inputs.mailserver.nixosModules.mailserver
|
||||||
|
]
|
||||||
|
++ commonModules;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
{ lib, config, inputs, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
tmux
|
|
||||||
bc
|
|
||||||
gnumake
|
|
||||||
pciutils
|
|
||||||
usbutils
|
|
||||||
ntfs3g
|
|
||||||
python3
|
|
||||||
htop
|
|
||||||
wget
|
|
||||||
ripgrep
|
|
||||||
kbd
|
|
||||||
gcc
|
|
||||||
vulkan-tools
|
|
||||||
vulkan-headers
|
|
||||||
jq
|
|
||||||
dconf
|
|
||||||
];
|
|
||||||
|
|
||||||
fonts.packages = with pkgs; [
|
|
||||||
fira-code
|
|
||||||
fira-mono
|
|
||||||
monoid
|
|
||||||
font-awesome
|
|
||||||
material-icons
|
|
||||||
material-design-icons
|
|
||||||
lohit-fonts.devanagari
|
|
||||||
lohit-fonts.gurmukhi
|
|
||||||
office-code-pro
|
|
||||||
eb-garamond
|
|
||||||
noto-fonts-cjk
|
|
||||||
takao
|
|
||||||
liberation_ttf
|
|
||||||
];
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
git.enable = true;
|
|
||||||
|
|
||||||
gnupg = {
|
|
||||||
agent = {
|
|
||||||
enableSSHSupport = true;
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
zsh = {
|
|
||||||
enable = true;
|
|
||||||
histSize = 30000;
|
|
||||||
enableBashCompletion = true;
|
|
||||||
enableCompletion = true;
|
|
||||||
autosuggestions = {
|
|
||||||
enable = true;
|
|
||||||
highlightStyle = "fg=yellow,bold";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
adb.enable = true;
|
|
||||||
gamemode.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -3,9 +3,19 @@
|
|||||||
boot = {
|
boot = {
|
||||||
kernel.sysctl."net.ipv4.ip_forward" = 1;
|
kernel.sysctl."net.ipv4.ip_forward" = 1;
|
||||||
initrd.kernelModules = [ "bochs" ];
|
initrd.kernelModules = [ "bochs" ];
|
||||||
initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" ];
|
initrd.availableKernelModules = [
|
||||||
|
"ata_piix"
|
||||||
|
"uhci_hcd"
|
||||||
|
"virtio_pci"
|
||||||
|
"virtio_scsi"
|
||||||
|
];
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
kernelParams = [ "console=ttyS0" "console=tty1" "nvme.shutdown_timeout=10" "libiscsi.debug_libiscsi_eh=1" ];
|
kernelParams = [
|
||||||
|
"console=ttyS0"
|
||||||
|
"console=tty1"
|
||||||
|
"nvme.shutdown_timeout=10"
|
||||||
|
"libiscsi.debug_libiscsi_eh=1"
|
||||||
|
];
|
||||||
loader = {
|
loader = {
|
||||||
systemd-boot.enable = true;
|
systemd-boot.enable = true;
|
||||||
efi.canTouchEfiVariables = true;
|
efi.canTouchEfiVariables = true;
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
{ config, pkgs, conf, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
conf,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./networking.nix
|
./networking.nix
|
||||||
@@ -16,7 +21,6 @@
|
|||||||
extraGroups = [ "wheel" ];
|
extraGroups = [ "wheel" ];
|
||||||
openssh.authorizedKeys.keys = conf.network.commonSSHKeys;
|
openssh.authorizedKeys.keys = conf.network.commonSSHKeys;
|
||||||
};
|
};
|
||||||
programs.zsh.enable = true;
|
|
||||||
|
|
||||||
system.stateVersion = "21.11";
|
system.stateVersion = "21.11";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [
|
||||||
[
|
(modulesPath + "/profiles/qemu-guest.nix")
|
||||||
(modulesPath + "/profiles/qemu-guest.nix")
|
];
|
||||||
];
|
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" = {
|
||||||
{
|
device = "/dev/disk/by-label/cloudimg-rootfs";
|
||||||
device = "/dev/disk/by-uuid/d91adce2-9059-4a8a-86e7-dee6ecc85b2b";
|
fsType = "ext4";
|
||||||
fsType = "ext4";
|
};
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [
|
swapDevices = [
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user