Compare commits
50 commits
Author | SHA1 | Date | |
---|---|---|---|
3c71c09a56 | |||
88a49bc9a2 | |||
a7608ace94 | |||
a989bacbd7 | |||
fb9ccce37a | |||
fc320d3fd9 | |||
99bb1e74c7 | |||
ca0c093ecd | |||
lelgenio | 411b55cb24 | ||
5bda7a8481 | |||
9bc508f4a6 | |||
b81c42034b | |||
4532cb43fa | |||
93b652b952 | |||
9c8bc05856 | |||
a4ebb60595 | |||
lelgenio | feafc57514 | ||
41d25a3c1c | |||
acc15e78ab | |||
lelgenio | 7fcb1b1892 | ||
lelgenio | cf21221a97 | ||
9e5870f3d4 | |||
c386394e10 | |||
6729d93793 | |||
c8ef4abda4 | |||
f8c524bf4a | |||
769937bf1a | |||
4cc524d1c5 | |||
lelgenio | a596e79a36 | ||
a05340b776 | |||
2ed85e09b8 | |||
e5dd16d126 | |||
0cffcef25a | |||
0f14332471 | |||
bd46b5610b | |||
26a34669d0 | |||
0681134c31 | |||
70d4c47983 | |||
5cd95a9b6a | |||
cb68f4f77c | |||
5062c28d4f | |||
2a4f056aaa | |||
9828e1366d | |||
f246c31794 | |||
f2f4a01c6a | |||
ddf010febb | |||
8887600322 | |||
bd7ae3084a | |||
lelgenio | 43f376d9ac | ||
dbb165237e |
231
flake.lock
231
flake.lock
|
@ -57,6 +57,22 @@
|
|||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"catboy-spinner": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1728098748,
|
||||
"narHash": "sha256-FHM/a+wqctmg1LXf/XB6TcXowL0Wzbq1kSCGVnxGgL8=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "c6fc11b0900826508f6a766c65cf92e0c7c4eab9",
|
||||
"revCount": 4,
|
||||
"type": "git",
|
||||
"url": "https://git.lelgenio.com/lelgenio/catboy-spinner"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.lelgenio.com/lelgenio/catboy-spinner"
|
||||
}
|
||||
},
|
||||
"crane": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
|
@ -82,6 +98,27 @@
|
|||
}
|
||||
},
|
||||
"crane_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"made-you-look",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1718730147,
|
||||
"narHash": "sha256-QmD6B6FYpuoCqu6ZuPJH896ItNquDkn0ulQlOn4ykN8=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "32c21c29b034d0a93fdb2379d6fabc40fc3d0e6c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"crane_3": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"warthunder-leak-counter",
|
||||
|
@ -176,11 +213,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724769572,
|
||||
"narHash": "sha256-K+HQbC2/hnGngIB019mX6f4XUrf7dB1eBfiUHW4Vx48=",
|
||||
"lastModified": 1730190761,
|
||||
"narHash": "sha256-o5m5WzvY6cGIDupuOvjgNSS8AN6yP2iI9MtUC6q/uos=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "b89a61129f3976d6440e2356ac5d3e30930f7012",
|
||||
"rev": "3979285062d6781525cded0f6c4ff92e71376b55",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -189,40 +226,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dzgui": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1702780245,
|
||||
"narHash": "sha256-cdW5LN2Q7eYW8xIqKPQfeYPd7e6VdJGaoA9NMHesCrE=",
|
||||
"owner": "aclist",
|
||||
"repo": "dztui",
|
||||
"rev": "28323f3edb8fa747dc559d1939ccdd7729e4e3a1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "aclist",
|
||||
"repo": "dztui",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dzgui-nix": {
|
||||
"inputs": {
|
||||
"dzgui": "dzgui",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1702850463,
|
||||
"narHash": "sha256-qR/c/GjsLUzrCyHN/Q9nnClduf6OqTg26S1AFYKPzxA=",
|
||||
"lastModified": 1727831626,
|
||||
"narHash": "sha256-Gvt5lapgNRRTL95gFH8vm48f8gjsk7GYM4Qo5aUOzzo=",
|
||||
"owner": "lelgenio",
|
||||
"repo": "dzgui-nix",
|
||||
"rev": "2ed6515b27d8186b9fedfe1dcaf861f07e796a0d",
|
||||
"rev": "38cf2b507d75cc36ec127b21fc5a4144fc821525",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lelgenio",
|
||||
"ref": "dzgui-4.1.0",
|
||||
"repo": "dzgui-nix",
|
||||
"type": "github"
|
||||
}
|
||||
|
@ -334,7 +353,7 @@
|
|||
},
|
||||
"flake-utils_4": {
|
||||
"inputs": {
|
||||
"systems": "systems_5"
|
||||
"systems": "systems_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1681202837,
|
||||
|
@ -372,6 +391,24 @@
|
|||
"inputs": {
|
||||
"systems": "systems_7"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1681202837,
|
||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_7": {
|
||||
"inputs": {
|
||||
"systems": "systems_8"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
|
@ -386,6 +423,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hello-fonts": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1728232065,
|
||||
"narHash": "sha256-1DUW1YqZALPFxBM7HYcNZiCZQvMqUiJ1m04NU4IIe3I=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "10f7485fea930bb45e97fbda0cd68f199a7e8f59",
|
||||
"revCount": 1,
|
||||
"type": "git",
|
||||
"url": "https://git.lelgenio.com/lelgenio/hello-fonts"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.lelgenio.com/lelgenio/hello-fonts"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -393,11 +446,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1720042825,
|
||||
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
|
||||
"lastModified": 1726989464,
|
||||
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
|
||||
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -407,6 +460,28 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"made-you-look": {
|
||||
"inputs": {
|
||||
"crane": "crane_2",
|
||||
"flake-utils": "flake-utils_4",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1728159958,
|
||||
"narHash": "sha256-r/h/ch70KfOQ8moftDhHagu3WajglaqU+hrEzUtTM1Y=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "96e978aa2f414d4b92b78e7ae975d7ff7db95a91",
|
||||
"revCount": 3,
|
||||
"type": "git",
|
||||
"url": "https://git.lelgenio.com/lelgenio/made-you-look"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.lelgenio.com/lelgenio/made-you-look"
|
||||
}
|
||||
},
|
||||
"nix-index-database": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -414,11 +489,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724576102,
|
||||
"narHash": "sha256-uM7n5nNL6fmA0bwMJBNll11f4cMWOFa2Ni6F5KeIldM=",
|
||||
"lastModified": 1729999765,
|
||||
"narHash": "sha256-LYsavZXitFjjyETZoij8usXjTa7fa9AIF3Sk3MJSX+Y=",
|
||||
"owner": "Mic92",
|
||||
"repo": "nix-index-database",
|
||||
"rev": "e333d62b70b179da1dd78d94315e8a390f2d12e5",
|
||||
"rev": "0e3a8778c2ee218eff8de6aacf3d2fa6c33b2d4f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -456,11 +531,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1726320982,
|
||||
"narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=",
|
||||
"lastModified": 1730137625,
|
||||
"narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8f7492cce28977fbf8bd12c72af08b1f6c7c3e49",
|
||||
"rev": "64b80bfb316b57cdb8919a9110ef63393d74382a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -471,16 +546,16 @@
|
|||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1726334142,
|
||||
"narHash": "sha256-SxGeAYrGoCnaGkQHNzGvExpgJv1pfS5J2pMX7zlwWxE=",
|
||||
"lastModified": 1729880355,
|
||||
"narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d9d07251f12399413e6d33d5875a6f1994ef75a7",
|
||||
"rev": "18536bf04cd71abd345f9579158841376fdd0c5a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"ref": "nixos-unstable",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
|
@ -519,11 +594,14 @@
|
|||
"root": {
|
||||
"inputs": {
|
||||
"agenix": "agenix",
|
||||
"catboy-spinner": "catboy-spinner",
|
||||
"demoji": "demoji",
|
||||
"dhist": "dhist",
|
||||
"disko": "disko",
|
||||
"dzgui-nix": "dzgui-nix",
|
||||
"hello-fonts": "hello-fonts",
|
||||
"home-manager": "home-manager",
|
||||
"made-you-look": "made-you-look",
|
||||
"nix-index-database": "nix-index-database",
|
||||
"nixos-mailserver": "nixos-mailserver",
|
||||
"nixpkgs": "nixpkgs",
|
||||
|
@ -531,8 +609,11 @@
|
|||
"plymouth-themes": "plymouth-themes",
|
||||
"ranger-icons": "ranger-icons",
|
||||
"tlauncher": "tlauncher",
|
||||
"tomater": "tomater",
|
||||
"vpsadminos": "vpsadminos",
|
||||
"warthunder-leak-counter": "warthunder-leak-counter",
|
||||
"wl-crosshair": "wl-crosshair"
|
||||
"wl-crosshair": "wl-crosshair",
|
||||
"youre-wrong": "youre-wrong"
|
||||
}
|
||||
},
|
||||
"rust-analyzer-src": {
|
||||
|
@ -684,9 +765,24 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_8": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tlauncher": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_4",
|
||||
"flake-utils": "flake-utils_5",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
|
@ -705,9 +801,25 @@
|
|||
"url": "https://git.lelgenio.xyz/lelgenio/tlauncher-nix"
|
||||
}
|
||||
},
|
||||
"tomater": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1728089744,
|
||||
"narHash": "sha256-WOz/qUKyao7lM2qcwqqcJDw4jI8mUJL6kNUNm0sxPKk=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "efff561c745514a7874e3f5de95307a74efc7df9",
|
||||
"revCount": 1,
|
||||
"type": "git",
|
||||
"url": "https://git.lelgenio.com/lelgenio/tomater"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.lelgenio.com/lelgenio/tomater"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"inputs": {
|
||||
"systems": "systems_4"
|
||||
"systems": "systems_5"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709126324,
|
||||
|
@ -723,10 +835,25 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"vpsadminos": {
|
||||
"locked": {
|
||||
"lastModified": 1730290190,
|
||||
"narHash": "sha256-a+op2lnWrCytuEhLOE24SKR/irRfjwDEHkpLyAL5P90=",
|
||||
"owner": "vpsfreecz",
|
||||
"repo": "vpsadminos",
|
||||
"rev": "63ac771b9667b45ab2ea87363f69ca7f85668e9b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "vpsfreecz",
|
||||
"repo": "vpsadminos",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"warthunder-leak-counter": {
|
||||
"inputs": {
|
||||
"crane": "crane_2",
|
||||
"flake-utils": "flake-utils_5",
|
||||
"crane": "crane_3",
|
||||
"flake-utils": "flake-utils_6",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
|
@ -747,7 +874,7 @@
|
|||
},
|
||||
"wl-crosshair": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_6",
|
||||
"flake-utils": "flake-utils_7",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
|
@ -765,6 +892,22 @@
|
|||
"repo": "wl-crosshair",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"youre-wrong": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1728228087,
|
||||
"narHash": "sha256-W40rQbQAo3lGrKlfenSA8JaGwZMSx/X4lP71enQtK7Y=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "64e7876233e99ad7223cae29688374a1c1ff569a",
|
||||
"revCount": 2,
|
||||
"type": "git",
|
||||
"url": "https://git.lelgenio.com/lelgenio/youre-wrong"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.lelgenio.com/lelgenio/youre-wrong"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
|
47
flake.nix
47
flake.nix
|
@ -2,9 +2,13 @@
|
|||
description = "My system config";
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-24.05";
|
||||
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
|
||||
|
||||
home-manager.url = "github:nix-community/home-manager/release-24.05";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
vpsadminos.url = "github:vpsfreecz/vpsadminos";
|
||||
|
||||
nix-index-database = {
|
||||
url = "github:Mic92/nix-index-database";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
@ -29,7 +33,7 @@
|
|||
};
|
||||
|
||||
dzgui-nix = {
|
||||
url = "github:lelgenio/dzgui-nix/dzgui-4.1.0";
|
||||
url = "github:lelgenio/dzgui-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
|
@ -58,6 +62,26 @@
|
|||
url = "git+https://git.lelgenio.com/lelgenio/warthunder-leak-counter";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
made-you-look = {
|
||||
url = "git+https://git.lelgenio.com/lelgenio/made-you-look";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
catboy-spinner = {
|
||||
url = "git+https://git.lelgenio.com/lelgenio/catboy-spinner";
|
||||
flake = false;
|
||||
};
|
||||
tomater = {
|
||||
url = "git+https://git.lelgenio.com/lelgenio/tomater";
|
||||
flake = false;
|
||||
};
|
||||
youre-wrong = {
|
||||
url = "git+https://git.lelgenio.com/lelgenio/youre-wrong";
|
||||
flake = false;
|
||||
};
|
||||
hello-fonts = {
|
||||
url = "git+https://git.lelgenio.com/lelgenio/hello-fonts";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
outputs =
|
||||
inputs:
|
||||
|
@ -75,7 +99,9 @@
|
|||
pkgs = import inputs.nixpkgs nixpkgsConfig;
|
||||
lib = inputs.nixpkgs.lib;
|
||||
|
||||
old_overlays = (import ./overlays { inherit inputs; });
|
||||
packages = import ./pkgs { inherit pkgs inputs; };
|
||||
|
||||
old_overlays = (import ./overlays { inherit packages inputs; });
|
||||
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
|
@ -85,6 +111,8 @@
|
|||
{ nixpkgs.pkgs = pkgs; }
|
||||
./system/configuration.nix
|
||||
./system/secrets.nix
|
||||
./system/greetd.nix
|
||||
{ login-manager.greetd.enable = desktop == "sway"; }
|
||||
|
||||
inputs.agenix.nixosModules.default
|
||||
inputs.dzgui-nix.nixosModules.default
|
||||
|
@ -120,16 +148,10 @@
|
|||
./hosts/monolith
|
||||
./system/monolith-gitlab-runner.nix
|
||||
./system/monolith-forgejo-runner.nix
|
||||
./system/nix-serve.nix
|
||||
./system/steam.nix
|
||||
] ++ common_modules;
|
||||
};
|
||||
rainbow = lib.nixosSystem {
|
||||
inherit system specialArgs;
|
||||
modules = [
|
||||
./hosts/rainbow
|
||||
./system/rainbow-gitlab-runner.nix
|
||||
] ++ common_modules;
|
||||
};
|
||||
double-rainbow = lib.nixosSystem {
|
||||
inherit system specialArgs;
|
||||
modules = [
|
||||
|
@ -152,7 +174,10 @@
|
|||
};
|
||||
phantom = lib.nixosSystem {
|
||||
inherit system specialArgs;
|
||||
modules = [ ./hosts/phantom ];
|
||||
modules = [
|
||||
{ nixpkgs.pkgs = pkgs; }
|
||||
./hosts/phantom
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -167,7 +192,7 @@
|
|||
modules = [ ./user/home.nix ];
|
||||
};
|
||||
|
||||
packages.${system} = pkgs;
|
||||
packages.${system} = pkgs // packages;
|
||||
|
||||
formatter.${system} = pkgs.nixfmt-rfc-style;
|
||||
};
|
||||
|
|
|
@ -44,7 +44,7 @@ in
|
|||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
swapDevices = [ { device = "/swapfile"; } ];
|
||||
|
||||
services.udev.extraRules = ''
|
||||
# Force all disks to use mq-deadline scheduler
|
||||
|
|
44
hosts/monolith/amdgpu.nix
Normal file
44
hosts/monolith/amdgpu.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{ pkgs, lib, ... }:
|
||||
let
|
||||
undervoltGpu = pkgs.writeShellScript "undervolt-gpu" ''
|
||||
set -xe
|
||||
cd $1
|
||||
echo "manual" > power_dpm_force_performance_level
|
||||
echo "1" > pp_power_profile_mode
|
||||
test -e pp_od_clk_voltage
|
||||
echo "vo -120" > pp_od_clk_voltage
|
||||
echo "c" > pp_od_clk_voltage
|
||||
'';
|
||||
in
|
||||
{
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelParams = [
|
||||
"amdgpu.dcdebugmask=0x10" # amdgpu undervolting bug
|
||||
"video=DP-1:1920x1080@144"
|
||||
"amdgpu.ppfeaturemask=0xfffd7fff" # enable undervolting
|
||||
];
|
||||
|
||||
systemd.services.amd-fan-control = {
|
||||
script = ''
|
||||
${lib.getExe pkgs.amd-fan-control} /sys/class/drm/card1/device 60 85
|
||||
'';
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
|
||||
hardware.opengl.driSupport = true;
|
||||
# # For 32 bit applications
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
libva
|
||||
libvdpau
|
||||
vaapiVdpau
|
||||
rocm-opencl-icd
|
||||
rocm-opencl-runtime
|
||||
rocmPackages.rocm-smi
|
||||
];
|
||||
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="hwmon", ATTR{name}=="amdgpu", ATTR{power1_cap}="186000000", RUN+="${undervoltGpu} %S%p/device"
|
||||
'';
|
||||
}
|
|
@ -23,7 +23,8 @@ in
|
|||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
./partition.nix
|
||||
./undervolt.nix
|
||||
./amdgpu.nix
|
||||
./factorio-server.nix
|
||||
];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
|
@ -36,35 +37,22 @@ in
|
|||
|
||||
hardware.opentabletdriver.enable = true;
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
|
||||
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelModules = [
|
||||
"kvm-amd"
|
||||
"amdgpu"
|
||||
"zenpower"
|
||||
];
|
||||
boot.kernelParams = [
|
||||
"amdgpu.dcdebugmask=0x10" # amdgpu undervolting bug
|
||||
"video=DP-1:1920x1080@144"
|
||||
];
|
||||
|
||||
systemd.sleep.extraConfig = ''
|
||||
HibernateDelaySec=30s
|
||||
SuspendState=mem
|
||||
'';
|
||||
|
||||
hardware.opengl.driSupport = true;
|
||||
# # For 32 bit applications
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
libva
|
||||
libvdpau
|
||||
vaapiVdpau
|
||||
rocm-opencl-icd
|
||||
rocm-opencl-runtime
|
||||
rocmPackages.rocm-smi
|
||||
];
|
||||
|
||||
fileSystems."/mnt/old" = {
|
||||
device = "/dev/disk/by-label/BTRFS_ROOT";
|
||||
fsType = "btrfs";
|
||||
|
@ -146,10 +134,9 @@ in
|
|||
virtualisation.virtualbox.host.enable = true;
|
||||
|
||||
services.udev.extraRules = ''
|
||||
# Disable using controller touchpad as mouse
|
||||
# https://wiki.archlinux.org/title/Gamepad#libinput
|
||||
ATTRS{name}=="Wireless Controller Touchpad", ENV{LIBINPUT_IGNORE_DEVICE}="1"
|
||||
|
||||
# Fix broken suspend with Logitech USB dongle
|
||||
# `lsusb | grep Logitech` will return "vendor:product"
|
||||
ACTION=="add" SUBSYSTEM=="usb" ATTR{idVendor}=="046d" ATTR{idProduct}=="c547" ATTR{power/wakeup}="disabled"
|
||||
# Force all disks to use mq-deadline scheduler
|
||||
# For some reason "noop" is used by default which is kinda bad when io is saturated
|
||||
ACTION=="add|change", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ATTR{../queue/scheduler}="mq-deadline"
|
||||
|
@ -174,16 +161,4 @@ in
|
|||
# size = (1024 * 16) + (1024 * 2); # RAM size + 2 GB
|
||||
# }
|
||||
# ];
|
||||
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
dates = "04:40";
|
||||
operation = "switch";
|
||||
flags = [
|
||||
"--update-input"
|
||||
"nixpkgs"
|
||||
"--print-build-logs"
|
||||
];
|
||||
flake = "/home/lelgenio/projects/nixos-config#monolith";
|
||||
};
|
||||
}
|
||||
|
|
17
hosts/monolith/factorio-server.nix
Normal file
17
hosts/monolith/factorio-server.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
services.factorio = {
|
||||
enable = true;
|
||||
package = pkgs.factorio-headless; # I override this in ./pkgs
|
||||
public = true;
|
||||
lan = true;
|
||||
openFirewall = true;
|
||||
admins = [ "lelgenio" ];
|
||||
extraSettingsFile = config.age.secrets.factorio-settings.path;
|
||||
};
|
||||
|
||||
age.secrets.factorio-settings = {
|
||||
file = ../../secrets/factorio-settings.age;
|
||||
mode = "777";
|
||||
};
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
undervoltGpu = pkgs.writeShellScript "undervolt-gpu" ''
|
||||
set -xe
|
||||
cd $1
|
||||
echo "manual" > power_dpm_force_performance_level
|
||||
echo "1" > pp_power_profile_mode
|
||||
test -e pp_od_clk_voltage
|
||||
echo "vo -120" > pp_od_clk_voltage
|
||||
echo "c" > pp_od_clk_voltage
|
||||
'';
|
||||
in
|
||||
{
|
||||
boot.kernelParams = [ "amdgpu.ppfeaturemask=0xfffd7fff" ];
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="hwmon", ATTR{name}=="amdgpu", ATTR{power1_cap}="186000000", RUN+="${undervoltGpu} %S%p/device"
|
||||
'';
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
}:
|
||||
{
|
||||
imports = [
|
||||
./vpsadminos.nix
|
||||
inputs.vpsadminos.nixosConfigurations.container
|
||||
inputs.agenix.nixosModules.default
|
||||
../../system/nix.nix
|
||||
./hardware-config.nix
|
||||
|
@ -18,9 +18,9 @@
|
|||
./writefreely.nix
|
||||
./email.nix
|
||||
./forgejo.nix
|
||||
./warthunder-leak-counter.nix
|
||||
./invidious.nix
|
||||
./davi.nix
|
||||
./goofs.nix
|
||||
];
|
||||
|
||||
networking.hostName = "phantom";
|
||||
|
@ -56,6 +56,18 @@
|
|||
identityPaths = [ "/root/.ssh/id_rsa" ];
|
||||
};
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
daemon.settings = {
|
||||
# needed by bitbucket runner ???
|
||||
log-driver = "json-file";
|
||||
log-opts = {
|
||||
max-size = "10m";
|
||||
max-file = "3";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nix.settings = {
|
||||
cores = 1;
|
||||
max-jobs = 1;
|
||||
|
|
|
@ -27,6 +27,9 @@ in
|
|||
ENABLED = true;
|
||||
DEFAULT_ACTIONS_URL = "github";
|
||||
};
|
||||
repository = {
|
||||
ENABLE_PUSH_CREATE_USER = true;
|
||||
};
|
||||
server = {
|
||||
DOMAIN = "git.lelgenio.com";
|
||||
HTTP_PORT = 3000;
|
||||
|
|
46
hosts/phantom/goofs.nix
Normal file
46
hosts/phantom/goofs.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{ inputs, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.warthunder-leak-counter.nixosModules.default
|
||||
inputs.made-you-look.nixosModules.default
|
||||
];
|
||||
|
||||
services.warthunder-leak-counter.enable = true;
|
||||
services.nginx.virtualHosts."warthunder-leak-counter.lelgenio.com" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.warthunder-leak-counter.port}";
|
||||
};
|
||||
};
|
||||
|
||||
services.made-you-look.enable = true;
|
||||
services.nginx.virtualHosts."coolest-thing-ever.lelgenio.com" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.made-you-look.port}";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."catboy-spinner.lelgenio.com" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
root = inputs.catboy-spinner;
|
||||
};
|
||||
services.nginx.virtualHosts."tomater.lelgenio.com" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
root = inputs.tomater;
|
||||
};
|
||||
services.nginx.virtualHosts."youre-wrong.lelgenio.com" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
root = inputs.youre-wrong;
|
||||
};
|
||||
services.nginx.virtualHosts."hello-fonts.lelgenio.com" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
root = inputs.hello-fonts;
|
||||
};
|
||||
}
|
|
@ -5,6 +5,12 @@
|
|||
...
|
||||
}:
|
||||
{
|
||||
fileSystems."/var/lib/syncthing-data" = {
|
||||
device = "172.16.130.7:/nas/5749/syncthinng_data";
|
||||
fsType = "nfs";
|
||||
options = [ "nofail" ];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/swap/swapfile";
|
||||
|
|
|
@ -1,12 +1,40 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# Replace with unstable, since 24.05 does not have sig-helper
|
||||
disabledModules = [ "services/web-apps/invidious.nix" ];
|
||||
imports = [ (inputs.nixpkgs-unstable + "/nixos/modules/services/web-apps/invidious.nix") ];
|
||||
|
||||
services.invidious = {
|
||||
enable = true;
|
||||
domain = "invidious.lelgenio.com";
|
||||
nginx.enable = true;
|
||||
port = 10601;
|
||||
settings.db = {
|
||||
http3-ytproxy.enable = true;
|
||||
sig-helper = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.inv-sig-helper;
|
||||
};
|
||||
# {
|
||||
# "visitor_data": "...",
|
||||
# "po_token": "..."
|
||||
# }
|
||||
extraSettingsFile = config.age.secrets.phantom-invidious-settings.path;
|
||||
settings = {
|
||||
force_resolve = "ipv6";
|
||||
db = {
|
||||
user = "invidious";
|
||||
dbname = "invidious";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
age.secrets.phantom-invidious-settings = {
|
||||
file = ../../secrets/phantom-invidious-settings.age;
|
||||
mode = "666";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
# This file provides compatibility for NixOS to run in a container on vpsAdminOS
|
||||
# hosts.
|
||||
#
|
||||
# If you're experiencing issues, try updating this file to the latest version
|
||||
# from vpsAdminOS repository:
|
||||
#
|
||||
# https://github.com/vpsfreecz/vpsadminos/blob/staging/os/lib/nixos-container/vpsadminos.nix
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
nameservers = [
|
||||
"1.1.1.1"
|
||||
"2606:4700:4700::1111"
|
||||
];
|
||||
in
|
||||
{
|
||||
networking.nameservers = mkDefault nameservers;
|
||||
services.resolved = mkDefault { fallbackDns = nameservers; };
|
||||
networking.dhcpcd.extraConfig = "noipv4ll";
|
||||
|
||||
systemd.services.systemd-sysctl.enable = false;
|
||||
systemd.services.systemd-oomd.enable = false;
|
||||
systemd.sockets."systemd-journald-audit".enable = false;
|
||||
systemd.mounts = [
|
||||
{
|
||||
where = "/sys/kernel/debug";
|
||||
enable = false;
|
||||
}
|
||||
];
|
||||
systemd.services.rpc-gssd.enable = false;
|
||||
|
||||
# Due to our restrictions in /sys, the default systemd-udev-trigger fails
|
||||
# on accessing PCI devices, etc. Override it to match only network devices.
|
||||
# In addition, boot.isContainer prevents systemd-udev-trigger.service from
|
||||
# being enabled at all, so add it explicitly.
|
||||
systemd.additionalUpstreamSystemUnits = [ "systemd-udev-trigger.service" ];
|
||||
systemd.services.systemd-udev-trigger.serviceConfig.ExecStart = [
|
||||
""
|
||||
"-udevadm trigger --subsystem-match=net --action=add"
|
||||
];
|
||||
|
||||
boot.isContainer = true;
|
||||
boot.enableContainers = mkDefault true;
|
||||
boot.loader.initScript.enable = true;
|
||||
boot.specialFileSystems."/run/keys".fsType = mkForce "tmpfs";
|
||||
boot.systemdExecutable = mkDefault "/run/current-system/systemd/lib/systemd/systemd systemd.unified_cgroup_hierarchy=0";
|
||||
|
||||
# Overrides for <nixpkgs/nixos/modules/virtualisation/container-config.nix>
|
||||
documentation.enable = mkOverride 500 true;
|
||||
documentation.nixos.enable = mkOverride 500 true;
|
||||
networking.useHostResolvConf = mkOverride 500 false;
|
||||
services.openssh.startWhenNeeded = mkOverride 500 false;
|
||||
|
||||
# Bring up the network, /ifcfg.{add,del} are supplied by the vpsAdminOS host
|
||||
systemd.services.networking-setup = {
|
||||
description = "Load network configuration provided by the vpsAdminOS host";
|
||||
before = [ "network.target" ];
|
||||
wantedBy = [ "network.target" ];
|
||||
after = [ "network-pre.target" ];
|
||||
path = [ pkgs.iproute2 ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${pkgs.bash}/bin/bash /ifcfg.add";
|
||||
ExecStop = "${pkgs.bash}/bin/bash /ifcfg.del";
|
||||
};
|
||||
unitConfig.ConditionPathExists = "/ifcfg.add";
|
||||
restartIfChanged = false;
|
||||
};
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ inputs.warthunder-leak-counter.nixosModules.default ];
|
||||
|
||||
services.warthunder-leak-counter.enable = true;
|
||||
|
||||
services.nginx.virtualHosts."warthunder-leak-counter.lelgenio.com" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.warthunder-leak-counter.port}";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
let
|
||||
btrfs_options = [
|
||||
"compress=zstd:3"
|
||||
"noatime"
|
||||
"x-systemd.device-timeout=0"
|
||||
];
|
||||
btrfs_ssd = [
|
||||
"ssd"
|
||||
"discard=async"
|
||||
];
|
||||
in
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usb_storage"
|
||||
"usbhid"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ "i915" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/BTRFS_ROOT";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=@nixos" ] ++ btrfs_options ++ btrfs_ssd;
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices = {
|
||||
"main" = {
|
||||
bypassWorkqueues = true;
|
||||
device = "/dev/disk/by-label/CRYPT_ROOT";
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-label/BTRFS_ROOT";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=@home" ] ++ btrfs_options ++ btrfs_ssd;
|
||||
};
|
||||
|
||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||
fileSystems."/boot/efi" = {
|
||||
device = "/dev/disk/by-uuid/DC3B-5753";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
fileSystems."/swap" = {
|
||||
device = "/dev/disk/by-label/BTRFS_ROOT";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=@swap" ] ++ btrfs_ssd;
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/swap/swapfile";
|
||||
size = (1024 * 8);
|
||||
}
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
||||
networking.hostName = "rainbow"; # Define your hostname.
|
||||
}
|
|
@ -1,16 +1,21 @@
|
|||
{ inputs, ... }:
|
||||
{ inputs, packages, ... }:
|
||||
rec {
|
||||
all = [
|
||||
scripts
|
||||
unstable
|
||||
themes
|
||||
(import ../pkgs)
|
||||
new-packages
|
||||
patches
|
||||
lib_extended
|
||||
disko
|
||||
];
|
||||
|
||||
scripts = (import ../scripts);
|
||||
|
||||
unstable = final: prev: {
|
||||
unstable = import inputs.nixpkgs-unstable { inherit (final) system config; };
|
||||
};
|
||||
|
||||
themes = (
|
||||
final: prev: {
|
||||
papirus_red = (final.papirus-icon-theme.override { color = "red"; });
|
||||
|
@ -34,12 +39,28 @@ rec {
|
|||
}
|
||||
);
|
||||
|
||||
new-packages = final: prev: {
|
||||
new-packages = (
|
||||
final: prev:
|
||||
packages
|
||||
// {
|
||||
dhist = inputs.dhist.packages.${prev.system}.dhist;
|
||||
demoji = inputs.demoji.packages.${prev.system}.default;
|
||||
tlauncher = inputs.tlauncher.packages.${prev.system}.tlauncher;
|
||||
wl-crosshair = inputs.wl-crosshair.packages.${prev.system}.default;
|
||||
}
|
||||
);
|
||||
|
||||
patches = (
|
||||
final: prev: {
|
||||
mySway = prev.sway.override {
|
||||
withBaseWrapper = true;
|
||||
withGtkWrapper = true;
|
||||
sway-unwrapped = prev.sway-unwrapped.overrideAttrs (old: {
|
||||
patches = old.patches ++ [ ../patches/sway/fix-hide_cursor-clearing-focus.patch ];
|
||||
});
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
lib_extended = (
|
||||
final: prev: {
|
||||
|
|
19
patches/orchis-fix-warnings.patch
Normal file
19
patches/orchis-fix-warnings.patch
Normal file
|
@ -0,0 +1,19 @@
|
|||
commit 9c516cc61775a88312280f7732328d5fdf7af825
|
||||
Author: lelgenio <lelgenio@disroot.org>
|
||||
Date: Mon May 22 11:30:01 2023 -0300
|
||||
|
||||
fix: limit lowest value for corner-radious at 0
|
||||
|
||||
diff --git a/src/_sass/_variables.scss b/src/_sass/_variables.scss
|
||||
index 9915a22..6e87a4f 100644
|
||||
--- a/src/_sass/_variables.scss
|
||||
+++ b/src/_sass/_variables.scss
|
||||
@@ -24,7 +24,7 @@ $large-icon-size: 32px;
|
||||
//
|
||||
|
||||
$window-radius: $default_corner + $space-size;
|
||||
-$corner-radius: if($compact == 'false', $default_corner, $default_corner - 2px);
|
||||
+$corner-radius: if($compact == 'false', $default_corner, max(0, $default_corner - 2px));
|
||||
$material-radius: $default_corner / 2 + 4px;
|
||||
$menu-radius: $default_corner / 4 + $space-size + 2px;
|
||||
$popup-radius: $default_corner + $space-size + 2px;
|
24
patches/sway/fix-hide_cursor-clearing-focus.patch
Normal file
24
patches/sway/fix-hide_cursor-clearing-focus.patch
Normal file
|
@ -0,0 +1,24 @@
|
|||
From b21dc487ac4bfc086cf295e06b8d8765a99e7266 Mon Sep 17 00:00:00 2001
|
||||
From: lelgenio <lelgenio@disroot.org>
|
||||
Date: Thu, 24 Jun 2021 22:36:10 -0300
|
||||
Subject: [PATCH] Fix #6297
|
||||
|
||||
This makes it so that `seat hide_cursor` no longer clears cursor focus when hidding.
|
||||
|
||||
Clearing focus casuses problems whenever keyboard and mouse are to be used in conjunction.
|
||||
---
|
||||
sway/input/cursor.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
|
||||
index 96b5b93514..99fe3b4e3f 100644
|
||||
--- a/sway/input/cursor.c
|
||||
+++ b/sway/input/cursor.c
|
||||
@@ -236,7 +236,6 @@ void cursor_update_image(struct sway_cursor *cursor,
|
||||
static void cursor_hide(struct sway_cursor *cursor) {
|
||||
wlr_cursor_set_image(cursor->cursor, NULL, 0, 0, 0, 0, 0, 0);
|
||||
cursor->hidden = true;
|
||||
- wlr_seat_pointer_notify_clear_focus(cursor->seat->wlr_seat);
|
||||
}
|
||||
|
||||
static int hide_notify(void *data) {
|
38
pkgs/cargo-checkmate.nix
Normal file
38
pkgs/cargo-checkmate.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
pkg-config,
|
||||
openssl,
|
||||
zlib,
|
||||
stdenv,
|
||||
Security ? null,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "cargo-checkmate";
|
||||
version = "0.1.10";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cargo-checkmate";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-I8l/r26cDdimjgy/+IsasF4iHX09UGjVj0Yf6ScI3wQ=";
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-hOB84u55ishahIFSqBnqccqH3OlC9J8mCYzsd23jTyA=";
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Check all the things.";
|
||||
longDescriptin = ''
|
||||
Perform a series of useful checks out of the box. cargo-checkmate
|
||||
ensures your project builds, tests pass, has good format, doesn't
|
||||
have dependencies with known vulnerabilities, and so on.
|
||||
'';
|
||||
homepage = "https://github.com/cargo-checkmate/cargo-checkmate";
|
||||
license = with licenses; [ mit ];
|
||||
};
|
||||
}
|
|
@ -1,7 +1,14 @@
|
|||
final: prev:
|
||||
let
|
||||
inherit (final) callPackage;
|
||||
in
|
||||
{
|
||||
draw-on-your-screen2 = callPackage ./draw-on-your-screen2 { };
|
||||
# Custom packages, that can be defined similarly to ones from nixpkgs
|
||||
# You can build them using 'nix build .#example' or (legacy) 'nix-build -A example'
|
||||
|
||||
{ pkgs, inputs }:
|
||||
rec {
|
||||
cargo-checkmate = pkgs.callPackage ./cargo-checkmate.nix { };
|
||||
lipsum = pkgs.callPackage ./lipsum.nix { };
|
||||
emmet-cli = pkgs.callPackage ./emmet-cli.nix { };
|
||||
material-wifi-icons = pkgs.callPackage ./material-wifi-icons.nix { };
|
||||
gnome-pass-search-provider = pkgs.callPackage ./gnome-pass-search-provider.nix { };
|
||||
factorio-headless = pkgs.callPackage ./factorio-headless {
|
||||
inherit (pkgs.unstable) factorio-headless;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
{ fetchFromGitHub, stdenv }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "draw-on-your-screen";
|
||||
version = "unstable-2024-06-18";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "zhrexl";
|
||||
repo = "DrawOnYourScreen2";
|
||||
rev = "9b5c6633a1c2b8c5b35bac45276ad1302542ab9b";
|
||||
hash = "sha256-J4ljx3HBe+86PGOIIgabtj8AuUAf88/bpTfRXowUng4=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/gnome-shell/extensions/draw-on-your-screen2@zhrexl.github.com
|
||||
cp -r ./* $out/share/gnome-shell/extensions/draw-on-your-screen2@zhrexl.github.com
|
||||
|
||||
mkdir -p $out/share/glib-2.0/
|
||||
cp -r ./schemas/ $out/share/glib-2.0/
|
||||
'';
|
||||
}
|
27
pkgs/emmet-cli.nix
Normal file
27
pkgs/emmet-cli.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
lib,
|
||||
buildNpmPackage,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
buildNpmPackage rec {
|
||||
pname = "emmet-cli";
|
||||
version = "0.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Delapouite";
|
||||
repo = "emmet-cli";
|
||||
rev = "407b0e8c59f65f205967d6be71105e0bd2001d62";
|
||||
hash = "sha256-8lDgD1eIc2r5aB2baaiHKbkFdAxErX5p96MNqztR9rg=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-Utgk/Cw83ffGr2/4aNkp3n3wSOojLZLA7OR+OakYBC0=";
|
||||
|
||||
dontNpmBuild = true;
|
||||
|
||||
meta = {
|
||||
description = "Emmet command line interface";
|
||||
homepage = "https://github.com/Delapouite/emmet-cli";
|
||||
mainProgram = "emmet";
|
||||
};
|
||||
}
|
10
pkgs/factorio-headless/default.nix
Normal file
10
pkgs/factorio-headless/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ factorio-headless, pkgs }:
|
||||
|
||||
factorio-headless.overrideAttrs (_: rec {
|
||||
version = "2.0.13";
|
||||
src = pkgs.fetchurl {
|
||||
name = "factorio_headless_x64-${version}.tar.xz";
|
||||
url = "https://www.factorio.com/get-download/${version}/headless/linux64";
|
||||
hash = "sha256-J7NpAaOeWTrfKEGMAoYULGx6n4PRVpY8c2m9QFolx9E=";
|
||||
};
|
||||
})
|
14
pkgs/factorio-headless/update.sh
Executable file
14
pkgs/factorio-headless/update.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -xe
|
||||
|
||||
cd "$(dirname $0)"
|
||||
|
||||
current_version="$(rg '^.*?version\s*=\s*"(.+)".*?$' --replace '$1' ./default.nix)"
|
||||
current_hash="$(rg '^.*?hash\s*=\s*"(.+)".*?$' --replace '$1' ./default.nix)"
|
||||
|
||||
new_version="$(curl https://factorio.com/api/latest-releases | jq -r .stable.headless)"
|
||||
new_hash="$(nix-hash --to-sri --type sha256 $(nix-prefetch-url --type sha256 https://www.factorio.com/get-download/${new_version}/headless/linux64))"
|
||||
|
||||
sd "$current_version" "$new_version" ./default.nix
|
||||
sd "$current_hash" "$new_hash" ./default.nix
|
64
pkgs/gnome-pass-search-provider.nix
Normal file
64
pkgs/gnome-pass-search-provider.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
python3Packages,
|
||||
wrapGAppsHook,
|
||||
gtk3,
|
||||
gobject-introspection,
|
||||
gnome,
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (python3Packages)
|
||||
dbus-python
|
||||
pygobject3
|
||||
fuzzywuzzy
|
||||
levenshtein
|
||||
;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gnome-pass-search-provider";
|
||||
version = "1.4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jle64";
|
||||
repo = "gnome-pass-search-provider";
|
||||
rev = version;
|
||||
hash = "sha256-PDR8fbDoT8IkHiTopQp0zd4DQg7JlacA6NdKYKYmrWw=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
python3Packages.wrapPython
|
||||
wrapGAppsHook
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
dbus-python
|
||||
pygobject3
|
||||
fuzzywuzzy
|
||||
levenshtein
|
||||
|
||||
gtk3
|
||||
gobject-introspection
|
||||
];
|
||||
|
||||
env = {
|
||||
LIBDIR = builtins.placeholder "out" + "/lib";
|
||||
DATADIR = builtins.placeholder "out" + "/share";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace conf/org.gnome.Pass.SearchProvider.service.{dbus,systemd} \
|
||||
--replace-fail "/usr/lib" "$LIBDIR"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
bash ./install.sh
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
makeWrapperArgs=( "''${gappsWrapperArgs[@]}" )
|
||||
wrapPythonProgramsIn "$out/lib" "$out $propagatedBuildInputs"
|
||||
'';
|
||||
}
|
32
pkgs/lipsum.nix
Normal file
32
pkgs/lipsum.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
pkg-config,
|
||||
vala,
|
||||
wrapGAppsHook,
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "lipsum";
|
||||
version = "0.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hannenz";
|
||||
repo = "lipsum";
|
||||
rev = "0fb31e6ede10fbd78d7652f5fb21670cddd8e3ed";
|
||||
hash = "sha256-a6uv0tJulN9cAGWxvQr8B0PUJEY8Rx4e759xzS66Xlo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
vala
|
||||
wrapGAppsHook
|
||||
];
|
||||
|
||||
makeFlags = [ "PRG=${pname}" ];
|
||||
|
||||
installPhase = ''
|
||||
install -Dm 755 "$pname" "$out/bin/$pname"
|
||||
install -Dm 755 "./data/de.hannenz.lipsum.gschema.xml" "$out/share/glib-2.0/schemas/de.hannenz.lipsum.gschema.xml"
|
||||
glib-compile-schemas "$out/share/glib-2.0/schemas/"
|
||||
'';
|
||||
}
|
16
pkgs/material-wifi-icons.nix
Normal file
16
pkgs/material-wifi-icons.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ stdenv, fetchFromGitHub }:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "material-wifi-icons";
|
||||
version = "0.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dcousens";
|
||||
repo = "material-wifi-icons";
|
||||
rev = "2daf6b3d96d65beb2a3e37a9a53556aab3826d97";
|
||||
hash = "sha256-KykU5J7SdpBDG+6rkD//XeHd+6pK3qabe+88RduhwKc=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
install -D material-wifi.ttf $out/share/fonts/${pname}
|
||||
'';
|
||||
}
|
12
scripts/_diffr
Executable file
12
scripts/_diffr
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
exec diffr \
|
||||
--colors 'refine-added:foreground:green:underline' \
|
||||
--colors 'refine-added:background:none' \
|
||||
--colors 'refine-removed:foreground:red:underline' \
|
||||
--colors 'refine-removed:background:none' \
|
||||
--colors 'added:foreground:green' \
|
||||
--colors 'added:background:none' \
|
||||
--colors 'removed:foreground:red' \
|
||||
--colors 'removed:background:none' \
|
||||
"$@"
|
30
scripts/_gpg-unlock.nix
Normal file
30
scripts/_gpg-unlock.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ pkgs, ... }:
|
||||
pkgs.writeShellScriptBin "_gpg-unlock" ''
|
||||
${pkgs.gnupg}/bin/gpg-connect-agent reloadagent /bye
|
||||
|
||||
set -e
|
||||
|
||||
test -f "$HOME/.config/.preset-password" || {
|
||||
${pkgs.libnotify}/bin/notify-send "No preset password found"
|
||||
exit 0;
|
||||
}
|
||||
|
||||
get_keygrip() {
|
||||
${pkgs.gnupg}/bin/gpg --list-secret-keys --with-keygrip |
|
||||
${pkgs.gawk}/bin/awk '
|
||||
/^ssb/ {
|
||||
ssb=1
|
||||
}
|
||||
/Keygrip/{
|
||||
if (ssb) print $3
|
||||
}'
|
||||
}
|
||||
|
||||
keygrip=$(get_keygrip)
|
||||
|
||||
test -n "$keygrip" || exit 0
|
||||
|
||||
${pkgs.coreutils}/bin/cat "$HOME/.config/.preset-password" |
|
||||
${pkgs.coreutils}/bin/base64 -d |
|
||||
${pkgs.gnupg}/libexec/gpg-preset-passphrase --preset "$keygrip"
|
||||
''
|
11
scripts/_sway_idle_toggle
Executable file
11
scripts/_sway_idle_toggle
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
swayidlectl() {
|
||||
systemctl --user $1 swayidle.service
|
||||
}
|
||||
|
||||
if swayidlectl status > /dev/null; then
|
||||
swayidlectl stop
|
||||
else
|
||||
swayidlectl start
|
||||
fi
|
10
scripts/_thunar-terminal
Executable file
10
scripts/_thunar-terminal
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
for path
|
||||
do
|
||||
test -f "$path" &&
|
||||
path=$(dirname "$path")
|
||||
|
||||
cd "$path"
|
||||
terminal
|
||||
done
|
50
scripts/amd-fan-control
Executable file
50
scripts/amd-fan-control
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
DEVICE="$1" # eg: /sys/class/drm/card1/device
|
||||
HWMON=$(echo "$DEVICE"/hwmon/hwmon*)
|
||||
|
||||
exit() {
|
||||
echo "Setting controll to auto" >&2
|
||||
echo 2 > "$HWMON/pwm1_enable"
|
||||
}
|
||||
|
||||
trap exit EXIT INT
|
||||
|
||||
bail() {
|
||||
echo "Error: $@" >&2
|
||||
echo "Exiting..." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ! [ -d $HWMON ]; then
|
||||
bail "Invalid HWMON"
|
||||
fi
|
||||
|
||||
TEMP_INPUT="$HWMON/temp2_input"
|
||||
|
||||
if ! [ -f $TEMP_INPUT ]; then
|
||||
bail "Invalid TEMP_INPUT"
|
||||
fi
|
||||
|
||||
MIN="$2"
|
||||
MAX="$3"
|
||||
|
||||
echo "Running..." >&2
|
||||
while true; do
|
||||
TEMPERATURE_RAW=$(cat "$TEMP_INPUT")
|
||||
TEMPERATURE="$(( $TEMPERATURE_RAW / 1000 ))"
|
||||
# Remap from a number between 60_000..90_000 to 0..255
|
||||
PWM=$(( ($TEMPERATURE - $MIN) * 255 / ($MAX - $MIN) ))
|
||||
|
||||
if [ "$PWM" -gt 255 ]; then
|
||||
PWM=255
|
||||
elif [ "$PWM" -lt 0 ]; then
|
||||
PWM=0
|
||||
fi
|
||||
|
||||
echo 1 > "$HWMON/pwm1_enable"
|
||||
echo "$PWM" > "$HWMON/pwm1"
|
||||
sleep .1s
|
||||
done
|
53
scripts/bmenu
Executable file
53
scripts/bmenu
Executable file
|
@ -0,0 +1,53 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
# wrapper around bemenu
|
||||
# bmenu * - use as dmenu, -p for custom prompt (man bemenu)
|
||||
# bmenu run - select from .desktop files and run it
|
||||
# bmenu start - internal option
|
||||
|
||||
if test "$argv[1]" = "run"
|
||||
test -n "$argv[2]" && set t "$argv[2]" || set t "terminal"
|
||||
|
||||
test -n "$i3SOCK" && set wrapper 'i3-msg exec --'
|
||||
test -n "$SWAYSOCK" && set wrapper 'swaymsg exec --'
|
||||
|
||||
exec j4-dmenu-desktop \
|
||||
--dmenu="bmenu start -p Iniciar:" \
|
||||
--term "$t" \
|
||||
--wrapper="$wrapper" \
|
||||
--no-generic
|
||||
end
|
||||
|
||||
if test -n "$SWAYSOCK"
|
||||
swaymsg -t get_outputs |
|
||||
jq -r 'map(.focused)|reverse|index(true)' |
|
||||
read focused_output
|
||||
|
||||
test -n "$focused_output"
|
||||
and set focused_output "-m $focused_output"
|
||||
end
|
||||
|
||||
set -l config "$HOME/.config/bmenu.conf"
|
||||
if test -f $config
|
||||
source $config
|
||||
end
|
||||
|
||||
exec dhist wrap -- bemenu \
|
||||
$focused_output\
|
||||
--ignorecase\
|
||||
--border 2\
|
||||
--center\
|
||||
--width-factor 0.5\
|
||||
--no-overlap\
|
||||
--list 30\
|
||||
--prefix '>'\
|
||||
--bdr "$bdr"\
|
||||
--fn "$fn"\
|
||||
--tb "$tb" --tf "$tf" \
|
||||
--fb "$fb" --ff "$ff" \
|
||||
--nb "$nb" --nf "$nf" \
|
||||
--ab "$ab" --af "$af" \
|
||||
--hb "$hb" --hf "$hf" \
|
||||
$argv
|
||||
|
||||
# vim: ft=fish
|
47
scripts/br
Executable file
47
scripts/br
Executable file
|
@ -0,0 +1,47 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e -u
|
||||
|
||||
end(){
|
||||
rm -r -- "$(dirname -- "$namebase")"
|
||||
[ $# -ne 0 ] && echo $@ >&2
|
||||
exit $#
|
||||
}
|
||||
|
||||
if [ $# -ne 0 ] ; then
|
||||
for i in "$@" ; do
|
||||
printf "%s\n" "$i"
|
||||
done | "$0"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
namebase="$(mktemp -d)/blkrn"
|
||||
echo '# Modify filenames without removing any line, quitting aborts' \
|
||||
> "$namebase.2"
|
||||
tee -- "$namebase.1" >> "$namebase.2"
|
||||
exec </dev/tty >/dev/tty ||
|
||||
end 'Interactive terminal needed'
|
||||
|
||||
"$EDITOR" -- "$namebase.2"
|
||||
sed -i -- '1d' "$namebase.2"
|
||||
|
||||
! diff -- "$namebase.1" "$namebase.2" &> /dev/null || end "no changes"
|
||||
[ `wc -l < "$namebase.1"` -eq `wc -l < "$namebase.2"` ] || end "Wrong number of lines"
|
||||
|
||||
{
|
||||
echo '# Please review/modify this script or empty it to do nothing'
|
||||
echo 'run(){'
|
||||
echo ' mkdir -p "$(dirname "$2")"'
|
||||
echo ' mv -T -- "$1" "$2"'
|
||||
echo '}'
|
||||
while read -r l1 <&3 && read -r l2 <&4; do
|
||||
[ "$l1" = "$l2" ] || printf "%s\n%s\n" "$l1" "$l2"
|
||||
done 3<"$namebase.1" 4<"$namebase.2" |
|
||||
sed 's/\([\\"$`]\)/\\\1/g;s/^.*$/"&"/' |
|
||||
xargs -d"\n" -L2 echo 'run'
|
||||
} > "$namebase.sh"
|
||||
|
||||
"$EDITOR" -- "$namebase.sh"
|
||||
sh -e -- "$namebase.sh"
|
||||
|
||||
end # exit normaly
|
10
scripts/color_picker
Executable file
10
scripts/color_picker
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -xe
|
||||
|
||||
grim -g "$(slurp -b aabbcc00 -p)" - |
|
||||
convert - txt:- |
|
||||
grep -oE '#[0-9A-Fa-f]{6}' |
|
||||
wl-copy -n
|
||||
|
||||
notify-send "$(wl-paste)" "Copied to clipboard"
|
38
scripts/controller-battery
Executable file
38
scripts/controller-battery
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
CONTROLLER=$(find /sys/class/power_supply -maxdepth 1 -name '*controller*' || true)
|
||||
|
||||
if test -z "$CONTROLLER"; then
|
||||
echo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
CAPACITY=$(cat "$CONTROLLER/capacity")
|
||||
|
||||
echo -n ''
|
||||
|
||||
if test "$CAPACITY" -ge 90; then
|
||||
echo ''
|
||||
elif test "$CAPACITY" -ge 90; then
|
||||
echo ''
|
||||
elif test "$CAPACITY" -ge 80; then
|
||||
echo ''
|
||||
elif test "$CAPACITY" -ge 70; then
|
||||
echo ''
|
||||
elif test "$CAPACITY" -ge 60; then
|
||||
echo ''
|
||||
elif test "$CAPACITY" -ge 50; then
|
||||
echo ''
|
||||
elif test "$CAPACITY" -ge 40; then
|
||||
echo ''
|
||||
elif test "$CAPACITY" -ge 30; then
|
||||
echo ''
|
||||
elif test "$CAPACITY" -ge 20; then
|
||||
echo ''
|
||||
elif test "$CAPACITY" -ge 10; then
|
||||
echo ''
|
||||
else
|
||||
echo ''
|
||||
fi
|
|
@ -18,17 +18,125 @@
|
|||
--suffix PATH : ${lib.makeBinPath runtimeInputs}
|
||||
'';
|
||||
createScripts = lib.mapAttrs (name: deps: wrapScript name ./${name} deps);
|
||||
|
||||
myPass = final.pass.withExtensions (ex: with ex; [ pass-otp ]);
|
||||
in
|
||||
with final;
|
||||
createScripts {
|
||||
amd-fan-control = [ bash ];
|
||||
br = [ ];
|
||||
bmenu = [
|
||||
bemenu
|
||||
dhist
|
||||
fish
|
||||
j4-dmenu-desktop
|
||||
jq
|
||||
sway
|
||||
];
|
||||
down_meme = [
|
||||
wl-clipboard
|
||||
yt-dlp
|
||||
libnotify
|
||||
];
|
||||
wl-copy-file = [
|
||||
wl-clipboard
|
||||
fish
|
||||
];
|
||||
_diffr = [ diffr ];
|
||||
_thunar-terminal = [ terminal ];
|
||||
_sway_idle_toggle = [ swayidle ];
|
||||
kak-pager = [
|
||||
fish
|
||||
_diffr
|
||||
];
|
||||
kak-man-pager = [ kak-pager ];
|
||||
helix-pager = [
|
||||
fish
|
||||
_diffr
|
||||
];
|
||||
helix-man-pager = [ helix-pager ];
|
||||
musmenu = [
|
||||
mpc-cli
|
||||
wdmenu
|
||||
trash-cli
|
||||
xdg-user-dirs
|
||||
libnotify
|
||||
sd
|
||||
wl-clipboard
|
||||
];
|
||||
showkeys = [ ]; # This will not work unless programs.wshowkeys is enabled systemwide
|
||||
terminal = [ alacritty ];
|
||||
playerctl-status = [ playerctl ];
|
||||
pass-export = [
|
||||
pass2csv
|
||||
gnupg
|
||||
sd
|
||||
];
|
||||
wpass = [
|
||||
wdmenu
|
||||
fd
|
||||
myPass
|
||||
sd
|
||||
wl-clipboard
|
||||
wtype
|
||||
];
|
||||
screenshotsh = [
|
||||
capitaine-cursors
|
||||
grim
|
||||
slurp
|
||||
jq
|
||||
sway
|
||||
wl-clipboard
|
||||
xdg-user-dirs
|
||||
];
|
||||
volumesh = [
|
||||
pulseaudio
|
||||
libnotify
|
||||
];
|
||||
pulse_sink = [
|
||||
pulseaudio
|
||||
pamixer
|
||||
wdmenu
|
||||
];
|
||||
color_picker = [
|
||||
grim
|
||||
slurp
|
||||
wl-clipboard
|
||||
libnotify
|
||||
imagemagick
|
||||
];
|
||||
dzadd = [
|
||||
procps
|
||||
libnotify
|
||||
wdmenu
|
||||
jq
|
||||
mpv
|
||||
pqiv
|
||||
python3Packages.deemix
|
||||
mpc-cli
|
||||
mpdDup
|
||||
];
|
||||
mpdDup = [
|
||||
mpc-cli
|
||||
perl
|
||||
];
|
||||
readQrCode = [
|
||||
grim
|
||||
zbar
|
||||
wl-clipboard
|
||||
];
|
||||
pint-fmt = [ ];
|
||||
powerplay-led-idle = [
|
||||
bash
|
||||
libinput
|
||||
libratbag
|
||||
];
|
||||
vrr-fullscreen = [ ];
|
||||
controller-battery = [ ];
|
||||
}
|
||||
// lib.mapAttrs importScript {
|
||||
wdmenu = ./wdmenu.nix;
|
||||
wlauncher = ./wlauncher.nix;
|
||||
_gpg-unlock = ./_gpg-unlock.nix;
|
||||
}
|
||||
)
|
||||
|
|
19
scripts/down_meme
Executable file
19
scripts/down_meme
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
DIR=$(mktemp -d)
|
||||
|
||||
cd "$DIR"
|
||||
|
||||
yt-dlp --merge-output-format mp4 "$(wl-paste)"
|
||||
|
||||
FILENAME="$(ls | head -n1)"
|
||||
|
||||
mkdir -p "$HOME/Downloads/Memes"
|
||||
|
||||
cp "$FILENAME" "$HOME/Downloads/Memes/$FILENAME"
|
||||
|
||||
wl-copy-file "$HOME/Downloads/Memes/$FILENAME"
|
||||
|
||||
notify-send "Meme downloaded" "$FILENAME"
|
||||
|
||||
rm -rf "$DIR"
|
176
scripts/dzadd
Executable file
176
scripts/dzadd
Executable file
|
@ -0,0 +1,176 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
tmpf=$(mktemp /tmp/dzadd.XXXXXX)
|
||||
|
||||
clean() {
|
||||
test "$?" -eq "0" ||
|
||||
notify-send "Exiting with error"
|
||||
|
||||
set +e
|
||||
kill "$mpvPid"
|
||||
rm -f "$tmpf"
|
||||
}
|
||||
|
||||
trap clean EXIT
|
||||
|
||||
main() {
|
||||
sType=$(printf "Track\nAlbum\nArtist" | wdmenu | tr '[:upper:]' '[:lower:]')
|
||||
test -n "$sType" || exit 1
|
||||
|
||||
query=$(echo -n | wdmenu | sed 's/[^ a-z0-9]//g;s/ /+/g')
|
||||
test -n "$query" || exit 1
|
||||
|
||||
case "$sType" in
|
||||
track)
|
||||
deezer_category="track"
|
||||
jqFilter='.data[]| "\(.title) - \(.album.title) - \(.artist.name) |\(.id)"'
|
||||
;;
|
||||
album)
|
||||
deezer_category="album"
|
||||
jqFilter='.data[]| "\(.nb_tracks) - \(.title) - \(.artist.name) |\(.id)"'
|
||||
;;
|
||||
artist)
|
||||
deezer_category="artist"
|
||||
jqFilter='.data[]| "\(.nb_fan) - \(.name) |\(.id)"'
|
||||
;;
|
||||
top50)
|
||||
deezer_category="artist"
|
||||
jqFilter='.data[]| "\(.nb_fan) - \(.name) |\(.id)"'
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
curl -m30 -s "api.deezer.com/search/${deezer_category}?q=${query}" |
|
||||
sed 's/|//g' |
|
||||
jq -r "$jqFilter" >"$tmpf"
|
||||
|
||||
pick_song
|
||||
}
|
||||
|
||||
pick_song() {
|
||||
choice=$(cat "$tmpf" | cut -d\| -f1 | wdmenu)
|
||||
choice=$(grep "$choice" "$tmpf" | head -n 1)
|
||||
choiceId=$(printf "%s" "$choice" | cut -d\| -f2)
|
||||
|
||||
case "$sType" in
|
||||
top50)
|
||||
choiceUrl="http://deezer.com/${deezer_category}/${choiceId}/top?=limit=50"
|
||||
;;
|
||||
*)
|
||||
choiceUrl="http://deezer.com/${deezer_category}/${choiceId}"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
pick_action "$choiceUrl"
|
||||
}
|
||||
|
||||
pick_action() {
|
||||
|
||||
choiceUrl="$1"
|
||||
|
||||
COMMON_CHOISES="View Image\nDownload\nCopy URL\nAnother"
|
||||
choice=$(printf "Preview\n${COMMON_CHOISES}" | wdmenu)
|
||||
|
||||
case "$choice" in
|
||||
|
||||
"Preview")
|
||||
common_preview
|
||||
;;
|
||||
|
||||
"View Image")
|
||||
common_art
|
||||
;;
|
||||
|
||||
"Download")
|
||||
common_download
|
||||
;;
|
||||
|
||||
"Copy URL")
|
||||
wl-copy
|
||||
;;
|
||||
|
||||
"Another")
|
||||
pick_song
|
||||
;;
|
||||
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
common_preview() {
|
||||
|
||||
case "$sType" in
|
||||
track)
|
||||
;;
|
||||
album)
|
||||
preview_suffix=tracks
|
||||
;;
|
||||
artist)
|
||||
preview_suffix=top
|
||||
;;
|
||||
top50)
|
||||
preview_suffix=top
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
choicePreview=$(
|
||||
curl -m30 -s "http://api.deezer.com/${deezer_category}/${choiceId}/${preview_suffix}" |
|
||||
jq -r '.preview, .data[0].preview | select(. != null)'
|
||||
)
|
||||
|
||||
mpv --quiet --volume=50 --no-resume-playback "$choicePreview" &
|
||||
mpvPid="$!"
|
||||
choice=$(printf "$COMMON_CHOISES" | wdmenu -p 'Download?')
|
||||
kill "$mpvPid" || true
|
||||
}
|
||||
|
||||
common_art() {
|
||||
|
||||
case "$sType" in
|
||||
track)
|
||||
image_filter='.album.cover_big'
|
||||
;;
|
||||
album)
|
||||
image_filter='.cover_big'
|
||||
;;
|
||||
artist)
|
||||
image_filter='.picture_big'
|
||||
;;
|
||||
top50)
|
||||
image_filter='.picture_big'
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
curl -m30 -s "api.deezer.com/${deezer_category}/${choiceId}" |
|
||||
jq -r "$image_filter" |
|
||||
xargs curl -m30 -s |
|
||||
pqiv -
|
||||
|
||||
pick_action
|
||||
}
|
||||
|
||||
common_download() {
|
||||
notify-send "Starting Download"
|
||||
deemix "$choiceUrl" </dev/null &&
|
||||
notify-send "Download Successful" ||
|
||||
notify-send "Download Failed"
|
||||
mpc add /
|
||||
mpdDup
|
||||
}
|
||||
|
||||
main
|
3
scripts/helix-man-pager
Executable file
3
scripts/helix-man-pager
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
col -b -x | hx
|
28
scripts/helix-pager
Executable file
28
scripts/helix-pager
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
if test (count $argv) -ne 0
|
||||
for i in $argv
|
||||
cat "$i"
|
||||
end | eval (status filename)
|
||||
exit 0
|
||||
end
|
||||
|
||||
set term_line_count (tput lines)
|
||||
|
||||
while read line
|
||||
set -a input_lines "$line"
|
||||
|
||||
set input_line_count (printf "%s\n" $input_lines | wc -l)
|
||||
|
||||
if test "$term_line_count" -lt "$input_line_count"
|
||||
begin
|
||||
printf "%s\n" $input_lines
|
||||
cat
|
||||
end | hx
|
||||
|
||||
exit 0
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
printf "%s\n" $input_lines
|
8
scripts/kak-man-pager
Executable file
8
scripts/kak-man-pager
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
kak -e '
|
||||
map global normal q :q<ret>;
|
||||
set buffer filetype man;
|
||||
rmhl global/number-lines;
|
||||
set global scrolloff 10,0
|
||||
'
|
33
scripts/kak-pager
Executable file
33
scripts/kak-pager
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
if test (count $argv) -ne 0
|
||||
for i in $argv
|
||||
cat "$i"
|
||||
end | eval (status filename)
|
||||
exit 0
|
||||
end
|
||||
|
||||
set term_line_count (tput lines)
|
||||
|
||||
while read line
|
||||
set -a input_lines "$line"
|
||||
|
||||
set input_line_count (printf "%s\n" $input_lines | wc -l)
|
||||
|
||||
if test "$term_line_count" -lt "$input_line_count"
|
||||
begin
|
||||
printf "%s\n" $input_lines
|
||||
cat
|
||||
end | kak -e '
|
||||
exec <a-o>
|
||||
map global normal q :q<ret>;
|
||||
rmhl global/number-lines;
|
||||
set global scrolloff 10,0;
|
||||
'
|
||||
|
||||
exit 0
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
printf "%s\n" $input_lines
|
5
scripts/mpdDup
Executable file
5
scripts/mpdDup
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
mpc playlist -f '%position%\t%file%' |
|
||||
sort -k 2 |
|
||||
perl -ne 'm/(.*)\t(.*)/; print "$1\n" if $2 eq $prev; $prev=$2' |
|
||||
mpc del
|
111
scripts/musmenu
Executable file
111
scripts/musmenu
Executable file
|
@ -0,0 +1,111 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
menu=wdmenu
|
||||
|
||||
search() {
|
||||
tabs 8
|
||||
|
||||
mpc playlist --format '%artist% : %title%@pos:%position%' |
|
||||
sed '/^ : \t/d'|
|
||||
column -ts"@" |
|
||||
$menu |
|
||||
grep -o 'pos:.*' |
|
||||
cut -d: -f2 |
|
||||
xargs -r mpc play
|
||||
}
|
||||
|
||||
get_current() {
|
||||
music_root=$(xdg-user-dir MUSIC || echo "$HOME/Music")
|
||||
current_file=$(mpc current -f %file%)
|
||||
|
||||
echo "${music_root}/${current_file}"
|
||||
}
|
||||
|
||||
delete() {
|
||||
current=$(get_current)
|
||||
answer=$(printf "nothing\n$current" | $menu -p"delete?")
|
||||
if test "$answer" = "$current"; then
|
||||
trash "$answer"
|
||||
mpc --quiet next
|
||||
mpc --quiet update
|
||||
|
||||
path=$(echo $answer | sd "$HOME" '~')
|
||||
notify-send "Removed Music" "$path"
|
||||
fi
|
||||
}
|
||||
|
||||
yank() {
|
||||
current=$(get_current)
|
||||
|
||||
# Some programs need you to pass a path, not the contents
|
||||
wl-copy --type 'text/uri-list' "file:///${current}"
|
||||
|
||||
notify-send "Yanked Music" "$(echo $current | sd "$HOME" "~")"
|
||||
}
|
||||
|
||||
padd() {
|
||||
get_current
|
||||
cd "$music_root"
|
||||
choice=$(fd -E '*.lrc' -E '*.m3u8' | sort | $menu -p "Add Songs(Use Ctrl):")
|
||||
mpc add "$choice" &&
|
||||
notify-send "Added Music" "$(echo $choice | sd "$HOME" "~")" ||
|
||||
notify-send "Failed to Add Music" "$(echo $choice | sd "$HOME" "~")"
|
||||
mpdDup
|
||||
}
|
||||
|
||||
pclear() {
|
||||
mpc clear &&
|
||||
notify-send "Cleared Playlist" ||
|
||||
notify-send "Failed Clear Playlist"
|
||||
}
|
||||
|
||||
psave() {
|
||||
name=$(mpc playlist | $menu -p 'Save Playlist(Use Shift): ')
|
||||
|
||||
mpc save "$name" &&
|
||||
notify-send "Created playlist" "$name" ||
|
||||
notify-send "Failed to Create Playlist" "$name"
|
||||
}
|
||||
|
||||
pload() {
|
||||
name=$(mpc lsplaylists | $menu -p 'Load Playlist: ')
|
||||
|
||||
mpc clear
|
||||
mpc load "$name" &&
|
||||
notify-send "Loaded playlist" "$name" ||
|
||||
notify-send "Failed to Load Playlist" "$name"
|
||||
}
|
||||
|
||||
pdelete() {
|
||||
name=$(mpc lsplaylists | $menu -p 'Delete Playlist: ')
|
||||
|
||||
mpc delete "$name" &&
|
||||
notify-send "Deleted playlist" "$name" ||
|
||||
notify-send "Failed to Delete Playlist" "$name"
|
||||
}
|
||||
|
||||
usage() {
|
||||
cmdname=$(basename "$0")
|
||||
echo "Commands:"
|
||||
echo " $cmdname search -- Search and play songs."
|
||||
echo " $cmdname delete -- Prompt to delete the current song."
|
||||
echo " $cmdname yank -- Copy current music to clipboard."
|
||||
echo "Playlist Commands:"
|
||||
echo " $cmdname padd -- Add song"
|
||||
echo " $cmdname pclear -- Clear"
|
||||
echo " $cmdname psave -- Save"
|
||||
echo " $cmdname pload -- Load"
|
||||
echo " $cmdname pdelete -- Delete"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
delete | search | yank | padd | pclear | psave | pload | pdelete)
|
||||
"$1"
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
test -n "$1"
|
||||
echo "Unreconized option: $1"
|
||||
;;
|
||||
esac
|
13
scripts/pass-export
Executable file
13
scripts/pass-export
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
if test -z "$PASSWORD_STORE_DIR"; then
|
||||
PASSWORD_STORE_DIR="$HOME/.password-store"
|
||||
fi
|
||||
|
||||
pass2csv "$PASSWORD_STORE_DIR" "$HOME/passwords.csv" \
|
||||
-f User '(user|login)(:\s*)?' \
|
||||
-f TOTP 'otpauth(:)?' \
|
||||
-f URL 'url(:\s*)?'
|
||||
|
||||
# Fix TOTP format for keepass
|
||||
sd '"//totp/.*?secret=(.*?)(&.*?)?"' '"$1"' "$HOME/passwords.csv"
|
7
scripts/pint-fmt
Executable file
7
scripts/pint-fmt
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
file="$(mktemp)"
|
||||
cat - >"$file"
|
||||
./vendor/bin/pint --quiet "$file"
|
||||
cat "$file"
|
||||
rm "$file"
|
10
scripts/playerctl-status
Executable file
10
scripts/playerctl-status
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
PLAYERCTL="playerctl --ignore-player=mpd"
|
||||
|
||||
test "$(LC_ALL=C $PLAYERCTL status)" = "Playing" \
|
||||
&& printf " %s" "$($PLAYERCTL metadata title)" \
|
||||
&& test -n "$($PLAYERCTL metadata artist)" \
|
||||
&& printf " - %s" "$($PLAYERCTL metadata artist)"
|
||||
|
||||
echo ""
|
26
scripts/pulse_sink
Executable file
26
scripts/pulse_sink
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
list_sinks() {
|
||||
env LC_ALL=C pactl list sinks
|
||||
}
|
||||
|
||||
desc=$(
|
||||
list_sinks |
|
||||
grep -ie "description:" |
|
||||
cut -d: -f2 |
|
||||
sed 's/^ //g;s/ $//g;' |
|
||||
wdmenu -i -p "Output:"
|
||||
)
|
||||
device=$(
|
||||
list_sinks |
|
||||
grep -C2 "Description: $desc"|
|
||||
grep Name |
|
||||
cut -d: -f2 |
|
||||
xargs
|
||||
)
|
||||
|
||||
vol=$(pamixer --get-volume)
|
||||
|
||||
pactl set-default-sink "$device"
|
||||
|
||||
pamixer --set-volume "$vol"
|
18
scripts/readQrCode
Executable file
18
scripts/readQrCode
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -o pipefail
|
||||
|
||||
main() {
|
||||
|
||||
if wl-paste | zbarimg -q --raw - | wl-copy
|
||||
then
|
||||
notify-send "Copied" "QrCode was copied to clipboard"
|
||||
rm "$LOGFILE"
|
||||
else
|
||||
notify-send "Failed to read QrCode" "Log file is '$LOGFILE'"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
LOGFILE=$(mktemp /tmp/qrcode-XXXXXXXX.log)
|
||||
main > "$LOGFILE" 2>&1
|
49
scripts/screenshotsh
Executable file
49
scripts/screenshotsh
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/bin/sh
|
||||
|
||||
export XCURSOR_SIZE=40
|
||||
export XCURSOR_THEME='capitaine-cursors-light'
|
||||
|
||||
screenshot="grim"
|
||||
copy="wl-copy -t image/png"
|
||||
|
||||
if which xdg-user-dir >/dev/null 2>&1; then
|
||||
DESTFOLDER="$(xdg-user-dir PICTURES)"
|
||||
else
|
||||
for i in Images Imagens Pictures Fotos ""; do
|
||||
DESTFOLDER="$HOME/$i"
|
||||
test -d "$DESTFOLDER" &&
|
||||
break
|
||||
done
|
||||
fi
|
||||
|
||||
DESTFOLDER="$DESTFOLDER/Screenshots"
|
||||
mkdir -p "$DESTFOLDER"
|
||||
DESTFILE="$DESTFOLDER/$(date +'%Y-%m-%d-%H%M%S_screenshot.png')"
|
||||
|
||||
case $1 in
|
||||
def)
|
||||
# Screenshot to file
|
||||
$screenshot "$DESTFILE"
|
||||
echo "$DESTFILE"
|
||||
;;
|
||||
|
||||
area)
|
||||
# Screen area to file
|
||||
$screenshot -g "$(slurp -d -b 30303088)" "$DESTFILE"
|
||||
echo "$DESTFILE"
|
||||
;;
|
||||
area-clip)
|
||||
# Screen area to clipboard
|
||||
$screenshot -g "$(slurp -d -b 30303088)" - | $copy
|
||||
;;
|
||||
|
||||
clip)
|
||||
# Focused monitor to clipboard
|
||||
cur_output=$(swaymsg -t get_outputs |
|
||||
jq -r '.[] | select(.focused) | .name')
|
||||
|
||||
test -n "$cur_output" &&
|
||||
$screenshot -o "$cur_output" - | $copy ||
|
||||
$screenshot - | $copy
|
||||
;;
|
||||
esac
|
10
scripts/showkeys
Executable file
10
scripts/showkeys
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
pidof wshowkeys && pkill wshowkeys ||
|
||||
exec wshowkeys \
|
||||
-a bottom -a right \
|
||||
-F 'Inter 20' \
|
||||
-b 202020AA \
|
||||
-s DD5050 \
|
||||
-t 1 \
|
||||
-m 100
|
18
scripts/terminal
Executable file
18
scripts/terminal
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
CLASS="terminal"
|
||||
|
||||
while test $# -gt 0;do
|
||||
case $1 in
|
||||
-c|--class)
|
||||
shift
|
||||
CLASS=$1
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
exec alacritty --class "$CLASS" "$@"
|
139
scripts/volumesh
Executable file
139
scripts/volumesh
Executable file
|
@ -0,0 +1,139 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -xe
|
||||
|
||||
# depends on: awk, pactl, pacmd, notify-send
|
||||
|
||||
MAX_VOL=150
|
||||
STEP=10
|
||||
|
||||
notify() {
|
||||
volume=$(get_vol_$TARGET)
|
||||
|
||||
if is_muted_$TARGET; then
|
||||
s="Muted"
|
||||
else
|
||||
s="Volume"
|
||||
fi
|
||||
|
||||
s=$(echo "${TARGET} ${s}" | sed 's/^\(.\)/\U\1/')
|
||||
|
||||
notify-send "${s}" "${volume}%" \
|
||||
--app-name=volumesh \
|
||||
--hint=int:value:"$volume"
|
||||
|
||||
}
|
||||
|
||||
round() {
|
||||
awk '{
|
||||
print int($1/'$STEP')*'$STEP';
|
||||
}'
|
||||
}
|
||||
|
||||
round_vol() {
|
||||
rounded=$(get_vol_$TARGET | round)
|
||||
newvol=$(min $MAX_VOL $rounded)
|
||||
}
|
||||
|
||||
min() {
|
||||
printf '%i\n' ${@} | sort -n | head -n1
|
||||
}
|
||||
|
||||
# Pulse{{{
|
||||
get_vol_system() {
|
||||
pamixer --get-volume
|
||||
}
|
||||
|
||||
is_muted_system() {
|
||||
test "$(pamixer --get-mute)" = "true" >/dev/null
|
||||
}
|
||||
|
||||
change_vol_system() {
|
||||
pamixer "-$1" "$(min 120 $2)"
|
||||
round_vol
|
||||
pamixer --set-volume "${newvol}"
|
||||
if
|
||||
test -n "$VOLUME_CHANGE_SOUND"
|
||||
then
|
||||
paplay "$VOLUME_CHANGE_SOUND"
|
||||
fi
|
||||
}
|
||||
|
||||
toggle_mute_system() {
|
||||
pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
}
|
||||
#}}}
|
||||
# Mpd {{{
|
||||
|
||||
get_vol_mpd() {
|
||||
env LC_ALL=C mpc vol |
|
||||
sed -e 's/^.*://g' -e 's/%.*$//g' -e 's/ //g'
|
||||
}
|
||||
|
||||
is_muted_mpd() {
|
||||
env LC_ALL=C mpc status | grep '\[paused\]' 1>/dev/null
|
||||
}
|
||||
change_vol_mpd() {
|
||||
case $1 in
|
||||
d)
|
||||
op="-";;
|
||||
i)
|
||||
op="+";;
|
||||
esac
|
||||
mpc vol "${op}${2}" &>/dev/null
|
||||
round_vol
|
||||
mpc vol "${newvol}" &>/dev/null
|
||||
}
|
||||
|
||||
toggle_mute_mpd() {
|
||||
mpc toggle
|
||||
}
|
||||
#}}}
|
||||
usage() {
|
||||
local CNAME=$(basename $0)
|
||||
echo "${CNAME} [-m][-di <amount>]"
|
||||
echo "${CNAME} [-m][-t]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " -m --mpd Target mpd instead of PulseAudio"
|
||||
echo " -i --increase <amount> of volume to increase"
|
||||
echo " -d --decrease <amount> of volume to decrease"
|
||||
echo " -t --toggle Mute/Unmute target"
|
||||
echo " -h --help Show This help message"
|
||||
|
||||
exit "$1"
|
||||
}
|
||||
TARGET=system
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
-m | --mpd)
|
||||
TARGET=mpd
|
||||
shift
|
||||
;;
|
||||
-i | --increase)
|
||||
shift
|
||||
change_vol_$TARGET i $1
|
||||
shift
|
||||
;;
|
||||
-d | --decrease)
|
||||
shift
|
||||
change_vol_$TARGET d $1
|
||||
shift
|
||||
;;
|
||||
-t | --toggle)
|
||||
toggle_mute_$TARGET
|
||||
shift
|
||||
;;
|
||||
-h | --help)
|
||||
usage 0
|
||||
;;
|
||||
*)
|
||||
usage 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
notify
|
||||
|
||||
# vim: fdm=marker
|
28
scripts/vrr-fullscreen
Executable file
28
scripts/vrr-fullscreen
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# List of supported outputs for VRR
|
||||
output_vrr_whitelist=(
|
||||
"DP-1"
|
||||
"DP-2"
|
||||
)
|
||||
|
||||
# Toggle VRR for fullscreened apps in prespecified displays to avoid stutters while in desktop
|
||||
swaymsg -t subscribe -m '[ "window" ]' | while read window_json; do
|
||||
window_event=$(echo ${window_json} | jq -r '.change')
|
||||
|
||||
# Process only focus change and fullscreen toggle
|
||||
if [[ $window_event = "focus" || $window_event = "fullscreen_mode" ]]; then
|
||||
output_json=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused == true)')
|
||||
output_name=$(echo ${output_json} | jq -r '.name')
|
||||
|
||||
# Use only VRR in whitelisted outputs
|
||||
if [[ ${output_vrr_whitelist[*]} =~ ${output_name} ]]; then
|
||||
output_vrr_status=$(echo ${output_json} | jq -r '.adaptive_sync_status')
|
||||
window_fullscreen_status=$(echo ${window_json} | jq -r '.container.fullscreen_mode')
|
||||
|
||||
# Only update output if nesseccary to avoid flickering
|
||||
[[ $output_vrr_status = "disabled" && $window_fullscreen_status = "1" ]] && swaymsg output "${output_name}" adaptive_sync 1
|
||||
[[ $output_vrr_status = "enabled" && $window_fullscreen_status = "0" ]] && swaymsg output "${output_name}" adaptive_sync 0
|
||||
fi
|
||||
fi
|
||||
done
|
4
scripts/wdmenu.nix
Normal file
4
scripts/wdmenu.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
pkgs.writeShellScriptBin "wdmenu" ''
|
||||
exec bmenu "$@"
|
||||
''
|
12
scripts/wfile-picker.nix
Normal file
12
scripts/wfile-picker.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
inherit (config.my) dmenu;
|
||||
available_menus = {
|
||||
bmenu = "bmenu run";
|
||||
rofi = "rofi -show drun -sort";
|
||||
};
|
||||
menu_cmd = available_menus.${dmenu};
|
||||
in
|
||||
pkgs.writeShellScriptBin "wlauncher" ''
|
||||
exec ${menu_cmd} "$@"
|
||||
''
|
4
scripts/wlauncher.nix
Normal file
4
scripts/wlauncher.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
pkgs.writeShellScriptBin "wlauncher" ''
|
||||
exec bmenu run "$@"
|
||||
''
|
BIN
secrets/factorio-settings.age
Normal file
BIN
secrets/factorio-settings.age
Normal file
Binary file not shown.
16
secrets/phantom-invidious-settings.age
Normal file
16
secrets/phantom-invidious-settings.age
Normal file
|
@ -0,0 +1,16 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-rsa BwwxHg
|
||||
iTcgtxF1IxopbtF+aw7V8IQfH7tWiMk9lE/eWlVHVjeaRvER5W6Y3xZNOFCjtbqY
|
||||
VwEyV6ibfZ4GJt1jRu2icEH/AnLUJFFGQnxu/K/rtoZ3tqSIk9WCBv3aPo4oZRiU
|
||||
uaaxi2gD8qo1RLyl/Ij7Djw4i/isUOO1EON5sgx1d39k6qUD4Mak0DSU4EtGdTsr
|
||||
OaxDAc0kAxhxZQOUH/QlKa0HLonaFcy1LHqvttOcw3UZuZnaYfZiPlcqe3USS9cm
|
||||
96aIC5cS9pHr4JFrqRYvfpla2TY5jlCB/xBGw3KjGEIQoBPXSsJZA6BCMZyp00++
|
||||
tdfS2aomt9HFmb1wZDS0jWAxkVF6nXXBbolFVih+58h0nYLljtHIQ3SizRoXY459
|
||||
x3JE9NReHp2OO3SlIeO03Kv8YMBvj7nSSd1C1PMpu+hJ/eCXi1WQxD6QY+40muk6
|
||||
KhqE3PZ8BCY2b+VpywUF5gVH28mo3jscqAzhf2dZ3SQlzldI+hFyKPxTdAqkfUOH
|
||||
|
||||
--- cinb+wzjVfTkpfm1CtFIFaepwoQVCj1MquB5rAC45Ew
|
||||
¾
|
||||
6
|
||||
ZCþHS07ïºÖóýE¼X*Àqb=üOßíÛÉwu¥¤³Pºþ¹Ùçǖѳ/£ómvòÞ×Ë2VœÄ«
|
||||
ÁŠxvç[“£‚µ£±”Ì‚A~ evdÓåÙ0¢Œni³1Ò›¹Qý„"í@Ù¹§ÞÔ{KpÐ:åϵuµsÊÎBñò(X…r[ÂQVg¢Tš¤°ðœîËï@Ä*ÇõÿíB«<>.§¯žhE鲟èÐë’÷½¥Žûzlz|kã`l8‘´8¼M›cch<63>îáZ`ƒ ?yeoƒ+ÈM-:/–À**ìè¦ÊcŸÎZD¡2Ñá¼é&·÷¾Ç¢¹£e¤ï*Hnç"Þ~+|ua(û6óËJ
|
|
@ -12,9 +12,11 @@ in
|
|||
"monolith-forgejo-runner-token.age".publicKeys = [ main_ssh_public_key ];
|
||||
"lelgenio-cachix.age".publicKeys = [ main_ssh_public_key ];
|
||||
"monolith-nix-serve-privkey.age".publicKeys = [ main_ssh_public_key ];
|
||||
"factorio-settings.age".publicKeys = [ main_ssh_public_key ];
|
||||
"phantom-nextcloud.age".publicKeys = [ main_ssh_public_key ];
|
||||
"phantom-writefreely.age".publicKeys = [ main_ssh_public_key ];
|
||||
"phantom-renawiki.age".publicKeys = [ main_ssh_public_key ];
|
||||
"phantom-forgejo-mailer-password.age".publicKeys = [ main_ssh_public_key ];
|
||||
"phantom-mastodon-mailer-password.age".publicKeys = [ main_ssh_public_key ];
|
||||
"phantom-invidious-settings.age".publicKeys = [ main_ssh_public_key ];
|
||||
}
|
||||
|
|
5
switch
5
switch
|
@ -4,10 +4,9 @@ nix fmt
|
|||
|
||||
git --no-pager diff
|
||||
|
||||
sudo nice ionice \
|
||||
nixos-rebuild \
|
||||
switch \
|
||||
--verbose \
|
||||
--use-remote-sudo \
|
||||
--print-build-logs \
|
||||
--flake .# \
|
||||
$@
|
||||
"$@"
|
||||
|
|
6
switch-with-home-cache
Executable file
6
switch-with-home-cache
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
./switch \
|
||||
--option extra-substituters "http://nixcache.lelgenio.1337.cx:5000" \
|
||||
--option extra-trusted-public-keys "nixcache.lelgenio.1337.cx:HZCwDaM39BOF+MLuviMQTUrz3rBWLTLV9H+GV4zcxVI=" \
|
||||
"$@"
|
|
@ -1,5 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
services.blueman.enable = true;
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
18
system/cachix.nix
Normal file
18
system/cachix.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.cachix-watch-store = {
|
||||
enable = true;
|
||||
cacheName = "lelgenio";
|
||||
cachixTokenFile = config.age.secrets.lelgenio-cachix.path;
|
||||
};
|
||||
systemd.services.cachix-watch-store-agent = {
|
||||
serviceConfig.TimeoutStopSec = 3;
|
||||
# If we don't do this, cachix tends to timeout
|
||||
serviceConfig.KillMode = lib.mkForce "control-group";
|
||||
};
|
||||
}
|
|
@ -9,8 +9,11 @@
|
|||
}:
|
||||
{
|
||||
imports = [
|
||||
./gamemode.nix
|
||||
./cachix.nix
|
||||
./media-packages.nix
|
||||
./boot.nix
|
||||
./thunar.nix
|
||||
./nix.nix
|
||||
./fonts.nix
|
||||
./sound.nix
|
||||
|
@ -45,6 +48,15 @@
|
|||
|
||||
services.geoclue2.enable = true;
|
||||
|
||||
# Workaround for nm-wait-online hanging??
|
||||
# Ref: https://github.com/NixOS/nixpkgs/issues/180175
|
||||
systemd.services.NetworkManager-wait-online = {
|
||||
serviceConfig.ExecStart = [
|
||||
""
|
||||
"${pkgs.networkmanager}/bin/nm-online -q"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.extraConfig = ''
|
||||
DefaultTimeoutStopSec=10s
|
||||
'';
|
||||
|
|
|
@ -12,6 +12,14 @@
|
|||
"--volumes"
|
||||
];
|
||||
};
|
||||
daemon.settings = {
|
||||
# needed by bitbucket runner ???
|
||||
log-driver = "json-file";
|
||||
log-opts = {
|
||||
max-size = "10m";
|
||||
max-file = "3";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.extra-container.enable = true;
|
||||
|
|
27
system/gamemode.nix
Normal file
27
system/gamemode.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.gamemode.enable = true;
|
||||
programs.gamemode.enableRenice = true;
|
||||
programs.gamemode.settings = {
|
||||
general = {
|
||||
renice = 10;
|
||||
};
|
||||
|
||||
# Warning: GPU optimisations have the potential to damage hardware
|
||||
gpu = {
|
||||
apply_gpu_optimisations = "accept-responsibility";
|
||||
gpu_device = 0;
|
||||
amd_performance_level = "high";
|
||||
};
|
||||
|
||||
custom = {
|
||||
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
|
||||
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -42,6 +42,6 @@
|
|||
|
||||
chrome-gnome-shell
|
||||
gnomeExtensions.quick-settings-audio-devices-hider
|
||||
gnomeExtensions.dual-shock-4-battery-percentage
|
||||
gnome-pass-search-provider
|
||||
];
|
||||
}
|
||||
|
|
97
system/greetd.nix
Normal file
97
system/greetd.nix
Normal file
|
@ -0,0 +1,97 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (config.my)
|
||||
key
|
||||
accent
|
||||
font
|
||||
theme
|
||||
desktop
|
||||
;
|
||||
|
||||
cfg = config.login-manager.greetd;
|
||||
in
|
||||
{
|
||||
options.login-manager.greetd = {
|
||||
enable = lib.mkEnableOption "Use greetd as login manager";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = false;
|
||||
|
||||
# enable sway window manager
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
package = pkgs.mySway;
|
||||
wrapperFeatures.gtk = true;
|
||||
};
|
||||
|
||||
services.dbus.enable = true;
|
||||
programs.wshowkeys.enable = true;
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
# Always pick the first monitor, this is fine since I only ever use a single monitor
|
||||
wlr.settings.screencast.chooser_type = "none";
|
||||
# gtk portal needed to make gtk apps happy
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
};
|
||||
services.greetd =
|
||||
let
|
||||
greetd_main_script = pkgs.writeShellScriptBin "main" ''
|
||||
export XDG_CURRENT_DESKTOP=sway GTK_THEME="${theme.gtk_theme}" XCURSOR_THEME="${theme.cursor_theme}"
|
||||
${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c ${desktop}
|
||||
swaymsg exit
|
||||
'';
|
||||
swayConfig = pkgs.writeText "greetd-sway-config" ''
|
||||
# `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet.
|
||||
exec "${greetd_main_script}/bin/main"
|
||||
bindsym Mod4+shift+e exec swaynag \
|
||||
-t warning \
|
||||
-m 'What do you want to do?' \
|
||||
-b 'Poweroff' 'systemctl poweroff' \
|
||||
-b 'Reboot' 'systemctl reboot'
|
||||
input "*" {
|
||||
repeat_delay 200
|
||||
repeat_rate 30
|
||||
xkb_layout us(colemak)
|
||||
xkb_numlock enabled
|
||||
xkb_options lv3:lsgt_switch,grp:shifts_toggle
|
||||
}
|
||||
'';
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
settings = {
|
||||
initial_session = {
|
||||
command = desktop;
|
||||
user = "lelgenio";
|
||||
};
|
||||
default_session = {
|
||||
command = "${pkgs.sway}/bin/sway --config ${swayConfig}";
|
||||
};
|
||||
};
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
sway
|
||||
swaylock
|
||||
swayidle
|
||||
|
||||
wayland
|
||||
pkgs.xdg-desktop-portal
|
||||
pkgs.xdg-desktop-portal-wlr
|
||||
|
||||
## Theme
|
||||
capitaine-cursors
|
||||
bibata-cursors
|
||||
orchis_theme_compact
|
||||
papirus_red
|
||||
];
|
||||
};
|
||||
}
|
15
system/kde.nix
Normal file
15
system/kde.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
# Enable the KDE Desktop Environment.
|
||||
services.xserver.displayManager.sddm.enable = true;
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
# services.xserver.displayManager.autologin.user = "lelgenio";
|
||||
programs.dconf.enable = true;
|
||||
# environment.systemPackages = with pkgs;
|
||||
# with gnome; [
|
||||
# gnome-tweaks
|
||||
# dconf-editor
|
||||
# ];
|
||||
}
|
|
@ -13,30 +13,22 @@ in
|
|||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
down_meme
|
||||
yt-dlp
|
||||
ffmpeg
|
||||
obs-studio
|
||||
imagemagick
|
||||
mpc-cli
|
||||
helvum
|
||||
gimp
|
||||
inkscape
|
||||
krita
|
||||
kdePackages.breeze
|
||||
kdePackages.kdenlive
|
||||
pitivi
|
||||
blender-hip
|
||||
libreoffice
|
||||
godot_4
|
||||
|
||||
(pkgs.writeTextFile {
|
||||
name = "krita-thumbnails";
|
||||
text = ''
|
||||
[Thumbnailer Entry]
|
||||
TryExec=unzip
|
||||
Exec=sh -c "${pkgs.unzip}/bin/unzip -p %i preview.png > %o"
|
||||
MimeType=application/x-krita;
|
||||
'';
|
||||
destination = "/share/thumbnailers/kra.thumbnailer";
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ in
|
|||
virtualisation.docker.enable = true;
|
||||
services.gitlab-runner = {
|
||||
enable = true;
|
||||
settings.concurrent = 4;
|
||||
settings.concurrent = 12;
|
||||
services = {
|
||||
# runner for building in docker via host's nix-daemon
|
||||
# nix store will be readable in runner, might be insecure
|
||||
|
|
12
system/nix-serve.nix
Normal file
12
system/nix-serve.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.nix-serve = {
|
||||
enable = true;
|
||||
secretKeyFile = config.age.secrets.monolith-nix-serve-privkey.path;
|
||||
};
|
||||
}
|
|
@ -14,18 +14,6 @@ in
|
|||
enable = true;
|
||||
settings.concurrent = 1;
|
||||
services = {
|
||||
# ci_test = {
|
||||
# registrationConfigFile = "/srv/gitlab-runner/env/ci_test";
|
||||
# dockerImage = "debian";
|
||||
# dockerPrivileged = true;
|
||||
# };
|
||||
thoreb_builder = {
|
||||
registrationConfigFile =
|
||||
config.age.secrets.rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.path;
|
||||
dockerImage = "debian";
|
||||
dockerPrivileged = true;
|
||||
};
|
||||
|
||||
thoreb-telemetria-nix = mkNixRunner config.age.secrets.gitlab-runner-thoreb-telemetria-registrationConfigFile.path;
|
||||
thoreb-itinerario-nix = mkNixRunner config.age.secrets.rainbow-gitlab-runner-thoreb-itinerario-registrationConfigFile.path;
|
||||
};
|
||||
|
|
|
@ -34,5 +34,4 @@
|
|||
];
|
||||
|
||||
programs.dzgui.enable = true;
|
||||
programs.dzgui.package = inputs.dzgui-nix.packages.${pkgs.system}.default;
|
||||
}
|
||||
|
|
32
system/thunar.nix
Normal file
32
system/thunar.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.thunar = {
|
||||
enable = true;
|
||||
plugins = with pkgs.xfce; [
|
||||
thunar-archive-plugin
|
||||
thunar-volman
|
||||
];
|
||||
};
|
||||
# Mount, trash, and other functionalities
|
||||
services.gvfs.enable = true;
|
||||
# Thumbnail support for images
|
||||
services.tumbler.enable = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeTextFile {
|
||||
name = "thumbs";
|
||||
text = ''
|
||||
[Thumbnailer Entry]
|
||||
TryExec=unzip
|
||||
Exec=sh -c "${pkgs.unzip}/bin/unzip -p %i preview.png > %o"
|
||||
MimeType=application/x-krita;
|
||||
'';
|
||||
destination = "/share/thumbnailers/kra.thumbnailer";
|
||||
})
|
||||
];
|
||||
}
|
179
user/alacritty.nix
Normal file
179
user/alacritty.nix
Normal file
|
@ -0,0 +1,179 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (config.my)
|
||||
key
|
||||
theme
|
||||
accent
|
||||
font
|
||||
;
|
||||
inherit (theme) color;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
font = {
|
||||
size = font.size.small;
|
||||
normal = {
|
||||
family = font.mono;
|
||||
};
|
||||
};
|
||||
colors = {
|
||||
primary = {
|
||||
background = "${color.bg}";
|
||||
foreground = "${color.txt}";
|
||||
};
|
||||
cursor = {
|
||||
text = "#000000";
|
||||
cursor = "${accent.color}";
|
||||
};
|
||||
normal = {
|
||||
black = "${color.normal.black}";
|
||||
red = "${color.normal.red}";
|
||||
green = "${color.normal.green}";
|
||||
yellow = "${color.normal.yellow}";
|
||||
blue = "${color.normal.blue}";
|
||||
magenta = "${color.normal.magenta}";
|
||||
cyan = "${color.normal.cyan}";
|
||||
white = "${color.normal.white}";
|
||||
};
|
||||
draw_bold_text_with_bright_colors = false;
|
||||
};
|
||||
window = {
|
||||
opacity = theme.opacity / 100.0;
|
||||
dynamic_padding = true;
|
||||
};
|
||||
|
||||
hints = {
|
||||
alphabet = key.hints;
|
||||
enabled = [
|
||||
{
|
||||
regex =
|
||||
let
|
||||
mimes = "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)";
|
||||
# I fucking hate regex, look at this bullshit
|
||||
delimiters = ''^\\u0000-\\u001F\\u007F-\\u009F<>"\\s{-}\\^⟨⟩`'';
|
||||
# Kakoune uses these characters to represent whitespace,
|
||||
# but alacritty doesn't know about them
|
||||
whitespace_characters = ''¬·→'';
|
||||
in
|
||||
"${mimes}[${delimiters}${whitespace_characters}]+";
|
||||
command = "xdg-open";
|
||||
post_processing = true;
|
||||
mouse = {
|
||||
enabled = true;
|
||||
mods = "None";
|
||||
};
|
||||
binding = {
|
||||
key = "U";
|
||||
mods = "Control|Shift";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
mouse = {
|
||||
hide_when_typing = true;
|
||||
};
|
||||
keyboard.bindings = [
|
||||
{
|
||||
key = lib.toUpper key.up;
|
||||
mode = "Vi|~Search";
|
||||
action = "Up";
|
||||
}
|
||||
{
|
||||
key = lib.toUpper key.down;
|
||||
mode = "Vi|~Search";
|
||||
action = "Down";
|
||||
}
|
||||
{
|
||||
key = lib.toUpper key.left;
|
||||
mode = "Vi|~Search";
|
||||
action = "Left";
|
||||
}
|
||||
{
|
||||
key = lib.toUpper key.right;
|
||||
mode = "Vi|~Search";
|
||||
action = "Right";
|
||||
}
|
||||
{
|
||||
key = lib.toUpper key.insertMode;
|
||||
mode = "Vi|~Search";
|
||||
action = "ScrollToBottom";
|
||||
}
|
||||
{
|
||||
key = lib.toUpper key.insertMode;
|
||||
mode = "Vi|~Search";
|
||||
action = "ToggleViMode";
|
||||
}
|
||||
{
|
||||
key = lib.toUpper key.next;
|
||||
mode = "Vi|~Search";
|
||||
action = "SearchNext";
|
||||
}
|
||||
{
|
||||
key = lib.toUpper key.next;
|
||||
mods = "Shift";
|
||||
mode = "Vi|~Search";
|
||||
action = "SearchPrevious";
|
||||
}
|
||||
{
|
||||
key = "Up";
|
||||
mods = "Control|Shift";
|
||||
mode = "~Alt";
|
||||
action = "ScrollLineUp";
|
||||
}
|
||||
{
|
||||
key = "Down";
|
||||
mods = "Control|Shift";
|
||||
mode = "~Alt";
|
||||
action = "ScrollLineDown";
|
||||
}
|
||||
{
|
||||
key = "PageUp";
|
||||
mods = "Control|Shift";
|
||||
mode = "~Alt";
|
||||
action = "ScrollHalfPageUp";
|
||||
}
|
||||
{
|
||||
key = "PageDown";
|
||||
mods = "Control|Shift";
|
||||
mode = "~Alt";
|
||||
action = "ScrollHalfPageDown";
|
||||
}
|
||||
{
|
||||
key = "N";
|
||||
mods = "Control|Shift";
|
||||
action = "SpawnNewInstance";
|
||||
}
|
||||
# {%@@ if key.layout == "colemak" @@%}
|
||||
{
|
||||
key = "T";
|
||||
mode = "Vi|~Search";
|
||||
action = "SemanticRightEnd";
|
||||
}
|
||||
# {%@@ endif @@%}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
TERMINAL = "alacritty";
|
||||
};
|
||||
|
||||
# Look at this fucking bullshit:
|
||||
# https://gitlab.gnome.org/GNOME/glib/-/blob/20c4fcb2a7246a2b205649eae3ebda4296217afc/gio/gdesktopappinfo.c#L2702
|
||||
# Theres a fucking hard coded list of terminals!
|
||||
home.packages = with pkgs; [
|
||||
(pkgs.writeShellScriptBin "gnome-terminal" ''
|
||||
[ "$1" = "--" ] && shift
|
||||
exec terminal -e "$@"
|
||||
'')
|
||||
];
|
||||
};
|
||||
}
|
|
@ -6,6 +6,41 @@
|
|||
}:
|
||||
{
|
||||
xdg.desktopEntries = {
|
||||
kak = {
|
||||
name = "Kakoune";
|
||||
genericName = "Text Editor";
|
||||
comment = "Edit text files";
|
||||
exec = "kak %F";
|
||||
terminal = true;
|
||||
type = "Application";
|
||||
icon = "kak.desktop";
|
||||
categories = [
|
||||
"Utility"
|
||||
"TextEditor"
|
||||
];
|
||||
startupNotify = true;
|
||||
mimeType = [
|
||||
"text/english"
|
||||
"text/plain"
|
||||
"text/x-makefile"
|
||||
"text/x-c++hdr"
|
||||
"text/x-c++src"
|
||||
"text/x-chdr"
|
||||
"text/x-csrc"
|
||||
"text/x-java"
|
||||
"text/x-moc"
|
||||
"text/x-pascal"
|
||||
"text/x-tcl"
|
||||
"text/x-tex"
|
||||
"application/x-shellscript"
|
||||
"text/x-c"
|
||||
"text/x-c++"
|
||||
];
|
||||
settings = {
|
||||
Keywords = "Text;editor;";
|
||||
TryExec = "kak";
|
||||
};
|
||||
};
|
||||
down_meme = {
|
||||
name = "DownMeme";
|
||||
genericName = "Download memes";
|
||||
|
|
61
user/eww/eww.scss
Normal file
61
user/eww/eww.scss
Normal file
|
@ -0,0 +1,61 @@
|
|||
|
||||
* {
|
||||
all: unset; //Unsets everything so you can style everything from scratch
|
||||
}
|
||||
|
||||
//Global Styles
|
||||
.bar {
|
||||
background-color: #202020;
|
||||
color: #b0b4bc;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
// Styles on classes (see eww.yuck for more information)
|
||||
|
||||
.sidestuff slider {
|
||||
all: unset;
|
||||
color: #cc5757;
|
||||
}
|
||||
|
||||
.metric scale trough highlight {
|
||||
all: unset;
|
||||
background-color: #D35D6E;
|
||||
color: #000000;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.metric scale trough {
|
||||
all: unset;
|
||||
background-color: #4e4e4e;
|
||||
border-radius: 50px;
|
||||
min-height: 3px;
|
||||
min-width: 50px;
|
||||
margin-left: 10px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.metric scale trough highlight {
|
||||
all: unset;
|
||||
background-color: #D35D6E;
|
||||
color: #000000;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.metric scale trough {
|
||||
all: unset;
|
||||
background-color: #4e4e4e;
|
||||
border-radius: 50px;
|
||||
min-height: 3px;
|
||||
min-width: 50px;
|
||||
margin-left: 10px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.label-ram {
|
||||
font-size: large;
|
||||
}
|
||||
.workspaces button:hover {
|
||||
color: #D35D6E;
|
||||
}
|
||||
|
||||
.workspaces button.active {
|
||||
color: #D35D6E;
|
||||
}
|
||||
|
||||
|
80
user/eww/eww.yuck
Normal file
80
user/eww/eww.yuck
Normal file
|
@ -0,0 +1,80 @@
|
|||
(defwidget bar []
|
||||
(centerbox :orientation "h"
|
||||
(workspaces)
|
||||
(music)
|
||||
(sidestuff)))
|
||||
|
||||
(defwidget sidestuff []
|
||||
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
|
||||
; (metric :label "🔊"
|
||||
; :value volume
|
||||
; :onchange "amixer -D pulse sset Master {}%")
|
||||
(metric :label ""
|
||||
:value {EWW_RAM.used_mem_perc}
|
||||
:onchange "")
|
||||
(metric :label "💾"
|
||||
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
|
||||
:onchange "")
|
||||
time))
|
||||
|
||||
(defwidget workspaces []
|
||||
(box :class "workspaces"
|
||||
:orientation "h"
|
||||
:space-evenly true
|
||||
:halign "start"
|
||||
:spacing 10
|
||||
(button :class "${active_workspace == 1 ? 'active' : '' }" :onclick "wmctrl -s 0" 1)
|
||||
(button :class "${active_workspace == 2 ? 'active' : '' }" :onclick "wmctrl -s 1" 2)
|
||||
(button :class "${active_workspace == 3 ? 'active' : '' }" :onclick "wmctrl -s 2" 3)
|
||||
(button :class "${active_workspace == 4 ? 'active' : '' }" :onclick "wmctrl -s 3" 4)
|
||||
(button :class "${active_workspace == 5 ? 'active' : '' }" :onclick "wmctrl -s 4" 5)
|
||||
(button :class "${active_workspace == 6 ? 'active' : '' }" :onclick "wmctrl -s 5" 6)
|
||||
(button :class "${active_workspace == 7 ? 'active' : '' }" :onclick "wmctrl -s 6" 7)
|
||||
(button :class "${active_workspace == 8 ? 'active' : '' }" :onclick "wmctrl -s 7" 8)
|
||||
(button :class "${active_workspace == 9 ? 'active' : '' }" :onclick "wmctrl -s 8" 9)))
|
||||
|
||||
(defwidget music []
|
||||
(box :class "music"
|
||||
:orientation "h"
|
||||
:space-evenly false
|
||||
:halign "center"
|
||||
{music != "" ? "🎵${music}" : ""}))
|
||||
|
||||
|
||||
(defwidget metric [label value onchange]
|
||||
(box :orientation "h"
|
||||
:class "metric"
|
||||
:space-evenly false
|
||||
(box :class "label" label)
|
||||
(scale :min 0
|
||||
:max 101
|
||||
:active {onchange != ""}
|
||||
:value value
|
||||
:onchange onchange)))
|
||||
|
||||
|
||||
|
||||
(deflisten music :initial ""
|
||||
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
|
||||
|
||||
; (defpoll volume :interval "1s"
|
||||
; "scripts/getvol")
|
||||
|
||||
(defpoll time :interval "10s"
|
||||
"date '+%H:%M %b %d, %Y'")
|
||||
|
||||
(defpoll active_workspace :interval "10ms"
|
||||
"hyprctl monitors -j | jq '.[]|.activeWorkspace.id'")
|
||||
|
||||
(defwindow bar
|
||||
:monitor 0
|
||||
:windowtype "dock"
|
||||
:geometry (geometry :x "0%"
|
||||
:y "0%"
|
||||
:width "100%"
|
||||
:height "10px"
|
||||
:anchor "top center")
|
||||
:reserve (struts :side "top" :distance "4%")
|
||||
:exclusive true
|
||||
(bar))
|
||||
|
2
user/eww/scripts/getram
Executable file
2
user/eww/scripts/getram
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}')
|
2
user/eww/scripts/getvol
Executable file
2
user/eww/scripts/getvol
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%' | head -1
|
134
user/firefox.nix
134
user/firefox.nix
|
@ -7,12 +7,84 @@
|
|||
}:
|
||||
let
|
||||
inherit (config.my) desktop browser;
|
||||
bugfixedFirefox = pkgs.firefox-devedition-unwrapped // {
|
||||
requireSigning = false;
|
||||
allowAddonSideload = true;
|
||||
};
|
||||
in
|
||||
{
|
||||
config = {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = pkgs.firefox-devedition;
|
||||
package = pkgs.wrapFirefox bugfixedFirefox {
|
||||
nixExtensions = [
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "darkreader";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/4205543/darkreader-4.9.73.xpi";
|
||||
hash = "sha256-fDmf8yVhiGu4Da0Mr6+PYpeSsLcf8e/PEmZ+BaKzjxo=";
|
||||
})
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "sponsorblock";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/4202411/sponsorblock-5.4.29.xpi";
|
||||
hash = "sha256-7Xqc8cyQNylMe5/dgDOx1f2QDVmz3JshDlTueu6AcSg=";
|
||||
})
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "tree-style-tab";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/4197314/tree_style_tab-3.9.19.xpi";
|
||||
hash = "sha256-u2f0elVPj5N/QXa+5hRJResPJAYwuT9z0s/0nwmFtVo=";
|
||||
})
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "ublock-origin";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/4290466/ublock_origin-1.58.0.xpi";
|
||||
hash = "sha256-RwxWmUpxdNshV4rc5ZixWKXcCXDIfFz+iJrGMr0wheo=";
|
||||
})
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "user_agent_string_switcher";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/4098688/user_agent_string_switcher-0.5.0.xpi";
|
||||
hash = "sha256-ncjaPIxG1PBNEv14nGNQH6ai9QL4WbKGk5oJDbY+rjM=";
|
||||
})
|
||||
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "i-still-dont-care-about-cookies";
|
||||
url = "https://github.com/OhMyGuus/I-Still-Dont-Care-About-Cookies/releases/download/v1.1.4/istilldontcareaboutcookies-1.1.4.xpi";
|
||||
hash = "sha256-yt6yRiLTuaK4K/QwgkL9gCVGsSa7ndFOHqZvKqIGZ5U=";
|
||||
})
|
||||
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "vimium_ff";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/4191523/vimium_ff-2.0.6.xpi";
|
||||
hash = "sha256-lKLX6IWWtliRdH1Ig33rVEB4DVfbeuMw0dfUPV/mSSI=";
|
||||
})
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "invidious_redirect";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/4292924/invidious_redirect_2-1.16.xpi";
|
||||
hash = "sha256-ApCc+MNmW9Wd/5seV6npePQVEaszT/rhD9EB7HGiUb8=";
|
||||
})
|
||||
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "mastodon_simplified_federation";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/4215691/mastodon_simplified_federation-2.2.xpi";
|
||||
hash = "sha256-4iU25chpjsdsMTPaa0yQOTWc9V9q1qFz6YV0lYtNjLA=";
|
||||
})
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "substitoot";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/4236602/substitoot-0.7.2.0.xpi";
|
||||
hash = "sha256-1auSqEjkebwRSbmAVUsYwy77dl7TQCOnqgozpoVnqgI=";
|
||||
})
|
||||
|
||||
# Locale
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "firefox_br";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/4144369/firefox_br-115.0.20230726.201356.xpi";
|
||||
hash = "sha256-8zkqfdW0lX0b62+gAJeq4FFlQ06nXGFAexpH+wg2Cr0=";
|
||||
})
|
||||
(pkgs.fetchFirefoxAddon {
|
||||
name = "corretor";
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/1176165/corretor-65.2018.12.8.xpi";
|
||||
hash = "sha256-/rFQtJHdgemMkGAd+KWuWxVA/BwSIkn6sk0XZE0LrGk=";
|
||||
})
|
||||
];
|
||||
};
|
||||
profiles = {
|
||||
dev-edition-default = {
|
||||
isDefault = true;
|
||||
|
@ -60,44 +132,44 @@ in
|
|||
''
|
||||
else
|
||||
''
|
||||
/* Hide tabs and other items */
|
||||
/* Element | chrome://browser/content/browser.xhtml */
|
||||
|
||||
#navigator-toolbox {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 50px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Element | chrome://browser/content/browser.xhtml */
|
||||
|
||||
#nav-bar {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
grid-column: 1 / 3;
|
||||
grid-row: 1;
|
||||
z-index: 0;
|
||||
padding-right: 29px !important;
|
||||
}
|
||||
|
||||
/* Element | chrome://browser/content/browser.xhtml */
|
||||
|
||||
.toolbar-items {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Make the url bar occupy the entire size of the container */
|
||||
#nav-bar {
|
||||
z-index: 1;
|
||||
padding-right: 29px !important;
|
||||
}
|
||||
/* Element | chrome://browser/content/browser.xhtml */
|
||||
|
||||
/* shrink the tab bar to a small size, since it's only the window close button basically */
|
||||
#titlebar {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 10px;
|
||||
#TabsToolbar {
|
||||
max-width: 50px;
|
||||
}
|
||||
|
||||
/* Element | chrome://browser/content/browser.xhtml */
|
||||
|
||||
#titlebar {
|
||||
max-width: 50px;
|
||||
grid-area: 1 / 2;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* Add a nice border to the top of the window */
|
||||
#nav-bar {
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
}
|
||||
|
||||
/* Make the private browser indicator look nice, over the close-window button */
|
||||
#private-browsing-indicator-with-label {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 15px;
|
||||
z-index: 20;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#private-browsing-indicator-with-label > label {
|
||||
display: none;
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
@ -18,9 +18,17 @@ in
|
|||
set -U fish_features stderr-nocaret qmark-noglob regex-easyesc ampersand-nobg-in-token
|
||||
|
||||
set_color red
|
||||
if not test -d "$PASSWORD_STORE_DIR"
|
||||
echo "Password Store not yet setup"
|
||||
end
|
||||
if not test -f "$HOME/.ssh/id_rsa"
|
||||
echo "SSH keys not yet setup"
|
||||
end
|
||||
if command -qs rustup &> /dev/null
|
||||
if not command -qs rustc; or not rustc --version &> /dev/null
|
||||
rustup default stable &>/dev/null &
|
||||
end
|
||||
end
|
||||
set_color normal
|
||||
|
||||
bind \cy 'commandline | wl-copy -n'
|
||||
|
@ -28,16 +36,21 @@ in
|
|||
shellAliases = {
|
||||
rm = "trash";
|
||||
tree = "eza -T";
|
||||
kill_yourself = "shutdown now";
|
||||
};
|
||||
shellAbbrs = {
|
||||
off = "shutdown now";
|
||||
v =
|
||||
{
|
||||
"helix" = "hx";
|
||||
"kakoune" = "kak";
|
||||
}
|
||||
.${editor};
|
||||
ns = "nix develop --command $SHELL";
|
||||
wcf = "wl-copy-file";
|
||||
c = "cargo";
|
||||
# system
|
||||
sv = "sudo systemct";
|
||||
suv = "sudo systemct --user";
|
||||
suv = "systemct --user";
|
||||
# docker abbrs
|
||||
d = "docker";
|
||||
dc = "docker-compose";
|
||||
|
|
|
@ -103,9 +103,8 @@ function fish_git_prompt
|
|||
_fish_prompt_warn "init"
|
||||
end
|
||||
|
||||
git rev-parse HEAD -- &>/dev/null
|
||||
or return
|
||||
|
||||
# if we have at least one commit
|
||||
if git rev-parse HEAD -- &>/dev/null
|
||||
# print a "↑" if ahead of origin
|
||||
test 0 -ne (git log --oneline "$git_remote_branch"..HEAD -- | wc -l)
|
||||
and set -f _git_sync_ahead '↑'
|
||||
|
@ -127,6 +126,7 @@ function fish_git_prompt
|
|||
_fish_prompt_normal '↻'
|
||||
_fish_prompt_warn $git_log_unpushed[1]
|
||||
end
|
||||
end
|
||||
|
||||
############################################################
|
||||
# Right side represents WorkTree/Staged
|
||||
|
|
|
@ -28,6 +28,11 @@ in
|
|||
autoSquash = true;
|
||||
autoStash = true;
|
||||
};
|
||||
pager = {
|
||||
log = "${pkgs._diffr}/bin/_diffr | ${pkgs.kak-pager}/bin/kak-pager";
|
||||
show = "${pkgs._diffr}/bin/_diffr | ${pkgs.kak-pager}/bin/kak-pager";
|
||||
diff = "${pkgs._diffr}/bin/_diffr | ${pkgs.kak-pager}/bin/kak-pager";
|
||||
};
|
||||
alias = {
|
||||
graph = "log --graph --oneline --branches";
|
||||
root = "rev-parse --show-toplevel";
|
||||
|
|
|
@ -40,8 +40,6 @@ lib.mkIf (config.my.desktop == "gnome") {
|
|||
libsForQt5.qtstyleplugin-kvantum
|
||||
qt6Packages.qt6ct
|
||||
qt6Packages.qtstyleplugin-kvantum
|
||||
|
||||
draw-on-your-screen2
|
||||
];
|
||||
|
||||
services.gpg-agent.pinentryPackage = pkgs.pinentry-gnome3;
|
||||
|
|
47
user/gpg.nix
Normal file
47
user/gpg.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config = {
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
defaultCacheTtl = 604800;
|
||||
maxCacheTtl = 604800;
|
||||
extraConfig = ''
|
||||
allow-preset-passphrase
|
||||
'';
|
||||
};
|
||||
systemd.user.services = {
|
||||
gpg_unlock = {
|
||||
Unit = {
|
||||
Description = "Unlock gpg keyring";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs._gpg-unlock}/bin/_gpg-unlock";
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.user.timers = {
|
||||
gpg_unlock = {
|
||||
Unit = {
|
||||
Description = "Unlock gpg keyring";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
Timer = {
|
||||
OnBootSec = "0";
|
||||
OnUnitActiveSec = "300";
|
||||
Unit = "gpg_unlock.service";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -56,8 +56,6 @@ in
|
|||
# goto mode
|
||||
g.n = "goto_line_start";
|
||||
g.o = "goto_line_end";
|
||||
# Formatting
|
||||
"space".m = ":format";
|
||||
};
|
||||
keys.select = {
|
||||
# basic movement
|
||||
|
@ -70,7 +68,6 @@ in
|
|||
L = "extend_search_prev";
|
||||
# edits
|
||||
s = "insert_mode";
|
||||
S = "insert_at_line_start";
|
||||
# open newline
|
||||
h = "open_below";
|
||||
H = "open_above";
|
||||
|
@ -90,7 +87,7 @@ in
|
|||
{
|
||||
name = "nix";
|
||||
auto-format = true;
|
||||
formatter.command = "nixfmt";
|
||||
formatter.command = "nixpkgs-fmt";
|
||||
}
|
||||
{
|
||||
name = "rust";
|
||||
|
|
|
@ -8,21 +8,36 @@
|
|||
}:
|
||||
{
|
||||
imports = [
|
||||
./waybar
|
||||
./helix.nix
|
||||
./kakoune
|
||||
./vscode
|
||||
./fish
|
||||
./firefox.nix
|
||||
./alacritty.nix
|
||||
./git.nix
|
||||
./ssh.nix
|
||||
./gpg.nix
|
||||
./rofi.nix
|
||||
./mpv.nix
|
||||
./mangohud.nix
|
||||
./pipewire.nix
|
||||
./mimeapps.nix
|
||||
./desktop-entries.nix
|
||||
./chat.nix
|
||||
./syncthing.nix
|
||||
./bmenu.nix
|
||||
./fzf.nix
|
||||
./ranger
|
||||
./lf
|
||||
./pass.nix
|
||||
./pqiv.nix
|
||||
./zathura.nix
|
||||
./man.nix
|
||||
./mpd.nix
|
||||
./sway
|
||||
./gnome.nix
|
||||
./thunar.nix
|
||||
./xdg-dirs.nix
|
||||
inputs.nix-index-database.hmModules.nix-index
|
||||
../settings
|
||||
|
@ -39,8 +54,9 @@
|
|||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
home.packages = with pkgs; [
|
||||
# home-manager
|
||||
terminal
|
||||
|
||||
pulse_sink
|
||||
pulseaudio
|
||||
|
||||
## CLI
|
||||
|
@ -53,6 +69,8 @@
|
|||
p7zip
|
||||
tealdeer
|
||||
micro
|
||||
_diffr
|
||||
br # bulk rename
|
||||
|
||||
comma
|
||||
|
||||
|
@ -61,14 +79,17 @@
|
|||
amdgpu_top
|
||||
inxi
|
||||
dmidecode
|
||||
ncdu
|
||||
|
||||
## text manipulation
|
||||
sd
|
||||
ripgrep
|
||||
translate-shell
|
||||
lipsum
|
||||
par
|
||||
|
||||
mate.engrampa
|
||||
# gnome.nautilus
|
||||
|
||||
## games
|
||||
# lutris-unwrapped
|
||||
# steam # It's enabled in the system config
|
||||
|
@ -86,7 +107,6 @@
|
|||
## Network
|
||||
speedtest-cli
|
||||
nmap
|
||||
httpie
|
||||
miniupnpc
|
||||
deluge
|
||||
nicotine-plus
|
||||
|
@ -98,7 +118,6 @@
|
|||
# rustup
|
||||
|
||||
docker-compose
|
||||
gnumake
|
||||
mariadb
|
||||
|
||||
nodePackages.intelephense
|
||||
|
@ -108,6 +127,7 @@
|
|||
clang-tools # c/c++ lsp server
|
||||
rust-analyzer # rust analyzer
|
||||
|
||||
unstable.blade-formatter
|
||||
nixfmt-rfc-style
|
||||
];
|
||||
|
||||
|
|
225
user/kakoune/colors.nix
Normal file
225
user/kakoune/colors.nix
Normal file
|
@ -0,0 +1,225 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
color,
|
||||
accent,
|
||||
}:
|
||||
let
|
||||
colors = lib.mapAttrs (_: lib.replaceStrings [ "#" ] [ "rgb:" ]) {
|
||||
accent_fg = accent.fg;
|
||||
accent_color = accent.color;
|
||||
bg_light = color.bg_light;
|
||||
bg_dark = color.bg_dark;
|
||||
nontxt = color.nontxt;
|
||||
orange = color.normal.orange;
|
||||
brown = color.normal.brown;
|
||||
};
|
||||
in
|
||||
with colors;
|
||||
''
|
||||
crosshairs-enable
|
||||
|
||||
face global crosshairs_line default,${bg_dark}
|
||||
face global crosshairs_column default+b
|
||||
|
||||
# For Code
|
||||
face global value magenta
|
||||
face global type yellow
|
||||
face global variable blue
|
||||
face global module ${brown}
|
||||
face global function ${orange}
|
||||
face global string green
|
||||
face global keyword ${accent_color}
|
||||
face global operator yellow
|
||||
face global attribute cyan
|
||||
face global comment ${bg_light}
|
||||
face global documentation comment
|
||||
face global meta +i@function
|
||||
face global builtin blue
|
||||
|
||||
# For markup
|
||||
face global title blue
|
||||
face global header cyan
|
||||
face global mono green
|
||||
face global block magenta
|
||||
face global link cyan
|
||||
face global bullet cyan
|
||||
face global list yellow
|
||||
|
||||
# builtin faces
|
||||
face global Default default,default
|
||||
|
||||
face global PrimaryCursor ${accent_fg},${accent_color}+fg
|
||||
face global PrimaryCursorEol PrimaryCursor
|
||||
face global PrimarySelection default,${bg_light}+f
|
||||
|
||||
face global SecondaryCursor default,default+rfg
|
||||
face global SecondaryCursorEol SecondaryCursor
|
||||
face global SecondarySelection PrimarySelection
|
||||
|
||||
face global InactiveCursor ${accent_fg},${bg_light}+fg
|
||||
|
||||
face global MenuForeground ${accent_fg},${accent_color}
|
||||
face global MenuBackground default,${bg_dark}
|
||||
face global MenuInfo cyan
|
||||
|
||||
face global Information default,${bg_dark}
|
||||
face global Error default,red+g
|
||||
|
||||
face global StatusLine %sh{
|
||||
printf "rgb:"
|
||||
head /dev/urandom |
|
||||
base64 |
|
||||
rg --text -o "${color.random_range}" |
|
||||
head -n 6 |
|
||||
sd '\n' ""
|
||||
}
|
||||
face global StatusLineMode StatusLine
|
||||
face global StatusLineInfo StatusLine
|
||||
face global StatusLineValue StatusLine
|
||||
face global StatusCursor ${accent_fg},${accent_color}
|
||||
|
||||
face global Prompt yellow,default
|
||||
try %{add-highlighter global/ show-matching}
|
||||
face global MatchingChar ${accent_color},default+b
|
||||
|
||||
# Goodies
|
||||
try %{add-highlighter global/number-lines number-lines -relative -hlcursor}
|
||||
face global LineNumbers ${bg_light},default
|
||||
face global LineNumberCursor default,${bg_dark}
|
||||
face global LineNumbersWrapped red,default
|
||||
|
||||
try %{add-highlighter global/ show-whitespaces}
|
||||
face global Whitespace ${nontxt},default+f
|
||||
face global BufferPadding ${nontxt},default
|
||||
## highlight trailing whitespace
|
||||
# add-highlighter global/ regex '\h*$' 0:red,red+u
|
||||
|
||||
face global Reference default+bu
|
||||
face global InlayHint ${bg_light}+buif
|
||||
|
||||
# Lsp
|
||||
''
|
||||
+ (lib.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList
|
||||
(name: color: ''
|
||||
face global HighlightDiagnostic${name} ${color},default+bu
|
||||
face global Diagnostic${name} ${color},default+bu
|
||||
face global TextDiagnostic${name} ${color},default+b
|
||||
face global InlayDiagnostic${name} ${color},default+br
|
||||
'')
|
||||
{
|
||||
Error = "red";
|
||||
Warning = "yellow";
|
||||
Hint = "blue";
|
||||
}
|
||||
))
|
||||
+ ''
|
||||
# Color palette
|
||||
declare-option str red "red"
|
||||
declare-option str mauve "magenta"
|
||||
declare-option str maroon "rgb:ee99a0"
|
||||
declare-option str pink "rgb:f5bde6"
|
||||
declare-option str cyan "cyan"
|
||||
declare-option str yellow "yellow"
|
||||
declare-option str green "green"
|
||||
declare-option str white "white"
|
||||
declare-option str blue "blue"
|
||||
declare-option str sky "rgb:91d7e3"
|
||||
declare-option str lavender "rgb:b7bdf8"
|
||||
declare-option str black1 "rgb:202020"
|
||||
declare-option str black2 "rgb:272727"
|
||||
declare-option str black3 "rgb:3a3a3a"
|
||||
declare-option str orange ${orange}
|
||||
declare-option str teal "rgb:8bd5ca"
|
||||
declare-option str flamingo "rgb:f0c6c6"
|
||||
declare-option str gray0 "rgb:606060"
|
||||
declare-option str gray1 "rgb:737373"
|
||||
declare-option str bright_red "%opt{red}+b"
|
||||
declare-option str bright_green "%opt{green}+b"
|
||||
declare-option str bright_yellow "%opt{yellow}+b"
|
||||
declare-option str bright_blue "%opt{blue}+b"
|
||||
declare-option str bright_cyan "%opt{cyan}+b"
|
||||
declare-option str foreground %opt{white}
|
||||
declare-option str background %opt{black2}
|
||||
declare-option str overlay0 "rgb:878787"
|
||||
declare-option str overlay1 "rgb:9a9a9a"
|
||||
|
||||
# Tree-sitter (<https://git.sr.ht/~hadronized/kak-tree-sitter>)
|
||||
set-face global ts_attribute "%opt{cyan}"
|
||||
set-face global ts_comment "%opt{overlay0}+i"
|
||||
set-face global ts_conceal "%opt{mauve}+i"
|
||||
set-face global ts_constant "%opt{orange}"
|
||||
set-face global ts_constant_builtin_boolean "%opt{sky}"
|
||||
set-face global ts_constant_character "%opt{yellow}"
|
||||
set-face global ts_constant_macro "%opt{mauve}"
|
||||
set-face global ts_constructor "%opt{cyan}"
|
||||
set-face global ts_diff_plus "%opt{green}"
|
||||
set-face global ts_diff_minus "%opt{red}"
|
||||
set-face global ts_diff_delta "%opt{blue}"
|
||||
set-face global ts_diff_delta_moved "%opt{mauve}"
|
||||
set-face global ts_error "%opt{red}+b"
|
||||
set-face global ts_function "%opt{blue}"
|
||||
set-face global ts_function_builtin "%opt{blue}+i"
|
||||
set-face global ts_function_macro "%opt{mauve}"
|
||||
set-face global ts_hint "%opt{blue}+b"
|
||||
set-face global ts_info "%opt{green}+b"
|
||||
set-face global ts_keyword "%opt{mauve}"
|
||||
set-face global ts_keyword_conditional "%opt{mauve}+i"
|
||||
set-face global ts_keyword_control_conditional "%opt{mauve}+i"
|
||||
set-face global ts_keyword_control_directive "%opt{mauve}+i"
|
||||
set-face global ts_keyword_control_import "%opt{mauve}+i"
|
||||
set-face global ts_keyword_directive "%opt{mauve}+i"
|
||||
set-face global ts_keyword_storage "%opt{mauve}"
|
||||
set-face global ts_keyword_storage_modifier "%opt{mauve}"
|
||||
set-face global ts_keyword_storage_modifier_mut "%opt{mauve}"
|
||||
set-face global ts_keyword_storage_modifier_ref "%opt{teal}"
|
||||
set-face global ts_label "%opt{cyan}+i"
|
||||
set-face global ts_markup_bold "%opt{orange}+b"
|
||||
set-face global ts_markup_heading "%opt{red}"
|
||||
set-face global ts_markup_heading_1 "%opt{red}"
|
||||
set-face global ts_markup_heading_2 "%opt{mauve}"
|
||||
set-face global ts_markup_heading_3 "%opt{green}"
|
||||
set-face global ts_markup_heading_4 "%opt{yellow}"
|
||||
set-face global ts_markup_heading_5 "%opt{pink}"
|
||||
set-face global ts_markup_heading_6 "%opt{teal}"
|
||||
set-face global ts_markup_heading_marker "%opt{orange}+b"
|
||||
set-face global ts_markup_italic "%opt{pink}+i"
|
||||
set-face global ts_markup_list_checked "%opt{green}"
|
||||
set-face global ts_markup_list_numbered "%opt{blue}+i"
|
||||
set-face global ts_markup_list_unchecked "%opt{teal}"
|
||||
set-face global ts_markup_list_unnumbered "%opt{mauve}"
|
||||
set-face global ts_markup_link_label "%opt{blue}"
|
||||
set-face global ts_markup_link_url "%opt{teal}+u"
|
||||
set-face global ts_markup_link_uri "%opt{teal}+u"
|
||||
set-face global ts_markup_link_text "%opt{blue}"
|
||||
set-face global ts_markup_quote "%opt{gray1}"
|
||||
set-face global ts_markup_raw "%opt{green}"
|
||||
set-face global ts_markup_strikethrough "%opt{gray1}+s"
|
||||
set-face global ts_namespace "%opt{blue}+i"
|
||||
set-face global ts_operator "%opt{sky}"
|
||||
set-face global ts_property "%opt{sky}"
|
||||
set-face global ts_punctuation "%opt{overlay1}"
|
||||
set-face global ts_punctuation_special "%opt{sky}"
|
||||
set-face global ts_special "%opt{blue}"
|
||||
set-face global ts_spell "%opt{mauve}"
|
||||
set-face global ts_string "%opt{green}"
|
||||
set-face global ts_string_regex "%opt{orange}"
|
||||
set-face global ts_string_regexp "%opt{orange}"
|
||||
set-face global ts_string_escape "%opt{mauve}"
|
||||
set-face global ts_string_special "%opt{blue}"
|
||||
set-face global ts_string_special_path "%opt{orange}"
|
||||
set-face global ts_string_special_symbol "%opt{mauve}"
|
||||
set-face global ts_string_symbol "%opt{red}"
|
||||
set-face global ts_tag "%opt{mauve}"
|
||||
set-face global ts_tag_error "%opt{red}"
|
||||
set-face global ts_text "%opt{white}"
|
||||
set-face global ts_text_title "%opt{mauve}"
|
||||
set-face global ts_type "%opt{yellow}"
|
||||
set-face global ts_type_enum_variant "%opt{flamingo}"
|
||||
set-face global ts_variable "%opt{blue}"
|
||||
set-face global ts_variable_builtin "%opt{red}"
|
||||
set-face global ts_variable_other_member "%opt{teal}"
|
||||
set-face global ts_variable_parameter "%opt{maroon}+i"
|
||||
set-face global ts_warning "%opt{orange}+b"
|
||||
''
|
155
user/kakoune/default.nix
Normal file
155
user/kakoune/default.nix
Normal file
|
@ -0,0 +1,155 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (config.my)
|
||||
dmenu
|
||||
editor
|
||||
theme
|
||||
accent
|
||||
;
|
||||
inherit (theme) color;
|
||||
inherit (pkgs) kakounePlugins;
|
||||
inherit (pkgs.kakouneUtils) buildKakounePlugin;
|
||||
in
|
||||
{
|
||||
imports = [ ./kak-tree-sitter.nix ];
|
||||
config = {
|
||||
programs.kakoune = {
|
||||
enable = true;
|
||||
plugins = with kakounePlugins; [
|
||||
kak-ansi
|
||||
active-window-kak
|
||||
(buildKakounePlugin rec {
|
||||
pname = "auto-pairs.kak";
|
||||
version = "0.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "alexherbo2";
|
||||
repo = pname;
|
||||
rev = "bfdcb8566076f653ec707f86207f83ea75173ce9";
|
||||
sha256 = "sha256-MgqCuGj03ctKty2yQgQvy6qV/0s7euNwukhSjqauqW8=";
|
||||
};
|
||||
})
|
||||
(buildKakounePlugin rec {
|
||||
pname = "kakoune-mirror-colemak";
|
||||
version = "0.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "lelgenio";
|
||||
repo = pname;
|
||||
rev = "8f191172590d7615d0a56c857e9331ce69164670";
|
||||
sha256 = "sha256-ERNtWOn8rq53YmByTQnwDObN7Fs5HYBwvNIyTJrj2hw=";
|
||||
};
|
||||
})
|
||||
(buildKakounePlugin rec {
|
||||
pname = "kakoune-palette";
|
||||
version = "0.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "delapouite";
|
||||
repo = pname;
|
||||
rev = "052cab5f48578679d94717ed5f62429be9865d5d";
|
||||
sha256 = "sha256-fk0TL6qG3zX8cPp1xvhMw0/g9xSKKp04uyagaPq/Nd0=";
|
||||
};
|
||||
})
|
||||
(buildKakounePlugin rec {
|
||||
pname = "kak-crosshairs";
|
||||
version = "0.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "lelgenio";
|
||||
repo = pname;
|
||||
rev = "3a6bcd9b50737a9280de109e32048991a2f85f7c";
|
||||
sha256 = "sha256-wZQ9tsAOqG4eW28DwJ6VcsR9gSrCGqFjbTARhvTLWTQ=";
|
||||
};
|
||||
})
|
||||
(buildKakounePlugin rec {
|
||||
pname = "kakoune-colemak-neio";
|
||||
version = "0.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "lelgenio";
|
||||
repo = pname;
|
||||
rev = "28b9aabafb8d422a4c52b2a15424056fb87c8d90";
|
||||
sha256 = "sha256-d3OTjo02QFsbNqmgd28fHgSjPcdF8BJleCJGCyOFc18=";
|
||||
};
|
||||
})
|
||||
(buildKakounePlugin rec {
|
||||
pname = "kakoune-multi-file";
|
||||
version = "0.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "natasky";
|
||||
repo = pname;
|
||||
rev = "1cc6baeb14b773916eb9209469aa77b3cfa67a0a";
|
||||
sha256 = "sha256-3PLxG9UtT0MMSibvTviXQIgTH3rApZ3WSbNCEH3c7HE=";
|
||||
};
|
||||
})
|
||||
];
|
||||
extraConfig =
|
||||
lib.concatStringsSep "\n" (
|
||||
map (lib.readFile) (
|
||||
[
|
||||
./filetypes.kak
|
||||
./hooks.kak
|
||||
./indent.kak
|
||||
./keys.kak
|
||||
./lsp-config.kak
|
||||
./usermode.kak
|
||||
./git-mode.kak
|
||||
]
|
||||
++ lib.optional (dmenu == "rofi") ./rofi-commands.kak
|
||||
)
|
||||
)
|
||||
+ ''
|
||||
try %{
|
||||
eval %sh{ kak-tree-sitter -vvvv -dks --init $kak_session }
|
||||
}
|
||||
|
||||
set global scrolloff 10,20
|
||||
set global autoreload yes
|
||||
set global startup_info_version 99999999
|
||||
|
||||
''
|
||||
+ (import ./colors.nix {
|
||||
inherit
|
||||
pkgs
|
||||
lib
|
||||
color
|
||||
accent
|
||||
;
|
||||
});
|
||||
};
|
||||
home.file = {
|
||||
".config/kak-lsp/kak-lsp.toml".source = ./kak-lsp.toml;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
terminal
|
||||
ranger
|
||||
bmenu
|
||||
kak-lsp
|
||||
unstable.kak-tree-sitter
|
||||
kak-pager
|
||||
kak-man-pager
|
||||
|
||||
emmet-cli
|
||||
nodePackages.prettier
|
||||
pint-fmt
|
||||
|
||||
aspell
|
||||
aspellDicts.en
|
||||
aspellDicts.pt_BR
|
||||
];
|
||||
home.activation = {
|
||||
update_kakoune = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
$DRY_RUN_CMD timeout 1s kak -clear &&
|
||||
$DRY_RUN_CMD timeout 1s kak -l | xargs -r -n1 timeout 1s kak -e "config-source;quit" -ui dummy -c ||
|
||||
$DRY_RUN_CMD true
|
||||
'';
|
||||
};
|
||||
home.sessionVariables = lib.mkIf (editor == "kakoune") {
|
||||
EDITOR = "kak";
|
||||
# Some plugins(kak_ansi) like to compile stuff
|
||||
CC = "cc";
|
||||
};
|
||||
};
|
||||
}
|
243
user/kakoune/filetypes.kak
Normal file
243
user/kakoune/filetypes.kak
Normal file
|
@ -0,0 +1,243 @@
|
|||
|
||||
try %{
|
||||
require-module python
|
||||
add-highlighter shared/python/code/function regex '\b([a-zA-Z_][a-zA-Z0-9_]*)\s*\(' 1:function
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=sh %{
|
||||
set buffer formatcmd 'shfmt -s -ci -i "4"'
|
||||
}
|
||||
hook global WinSetOption filetype=c %{
|
||||
set buffer formatcmd 'clang-format'
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=nix %{
|
||||
set buffer formatcmd 'nixfmt'
|
||||
}
|
||||
|
||||
hook global BufCreate .*\.html %{
|
||||
set buffer formatcmd 'prettier --parser html'
|
||||
}
|
||||
|
||||
hook global BufCreate .*\.component\.html %{
|
||||
set buffer filetype angular
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=angular %[
|
||||
set-option buffer extra_word_chars '_' '-'
|
||||
|
||||
require-module html
|
||||
add-highlighter buffer/angular ref html
|
||||
]
|
||||
|
||||
hook global BufCreate .*\.php %{
|
||||
set buffer formatcmd 'pint-fmt'
|
||||
}
|
||||
|
||||
hook global BufCreate .*\.js %{
|
||||
set buffer formatcmd 'prettier --parser babel'
|
||||
}
|
||||
|
||||
hook global BufCreate .*\.scss %{
|
||||
set buffer formatcmd 'prettier --parser scss'
|
||||
}
|
||||
|
||||
hook global BufCreate .*\.vue %{
|
||||
set buffer formatcmd 'prettier --parser vue'
|
||||
hook buffer InsertCompletionHide {
|
||||
execute-keys 'Ghs$1<ret>c'
|
||||
}
|
||||
}
|
||||
|
||||
hook global BufCreate .*\.jsonc %[ set buffer filetype jsonc ]
|
||||
hook global BufCreate .*\.blade.php %[ set buffer filetype blade ]
|
||||
hook global BufCreate .*\.less %[ set buffer filetype less ]
|
||||
hook global BufCreate .*\.(tera|askama)\.?.* %[
|
||||
require-module jinja
|
||||
add-highlighter buffer/jinja ref jinja
|
||||
]
|
||||
|
||||
hook global WinSetOption filetype=rust %[
|
||||
require-module rust
|
||||
|
||||
add-highlighter window/rust-custom regions
|
||||
|
||||
require-module html
|
||||
add-highlighter window/rust-custom/html region -recurse '\{' '(html|view)!\s*\{\K' '(?=\})' ref html
|
||||
|
||||
require-module sql
|
||||
add-highlighter window/rust-custom/sql region 'r#"\K--\s*sql' '"#' group
|
||||
add-highlighter window/rust-custom/sql/ fill white
|
||||
add-highlighter window/rust-custom/sql/ ref sql
|
||||
]
|
||||
|
||||
hook global WinSetOption filetype=sql %[
|
||||
set buffer comment_line '--'
|
||||
]
|
||||
|
||||
hook global WinSetOption filetype=jsonc %[
|
||||
set buffer comment_line '//'
|
||||
|
||||
require-module json
|
||||
add-highlighter buffer/jsonc regions
|
||||
add-highlighter buffer/jsonc/base default-region ref json
|
||||
add-highlighter buffer/jsonc/double_string region ["] ["] fill string
|
||||
add-highlighter buffer/jsonc/line-comment region // $ fill comment
|
||||
]
|
||||
|
||||
|
||||
hook global WinSetOption filetype=blade %[
|
||||
set buffer formatcmd 'blade-formatter \
|
||||
--end-with-newline \
|
||||
--indent-size "4" \
|
||||
--wrap-line-length "80" \
|
||||
--stdin'
|
||||
set-option buffer extra_word_chars '_' '-'
|
||||
|
||||
hook window ModeChange pop:insert:.* -group blade-trim-indent blade-trim-indent
|
||||
hook window InsertChar .* -group blade-indent blade-indent-on-char
|
||||
hook window InsertChar \n -group blade-indent blade-indent-on-new-line
|
||||
|
||||
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window blade-.+ }
|
||||
|
||||
require-module php
|
||||
require-module javascript
|
||||
|
||||
add-highlighter buffer/blade regions
|
||||
add-highlighter buffer/blade/base default-region group
|
||||
|
||||
add-highlighter buffer/blade/string region '"' '"' regions
|
||||
add-highlighter buffer/blade/string/base default-region fill string
|
||||
add-highlighter buffer/blade/string/expression region '\{\{(?!--)' '(?!--)\}\}' ref php
|
||||
add-highlighter buffer/blade/string/raw-expression region '\{!!' '!!\}' ref php
|
||||
|
||||
add-highlighter buffer/blade/base/ ref html
|
||||
|
||||
add-highlighter buffer/blade/php region '@php' '@endphp' group
|
||||
add-highlighter buffer/blade/php/ ref php
|
||||
add-highlighter buffer/blade/php/ regex '@((end)?php)' 1:block
|
||||
|
||||
add-highlighter buffer/blade/js region '<script>' '</script>' group
|
||||
add-highlighter buffer/blade/js/ ref javascript
|
||||
|
||||
add-highlighter buffer/blade/expression region '\{\{(?!--)' '(?!--)\}\}' ref php
|
||||
add-highlighter buffer/blade/statement region -recurse '\(' '@(if|foreach|for|section|yield|include)\s*\(' '\)' ref php
|
||||
add-highlighter buffer/blade/base/ regex '@(else(if)?|include|case|break)' 1:keyword
|
||||
add-highlighter buffer/blade/base/ regex '@((end)?(if|isset|foreach|for|section|switch))' 1:keyword
|
||||
|
||||
add-highlighter buffer/blade/comment region '\{\{--' '--\}\}' fill comment
|
||||
set-option buffer comment_block_begin '{{-- '
|
||||
set-option buffer comment_block_end ' --}}'
|
||||
|
||||
map buffer user 'c' '<a-x>_: comment-block<ret><a-;>;' -docstring 'comment block'
|
||||
]
|
||||
|
||||
try %§
|
||||
|
||||
define-command -hidden blade-trim-indent %{
|
||||
# remove trailing white spaces
|
||||
try %{ execute-keys -draft -itersel <a-x> s \h+$ <ret> d }
|
||||
}
|
||||
|
||||
define-command -hidden blade-indent-on-char %<
|
||||
evaluate-commands -draft -itersel %<
|
||||
# align closer token to its opener when alone on a line
|
||||
try %/ execute-keys -draft <a-h> <a-k> ^\h+[\]}]$ <ret> m s \A|.\z <ret> 1<a-&> /
|
||||
>
|
||||
>
|
||||
|
||||
define-command -hidden blade-indent-on-new-line %<
|
||||
evaluate-commands -draft -itersel %<
|
||||
# copy // comments or docblock * prefix and following white spaces
|
||||
try %{ execute-keys -draft s [^/] <ret> k <a-x> s ^\h*\K(?://|[*][^/])\h* <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ execute-keys -draft <semicolon> K <a-&> }
|
||||
# filter previous line
|
||||
try %{ execute-keys -draft k : blade-trim-indent <ret> }
|
||||
# indent after lines beginning / ending with opener token
|
||||
try %_ execute-keys -draft k <a-x> <a-k> ^\h*[[{]|[[{]$ <ret> j <a-gt> _
|
||||
# append " * " on lines starting a multiline /** or /* comment
|
||||
try %{ execute-keys -draft k <a-x> s ^\h*/[*][* ]? <ret> j gi i <space>*<space> }
|
||||
# deindent closer token(s) when after cursor
|
||||
try %_ execute-keys -draft <a-x> <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> _
|
||||
>
|
||||
>
|
||||
§
|
||||
|
||||
hook global WinSetOption filetype=less %[
|
||||
set buffer formatcmd 'prettier \
|
||||
--tab-width "4" \
|
||||
--print-width "80" \
|
||||
--parser less'
|
||||
|
||||
set-option buffer extra_word_chars '_' '-'
|
||||
|
||||
set buffer comment_line '//'
|
||||
set buffer comment_block_begin '/*'
|
||||
set buffer comment_block_end '*/'
|
||||
|
||||
hook window ModeChange pop:insert:.* -group less-trim-indent less-trim-indent
|
||||
hook window InsertChar \n -group less-indent less-indent-on-new-line
|
||||
hook window InsertChar \} -group less-indent less-indent-on-closing-curly-brace
|
||||
|
||||
map buffer insert <c-k> '<esc>xs\$\d+<ret>) c'
|
||||
|
||||
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window less-.+ }
|
||||
|
||||
add-highlighter buffer/less regions
|
||||
add-highlighter buffer/less/code default-region group
|
||||
|
||||
add-highlighter buffer/less/line-comment region // $ fill comment
|
||||
add-highlighter buffer/less/comment region /[*] [*]/ fill comment
|
||||
add-highlighter buffer/less/double_string region ["] ["] fill string
|
||||
add-highlighter buffer/less/single_string region ['] ['] fill string
|
||||
|
||||
add-highlighter buffer/less/code/ regex ([A-Za-z][A-Za-z0-9_-]*)\h*: 1:keyword
|
||||
add-highlighter buffer/less/code/ regex ::?(\w+) 0:attribute
|
||||
add-highlighter buffer/less/code/ regex !important 0:keyword
|
||||
|
||||
add-highlighter buffer/less/code/selector group
|
||||
add-highlighter buffer/less/code/selector/ regex [A-Za-z][A-Za-z0-9_-]* 0:keyword
|
||||
add-highlighter buffer/less/code/selector/ regex [*]|[#.][A-Za-z][A-Za-z0-9_-]* 0:variable
|
||||
add-highlighter buffer/less/code/selector/ regex &([A-Za-z0-9_-]*) 1:variable
|
||||
add-highlighter buffer/less/code/selector/ regex & 0:operator
|
||||
add-highlighter buffer/less/code/selector/ regex (\.?[A-Za-z][A-Za-z0-9_-]*)\s*\( 1:function
|
||||
|
||||
add-highlighter buffer/less/code/ regex (\b(\d*\.)?\d+(ch|cm|em|ex|mm|pc|pt|px|rem|vh|vmax|vmin|vw|%|s|ms)?) 0:value 3:type
|
||||
add-highlighter buffer/less/code/ regex (#)[0-9A-Fa-f]{3}([0-9A-Fa-f]{3}([0-9A-Fa-f]{2})?)?\b 0:value 1:operator
|
||||
|
||||
add-highlighter buffer/less/code/ regex (?i)\b(AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGray|DarkGrey|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGray|DarkSlateGrey|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGray|DimGrey|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gray|Grey|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGray|LightGrey|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGray|LightSlateGrey|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGray|SlateGrey|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b 0:value
|
||||
|
||||
add-highlighter buffer/less/code/ regex ([\w-_]+)\s*: 1:attribute
|
||||
add-highlighter buffer/less/code/ regex @[\w\d-_]+ 0:variable
|
||||
|
||||
]
|
||||
|
||||
try %§
|
||||
|
||||
define-command -hidden less-trim-indent %{
|
||||
# remove trailing white spaces
|
||||
try %{ execute-keys -draft -itersel <a-x> s \h+$ <ret> d }
|
||||
}
|
||||
|
||||
define-command -hidden less-indent-on-new-line %[
|
||||
evaluate-commands -draft -itersel %[
|
||||
# preserve previous line indent
|
||||
try %[ execute-keys -draft <semicolon> K <a-&> ]
|
||||
# filter previous line
|
||||
try %[ execute-keys -draft k : less-trim-indent <ret> ]
|
||||
# indent after lines ending with with {
|
||||
try %[ execute-keys -draft k <a-x> <a-k> \{$ <ret> j <a-gt> ]
|
||||
# deindent closing brace when after cursor
|
||||
try %[ execute-keys -draft <a-x> <a-k> ^\h*\} <ret> gh / \} <ret> m <a-S> 1<a-&> ]
|
||||
]
|
||||
]
|
||||
|
||||
define-command -hidden less-indent-on-closing-curly-brace %[
|
||||
evaluate-commands -draft -itersel %[
|
||||
# align to opening curly brace when alone on a line
|
||||
try %[ execute-keys -draft <a-h> <a-k> ^\h+\}$ <ret> m s \A|.\z <ret> 1<a-&> ]
|
||||
]
|
||||
]
|
||||
|
||||
§
|
134
user/kakoune/git-mode.kak
Normal file
134
user/kakoune/git-mode.kak
Normal file
|
@ -0,0 +1,134 @@
|
|||
try %{
|
||||
# declare-user-mode surround
|
||||
declare-user-mode git
|
||||
}
|
||||
|
||||
map global user 'v' ': enter-user-mode git<ret>' -docstring 'git vcs mode'
|
||||
map global user 'V' ': enter-user-mode -lock git<ret>' -docstring 'git vcs mode'
|
||||
|
||||
# show status
|
||||
map global git 's' ': git status<ret>' -docstring 'status'
|
||||
map global git 'S' '_: git show %val{selection} --<ret>' -docstring 'show'
|
||||
map global git 'g' ': git-graph <ret>' -docstring 'graph all commits'
|
||||
map global git 'G' ': git-graph-simpified <ret>' -docstring 'graph all branches'
|
||||
map global git '<a-g>' ': git-graph-with-remotes<ret>' -docstring 'graph all branches and remotes'
|
||||
map global git 'd' ': git diff %reg{%}<ret>' -docstring 'diff current'
|
||||
map global git 'D' ': git diff<ret>' -docstring 'diff all'
|
||||
map global git '<a-d>' ': git diff --staged<ret>' -docstring 'diff staged'
|
||||
|
||||
map global git 'n' ': git next-hunk <ret>' -docstring 'next git modification'
|
||||
map global git 'p' ': git prev-hunk <ret>' -docstring 'previous git modification'
|
||||
|
||||
# make commits
|
||||
map global git 'a' ': git add<ret>' -docstring 'add current'
|
||||
map global git 'A' ': git add --all<ret>' -docstring 'add all'
|
||||
map global git 'c' ': git commit -v<ret>' -docstring 'commit'
|
||||
|
||||
# discard work
|
||||
map global git 'r' ': git checkout %reg{%}<ret>' -docstring 'restore current'
|
||||
|
||||
# deal with merges
|
||||
map global git 'N' ': git-next-merge-conflict <ret>' -docstring 'next git merge conflict'
|
||||
map global git 'P' ': git-prev-merge-conflict <ret>' -docstring 'previous git merge conflict'
|
||||
map global git 'm' ': git-merge-head <ret>' -docstring 'merge using head'
|
||||
map global git 'M' ': git-merge-new <ret>' -docstring 'merge using new'
|
||||
map global git '<c-m>' ': git-merge-head-and-new <ret>' -docstring 'merge using both head and new'
|
||||
map global git '<a-m>' ': git-merge-original <ret>' -docstring 'merge using original'
|
||||
|
||||
define-command -override git-next-merge-conflict %{
|
||||
try %{
|
||||
execute-keys /^<lt>{6,}.*?^<gt>{6,}.*?$<ret>
|
||||
} catch %{
|
||||
fail "No hunks found forward"
|
||||
}
|
||||
} -docstring "next git merge hunk"
|
||||
|
||||
define-command -override git-prev-merge-conflict %{
|
||||
try %{
|
||||
execute-keys <a-/>^<lt>{6,}.*?^<gt>{6,}.*?$<ret>
|
||||
} catch %{
|
||||
fail "No hunks found backwards"
|
||||
}
|
||||
} -docstring "previous git merge hunk"
|
||||
|
||||
define-command -override git-merge-head %{
|
||||
evaluate-commands -draft %{
|
||||
# delete head marker
|
||||
execute-keys <a-/>^<lt>{4,}<ret>xd
|
||||
try %{
|
||||
# select original marker
|
||||
execute-keys /^[|]{4,}<ret>
|
||||
# extend to theirs marker
|
||||
execute-keys ?^={4,}<ret>x
|
||||
} catch %{
|
||||
# select theirs marker
|
||||
execute-keys /^={4,}<ret>x
|
||||
}
|
||||
# extend to end marker
|
||||
execute-keys ?^<gt>{4,}<ret>xd
|
||||
}
|
||||
} -docstring "merge using head"
|
||||
|
||||
define-command -override git-merge-original %{
|
||||
evaluate-commands -draft %{
|
||||
# select head marker
|
||||
execute-keys <a-/>^<lt>{4,}<ret>
|
||||
# select to middle of conflict
|
||||
execute-keys ?^[|]{4,}<ret>xd
|
||||
# select theirs marker
|
||||
execute-keys /^={4,}<ret>
|
||||
# extend to end marker
|
||||
execute-keys ?^<gt>{4,}<ret>xd
|
||||
}
|
||||
} -docstring "merge using original"
|
||||
|
||||
define-command -override git-merge-new %{
|
||||
evaluate-commands -draft %{
|
||||
# select head marker
|
||||
execute-keys <a-/>^<lt>{4,}<ret>
|
||||
# extend to theirs marker
|
||||
execute-keys ?^={4,}\n<ret>d
|
||||
# delete end marker
|
||||
execute-keys /^<gt>{4,}<ret>xd
|
||||
}
|
||||
} -docstring "merge using new"
|
||||
|
||||
define-command -override git-merge-head-and-new %{
|
||||
evaluate-commands -draft %{
|
||||
# delete head marker
|
||||
execute-keys <a-/>^<lt>{4,}<ret>xd
|
||||
# select middle of conflict
|
||||
execute-keys /^[|]{4,}<ret>x
|
||||
# extendo to theirs marker
|
||||
execute-keys ?^={4,}<ret>xd
|
||||
# delete end marker
|
||||
execute-keys /^<gt>{4,}<ret>xd
|
||||
}
|
||||
} -docstring "merge using head and new"
|
||||
|
||||
define-command -override git-graph %{
|
||||
try %{ delete-buffer '*git-graph*' }
|
||||
edit -scratch '*git-graph*'
|
||||
execute-keys '<a-!> timeout 10s git graph --color=always --decorate --branches<ret>'
|
||||
execute-keys 'gg'
|
||||
try ansi-render
|
||||
map buffer normal q ': delete-buffer!<ret>'
|
||||
}
|
||||
|
||||
define-command -override git-graph-simpified %{
|
||||
try %{ delete-buffer '*git-graph*' }
|
||||
edit -scratch '*git-graph*'
|
||||
execute-keys '<a-!> timeout 10s git graph --color=always --decorate --all --simplify-by-decoration<ret>'
|
||||
execute-keys 'gg'
|
||||
try ansi-render
|
||||
map buffer normal q ': delete-buffer!<ret>'
|
||||
}
|
||||
|
||||
define-command -override git-graph-with-remotes %{
|
||||
try %{ delete-buffer '*git-graph*' }
|
||||
edit -scratch '*git-graph*'
|
||||
execute-keys '<a-!> timeout 10s git graph --color=always --decorate --all<ret>'
|
||||
execute-keys 'gg'
|
||||
try ansi-render
|
||||
map buffer normal q ': delete-buffer!<ret>'
|
||||
}
|
56
user/kakoune/hooks.kak
Normal file
56
user/kakoune/hooks.kak
Normal file
|
@ -0,0 +1,56 @@
|
|||
set global idle_timeout 500
|
||||
|
||||
enable-auto-pairs
|
||||
|
||||
hook global NormalIdle .* %{ evaluate-commands %sh{
|
||||
hex_with_size() {
|
||||
for i in 3 4 6 8; do
|
||||
printf "[0-9a-f]{$i}|"
|
||||
done
|
||||
}
|
||||
echo "$kak_selection" | grep -P "^#?($(hex_with_size))$" > /dev/null &&
|
||||
echo 'palette-status'
|
||||
} }
|
||||
|
||||
define-command -hidden -override git-try-show-diff %{
|
||||
evaluate-commands -draft %sh{
|
||||
test -f "$kak_buffile" || exit 0
|
||||
cd $(dirname "$kak_buffile")
|
||||
git rev-parse --git-dir > /dev/null &&
|
||||
echo "git show-diff"
|
||||
}
|
||||
}
|
||||
|
||||
evaluate-commands %sh{
|
||||
for hook in NormalIdle FocusIn FocusOut BufWritePost BufOpenFile; do
|
||||
printf "hook global %s .* 'git-try-show-diff'\n" "$hook"
|
||||
done
|
||||
}
|
||||
|
||||
define-command -override diffr %{ try %{
|
||||
execute-keys -draft 'ggxsdiff<ret>'
|
||||
execute-keys -draft '%<a-;>J| _diffr<ret>'
|
||||
ansi-render
|
||||
} }
|
||||
|
||||
hook global BufOpenFile .* diffr
|
||||
|
||||
hook global BufOpenFile .* %{
|
||||
modeline-parse
|
||||
}
|
||||
|
||||
hook global BufOpenFile .*/COMMIT_EDITMSG %{
|
||||
execute-keys -draft 'ge<a-!>git log -1000 --oneline<ret>'
|
||||
write
|
||||
}
|
||||
|
||||
hook global RegisterModified '"' %{ nop %sh{ {
|
||||
printf %s "$kak_reg_dquote" | wl-copy -n
|
||||
printf %s "$kak_reg_dquote" | xclip -i -selection clipboard
|
||||
} > /dev/null 2>&1 < /dev/null & }} -group sync-clipboard
|
||||
|
||||
# Trim trailing whitespace
|
||||
hook global BufWritePre .* %{ try %{
|
||||
execute-keys -draft \%s\h+$<ret>d
|
||||
} } -group remove-whitespace
|
||||
|
33
user/kakoune/indent.kak
Normal file
33
user/kakoune/indent.kak
Normal file
|
@ -0,0 +1,33 @@
|
|||
# {{@@ header() @@}}
|
||||
# _ __ _
|
||||
# | |/ /__ _| | _____ _ _ _ __ ___
|
||||
# | ' // _` | |/ / _ \| | | | '_ \ / _ \
|
||||
# | . \ (_| | < (_) | |_| | | | | __/
|
||||
# |_|\_\__,_|_|\_\___/ \__,_|_| |_|\___|
|
||||
|
||||
set global tabstop 4
|
||||
|
||||
hook global BufCreate .*\.py %{
|
||||
set global indentwidth 4
|
||||
}
|
||||
|
||||
hook global BufCreate .*\.nix %{
|
||||
set global indentwidth 2
|
||||
}
|
||||
|
||||
#################################################################
|
||||
# Spaces
|
||||
#################################################################
|
||||
|
||||
set global indentwidth 4
|
||||
|
||||
# use spaces insted of tabs
|
||||
hook global BufCreate .* %{
|
||||
hook buffer InsertChar \t %{
|
||||
exec -draft -itersel h@
|
||||
} -group replace-tabs-with-spaces
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=makefile %{
|
||||
remove-hooks buffer replace-tabs-with-spaces
|
||||
}
|
155
user/kakoune/kak-lsp.toml
Normal file
155
user/kakoune/kak-lsp.toml
Normal file
|
@ -0,0 +1,155 @@
|
|||
snippet_support = false
|
||||
verbosity = 2
|
||||
|
||||
[server]
|
||||
# exit session if no requests were received during given period in seconds
|
||||
# works only in unix sockets mode (-s/--session)
|
||||
# set to 0 to disable
|
||||
timeout = 1800 # seconds = 30 minutes
|
||||
|
||||
[language_server.angular]
|
||||
filetypes = ["angular"]
|
||||
roots = [".angular", ".git"]
|
||||
command = "node"
|
||||
args = [
|
||||
"/home/lelgenio/.config/yarn/global/node_modules/@angular/language-server",
|
||||
"--ngProbeLocations",
|
||||
"/home/lelgenio/.config/yarn/global/node_modules",
|
||||
"--tsProbeLocations",
|
||||
"/home/lelgenio/.config/yarn/global/node_modules",
|
||||
"--stdio",
|
||||
]
|
||||
|
||||
[language_server.bash-language-server]
|
||||
filetypes = ["sh"]
|
||||
roots = [".git", ".hg"]
|
||||
command = "bash-language-server"
|
||||
args = ["start"]
|
||||
|
||||
[language_server.clangd]
|
||||
filetypes = ["c", "cpp"]
|
||||
roots = ["compile_commands.json", ".clangd", ".git", ".hg"]
|
||||
command = "clangd"
|
||||
|
||||
[language_server.css-language-server]
|
||||
filetypes = ["css"]
|
||||
roots = ["package.json", ".git", ".hg"]
|
||||
command = "vscode-css-languageserver"
|
||||
args = ["--stdio"]
|
||||
|
||||
[language_server.less-language-server]
|
||||
filetypes = ["less"]
|
||||
roots = ["package.json", ".git", ".hg"]
|
||||
command = "vscode-css-languageserver"
|
||||
args = ["--stdio"]
|
||||
|
||||
[language_server.html-language-server]
|
||||
filetypes = ["html"]
|
||||
roots = ["package.json"]
|
||||
command = "vscode-html-languageserver"
|
||||
args = ["--stdio"]
|
||||
settings_section = "_"
|
||||
[language_server.html-language-server.settings._]
|
||||
# quotePreference = "single"
|
||||
# javascript.format.semicolons = "insert"
|
||||
|
||||
[language_server.typescript-language-server]
|
||||
filetypes = ["javascript", "typescript"]
|
||||
roots = ["package.json", "tsconfig.json", "jsconfig.json", ".git", ".hg"]
|
||||
command = "typescript-language-server"
|
||||
args = ["--stdio"]
|
||||
settings_section = "_"
|
||||
[language_server.typescript-language-server.settings._]
|
||||
# quotePreference = "double"
|
||||
# typescript.format.semicolons = "insert"
|
||||
|
||||
[language_server.json-language-server]
|
||||
filetypes = ["json"]
|
||||
roots = ["package.json"]
|
||||
command = "vscode-json-languageserver"
|
||||
args = ["--stdio"]
|
||||
|
||||
[language_server.nil]
|
||||
filetypes = ["nix"]
|
||||
command = "nil"
|
||||
roots = ["flake.nix", "shell.nix", ".git"]
|
||||
[language_server.nil.settings.nil]
|
||||
formatting.command = [ "nixfmt" ]
|
||||
|
||||
[language_server.intelephense]
|
||||
filetypes = ["php"]
|
||||
roots = [".htaccess", "composer.json"]
|
||||
command = "intelephense"
|
||||
args = ["--stdio"]
|
||||
settings_section = "intelephense"
|
||||
[language_server.intelephense.settings.intelephense]
|
||||
storagePath = "/tmp/intelephense"
|
||||
|
||||
format.braces = "k&r"
|
||||
environment.includePaths = [
|
||||
"./vendor",
|
||||
"./vendor/autoload",
|
||||
"./vendor/laravel/framework/",
|
||||
"./vendor/laravel/framework/src/",
|
||||
"./vendor/laravel/framework/src/Illuminate/"
|
||||
]
|
||||
files.exclude = [
|
||||
"**/.git/**",
|
||||
"**/.svn/**",
|
||||
"**/.hg/**",
|
||||
"**/.direnv/**",
|
||||
"**/CVS/**",
|
||||
"**/.DS_Store/**",
|
||||
"**/node_modules/**",
|
||||
"**/bower_components/**",
|
||||
"**/resources/views/**"
|
||||
]
|
||||
|
||||
[language_server.rust-analyzer]
|
||||
filetypes = ["rust"]
|
||||
roots = ["Cargo.toml"]
|
||||
command = "sh"
|
||||
args = [
|
||||
"-c",
|
||||
"""
|
||||
if path=$(rustup which rust-analyzer 2>/dev/null); then
|
||||
"$path"
|
||||
else
|
||||
rust-analyzer
|
||||
fi
|
||||
""",
|
||||
]
|
||||
[language_server.rust-analyzer.settings.rust-analyzer]
|
||||
# See https://rust-analyzer.github.io/manual.html#configuration
|
||||
# cargo.features = []
|
||||
checkOnSave.command = "clippy"
|
||||
hoverActions.enable = false # kak-lsp doesn't support this at the moment
|
||||
|
||||
[language_server.godot]
|
||||
filetypes = ["gd", "gdscript", "gdscript3"]
|
||||
roots = ["project.godot", ".git/"]
|
||||
command = "nc"
|
||||
args = [ "localhost", "6008"]
|
||||
|
||||
# Semantic tokens support
|
||||
# See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_semanticTokens
|
||||
# for the default list of tokens and modifiers.
|
||||
# However, many language servers implement their own values.
|
||||
# Make sure to check the output of `lsp-capabilities` and each server's documentation and source code as well.
|
||||
# Examples:
|
||||
# - TypeScript: https://github.com/microsoft/vscode-languageserver-node/blob/main/client/src/common/semanticTokens.ts
|
||||
# - Rust Analyzer: https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/syntax_highlighting.rs
|
||||
[semantic_tokens]
|
||||
faces = [
|
||||
{face="documentation", token="comment", modifiers=["documentation"]},
|
||||
{face="comment", token="comment"},
|
||||
{face="function", token="function"},
|
||||
{face="keyword", token="keyword"},
|
||||
{face="module", token="namespace"},
|
||||
{face="operator", token="operator"},
|
||||
{face="string", token="string"},
|
||||
{face="type", token="type"},
|
||||
{face="default+d", token="variable", modifiers=["readonly"]},
|
||||
{face="default+d", token="variable", modifiers=["constant"]},
|
||||
{face="variable", token="variable"},
|
||||
]
|
64
user/kakoune/kak-tree-sitter.nix
Normal file
64
user/kakoune/kak-tree-sitter.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{ pkgs, lib, ... }:
|
||||
let
|
||||
hx-src = pkgs.helix.src;
|
||||
kts-src = pkgs.unstable.kak-tree-sitter-unwrapped.src;
|
||||
inherit (pkgs) fetchFromGitHub;
|
||||
in
|
||||
with pkgs.tree-sitter-grammars;
|
||||
{
|
||||
xdg.configFile."kak-tree-sitter/config.toml".text =
|
||||
lib.foldlAttrs
|
||||
(
|
||||
acc: name: vals:
|
||||
acc
|
||||
+ ''
|
||||
[language.${name}.grammar.source.local]
|
||||
path = "${vals.parser}"
|
||||
[language.${name}.grammar]
|
||||
compile = "cc"
|
||||
compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."]
|
||||
compile_flags = ["-O3"]
|
||||
link = "cc"
|
||||
link_args = ["-shared", "-fpic", "scanner.o", "parser.o", "-o", "typescript.so"]
|
||||
link_flags = ["-O3"]
|
||||
[language.${name}.queries.source.local]
|
||||
path = "${vals.queries}"
|
||||
[language.${name}.queries]
|
||||
path = "${vals.queries}"
|
||||
''
|
||||
)
|
||||
""
|
||||
{
|
||||
nix = {
|
||||
parser = tree-sitter-nix + "/parser";
|
||||
queries = tree-sitter-nix + "/queries";
|
||||
};
|
||||
|
||||
scss = {
|
||||
parser = tree-sitter-scss + "/parser";
|
||||
queries = tree-sitter-scss + "/queries";
|
||||
};
|
||||
css = {
|
||||
parser = tree-sitter-css + "/parser";
|
||||
queries = tree-sitter-css + "/queries";
|
||||
};
|
||||
|
||||
javascript = {
|
||||
parser = tree-sitter-javascript + "/parser";
|
||||
queries = tree-sitter-javascript + "/queries";
|
||||
};
|
||||
typescript = {
|
||||
parser =
|
||||
tree-sitter-typescript.overrideAttrs (old: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "tree-sitter";
|
||||
repo = "tree-sitter-typescript";
|
||||
rev = "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf";
|
||||
hash = "sha256-oZKit8kScXcOptmT2ckywL5JlAVe+wuwhuj6ThEI5OQ=";
|
||||
};
|
||||
})
|
||||
+ "/parser";
|
||||
queries = kts-src + "/runtime/queries/typescript";
|
||||
};
|
||||
};
|
||||
}
|
20
user/kakoune/kakrc
Normal file
20
user/kakoune/kakrc
Normal file
|
@ -0,0 +1,20 @@
|
|||
# {{@@ header() @@}}
|
||||
# _ __ _
|
||||
# | |/ /__ _| | _____ _ _ _ __ ___
|
||||
# | ' // _` | |/ / _ \| | | | '_ \ / _ \
|
||||
# | . \ (_| | < (_) | |_| | | | | __/
|
||||
# |_|\_\__,_|_|\_\___/ \__,_|_| |_|\___|
|
||||
|
||||
|
||||
set global scrolloff 10,20
|
||||
set global autoreload yes
|
||||
set global startup_info_version 20200901
|
||||
|
||||
source "%val{config}/rc/plug.kak"
|
||||
source "%val{config}/rc/keys.kak"
|
||||
source "%val{config}/rc/usermode.kak"
|
||||
source "%val{config}/rc/git-mode.kak"
|
||||
source "%val{config}/rc/hooks.kak"
|
||||
source "%val{config}/rc/filetypes.kak"
|
||||
source "%val{config}/rc/indent.kak"
|
||||
source "%val{config}/colors.kak"
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue