Compare commits
138 commits
add-cosmic
...
main
Author | SHA1 | Date | |
---|---|---|---|
559e23faae | |||
849b43d69f | |||
1a159bb60c | |||
74749c5af1 | |||
558c12a420 | |||
98a319696f | |||
4e4a2d86e5 | |||
4abdc5e278 | |||
dd9833a199 | |||
cc10685f6d | |||
07fbc5de39 | |||
0e72c5f67d | |||
a3a3aa8231 | |||
cefaa9a11a | |||
5a0e7a92f4 | |||
d3bb2e0e57 | |||
54ae0fdd92 | |||
b84f8374cd | |||
55a3c1bce2 | |||
d049c9ce43 | |||
3748b6c433 | |||
d393b01634 | |||
c122cea302 | |||
2ee69adcd7 | |||
edd039947c | |||
d11fb3a0e2 | |||
174b6251e8 | |||
9ecbef95bf | |||
9774000f64 | |||
876153ba2c | |||
906ee6c1ed | |||
276bc305cf | |||
806a59d366 | |||
a3f40b2778 | |||
f5d16c5e87 | |||
8cdb458c0c | |||
9648fdf0a5 | |||
6129318685 | |||
2719bbada1 | |||
d14fc3c13d | |||
749de574a0 | |||
c5e559afc0 | |||
8569d84f5b | |||
76ee718615 | |||
6c27c49918 | |||
aa36a6eda9 | |||
b15f8de08f | |||
a6e1683060 | |||
b6d62c71fe | |||
a1ebf9d7fa | |||
ceac787218 | |||
6f4e01d8fa | |||
22a9c7e80b | |||
c0dda38da1 | |||
1a299516a3 | |||
f6fedf748f | |||
3540b0af76 | |||
c208306c96 | |||
46c78fe6e1 | |||
50ed7b7b4d | |||
8bd8c3f995 | |||
7a109c779e | |||
![]() |
4e6b2a1162 | ||
499973debf | |||
b67d532e24 | |||
dfc86765ff | |||
4dcf7a0890 | |||
7dcc38f6a2 | |||
ed3dde6c28 | |||
5e568693f6 | |||
dccea7f8c6 | |||
d9bcae7d25 | |||
a0f3b2b2d8 | |||
cdf775bb8a | |||
befd97efe5 | |||
fddfda5787 | |||
2b85d48a32 | |||
7e2602becd | |||
aaa060915a | |||
95d6d0cc32 | |||
ef4a5c8ae6 | |||
f71dd9c197 | |||
8078f7b853 | |||
00d1d7cad5 | |||
fabbd78476 | |||
5216978270 | |||
5f90b9194f | |||
9426ccfc1d | |||
4f3e57eeef | |||
45f8e26757 | |||
9e65cad8fc | |||
8c64859dab | |||
107729a57a | |||
dec28d2d6e | |||
f2e7539501 | |||
79a5f87dce | |||
86f91b9ca9 | |||
3152fb01ee | |||
0c97bb510b | |||
b8aba304d9 | |||
c953ba9371 | |||
87b908311c | |||
daffd82cdb | |||
2f14eb0526 | |||
bc6404817e | |||
739f6506f4 | |||
fefb76e1cf | |||
c39c540a3f | |||
0007b9be66 | |||
51d1e95ee6 | |||
7cf0fbc18e | |||
aab4e171f1 | |||
52d5aaf340 | |||
54542a1b85 | |||
3ed8addd90 | |||
2ede974607 | |||
77b9b09d12 | |||
4a6b8edd73 | |||
1c12cf34ad | |||
1fb4a2ec9c | |||
61821dcf20 | |||
b416ae7660 | |||
4a419ae083 | |||
ba2e8b4ad3 | |||
a718648ca7 | |||
767ef7b903 | |||
948f46e401 | |||
c06a16c8d7 | |||
6d7509521f | |||
d8a86714d8 | |||
38fa12f409 | |||
43bc4fe2a5 | |||
58301019f3 | |||
6a1d960485 | |||
3015496b7d | |||
762634f489 | |||
f304048421 | |||
61372c7e34 |
84 changed files with 1321 additions and 4185 deletions
|
@ -13,7 +13,7 @@ My NixOS configurations, using flakes.
|
||||||
| [assets](assets/) | Resources used throughout the system (images etc.) |
|
| [assets](assets/) | Resources used throughout the system (images etc.) |
|
||||||
| [hosts](hosts/) | Host-specific |
|
| [hosts](hosts/) | Host-specific |
|
||||||
| [modules](modules/) | Local module system (where the bulk of the configurations lives) |
|
| [modules](modules/) | Local module system (where the bulk of the configurations lives) |
|
||||||
| [shared](shared/) | Exported components (so far only packages) |
|
| [shared](shared/) | Exported components (packages and NixOS modules) |
|
||||||
|
|
||||||
My configuration is structured based on the following principles:
|
My configuration is structured based on the following principles:
|
||||||
|
|
||||||
|
|
3
assets/icons/my-caffeine-off-symbolic.svg
Normal file
3
assets/icons/my-caffeine-off-symbolic.svg
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" version="1.1">
|
||||||
|
<path style="fill:#dfdfdf" d="M 4,6 C 1.7909,6 0,7.79 0,10 0,12.21 1.7909,14 4,14 4.2425,14 4.4843,13.98 4.7227,13.93 5.462,15.48 6.958,16 10,16 16,16 16,14 16,6 Z M 4,8 H 4.0078 C 4.0194,9.6 4.06,10.94 4.2031,11.99 4.1357,11.99 4.0679,12 4,12 2.8954,12 2,11.1 2,10 2,8.9 2.8954,8 4,8 Z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 376 B |
3
assets/icons/my-caffeine-on-symbolic.svg
Normal file
3
assets/icons/my-caffeine-on-symbolic.svg
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" version="1.1">
|
||||||
|
<path style="fill:#dfdfdf" d="M 7.1934,0 C 6.0952,1.38 5.766,1.57 6.1621,2.45 6.5212,3.25 7.449,3.15 6.9824,5 7.7488,4.1 8.3577,3.46 7.7559,2.54 7.1437,1.6 6.8084,1.53 7.1934,0 Z M 10.193,0 C 9.0952,1.38 8.766,1.57 9.1621,2.45 9.5212,3.25 10.449,3.15 9.9824,5 10.749,4.1 11.358,3.46 10.756,2.54 10.144,1.6 9.8084,1.53 10.193,0 Z M 13.193,0 C 12.095,1.38 11.766,1.57 12.162,2.45 12.521,3.25 13.449,3.15 12.982,5 13.749,4.1 14.358,3.46 13.756,2.54 13.144,1.6 12.808,1.53 13.193,0 Z M 4,6 C 1.7909,6 0,7.79 0,10 0,12.21 1.7909,14 4,14 4.2425,14 4.4843,13.98 4.7227,13.93 5.462,15.48 6.958,16 10,16 16,16 16,14 16,6 Z M 4,8 H 4.0078 C 4.0194,9.6 4.06,10.94 4.2031,11.99 4.1357,11.99 4.0679,12 4,12 2.8954,12 2,11.1 2,10 2,8.9 2.8954,8 4,8 Z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 826 B |
3519
flake.lock
generated
3519
flake.lock
generated
File diff suppressed because it is too large
Load diff
72
flake.nix
72
flake.nix
|
@ -17,6 +17,8 @@
|
||||||
(system: function nixpkgs.legacyPackages.${system});
|
(system: function nixpkgs.legacyPackages.${system});
|
||||||
treefmtEval = forAllSystems (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
|
treefmtEval = forAllSystems (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
|
||||||
in {
|
in {
|
||||||
|
checks = builtins.mapAttrs (_: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
||||||
|
deploy.nodes = import ./nodes.nix {inherit inputs;};
|
||||||
devShells = forAllSystems (pkgs: {
|
devShells = forAllSystems (pkgs: {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
packages = [
|
packages = [
|
||||||
|
@ -29,15 +31,14 @@
|
||||||
});
|
});
|
||||||
formatter = forAllSystems (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
|
formatter = forAllSystems (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
|
||||||
nixosConfigurations = import ./hosts {inherit self inputs;};
|
nixosConfigurations = import ./hosts {inherit self inputs;};
|
||||||
|
nixosModules.hjemModules = import ./shared/modules/hjem/nixos.nix {inherit (nixpkgs) lib;};
|
||||||
packages = forAllSystems (pkgs: import ./shared/pkgs {inherit inputs pkgs;});
|
packages = forAllSystems (pkgs: import ./shared/pkgs {inherit inputs pkgs;});
|
||||||
deploy.nodes = import ./nodes.nix {inherit inputs;};
|
|
||||||
checks = builtins.mapAttrs (_: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
|
||||||
};
|
};
|
||||||
inputs = {
|
inputs = {
|
||||||
# nix related
|
# nix related
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
||||||
nix-index-db = {
|
nix-index-database = {
|
||||||
url = "github:nix-community/nix-index-database";
|
url = "github:nix-community/nix-index-database";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
@ -46,32 +47,42 @@
|
||||||
agenix = {
|
agenix = {
|
||||||
url = "github:ryantm/agenix";
|
url = "github:ryantm/agenix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.systems.follows = "systems";
|
||||||
};
|
};
|
||||||
anyrun = {
|
anyrun = {
|
||||||
url = "github:anyrun-org/anyrun";
|
url = "github:anyrun-org/anyrun";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs = {
|
||||||
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
systems.follows = "systems";
|
||||||
|
flake-parts.follows = "flake-parts";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
basix = {
|
basix = {
|
||||||
url = "github:notashelf/basix";
|
url = "github:notashelf/basix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
inputs.flake-parts.follows = "flake-parts";
|
||||||
nixos-cosmic = {
|
|
||||||
url = "github:lilyinstarlight/nixos-cosmic";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
};
|
||||||
deploy-rs = {
|
deploy-rs = {
|
||||||
url = "github:serokell/deploy-rs";
|
url = "github:serokell/deploy-rs";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
inputs.utils.follows = "flake-utils"; # Yes, it's actually called `utils`, not a typo
|
||||||
};
|
};
|
||||||
|
|
||||||
hyprland.url = "github:hyprwm/Hyprland";
|
hyprland = {
|
||||||
|
url = "github:hyprwm/Hyprland";
|
||||||
|
inputs.systems.follows = "systems";
|
||||||
|
};
|
||||||
hypridle = {
|
hypridle = {
|
||||||
url = "github:hyprwm/hypridle";
|
url = "github:hyprwm/hypridle";
|
||||||
inputs = {
|
inputs = {
|
||||||
hyprlang.follows = "hyprland/hyprlang";
|
hyprlang.follows = "hyprland/hyprlang";
|
||||||
hyprutils.follows = "hyprland/hyprutils";
|
hyprutils.follows = "hyprland/hyprutils";
|
||||||
|
hyprwayland-scanner.follows = "hyprland/hyprwayland-scanner";
|
||||||
|
hyprland-protocols.follows = "hyprland/hyprland-protocols";
|
||||||
|
|
||||||
nixpkgs.follows = "hyprland/nixpkgs";
|
nixpkgs.follows = "hyprland/nixpkgs";
|
||||||
systems.follows = "hyprland/systems";
|
systems.follows = "systems";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
hyprlock = {
|
hyprlock = {
|
||||||
|
@ -79,8 +90,11 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
hyprlang.follows = "hyprland/hyprlang";
|
hyprlang.follows = "hyprland/hyprlang";
|
||||||
hyprutils.follows = "hyprland/hyprutils";
|
hyprutils.follows = "hyprland/hyprutils";
|
||||||
|
hyprgraphics.follows = "hyprland/hyprgraphics";
|
||||||
|
hyprwayland-scanner.follows = "hyprland/hyprwayland-scanner";
|
||||||
|
|
||||||
nixpkgs.follows = "hyprland/nixpkgs";
|
nixpkgs.follows = "hyprland/nixpkgs";
|
||||||
systems.follows = "hyprland/systems";
|
systems.follows = "systems";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
hyprpaper = {
|
hyprpaper = {
|
||||||
|
@ -88,25 +102,45 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
hyprlang.follows = "hyprland/hyprlang";
|
hyprlang.follows = "hyprland/hyprlang";
|
||||||
hyprutils.follows = "hyprland/hyprutils";
|
hyprutils.follows = "hyprland/hyprutils";
|
||||||
|
hyprgraphics.follows = "hyprland/hyprgraphics";
|
||||||
|
hyprwayland-scanner.follows = "hyprland/hyprwayland-scanner";
|
||||||
|
|
||||||
nixpkgs.follows = "hyprland/nixpkgs";
|
nixpkgs.follows = "hyprland/nixpkgs";
|
||||||
systems.follows = "hyprland/systems";
|
systems.follows = "systems";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
hyprwm-contrib = {
|
hyprwm-contrib = {
|
||||||
url = "github:hyprwm/contrib";
|
url = "github:hyprwm/contrib";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
hjem = {
|
hjem = {
|
||||||
url = "github:nezia1/hjem/implement-environment-variables"; # TODO: change to github:feel-co/hjem if env var PR gets in
|
url = "github:nezia1/hjem";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
# TODO: remove once https://github.com/snugnug/hjem-rum/pull/14 gets merged
|
||||||
|
hjem-rum = {
|
||||||
|
url = "github:nezia1/hjem-rum/add-hyprland";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
morewaita = {
|
||||||
|
url = "github:somepaulo/MoreWaita";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
nix-gaming = {
|
nix-gaming = {
|
||||||
url = "github:fufexan/nix-gaming";
|
url = "github:fufexan/nix-gaming";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.flake-parts.follows = "flake-parts";
|
||||||
};
|
};
|
||||||
nvf = {
|
nvf = {
|
||||||
url = "github:notashelf/nvf";
|
url = "github:notashelf/nvf";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs = {
|
||||||
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
systems.follows = "systems";
|
||||||
|
flake-utils.follows = "flake-utils";
|
||||||
|
flake-parts.follows = "flake-parts";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
treefmt-nix = {
|
treefmt-nix = {
|
||||||
url = "github:numtide/treefmt-nix";
|
url = "github:numtide/treefmt-nix";
|
||||||
|
@ -116,6 +150,14 @@
|
||||||
url = "github:nezia1/nezia.dev";
|
url = "github:nezia1/nezia.dev";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# dependency pinning to prevent duplicate versions
|
||||||
|
systems.url = "github:nix-systems/default";
|
||||||
|
flake-utils = {
|
||||||
|
url = "github:numtide/flake-utils";
|
||||||
|
inputs.systems.follows = "systems";
|
||||||
|
};
|
||||||
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
};
|
};
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
extra-substituters = [
|
extra-substituters = [
|
||||||
|
@ -125,7 +167,6 @@
|
||||||
"https://hyprland.cachix.org"
|
"https://hyprland.cachix.org"
|
||||||
"https://nix-gaming.cachix.org"
|
"https://nix-gaming.cachix.org"
|
||||||
"https://anyrun.cachix.org"
|
"https://anyrun.cachix.org"
|
||||||
"https://cosmic.cachix.org/"
|
|
||||||
];
|
];
|
||||||
extra-trusted-public-keys = [
|
extra-trusted-public-keys = [
|
||||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||||
|
@ -133,7 +174,6 @@
|
||||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||||
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
||||||
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
||||||
"cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
{inputs, ...}: let
|
{
|
||||||
|
self,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
lib' = import ../lib inputs.nixpkgs.lib;
|
lib' = import ../lib inputs.nixpkgs.lib;
|
||||||
mkSystem = args:
|
mkSystem = args:
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = {inherit inputs lib';};
|
specialArgs = {inherit self inputs lib';};
|
||||||
modules =
|
modules =
|
||||||
(args.modules or [])
|
(args.modules or [])
|
||||||
++ [
|
++ [../modules];
|
||||||
../modules
|
|
||||||
inputs.hjem.nixosModules.default
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
vamos = mkSystem {
|
vamos = mkSystem {
|
||||||
|
|
|
@ -5,7 +5,6 @@ _: {
|
||||||
systemVars = {
|
systemVars = {
|
||||||
hostName = "solaire";
|
hostName = "solaire";
|
||||||
username = "nezia";
|
username = "nezia";
|
||||||
desktop = "Hyprland";
|
|
||||||
};
|
};
|
||||||
homeVars = {
|
homeVars = {
|
||||||
fullName = "Anthony Rodriguez";
|
fullName = "Anthony Rodriguez";
|
||||||
|
@ -14,10 +13,12 @@ _: {
|
||||||
};
|
};
|
||||||
|
|
||||||
profiles = {
|
profiles = {
|
||||||
|
desktop.enable = true;
|
||||||
gaming.enable = true;
|
gaming.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
|
hyprland.enable = true;
|
||||||
nvidia.enable = true;
|
nvidia.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,7 +8,6 @@ _: {
|
||||||
systemVars = {
|
systemVars = {
|
||||||
hostName = "vamos";
|
hostName = "vamos";
|
||||||
username = "nezia";
|
username = "nezia";
|
||||||
desktop = "Hyprland";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
homeVars = {
|
homeVars = {
|
||||||
|
@ -18,7 +17,12 @@ _: {
|
||||||
};
|
};
|
||||||
|
|
||||||
profiles = {
|
profiles = {
|
||||||
|
desktop.enable = true;
|
||||||
laptop.enable = true;
|
laptop.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
modules = {
|
||||||
|
hyprland.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,39 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
boot = {
|
lib,
|
||||||
loader = {
|
config,
|
||||||
timeout = 0;
|
...
|
||||||
systemd-boot = {
|
}: let
|
||||||
enable = true;
|
inherit (lib.modules) mkIf;
|
||||||
consoleMode = "2";
|
inherit (config.local.profiles) server;
|
||||||
|
in {
|
||||||
|
config = mkIf (!server.enable) {
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
timeout = 0;
|
||||||
|
systemd-boot = {
|
||||||
|
enable = true;
|
||||||
|
consoleMode = "2";
|
||||||
|
};
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
};
|
};
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
|
plymouth = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = ''
|
||||||
|
[Daemon]
|
||||||
|
DeviceScale=2
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
consoleLogLevel = 0;
|
||||||
|
initrd.systemd.enable = true;
|
||||||
|
initrd.verbose = false;
|
||||||
|
|
||||||
|
kernelParams = [
|
||||||
|
"quiet"
|
||||||
|
"systemd.show_status=auto"
|
||||||
|
"rd.udev.log_level=3"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
plymouth = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = ''
|
|
||||||
[Daemon]
|
|
||||||
DeviceScale=2
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
consoleLogLevel = 0;
|
|
||||||
initrd.systemd.enable = true;
|
|
||||||
initrd.verbose = false;
|
|
||||||
|
|
||||||
kernelParams = [
|
|
||||||
"quiet"
|
|
||||||
"systemd.show_status=auto"
|
|
||||||
"rd.udev.log_level=3"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
fonts = {
|
fonts = {
|
||||||
enableDefaultPackages = false;
|
enableDefaultPackages = false;
|
||||||
packages = [
|
packages = [
|
||||||
|
|
13
modules/core/hardware/bluetooth.nix
Normal file
13
modules/core/hardware/bluetooth.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (config.local.profiles) desktop;
|
||||||
|
in {
|
||||||
|
config = mkIf desktop.enable {
|
||||||
|
hardware.bluetooth.enable = true; # enables support for Bluetooth
|
||||||
|
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./bluetooth.nix
|
||||||
./fprintd.nix
|
./fprintd.nix
|
||||||
./fwupd.nix
|
./fwupd.nix
|
||||||
./nvidia.nix
|
./nvidia.nix
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
services.fwupd.enable = true;
|
services.fwupd.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
services = {
|
services = {
|
||||||
# setup printing service
|
# setup printing service
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
nix = {
|
nix = {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
security = {
|
security = {
|
||||||
polkit.enable = true;
|
polkit.enable = true;
|
||||||
polkit = {
|
polkit = {
|
||||||
|
|
|
@ -1,16 +1,24 @@
|
||||||
{
|
{
|
||||||
|
self,
|
||||||
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (config.local.systemVars) desktop username;
|
inherit (config.local.systemVars) username;
|
||||||
inherit (config.local.homeVars) fullName;
|
inherit (config.local.homeVars) fullName;
|
||||||
|
inherit (config.local.profiles) desktop;
|
||||||
in {
|
in {
|
||||||
|
imports = [
|
||||||
|
inputs.hjem.nixosModules.default
|
||||||
|
inputs.hjem-rum.nixosModules.default
|
||||||
|
self.outputs.nixosModules.hjemModules
|
||||||
|
];
|
||||||
users.users.${username} = {
|
users.users.${username} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = fullName;
|
description = fullName;
|
||||||
extraGroups = mkIf (desktop != "none") [
|
extraGroups = mkIf desktop.enable [
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
"audio"
|
"audio"
|
||||||
"video"
|
"video"
|
||||||
|
@ -19,15 +27,12 @@ in {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
hjem = mkIf (desktop != "none") {
|
hjem = mkIf desktop.enable {
|
||||||
clobberByDefault = true;
|
clobberByDefault = true;
|
||||||
users.${username} = {
|
users.${username} = {
|
||||||
enable = true;
|
enable = true;
|
||||||
directory = "/home/${username}";
|
directory = "/home/${username}";
|
||||||
user = "${username}";
|
user = "${username}";
|
||||||
environment = {
|
|
||||||
forceOverride = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,30 +4,23 @@
|
||||||
options,
|
options,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkOption;
|
inherit (lib) mkIf mkOption;
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
inherit (lib.types) str;
|
inherit (lib.types) str;
|
||||||
in {
|
in {
|
||||||
options.local.homeVars = {
|
options.local.homeVars = {
|
||||||
fullName = mkOption {
|
fullName = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
description = ''
|
description = "your full name (used for git commits and user description)";
|
||||||
your full name (used for git commits and user description)
|
|
||||||
'';
|
|
||||||
default = "User";
|
default = "User";
|
||||||
};
|
};
|
||||||
email = mkOption {
|
email = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
description = ''
|
description = "your email (used for git commits)";
|
||||||
your email (used for git commits)
|
|
||||||
'';
|
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
signingKey = mkOption {
|
signingKey = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
description = ''
|
description = "your ssh public key (used for signing git commits)";
|
||||||
your ssh public key (used for signing git commits)"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./hyprland.nix
|
||||||
./nvidia.nix
|
./nvidia.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
7
modules/options/modules/hyprland.nix
Normal file
7
modules/options/modules/hyprland.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib) mkEnableOption;
|
||||||
|
in {
|
||||||
|
options.local.modules.hyprland = {
|
||||||
|
enable = mkEnableOption "Hyprland modules";
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./desktop.nix
|
||||||
./gaming.nix
|
./gaming.nix
|
||||||
./laptop.nix
|
./laptop.nix
|
||||||
./server.nix
|
./server.nix
|
||||||
|
|
18
modules/options/profiles/desktop.nix
Normal file
18
modules/options/profiles/desktop.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkEnableOption;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
local.profiles.desktop.enable = mkEnableOption "the desktop profile";
|
||||||
|
};
|
||||||
|
|
||||||
|
config.assertions = lib.mkIf config.local.profiles.desktop.enable [
|
||||||
|
{
|
||||||
|
assertion = !config.local.profiles.server.enable;
|
||||||
|
message = "The desktop profile cannot be enabled if `local.profiles.server.enable` is set to true.";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -11,7 +11,7 @@ in {
|
||||||
|
|
||||||
config.assertions = lib.mkIf config.local.profiles.server.enable [
|
config.assertions = lib.mkIf config.local.profiles.server.enable [
|
||||||
{
|
{
|
||||||
assertion = !(config.local.systemVars.desktop != "none");
|
assertion = !config.local.profiles.desktop.enable;
|
||||||
message = "The server profile cannot be enabled if `local.profiles.desktop.enable` is set to true.";
|
message = "The server profile cannot be enabled if `local.profiles.desktop.enable` is set to true.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) attrNames mkEnableOption mkOption pathExists;
|
inherit (lib) attrNames mkEnableOption mkOption pathExists;
|
||||||
inherit (lib.types) attrs bool enum package path str;
|
inherit (lib.types) attrs bool enum package path str;
|
||||||
|
inherit (lib.lists) singleton;
|
||||||
|
|
||||||
cfg = config.local.style;
|
cfg = config.local.style;
|
||||||
in {
|
in {
|
||||||
|
@ -80,7 +81,7 @@ in {
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
description = "Name for the GTK theme";
|
description = "Name for the GTK theme";
|
||||||
default = "adw-gtk3";
|
default = "adw-gtk3-dark";
|
||||||
};
|
};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = package;
|
type = package;
|
||||||
|
@ -94,15 +95,41 @@ in {
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
description = "The name for the icon theme that will be used for GTK programs";
|
description = "The name for the icon theme that will be used for GTK programs";
|
||||||
default = "Papirus-Dark";
|
default = "MoreWaita";
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = package;
|
type = package;
|
||||||
description = "The GTK icon theme to be used";
|
description = "The GTK icon theme to be used";
|
||||||
default = pkgs.catppuccin-papirus-folders.override {
|
default = pkgs.morewaita-icon-theme.overrideAttrs {
|
||||||
flavor = "mocha";
|
src = inputs.morewaita;
|
||||||
accent = "lavender";
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
install -d $out/share/icons/MoreWaita
|
||||||
|
cp -r . $out/share/icons/MoreWaita
|
||||||
|
cp ${../../assets/icons/my-caffeine-on-symbolic.svg} $out/share/icons/MoreWaita/symbolic/status/my-caffeine-on-symbolic.svg
|
||||||
|
cp ${../../assets/icons/my-caffeine-off-symbolic.svg} $out/share/icons/MoreWaita/symbolic/status/my-caffeine-off-symbolic.svg
|
||||||
|
gtk-update-icon-cache -f -t $out/share/icons/MoreWaita && xdg-desktop-menu forceupdate
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
/*
|
||||||
|
a patch is needed because MoreWaita expects a `meson.build` file in the directory, containing the
|
||||||
|
name of every icon.
|
||||||
|
*/
|
||||||
|
patches = singleton (pkgs.writeText "add-caffeine-icons.patch" ''
|
||||||
|
diff --git a/symbolic/status/meson.build b/symbolic/status/meson.build
|
||||||
|
index 4e5bfc5..3bbf989 100644
|
||||||
|
--- a/symbolic/status/meson.build
|
||||||
|
+++ b/symbolic/status/meson.build
|
||||||
|
@@ -17,2 +17,4 @@ regular_files = [
|
||||||
|
'keepassxc-unlocked.svg',
|
||||||
|
+ 'my-caffeine-off-symbolic.svg',
|
||||||
|
+ 'my-caffeine-on-symbolic.svg',
|
||||||
|
'pamac-tray-no-update.svg',
|
||||||
|
'');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -119,8 +146,20 @@ in {
|
||||||
${toString themePath} set by the GTK module does not exist!
|
${toString themePath} set by the GTK module does not exist!
|
||||||
|
|
||||||
To suppress this message, make sure that
|
To suppress this message, make sure that
|
||||||
`config.modules.theme.gtk.theme.package` contains
|
`config.local.theme.gtk.theme.package` contains
|
||||||
the path `${cfg.theme.name}`
|
the path `${cfg.gtk.theme.name}`
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
(let
|
||||||
|
iconPath = cfg.gtk.iconTheme.package + /share/icons + "/${cfg.gtk.iconTheme.name}";
|
||||||
|
in {
|
||||||
|
assertion = cfg.gtk.enable -> pathExists iconPath;
|
||||||
|
message = ''
|
||||||
|
${toString iconPath} set by the GTK module does not exist!
|
||||||
|
|
||||||
|
To suppress this message, make sure that
|
||||||
|
`config.local.theme.gtk.iconTheme.package` contains
|
||||||
|
the path `${cfg.gtk.iconTheme.name}`
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,30 +4,19 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkOption;
|
inherit (lib) mkOption;
|
||||||
inherit (lib.types) enum str;
|
inherit (lib.types) str;
|
||||||
in {
|
in {
|
||||||
options.local.systemVars = {
|
options.local.systemVars = {
|
||||||
hostName = mkOption {
|
hostName = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
description = ''
|
description = "hostname for the current host";
|
||||||
hostname for the current host
|
|
||||||
'';
|
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
username = mkOption {
|
username = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
description = ''
|
description = "username for the home directory";
|
||||||
username for the home directory
|
|
||||||
'';
|
|
||||||
default = "user";
|
default = "user";
|
||||||
};
|
};
|
||||||
desktop = mkOption {
|
|
||||||
type = enum ["none" "Hyprland" "cosmic"];
|
|
||||||
default = "none";
|
|
||||||
description = ''
|
|
||||||
the desktop environment to be used
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config.assertions = [
|
config.assertions = [
|
||||||
|
@ -37,8 +26,5 @@ in {
|
||||||
{
|
{
|
||||||
assertion = options.local.systemVars.username.isDefined;
|
assertion = options.local.systemVars.username.isDefined;
|
||||||
}
|
}
|
||||||
{
|
|
||||||
assertion = options.local.systemVars.desktop.isDefined;
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
in {
|
in {
|
||||||
config = mkIf (config.local.systemVars.desktop == "Hyprland") {
|
config = mkIf config.local.modules.hyprland.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [inputs.anyrun.packages.${pkgs.system}.anyrun-with-all-plugins];
|
packages = [inputs.anyrun.packages.${pkgs.system}.anyrun-with-all-plugins];
|
||||||
files = {
|
files = {
|
||||||
|
|
14
modules/programs/comma.nix
Normal file
14
modules/programs/comma.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (config.local.profiles) desktop;
|
||||||
|
in {
|
||||||
|
imports = [inputs.nix-index-database.nixosModules.nix-index];
|
||||||
|
config = mkIf desktop.enable {
|
||||||
|
programs.nix-index-database.comma.enable = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,18 +1,19 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./anyrun
|
./anyrun
|
||||||
./discord
|
|
||||||
./editors
|
./editors
|
||||||
./hypr
|
./hypr
|
||||||
./media
|
./media
|
||||||
./terminal
|
./terminal
|
||||||
|
|
||||||
|
./comma.nix
|
||||||
|
./discord.nix
|
||||||
./fastfetch.nix
|
./fastfetch.nix
|
||||||
./firefox.nix
|
./firefox.nix
|
||||||
./games.nix
|
./games.nix
|
||||||
./misc.nix
|
./misc.nix
|
||||||
./nh.nix
|
./nh.nix
|
||||||
./thunar.nix
|
./pcmanfm.nix
|
||||||
./waybar.nix
|
./waybar.nix
|
||||||
./wlogout.nix
|
./wlogout.nix
|
||||||
./xdg.nix
|
./xdg.nix
|
||||||
|
|
|
@ -7,25 +7,16 @@
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
styleCfg = config.local.style;
|
styleCfg = config.local.style;
|
||||||
discord = pkgs.discord-canary.override {
|
# TODO remove override when https://github.com/NixOS/nixpkgs/issues/380429 gets merged
|
||||||
withOpenASAR = true;
|
discord = pkgs.vesktop.override {
|
||||||
withVencord = true;
|
electron = pkgs.electron_33;
|
||||||
};
|
};
|
||||||
|
|
||||||
# run once with krisp-patcher ~/.config/discordcanary/*/modules/discord_krisp/discord_krisp.node
|
|
||||||
krisp-patcher = pkgs.writers.writePython3Bin "krisp-patcher" {
|
|
||||||
libraries = with pkgs.python3Packages; [capstone pyelftools];
|
|
||||||
flakeIgnore = [
|
|
||||||
"E501" # line too long (82 > 79 characters)
|
|
||||||
"F403" # ‘from module import *’ used; unable to detect undefined names
|
|
||||||
"F405" # name may be undefined, or defined from star imports: module
|
|
||||||
];
|
|
||||||
} (builtins.readFile ./krisp-patcher.py);
|
|
||||||
in {
|
in {
|
||||||
config = mkIf (config.local.systemVars.desktop != "none") {
|
config = mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [discord krisp-patcher];
|
packages = [discord];
|
||||||
files.".config/Vencord/themes/midnight-base16.css".text = with styleCfg.scheme.palette;
|
autostart.programs = [discord];
|
||||||
|
files.".config/vesktop/themes/midnight-base16.css".text = with styleCfg.scheme.palette;
|
||||||
mkIf styleCfg.enable ''
|
mkIf styleCfg.enable ''
|
||||||
/**
|
/**
|
||||||
* @name Midnight-base16
|
* @name Midnight-base16
|
|
@ -1,91 +0,0 @@
|
||||||
import sys
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
from elftools.elf.elffile import ELFFile
|
|
||||||
from capstone import *
|
|
||||||
from capstone.x86 import *
|
|
||||||
|
|
||||||
if len(sys.argv) < 2:
|
|
||||||
print(f"Usage: {sys.argv[0]} [path to discord_krisp.node]")
|
|
||||||
# "Unix programs generally use 2 for command line syntax errors and 1 for all other kind of errors."
|
|
||||||
sys.exit(2)
|
|
||||||
|
|
||||||
executable = sys.argv[1]
|
|
||||||
|
|
||||||
elf = ELFFile(open(executable, "rb"))
|
|
||||||
symtab = elf.get_section_by_name(".symtab")
|
|
||||||
|
|
||||||
krisp_initialize_address = symtab.get_symbol_by_name(
|
|
||||||
"_ZN7discordL17DoKrispInitializeEv"
|
|
||||||
)[0].entry.st_value
|
|
||||||
isSignedByDiscord_address = symtab.get_symbol_by_name(
|
|
||||||
"_ZN7discord4util17IsSignedByDiscordERKNSt4__Cr12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE"
|
|
||||||
)[0].entry.st_value
|
|
||||||
|
|
||||||
text = elf.get_section_by_name(".text")
|
|
||||||
text_start = text["sh_addr"]
|
|
||||||
text_start_file = text["sh_offset"]
|
|
||||||
# This seems to always be zero (.text starts at the right offset in the file). Do it just in case?
|
|
||||||
address_to_file = text_start_file - text_start
|
|
||||||
|
|
||||||
# Done with the ELF now.
|
|
||||||
# elf.close()
|
|
||||||
|
|
||||||
krisp_initialize_offset = krisp_initialize_address - address_to_file
|
|
||||||
isSignedByDiscord_offset = krisp_initialize_address - address_to_file
|
|
||||||
|
|
||||||
f = open(executable, "rb")
|
|
||||||
f.seek(krisp_initialize_offset)
|
|
||||||
krisp_initialize = f.read(256)
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
# States
|
|
||||||
found_issigned_by_discord_call = False
|
|
||||||
found_issigned_by_discord_test = False
|
|
||||||
found_issigned_by_discord_je = False
|
|
||||||
found_already_patched = False
|
|
||||||
je_location = None
|
|
||||||
je_size = 0
|
|
||||||
|
|
||||||
# We are looking for a call to IsSignedByDiscord, followed by a test, followed by a je.
|
|
||||||
# Then we replace the je with nops.
|
|
||||||
|
|
||||||
md = Cs(CS_ARCH_X86, CS_MODE_64)
|
|
||||||
md.detail = True
|
|
||||||
for i in md.disasm(krisp_initialize, krisp_initialize_address):
|
|
||||||
if i.id == X86_INS_CALL:
|
|
||||||
if i.operands[0].type == X86_OP_IMM:
|
|
||||||
if i.operands[0].imm == isSignedByDiscord_address:
|
|
||||||
found_issigned_by_discord_call = True
|
|
||||||
|
|
||||||
if i.id == X86_INS_TEST:
|
|
||||||
if found_issigned_by_discord_call:
|
|
||||||
found_issigned_by_discord_test = True
|
|
||||||
|
|
||||||
if i.id == X86_INS_JE:
|
|
||||||
if found_issigned_by_discord_test:
|
|
||||||
found_issigned_by_discord_je = True
|
|
||||||
je_location = i.address
|
|
||||||
je_size = len(i.bytes)
|
|
||||||
break
|
|
||||||
|
|
||||||
if i.id == X86_INS_NOP:
|
|
||||||
if found_issigned_by_discord_test:
|
|
||||||
found_already_patched = True
|
|
||||||
break
|
|
||||||
|
|
||||||
if je_location:
|
|
||||||
print(f"Found patch location: 0x{je_location:x}")
|
|
||||||
|
|
||||||
shutil.copyfile(executable, executable + ".orig")
|
|
||||||
f = open(executable, "rb+")
|
|
||||||
f.seek(je_location - address_to_file)
|
|
||||||
f.write(
|
|
||||||
b"\x90" * je_size
|
|
||||||
) # je can be larger than 2 bytes given a large enough displacement :(
|
|
||||||
f.close()
|
|
||||||
else:
|
|
||||||
if found_already_patched:
|
|
||||||
print("Couldn't find patch location - already patched.")
|
|
||||||
else:
|
|
||||||
print("Couldn't find patch location - review manually. Sorry.")
|
|
|
@ -7,10 +7,10 @@
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./neovim.nix
|
./neovim
|
||||||
];
|
];
|
||||||
|
|
||||||
config = mkIf (config.local.systemVars.desktop != "none") {
|
config = mkIf config.local.profiles.desktop.enable {
|
||||||
/*
|
/*
|
||||||
we don't want the default NixOS EDITOR value, which is nano and will override the `environment.d` setting.
|
we don't want the default NixOS EDITOR value, which is nano and will override the `environment.d` setting.
|
||||||
we have to unset it like this so that our systemd user variable will take precedence:
|
we have to unset it like this so that our systemd user variable will take precedence:
|
||||||
|
|
15
modules/programs/editors/neovim/basedpyright-fix.nix
Normal file
15
modules/programs/editors/neovim/basedpyright-fix.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# thanks https://gitlab.com/fazzi/nixohess/-/blob/3e0544761d7f0361e7a8ac7b15714515e7fd5e7c/overlays/basedpyright-fix.nix
|
||||||
|
_: {
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(_: prev: {
|
||||||
|
basedpyright = prev.basedpyright.overrideAttrs (old: {
|
||||||
|
postInstall =
|
||||||
|
old.postInstall
|
||||||
|
+ ''
|
||||||
|
# Remove dangling symlinks created during installation (remove -delete to just see the files, or -print '%l\n' to see the target
|
||||||
|
find -L $out -type l -print -delete
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
|
@ -53,9 +53,21 @@
|
||||||
|
|
||||||
ui = {
|
ui = {
|
||||||
noice.enable = true;
|
noice.enable = true;
|
||||||
|
smartcolumn = {
|
||||||
|
enable = true;
|
||||||
|
setupOpts = {
|
||||||
|
custom_colorcolumn = {
|
||||||
|
nix = "110";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
notify.nvim-notify.enable = true;
|
|
||||||
|
|
||||||
|
mini = {
|
||||||
|
comment.enable = true;
|
||||||
|
notify.enable = true;
|
||||||
|
surround.enable = true;
|
||||||
|
};
|
||||||
statusline = {
|
statusline = {
|
||||||
lualine = {
|
lualine = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -159,11 +171,13 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
git.enable = true;
|
git = {
|
||||||
|
enable = true;
|
||||||
|
gitsigns.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
utility = {
|
utility = {
|
||||||
vim-wakatime.enable = true;
|
vim-wakatime.enable = true;
|
||||||
surround.enable = true;
|
|
||||||
motion.leap = {
|
motion.leap = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
@ -204,7 +218,10 @@
|
||||||
enableLSP = true;
|
enableLSP = true;
|
||||||
enableTreesitter = true;
|
enableTreesitter = true;
|
||||||
|
|
||||||
nix.enable = true;
|
nix = {
|
||||||
|
enable = true;
|
||||||
|
lsp.server = "nil";
|
||||||
|
};
|
||||||
clang.enable = true;
|
clang.enable = true;
|
||||||
python.enable = true;
|
python.enable = true;
|
||||||
ts.enable = true;
|
ts.enable = true;
|
||||||
|
@ -239,7 +256,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
imports = [./basedpyright-fix.nix];
|
||||||
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [customNeovim.neovim];
|
packages = [customNeovim.neovim];
|
||||||
};
|
};
|
|
@ -10,7 +10,7 @@
|
||||||
sha256 = "137k3i7z4va68v4rvrazy26szc7p2w59h7bc2h8japzjyj6xjs71";
|
sha256 = "137k3i7z4va68v4rvrazy26szc7p2w59h7bc2h8japzjyj6xjs71";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [pkgs.fastfetch];
|
packages = [pkgs.fastfetch];
|
||||||
files = {
|
files = {
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (builtins) readFile;
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
toINI = lib.generators.toINI {};
|
|
||||||
|
|
||||||
betterfox = pkgs.fetchFromGitHub {
|
betterfox = pkgs.fetchFromGitHub {
|
||||||
owner = "yokoffing";
|
owner = "yokoffing";
|
||||||
|
@ -13,156 +13,152 @@
|
||||||
rev = "e026ed7d3a763c5d3f96c2680d7bc3340831af4f";
|
rev = "e026ed7d3a763c5d3f96c2680d7bc3340831af4f";
|
||||||
hash = "sha256-hpkEO5BhMVtINQG8HN4xqfas/R6q5pYPZiFK8bilIDs=";
|
hash = "sha256-hpkEO5BhMVtINQG8HN4xqfas/R6q5pYPZiFK8bilIDs=";
|
||||||
};
|
};
|
||||||
|
in {
|
||||||
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
|
hjem.users.${username} = {
|
||||||
|
programs.firefox = {
|
||||||
|
enable = true;
|
||||||
|
inherit username;
|
||||||
|
|
||||||
firefox = pkgs.wrapFirefox pkgs.firefox-esr-128-unwrapped {
|
policies = {
|
||||||
extraPolicies = {
|
DisableTelemetry = true;
|
||||||
SearchEngines.Default = "SearxNG";
|
DisablePocket = true;
|
||||||
SearchEngines.Add = [
|
DisableFeedbackCommands = true;
|
||||||
{
|
DisableFirefoxStudies = true;
|
||||||
Name = "SearxNG";
|
OfferToSaveLogins = false;
|
||||||
URLTemplate = "https://search.nezia.dev/search?q={searchTerms}";
|
OffertosaveloginsDefault = false;
|
||||||
Method = "GET";
|
PasswordManagerEnabled = false;
|
||||||
SuggestURLTemplate = "https://search.nezia.dev/autocompleter?q={searchTerms}";
|
SearchSuggestEnabled = true;
|
||||||
}
|
FirefoxHome = {
|
||||||
{
|
Pocket = false;
|
||||||
Name = "Nix Packages";
|
Snippets = false;
|
||||||
Alias = "@np";
|
|
||||||
URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}";
|
|
||||||
Method = "GET";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
Name = "Nix Options";
|
|
||||||
Alias = "@no";
|
|
||||||
URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}";
|
|
||||||
Method = "GET";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
Name = "NixOS Wiki";
|
|
||||||
Alias = "@nw";
|
|
||||||
URLTemplate = "https://wiki.nixos.org/w/index.php?search={searchTerms}";
|
|
||||||
Method = "GET";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
Name = "Home Manager Options";
|
|
||||||
Alias = "@hmo";
|
|
||||||
URLTemplate = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master";
|
|
||||||
Method = "GET";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
Name = "ProtonDB";
|
|
||||||
Alias = "@pdb";
|
|
||||||
URLTemplate = "https://www.protondb.com/search?q={searchTerms}";
|
|
||||||
Method = "GET";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
Name = "Noogle";
|
|
||||||
Alias = "@ng";
|
|
||||||
URLTemplate = "https://noogle.dev/q?term={searchTerms}";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
Name = "GitHub Nix";
|
|
||||||
Alias = "@ghn";
|
|
||||||
URLTemplate = "https://github.com/search?q=language:nix NOT is:fork {searchTerms}&type=code";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
DisableTelemetry = true;
|
|
||||||
DisablePocket = true;
|
|
||||||
DisableFeedbackCommands = true;
|
|
||||||
DisableFirefoxStudies = true;
|
|
||||||
OfferToSaveLogins = false;
|
|
||||||
OffertosaveloginsDefault = false;
|
|
||||||
PasswordManagerEnabled = false;
|
|
||||||
SearchSuggestEnabled = true;
|
|
||||||
|
|
||||||
# https://github.com/Sly-Harvey/NixOS/blob/f9da2691ea46565256ad757959cfc26ec6cee10d/modules/programs/browser/firefox/default.nix#L58-L163
|
|
||||||
"3rdparty".Extensions = {
|
|
||||||
"addon@darkreader.org" = {
|
|
||||||
permissions = ["internal:privateBrowsingAllowed"];
|
|
||||||
enabled = true;
|
|
||||||
automation = {
|
|
||||||
enabled = true;
|
|
||||||
behavior = "OnOff";
|
|
||||||
mode = "system";
|
|
||||||
};
|
};
|
||||||
detectDarkTheme = true;
|
|
||||||
enabledByDefault = true;
|
SearchEngines.Default = "SearxNG";
|
||||||
changeBrowserTheme = false;
|
SearchEngines.Add = [
|
||||||
enableForProtectedPages = true;
|
{
|
||||||
fetchNews = false;
|
Name = "SearxNG";
|
||||||
previewNewDesign = true;
|
URLTemplate = "https://search.nezia.dev/search?q={searchTerms}";
|
||||||
};
|
Method = "GET";
|
||||||
"uBlock0@raymondhill.net" = {
|
SuggestURLTemplate = "https://search.nezia.dev/autocompleter?q={searchTerms}";
|
||||||
permissions = ["internal:privateBrowsingAllowed"];
|
}
|
||||||
advancedSettings = [
|
{
|
||||||
[
|
Name = "Nix Packages";
|
||||||
"userResourcesLocation"
|
Alias = "@np";
|
||||||
"https://raw.githubusercontent.com/pixeltris/TwitchAdSolutions/master/video-swap-new/video-swap-new-ublock-origin.js"
|
URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}";
|
||||||
]
|
Method = "GET";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Name = "Nix Options";
|
||||||
|
Alias = "@no";
|
||||||
|
URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}";
|
||||||
|
Method = "GET";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Name = "NixOS Wiki";
|
||||||
|
Alias = "@nw";
|
||||||
|
URLTemplate = "https://wiki.nixos.org/w/index.php?search={searchTerms}";
|
||||||
|
Method = "GET";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Name = "Home Manager Options";
|
||||||
|
Alias = "@hmo";
|
||||||
|
URLTemplate = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master";
|
||||||
|
Method = "GET";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Name = "ProtonDB";
|
||||||
|
Alias = "@pdb";
|
||||||
|
URLTemplate = "https://www.protondb.com/search?q={searchTerms}";
|
||||||
|
Method = "GET";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Name = "Noogle";
|
||||||
|
Alias = "@ng";
|
||||||
|
URLTemplate = "https://noogle.dev/q?term={searchTerms}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Name = "GitHub Nix";
|
||||||
|
Alias = "@ghn";
|
||||||
|
URLTemplate = "https://github.com/search?q=language:nix NOT is:fork {searchTerms}&type=code";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
adminSettings = {
|
|
||||||
userSettings = {
|
# https://github.com/Sly-Harvey/NixOS/blob/f9da2691ea46565256ad757959cfc26ec6cee10d/modules/programs/browser/firefox/default.nix#L58-L163
|
||||||
uiTheme = "dark";
|
"3rdparty".Extensions = {
|
||||||
advancedUserEnabled = true;
|
"addon@darkreader.org" = {
|
||||||
userFiltersTrusted = true;
|
permissions = ["internal:privateBrowsingAllowed"];
|
||||||
importedLists = [
|
enabled = true;
|
||||||
"https://raw.githubusercontent.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/main/list.txt"
|
automation = {
|
||||||
];
|
enabled = true;
|
||||||
selectedFilterLists = [
|
behavior = "OnOff";
|
||||||
"FRA-0"
|
mode = "system";
|
||||||
"adguard-cookies"
|
};
|
||||||
"adguard-mobile-app-banners"
|
detectDarkTheme = true;
|
||||||
"adguard-other-annoyances"
|
enabledByDefault = true;
|
||||||
"adguard-popup-overlays"
|
changeBrowserTheme = false;
|
||||||
"adguard-social"
|
enableForProtectedPages = true;
|
||||||
"adguard-spyware-url"
|
fetchNews = false;
|
||||||
"adguard-widgets"
|
previewNewDesign = true;
|
||||||
"easylist"
|
};
|
||||||
"easylist-annoyances"
|
"uBlock0@raymondhill.net" = {
|
||||||
"easylist-chat"
|
permissions = ["internal:privateBrowsingAllowed"];
|
||||||
"easylist-newsletters"
|
advancedSettings = [
|
||||||
"easylist-notifications"
|
[
|
||||||
"easyprivacy"
|
"userResourcesLocation"
|
||||||
"fanboy-cookiemonster"
|
"https://raw.githubusercontent.com/pixeltris/TwitchAdSolutions/master/video-swap-new/video-swap-new-ublock-origin.js"
|
||||||
"https://filters.adtidy.org/extension/ublock/filters/3.txt"
|
]
|
||||||
"https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt"
|
|
||||||
"plowe-0"
|
|
||||||
"ublock-annoyances"
|
|
||||||
"ublock-badware"
|
|
||||||
"ublock-cookies-adguard"
|
|
||||||
"ublock-cookies-easylist"
|
|
||||||
"ublock-filters"
|
|
||||||
"ublock-privacy"
|
|
||||||
"ublock-quick-fixes"
|
|
||||||
"ublock-unbreak"
|
|
||||||
"urlhaus-1"
|
|
||||||
"https://raw.githubusercontent.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/main/list.txt"
|
|
||||||
];
|
];
|
||||||
|
adminSettings = {
|
||||||
|
userSettings = {
|
||||||
|
uiTheme = "dark";
|
||||||
|
advancedUserEnabled = true;
|
||||||
|
userFiltersTrusted = true;
|
||||||
|
importedLists = [
|
||||||
|
"https://raw.githubusercontent.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/main/list.txt"
|
||||||
|
];
|
||||||
|
selectedFilterLists = [
|
||||||
|
"FRA-0"
|
||||||
|
"adguard-cookies"
|
||||||
|
"adguard-mobile-app-banners"
|
||||||
|
"adguard-other-annoyances"
|
||||||
|
"adguard-popup-overlays"
|
||||||
|
"adguard-social"
|
||||||
|
"adguard-spyware-url"
|
||||||
|
"adguard-widgets"
|
||||||
|
"easylist"
|
||||||
|
"easylist-annoyances"
|
||||||
|
"easylist-chat"
|
||||||
|
"easylist-newsletters"
|
||||||
|
"easylist-notifications"
|
||||||
|
"easyprivacy"
|
||||||
|
"fanboy-cookiemonster"
|
||||||
|
"https://filters.adtidy.org/extension/ublock/filters/3.txt"
|
||||||
|
"https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt"
|
||||||
|
"plowe-0"
|
||||||
|
"ublock-annoyances"
|
||||||
|
"ublock-badware"
|
||||||
|
"ublock-cookies-adguard"
|
||||||
|
"ublock-cookies-easylist"
|
||||||
|
"ublock-filters"
|
||||||
|
"ublock-privacy"
|
||||||
|
"ublock-quick-fixes"
|
||||||
|
"ublock-unbreak"
|
||||||
|
"urlhaus-1"
|
||||||
|
"https://raw.githubusercontent.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/main/list.txt"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
extraConfig = builtins.concatStringsSep "\n" [
|
||||||
};
|
(readFile "${betterfox}/user.js")
|
||||||
in {
|
(readFile "${betterfox}/Securefox.js")
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
(readFile "${betterfox}/Fastfox.js")
|
||||||
hjem.users.${username} = {
|
(readFile "${betterfox}/Peskyfox.js")
|
||||||
packages = [firefox];
|
(readFile "${betterfox}/Smoothfox.js")
|
||||||
files = {
|
|
||||||
".mozilla/firefox/profiles.ini".text = toINI {
|
|
||||||
Profile0 = {
|
|
||||||
# creates lunarnova profile and sets it as default
|
|
||||||
Name = "${username}";
|
|
||||||
IsRelative = 1;
|
|
||||||
Path = "${username}";
|
|
||||||
Default = 1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
".mozilla/firefox/${username}/user.js".text = builtins.concatStringsSep "\n" [
|
|
||||||
(builtins.readFile "${betterfox}/user.js")
|
|
||||||
(builtins.readFile "${betterfox}/Securefox.js")
|
|
||||||
(builtins.readFile "${betterfox}/Fastfox.js")
|
|
||||||
(builtins.readFile "${betterfox}/Peskyfox.js")
|
|
||||||
(builtins.readFile "${betterfox}/Smoothfox.js")
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,7 +12,6 @@ in {
|
||||||
packages = [
|
packages = [
|
||||||
pkgs.mangohud
|
pkgs.mangohud
|
||||||
pkgs.bolt-launcher
|
pkgs.bolt-launcher
|
||||||
pkgs.ankama-launcher
|
|
||||||
pkgs.lutris
|
pkgs.lutris
|
||||||
pkgs.qbittorrent
|
pkgs.qbittorrent
|
||||||
pkgs.protonplus
|
pkgs.protonplus
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
hyprlock = "${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock";
|
hyprlock = "${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock";
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop == "Hyprland") {
|
config = lib.mkIf config.local.modules.hyprland.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [hypridle];
|
packages = [hypridle];
|
||||||
files = {
|
files = {
|
||||||
|
@ -52,7 +52,7 @@ in {
|
||||||
wantedBy = ["graphical-session.target"];
|
wantedBy = ["graphical-session.target"];
|
||||||
restartTriggers = ["${config.hjem.users.${username}.files.".config/hypr/hypridle.conf".text}"];
|
restartTriggers = ["${config.hjem.users.${username}.files.".config/hypr/hypridle.conf".text}"];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "exec";
|
Type = "simple";
|
||||||
ExecStart = "${hypridle}/bin/hypridle";
|
ExecStart = "${hypridle}/bin/hypridle";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
Slice = "background-graphical.slice";
|
Slice = "background-graphical.slice";
|
||||||
|
|
|
@ -8,17 +8,17 @@ lib: let
|
||||||
in {
|
in {
|
||||||
"$mod" = "SUPER";
|
"$mod" = "SUPER";
|
||||||
bindr = [
|
bindr = [
|
||||||
"$mod, SUPER_L, exec, ${toggle "anyrun" false}"
|
"$mod, SUPER_L, exec, ${toggle "anyrun" true}"
|
||||||
];
|
];
|
||||||
bind = [
|
bind = [
|
||||||
"$mod, Return, exec, ${run "ghostty"}"
|
"$mod, Return, exec, ${run "ghostty"}"
|
||||||
"$mod, n, exec, ${run "neovide"}"
|
"$mod, n, exec, ${run "neovide"}"
|
||||||
"$mod, w, exec, ${run "firefox"}"
|
"$mod, w, exec, ${run "firefox"}"
|
||||||
", Print, exec, ${runOnce "grimblast"} --notify --cursor copysave output"
|
", Print, exec, ${runOnce "grimblast"} --notify copysave output"
|
||||||
"$mod, q, killactive"
|
"$mod, q, killactive"
|
||||||
"$mod SHIFT, q, exec, loginctl terminate-user ''"
|
"$mod SHIFT, q, exec, loginctl terminate-user ''"
|
||||||
"$mod, period, exec, ${toggle "walker -m emojis" false}" # not using uwsm as it already runs as a service
|
"$mod, period, exec, ${toggle "walker -m emojis" false}" # not using uwsm as it already runs as a service
|
||||||
"CTRL, Print, exec, ${runOnce "grimblast"} --notify --cursor --freeze copysave area"
|
"CTRL, Print, exec, ${runOnce "grimblast"} --notify --freeze copysave area"
|
||||||
|
|
||||||
"$mod, h, movefocus, l"
|
"$mod, h, movefocus, l"
|
||||||
"$mod, j, movefocus, d"
|
"$mod, j, movefocus, d"
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
|
|
||||||
styleCfg = config.local.style;
|
styleCfg = config.local.style;
|
||||||
|
|
||||||
gnomeControlCenter = pkgs.gnome-control-center.overrideAttrs (old: {
|
gnomeControlCenter = pkgs.gnome-control-center.overrideAttrs (old: {
|
||||||
postInstall =
|
postInstall =
|
||||||
old.postInstall
|
old.postInstall
|
||||||
|
@ -29,7 +30,7 @@
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
in {
|
in {
|
||||||
config = mkIf (config.local.systemVars.desktop == "Hyprland") {
|
config = mkIf config.local.modules.hyprland.enable {
|
||||||
programs.hyprland = {
|
programs.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
||||||
|
@ -58,103 +59,103 @@ in {
|
||||||
inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast
|
inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast
|
||||||
gnomeControlCenter
|
gnomeControlCenter
|
||||||
];
|
];
|
||||||
files = {
|
|
||||||
".config/hypr/hyprland.conf".text = toHyprConf {
|
|
||||||
attrs =
|
|
||||||
{
|
|
||||||
xwayland = {
|
|
||||||
force_zero_scaling = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
env = [
|
rum.programs.hyprland = {
|
||||||
|
enable = true;
|
||||||
|
settings =
|
||||||
|
{
|
||||||
|
xwayland = {
|
||||||
|
force_zero_scaling = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
env = [
|
||||||
|
];
|
||||||
|
|
||||||
|
cursor = {
|
||||||
|
no_hardware_cursors = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
monitor = [
|
||||||
|
"eDP-1, preferred, auto, 1.33"
|
||||||
|
"Unknown-1,disabled"
|
||||||
|
];
|
||||||
|
workspace = [
|
||||||
|
"special:terminal, on-created-empty:ghostty"
|
||||||
|
"special:file_manager_gui, on-created-empty:pcmanfm"
|
||||||
|
"special:file_manager_tui, on-created-empty:ghostty -e yazi"
|
||||||
|
|
||||||
|
"special:calculator_gui, on-created-empty:qalculate-gtk"
|
||||||
|
"special:mixer_gui, on-created-empty:pavucontrol"
|
||||||
|
];
|
||||||
|
|
||||||
|
windowrulev2 = [
|
||||||
|
# fixes fullscreen windows (mostly games)
|
||||||
|
"stayfocused, initialtitle:^()$, initialclass:^(steam)$"
|
||||||
|
"minsize 1 1, initialtitle:^()$, initialclass:^(steam)$"
|
||||||
|
"maximize, initialtitle:^(\S+)$, initialclass:^(steamwebhelper)$"
|
||||||
|
|
||||||
|
"immediate, initialclass:^(steam_app_)(.*)$"
|
||||||
|
"fullscreen, initialclass:^(steam_app_)(.*)$"
|
||||||
|
|
||||||
|
# inhibit idle on fullscreen apps (avoids going idle on games when playing with gamepad)
|
||||||
|
"idleinhibit always, fullscreen:1"
|
||||||
|
];
|
||||||
|
|
||||||
|
render = {
|
||||||
|
explicit_sync = 1;
|
||||||
|
explicit_sync_kms = 1;
|
||||||
|
expand_undersized_textures = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
bezier = "overshot, 0.05, 0.9, 0.1, 1.1";
|
||||||
|
|
||||||
|
animations = {
|
||||||
|
enabled = true;
|
||||||
|
animation = [
|
||||||
|
"windows, 1, 5, overshot"
|
||||||
|
"windowsOut, 1, 5, default, popin 80%"
|
||||||
|
"windowsMove, 1, 5, default, popin 80%"
|
||||||
|
"fade, 1, 5, default"
|
||||||
|
"border, 1, 5, default"
|
||||||
|
"borderangle, 0, 8, default"
|
||||||
|
"workspaces, 0"
|
||||||
|
"specialWorkspace, 0"
|
||||||
];
|
];
|
||||||
|
};
|
||||||
|
|
||||||
cursor = {
|
input = {
|
||||||
no_hardware_cursors = 1;
|
kb_options = "compose:ralt";
|
||||||
|
touchpad = {
|
||||||
|
natural_scroll = true;
|
||||||
|
scroll_factor = 0.8;
|
||||||
|
tap-to-click = true;
|
||||||
|
clickfinger_behavior = true;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
monitor = [
|
gestures = {
|
||||||
"eDP-1, preferred, auto, 1.33"
|
workspace_swipe = true;
|
||||||
"Unknown-1,disabled"
|
workspace_swipe_direction_lock = false;
|
||||||
];
|
workspace_swipe_cancel_ratio = 0.15;
|
||||||
workspace = [
|
};
|
||||||
"special:terminal, on-created-empty:ghostty"
|
|
||||||
"special:file_manager_gui, on-created-empty:thunar"
|
|
||||||
"special:file_manager_tui, on-created-empty:ghostty -e yazi"
|
|
||||||
|
|
||||||
"special:calculator_gui, on-created-empty:qalculate-gtk"
|
misc = {
|
||||||
"special:mixer_gui, on-created-empty:pavucontrol"
|
force_default_wallpaper = 0;
|
||||||
];
|
disable_hyprland_logo = true;
|
||||||
|
middle_click_paste = false;
|
||||||
windowrulev2 = [
|
};
|
||||||
# fixes fullscreen windows (mostly games)
|
}
|
||||||
"stayfocused, initialtitle:^()$, initialclass:^(steam)$"
|
// optionalAttrs styleCfg.enable {
|
||||||
"minsize 1 1, initialtitle:^()$, initialclass:^(steam)$"
|
general = {
|
||||||
"maximize, initialtitle:^(\S+)$, initialclass:^(steamwebhelper)$"
|
border_size = 4;
|
||||||
|
"col.active_border" = "rgb(${lib.removePrefix "#" styleCfg.scheme.palette.base0E})";
|
||||||
"immediate, initialclass:^(steam_app_)(.*)$"
|
};
|
||||||
"fullscreen, initialclass:^(steam_app_)(.*)$"
|
decoration = {
|
||||||
|
rounding = 10;
|
||||||
# inhibit idle on fullscreen apps (avoids going idle on games when playing with gamepad)
|
blur.enabled = true;
|
||||||
"idleinhibit always, fullscreen:1"
|
};
|
||||||
];
|
}
|
||||||
|
// import ./binds.nix lib;
|
||||||
render = {
|
|
||||||
explicit_sync = 1;
|
|
||||||
explicit_sync_kms = 1;
|
|
||||||
expand_undersized_textures = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
bezier = "overshot, 0.05, 0.9, 0.1, 1.1";
|
|
||||||
|
|
||||||
animations = {
|
|
||||||
enabled = true;
|
|
||||||
animation = [
|
|
||||||
"windows, 1, 5, overshot"
|
|
||||||
"windowsOut, 1, 5, default, popin 80%"
|
|
||||||
"windowsMove, 1, 5, default, popin 80%"
|
|
||||||
"fade, 1, 5, default"
|
|
||||||
"border, 1, 5, default"
|
|
||||||
"borderangle, 0, 8, default"
|
|
||||||
"workspaces, 0"
|
|
||||||
"specialWorkspace, 0"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
input = {
|
|
||||||
kb_options = "compose:ralt";
|
|
||||||
touchpad = {
|
|
||||||
natural_scroll = true;
|
|
||||||
scroll_factor = 0.8;
|
|
||||||
tap-to-click = true;
|
|
||||||
clickfinger_behavior = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
gestures = {
|
|
||||||
workspace_swipe = true;
|
|
||||||
workspace_swipe_direction_lock = false;
|
|
||||||
workspace_swipe_cancel_ratio = 0.15;
|
|
||||||
};
|
|
||||||
|
|
||||||
misc = {
|
|
||||||
force_default_wallpaper = 0;
|
|
||||||
disable_hyprland_logo = true;
|
|
||||||
middle_click_paste = false;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// optionalAttrs styleCfg.enable {
|
|
||||||
general = {
|
|
||||||
border_size = 4;
|
|
||||||
"col.active_border" = "rgb(${lib.removePrefix "#" styleCfg.scheme.palette.base0E})";
|
|
||||||
};
|
|
||||||
decoration = {
|
|
||||||
rounding = 10;
|
|
||||||
blur.enabled = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// import ./binds.nix lib;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.sessionVariables = mkMerge [
|
environment.sessionVariables = mkMerge [
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
styleCfg = config.local.style;
|
styleCfg = config.local.style;
|
||||||
rgbaPalette = builtins.mapAttrs (_: c: (lib'.rgba c 1)) styleCfg.scheme.palette;
|
rgbaPalette = builtins.mapAttrs (_: c: (lib'.rgba c 1)) styleCfg.scheme.palette;
|
||||||
in {
|
in {
|
||||||
config = mkIf (config.local.systemVars.desktop == "Hyprland") {
|
config = mkIf config.local.modules.hyprland.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [hyprlock];
|
packages = [hyprlock];
|
||||||
files = {
|
files = {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
inherit (config.local.style) wallpaper;
|
inherit (config.local.style) wallpaper;
|
||||||
inherit (inputs.hyprpaper.packages.${pkgs.system}) hyprpaper;
|
inherit (inputs.hyprpaper.packages.${pkgs.system}) hyprpaper;
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop == "Hyprland") {
|
config = lib.mkIf config.local.modules.hyprland.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [hyprpaper];
|
packages = [hyprpaper];
|
||||||
files = {
|
files = {
|
||||||
|
|
|
@ -11,7 +11,7 @@ in {
|
||||||
./zathura.nix
|
./zathura.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username}.packages = [
|
hjem.users.${username}.packages = [
|
||||||
pkgs.gnome-calculator
|
pkgs.gnome-calculator
|
||||||
pkgs.gthumb
|
pkgs.gthumb
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
styleCfg = config.local.style;
|
styleCfg = config.local.style;
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [pkgs.tidal-hifi];
|
packages = [pkgs.tidal-hifi];
|
||||||
files = {
|
files = {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
builtins.concatStringsSep "\n"
|
builtins.concatStringsSep "\n"
|
||||||
(lib.mapAttrsToList (option: value: "set ${option} \"${toString value}\"") attrs);
|
(lib.mapAttrsToList (option: value: "set ${option} \"${toString value}\"") attrs);
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [pkgs.zathura];
|
packages = [pkgs.zathura];
|
||||||
files = {
|
files = {
|
||||||
|
|
|
@ -8,9 +8,10 @@
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
in {
|
in {
|
||||||
config = mkIf (config.local.systemVars.desktop != "none") {
|
config = mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
|
devenv
|
||||||
entr
|
entr
|
||||||
fractal
|
fractal
|
||||||
fzf
|
fzf
|
||||||
|
|
|
@ -4,9 +4,10 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (config.local.systemVars) desktop username;
|
inherit (config.local.profiles) desktop;
|
||||||
|
inherit (config.local.systemVars) username;
|
||||||
in {
|
in {
|
||||||
config = mkIf (desktop != "none") {
|
config = mkIf desktop.enable {
|
||||||
programs.nh = {
|
programs.nh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
clean = {
|
clean = {
|
||||||
|
@ -15,6 +16,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
hjem.users.${username}.environment.sessionVariables.FLAKE = "${config.hjem.users.${username}.directory}/.dotfiles";
|
hjem.users.${username}.environment.sessionVariables.FLAKE = "/home/${username}/.dotfiles";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
35
modules/programs/pcmanfm.nix
Normal file
35
modules/programs/pcmanfm.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
inherit (config.local.systemVars) username;
|
||||||
|
in {
|
||||||
|
config = mkIf config.local.profiles.desktop.enable {
|
||||||
|
hjem.users.${username} = {
|
||||||
|
packages = with pkgs; [
|
||||||
|
lxmenu-data
|
||||||
|
pcmanfm # builds with gtk3 by default, no need to override
|
||||||
|
shared-mime-info
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.gvfs.enable = true; # mount, trash, and other functionalities
|
||||||
|
|
||||||
|
systemd.user.services.pcmanfm = {
|
||||||
|
description = "PCManFM daemon";
|
||||||
|
documentation = ["https://github.com/lxde/pcmanfm"];
|
||||||
|
after = ["graphical-session.target"];
|
||||||
|
partOf = ["graphical-session.target"];
|
||||||
|
wantedBy = ["graphical-session.target"];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${pkgs.pcmanfm}/bin/pcmanfm --daemon-mode";
|
||||||
|
Restart = "on-failure";
|
||||||
|
Slice = "background-graphical.slice";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -5,7 +5,6 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) optionalAttrs;
|
inherit (lib) optionalAttrs;
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
|
|
||||||
styleCfg = config.local.style;
|
styleCfg = config.local.style;
|
||||||
|
@ -39,7 +38,7 @@
|
||||||
"21" = palette.base06;
|
"21" = palette.base06;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
config = mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.modules.hyprland.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [pkgs.foot];
|
packages = [pkgs.foot];
|
||||||
files = {
|
files = {
|
||||||
|
|
|
@ -6,95 +6,91 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mapAttrs mkIf mkMerge optionalAttrs removePrefix;
|
inherit (lib) mapAttrs mkIf mkMerge optionalAttrs removePrefix;
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
toINI = lib.generators.toINIWithGlobalSection {listsAsDuplicateKeys = true;};
|
|
||||||
styleCfg = config.local.style;
|
styleCfg = config.local.style;
|
||||||
|
|
||||||
prefix = "ctrl+a";
|
prefix = "ctrl+a";
|
||||||
|
|
||||||
mkGhosttyTheme = palette: let
|
mkGhosttyTheme = palette: let
|
||||||
colors = mapAttrs (_: value: removePrefix "#" value) palette;
|
colors = mapAttrs (_: value: removePrefix "#" value) palette;
|
||||||
in {
|
in
|
||||||
palette = [
|
with colors; {
|
||||||
"0=#${colors.base00}"
|
base16 = {
|
||||||
"1=#${colors.base08}"
|
palette = {
|
||||||
"2=#${colors.base0B}"
|
"0" = "#${base00}";
|
||||||
"3=#${colors.base0A}"
|
"1" = "#${base08}";
|
||||||
"4=#${colors.base0D}"
|
"2" = "#${base0B}";
|
||||||
"5=#${colors.base0E}"
|
"3" = "#${base0A}";
|
||||||
"6=#${colors.base0C}"
|
"4" = "#${base0D}";
|
||||||
"7=#${colors.base05}"
|
"5" = "#${base0E}";
|
||||||
"8=#${colors.base02}"
|
"6" = "#${base0C}";
|
||||||
"9=#${colors.base08}"
|
"7" = "#${base05}";
|
||||||
"10=#${colors.base0B}"
|
"8" = "#${base02}";
|
||||||
"11=#${colors.base0A}"
|
"9" = "#${base08}";
|
||||||
"12=#${colors.base0D}"
|
"10" = "#${base0B}";
|
||||||
"13=#${colors.base0E}"
|
"11" = "#${base0A}";
|
||||||
"14=#${colors.base0C}"
|
"12" = "#${base0D}";
|
||||||
"15=#${colors.base07}"
|
"13" = "#${base0E}";
|
||||||
"16=#${colors.base09}"
|
"14" = "#${base0C}";
|
||||||
"17=#${colors.base0F}"
|
"15" = "#${base07}";
|
||||||
"18=#${colors.base01}"
|
"16" = "#${base09}";
|
||||||
"19=#${colors.base02}"
|
"17" = "#${base0F}";
|
||||||
"20=#${colors.base04}"
|
"18" = "#${base01}";
|
||||||
"21=#${colors.base06}"
|
"19" = "#${base02}";
|
||||||
];
|
"20" = "#${base04}";
|
||||||
background = colors.base00;
|
"21" = "#${base06}";
|
||||||
foreground = colors.base05;
|
};
|
||||||
cursor-color = colors.base06;
|
background = base00;
|
||||||
selection-background = colors.base02;
|
foreground = base05;
|
||||||
selection-foreground = colors.base05;
|
cursor-color = base06;
|
||||||
};
|
selection-background = base02;
|
||||||
|
selection-foreground = base05;
|
||||||
|
};
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
config = mkIf (config.local.systemVars.desktop != "none") {
|
config = mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
files = mkMerge [
|
programs.ghostty = mkMerge [
|
||||||
{
|
{
|
||||||
".config/ghostty/config".text =
|
enable = true;
|
||||||
toINI
|
settings = {
|
||||||
{
|
font-family = ["monospace" "Symbols Nerd Font"];
|
||||||
globalSection = {
|
font-size = 14;
|
||||||
font-family = ["monospace" "Symbols Nerd Font"];
|
gtk-single-instance = true;
|
||||||
font-size = 14;
|
gtk-adwaita = false;
|
||||||
gtk-single-instance = true;
|
confirm-close-surface = false;
|
||||||
gtk-adwaita = false;
|
|
||||||
confirm-close-surface = false;
|
|
||||||
|
|
||||||
keybind = [
|
keybind = {
|
||||||
"${prefix}>c=new_tab"
|
"${prefix}>c" = "new_tab";
|
||||||
"${prefix}>p=move_tab:-1"
|
"${prefix}>p" = "move_tab:-1";
|
||||||
"${prefix}>n=move_tab:1"
|
"${prefix}>n" = "move_tab:1";
|
||||||
|
|
||||||
"${prefix}>\\=new_split:right"
|
"${prefix}>\\" = "new_split:right";
|
||||||
"${prefix}>-=new_split:down"
|
"${prefix}>-" = "new_split:down";
|
||||||
"${prefix}>h=goto_split:left"
|
"${prefix}>h" = "goto_split:left";
|
||||||
"${prefix}>j=goto_split:bottom"
|
"${prefix}>j" = "goto_split:bottom";
|
||||||
"${prefix}>k=goto_split:top"
|
"${prefix}>k" = "goto_split:top";
|
||||||
"${prefix}>l=goto_split:right"
|
"${prefix}>l" = "goto_split:right";
|
||||||
"${prefix}>shift+h=resize_split:left,10"
|
"${prefix}>shift+h" = "resize_split:left,10";
|
||||||
"${prefix}>shift+j=resize_split:down,10"
|
"${prefix}>shift+j" = "resize_split:down,10";
|
||||||
"${prefix}>shift+k=resize_split:up,10"
|
"${prefix}>shift+k" = "resize_split:up,10";
|
||||||
"${prefix}>shift+l=resize_split:right,11"
|
"${prefix}>shift+l" = "resize_split:right,11";
|
||||||
"${prefix}>z=toggle_split_zoom"
|
"${prefix}>z" = "toggle_split_zoom";
|
||||||
];
|
|
||||||
|
|
||||||
adw-toolbar-style = "flat";
|
|
||||||
gtk-tabs-location = "bottom";
|
|
||||||
gtk-wide-tabs = false;
|
|
||||||
window-decoration = false;
|
|
||||||
|
|
||||||
linux-cgroup = "always";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
adw-toolbar-style = "flat";
|
||||||
|
gtk-tabs-location = "bottom";
|
||||||
|
gtk-wide-tabs = false;
|
||||||
|
window-decoration = false;
|
||||||
|
|
||||||
|
linux-cgroup = "always";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
(optionalAttrs styleCfg.enable
|
(optionalAttrs styleCfg.enable
|
||||||
{
|
{
|
||||||
".config/ghostty/config".text = toINI {
|
settings.theme = "base16";
|
||||||
globalSection.theme = "base16";
|
themes.base16 = mkGhosttyTheme styleCfg.scheme.palette;
|
||||||
};
|
|
||||||
".config/ghostty/themes/base16".text = toINI {globalSection = mkGhosttyTheme styleCfg.scheme.palette;};
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
packages = [pkgs.ghostty];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.ghostty = {
|
systemd.user.services.ghostty = {
|
||||||
|
@ -108,8 +104,8 @@ in {
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
ExecStart = "${pkgs.ghostty}/bin/ghostty --initial-window=false --quit-after-last-window-closed=false";
|
ExecStart = "${pkgs.ghostty}/bin/ghostty --initial-window=false --quit-after-last-window-closed=false";
|
||||||
Slice = "background-graphical.slice";
|
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
Slice = "background-graphical.slice";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
builtins.concatStringsSep "\n"
|
builtins.concatStringsSep "\n"
|
||||||
(lib.mapAttrsToList (option: value: "--${option}=\"${value}\"") attrs);
|
(lib.mapAttrsToList (option: value: "--${option}=\"${value}\"") attrs);
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [
|
packages = [
|
||||||
pkgs.bat
|
pkgs.bat
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
./bat.nix
|
./bat.nix
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
|
./lsd.nix
|
||||||
./misc.nix
|
./misc.nix
|
||||||
# ./tmux.nix
|
# ./tmux.nix
|
||||||
];
|
];
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
programs.direnv.enable = true;
|
programs.direnv.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
inherit (config.local.homeVars) signingKey;
|
inherit (config.local.homeVars) signingKey;
|
||||||
toINI = lib.generators.toINI {};
|
toINI = lib.generators.toINI {};
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = with pkgs; [git lazygit];
|
packages = with pkgs; [git lazygit];
|
||||||
files = {
|
files = {
|
||||||
|
|
17
modules/programs/terminal/programs/lsd.nix
Normal file
17
modules/programs/terminal/programs/lsd.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (config.local.systemVars) username;
|
||||||
|
inherit (config.local.profiles) desktop;
|
||||||
|
in {
|
||||||
|
config = mkIf desktop.enable {
|
||||||
|
hjem.users.${username} = {
|
||||||
|
rum.programs.lsd = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -6,7 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
# archives
|
# archives
|
||||||
|
@ -15,7 +15,6 @@ in {
|
||||||
unrar
|
unrar
|
||||||
|
|
||||||
# utils
|
# utils
|
||||||
comma
|
|
||||||
fd
|
fd
|
||||||
file
|
file
|
||||||
ripgrep
|
ripgrep
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
osConfig,
|
osConfig,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (osConfig.local.systemVars.desktop != "none") {
|
config = lib.mkIf osConfig.local.profiles.desktop.enable {
|
||||||
programs.tmux = {
|
programs.tmux = {
|
||||||
enable = true;
|
enable = true;
|
||||||
prefix = "C-space";
|
prefix = "C-space";
|
||||||
|
|
|
@ -14,7 +14,7 @@ in {
|
||||||
./zsh.nix
|
./zsh.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config = mkIf (config.local.systemVars.desktop != "none") {
|
config = mkIf config.local.profiles.desktop.enable {
|
||||||
users.users.${username}.shell = pkgs.zsh;
|
users.users.${username}.shell = pkgs.zsh;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
starshipCache = "${config.hjem.users.${username}.directory}/.cache/starship";
|
starshipCache = "${config.hjem.users.${username}.directory}/.cache/starship";
|
||||||
zoxideCache = "${config.hjem.users.${username}.directory}/.cache/zoxide";
|
zoxideCache = "${config.hjem.users.${username}.directory}/.cache/zoxide";
|
||||||
in {
|
in {
|
||||||
config = mkIf (config.local.systemVars.desktop != "none") {
|
config = mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = with pkgs; [carapace nushell];
|
packages = with pkgs; [carapace nushell];
|
||||||
files = {
|
files = {
|
||||||
|
|
|
@ -4,14 +4,15 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (config.local.systemVars) username;
|
inherit (lib.strings) concatStrings;
|
||||||
toTOML = (pkgs.formats.toml {}).generate;
|
toTOML = (pkgs.formats.toml {}).generate;
|
||||||
|
inherit (config.local.systemVars) username;
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [pkgs.starship];
|
packages = [pkgs.starship];
|
||||||
files = {
|
files = {
|
||||||
".config/starship/config.toml".source = toTOML "starship config" {
|
".config/starship.toml".source = toTOML "starship config" {
|
||||||
add_newline = true;
|
add_newline = true;
|
||||||
directory = {
|
directory = {
|
||||||
style = "bold yellow";
|
style = "bold yellow";
|
||||||
|
@ -25,6 +26,43 @@ in {
|
||||||
style = "yellow";
|
style = "yellow";
|
||||||
format = "[ $duration]($style)";
|
format = "[ $duration]($style)";
|
||||||
};
|
};
|
||||||
|
# https://github.com/llakala/nixos/blob/6e840f11d19e59b49e7ba9573f1398830799758a/apps/core/starship/git_status.nix
|
||||||
|
git_status = {
|
||||||
|
modified = "M";
|
||||||
|
staged = "S";
|
||||||
|
untracked = "A";
|
||||||
|
renamed = "R";
|
||||||
|
deleted = "D";
|
||||||
|
conflicted = "U";
|
||||||
|
|
||||||
|
ahead = "[+$count](green)";
|
||||||
|
behind = "[-$count](red)";
|
||||||
|
diverged = "[+$ahead_count](green),[-$behind_count](red)";
|
||||||
|
|
||||||
|
style = "white";
|
||||||
|
|
||||||
|
# referenced from https://github.com/clotodex/nix-config/blob/c878ff5d5ae674b49912387ea9253ce985cbd3cd/shell/starship.nix#L82
|
||||||
|
format =
|
||||||
|
concatStrings
|
||||||
|
[
|
||||||
|
"[("
|
||||||
|
|
||||||
|
"(\\["
|
||||||
|
"[($conflicted)](orange)"
|
||||||
|
"[($stashed)](white)"
|
||||||
|
"[($staged)](blue)"
|
||||||
|
"[($deleted)](red)"
|
||||||
|
"[($renamed)](yellow)"
|
||||||
|
"[($modified)](yellow)"
|
||||||
|
"[($untracked)](green)"
|
||||||
|
"\\])"
|
||||||
|
|
||||||
|
"( \\[$ahead_behind\\])"
|
||||||
|
|
||||||
|
" )]"
|
||||||
|
"($style)"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [pkgs.zoxide];
|
packages = [pkgs.zoxide];
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,25 +7,72 @@
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
in {
|
in {
|
||||||
config = mkIf (config.local.systemVars.desktop != "none") {
|
config = mkIf config.local.profiles.desktop.enable {
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [pkgs.zsh];
|
packages = [pkgs.zsh];
|
||||||
files = {
|
files = {
|
||||||
".zshrc".text = ''
|
".zshrc".text = ''
|
||||||
SAVEHIST=2000
|
# enable vi mode
|
||||||
HISTSIZE=2000
|
|
||||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=8"
|
|
||||||
|
|
||||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
|
|
||||||
bindkey -v
|
bindkey -v
|
||||||
|
export KEYTIMEOUT=1
|
||||||
|
|
||||||
|
# history
|
||||||
|
SAVEHIST=2000
|
||||||
|
HISTSIZE=5000
|
||||||
|
|
||||||
|
# prompt
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
eval "$(zoxide init zsh)"
|
eval "$(zoxide init zsh)"
|
||||||
|
|
||||||
source <(fzf --zsh)
|
# aliases
|
||||||
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
alias ls=lsd
|
||||||
|
## git
|
||||||
|
alias lg='lazygit'
|
||||||
|
alias g='git'
|
||||||
|
alias gs='git status'
|
||||||
|
alias ga='git add'
|
||||||
|
alias gc='git commit'
|
||||||
|
alias gca='git commit --amend'
|
||||||
|
alias gcm='git commit --message'
|
||||||
|
alias gk='git checkout'
|
||||||
|
alias gd='git diff'
|
||||||
|
alias gf='git fetch'
|
||||||
|
alias gl='git log'
|
||||||
|
alias gp='git push'
|
||||||
|
alias gpf='git push --force-with-lease'
|
||||||
|
alias gr='git reset'
|
||||||
|
alias gt='git stash'
|
||||||
|
alias gtp='git stash pop'
|
||||||
|
alias gu='git pull'
|
||||||
|
|
||||||
|
## bat
|
||||||
|
alias man='batman'
|
||||||
|
alias -g -- --help='--help 2>&1 | bat --language=help --style=plain'
|
||||||
|
|
||||||
|
# add extra completions
|
||||||
|
fpath+=(${pkgs.zsh-completions}/share/zsh/site-functions)
|
||||||
|
fpath+=(${pkgs.nix-zsh-completions}/share/zsh/site-functions)
|
||||||
|
source ${pkgs.nix-zsh-completions}/share/zsh/plugins/nix/nix-zsh-completions.plugin.zsh
|
||||||
|
|
||||||
|
# fzf integration
|
||||||
|
source <(fzf --zsh)
|
||||||
|
source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh
|
||||||
|
|
||||||
|
# completion styling
|
||||||
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||||
|
zstyle ':completion:*' list-colors "\$\{s.:. LS_COLORS}"
|
||||||
|
zstyle ':completion:*' menu no
|
||||||
|
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'lsd'
|
||||||
|
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'lsd'
|
||||||
|
|
||||||
|
# autosuggestions
|
||||||
|
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=8"
|
||||||
|
source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||||
|
|
||||||
|
# highlighting
|
||||||
|
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||||
|
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
|
||||||
ZSH_HIGHLIGHT_STYLES[default]=none
|
ZSH_HIGHLIGHT_STYLES[default]=none
|
||||||
ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=red,underline
|
ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=red,underline
|
||||||
ZSH_HIGHLIGHT_STYLES[reserved-word]=fg=cyan,bold
|
ZSH_HIGHLIGHT_STYLES[reserved-word]=fg=cyan,bold
|
||||||
|
@ -67,31 +114,6 @@ in {
|
||||||
ZSH_HIGHLIGHT_STYLES[bracket-level-4]=fg=yellow,bold
|
ZSH_HIGHLIGHT_STYLES[bracket-level-4]=fg=yellow,bold
|
||||||
ZSH_HIGHLIGHT_STYLES[bracket-level-5]=fg=cyan,bold
|
ZSH_HIGHLIGHT_STYLES[bracket-level-5]=fg=cyan,bold
|
||||||
ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]=standout
|
ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]=standout
|
||||||
source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh
|
|
||||||
|
|
||||||
# aliases
|
|
||||||
## git
|
|
||||||
alias lg='lazygit'
|
|
||||||
alias g='git'
|
|
||||||
alias gs='git status'
|
|
||||||
alias ga='git add'
|
|
||||||
alias gc='git commit'
|
|
||||||
alias gca='git commit --amend'
|
|
||||||
alias gcm='git commit --message'
|
|
||||||
alias gk='git checkout'
|
|
||||||
alias gd='git diff'
|
|
||||||
alias gf='git fetch'
|
|
||||||
alias gl='git log'
|
|
||||||
alias gp='git push'
|
|
||||||
alias gpf='git push --force-with-lease'
|
|
||||||
alias gr='git reset'
|
|
||||||
alias gt='git stash'
|
|
||||||
alias gtp='git stash pop'
|
|
||||||
alias gu='git pull'
|
|
||||||
|
|
||||||
## bat
|
|
||||||
alias man='batman'
|
|
||||||
alias -g -- --help='--help 2>&1 | bat --language=help --style=plain'
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) mkIf;
|
|
||||||
in {
|
|
||||||
config = mkIf (config.local.systemVars.desktop != "none") {
|
|
||||||
programs = {
|
|
||||||
thunar = {
|
|
||||||
enable = true;
|
|
||||||
plugins = with pkgs.xfce; [
|
|
||||||
thunar-archive-plugin
|
|
||||||
thunar-volman
|
|
||||||
exo
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
xfconf.enable = true;
|
|
||||||
file-roller.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.gvfs.enable = true; # Mount, trash, and other functionalities
|
|
||||||
services.tumbler.enable = true; # Thumbnail support for images
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -10,7 +10,7 @@
|
||||||
styleCfg = config.local.style;
|
styleCfg = config.local.style;
|
||||||
betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)";
|
betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)";
|
||||||
in {
|
in {
|
||||||
config = mkIf (config.local.systemVars.desktop == "Hyprland") {
|
config = mkIf config.local.modules.hyprland.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [
|
packages = [
|
||||||
pkgs.waybar
|
pkgs.waybar
|
||||||
|
@ -270,22 +270,26 @@ in {
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.services.waybar = {
|
systemd.services.waybar.settings = {
|
||||||
description = "Highly customizable Wayland bar for Sway and Wlroots based compositors.";
|
Unit = {
|
||||||
documentation = ["https://github.com/Alexays/Waybar/wiki/"];
|
Description = "Highly customizable Wayland bar for Sway and Wlroots based compositors.";
|
||||||
after = ["graphical-session.target"];
|
Documentation = ["https://github.com/Alexays/Waybar/wiki/"];
|
||||||
partOf = ["graphical-session.target"];
|
After = ["graphical-session.target"];
|
||||||
requisite = ["graphical-session.target"];
|
PartOf = ["graphical-session.target"];
|
||||||
wantedBy = ["graphical-session.target"];
|
Requisite = ["graphical-session.target"];
|
||||||
|
};
|
||||||
|
|
||||||
reloadTriggers = ["${config.hjem.users.${username}.files.".config/waybar/config".text}"];
|
Service = {
|
||||||
serviceConfig = {
|
ExecStart = "${pkgs.waybar}/bin/waybar";
|
||||||
ExecStart = "${pkgs.waybar}/bin/waybar";
|
ExecReload = "kill -SIGUSR2 $MAINPID";
|
||||||
ExecReload = "kill -SIGUSR2 $MAINPID";
|
Restart = "on-failure";
|
||||||
Restart = "on-failure";
|
Slice = "app-graphical.slice";
|
||||||
Slice = "app-graphical.slice";
|
};
|
||||||
|
|
||||||
|
Install = {
|
||||||
|
WantedBy = ["graphical-session.target"];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
in
|
in
|
||||||
builtins.concatStringsSep "\n" (map formatItem items);
|
builtins.concatStringsSep "\n" (map formatItem items);
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop == "Hyprland") {
|
config = lib.mkIf config.local.modules.hyprland.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [pkgs.wlogout];
|
packages = [pkgs.wlogout];
|
||||||
files = {
|
files = {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
files = {
|
files = {
|
||||||
".config/mimeapps.list".text = ''
|
".config/mimeapps.list".text = ''
|
||||||
|
@ -17,7 +17,7 @@ in {
|
||||||
image/jpeg=org.gnome.gThumb.desktop
|
image/jpeg=org.gnome.gThumb.desktop
|
||||||
image/png=org.gnome.gThumb.desktop
|
image/png=org.gnome.gThumb.desktop
|
||||||
image/svg= org.gnome.gThumb.desktop
|
image/svg= org.gnome.gThumb.desktop
|
||||||
inode/directory=thunar.desktop
|
inode/directory=pcmanfm.desktop
|
||||||
text/html=firefox.desktop
|
text/html=firefox.desktop
|
||||||
video/avi=io.github.celluloid_player.Celluloid.desktop
|
video/avi=io.github.celluloid_player.Celluloid.desktop
|
||||||
video/mkv=io.github.celluloid_player.Celluloid.desktop
|
video/mkv=io.github.celluloid_player.Celluloid.desktop
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
virtualisation.podman = {
|
virtualisation.podman = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dockerCompat = true;
|
dockerCompat = true;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
documentation = {
|
documentation = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
services.flatpak.enable = true;
|
services.flatpak.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
toINI = lib.generators.toINI {};
|
toINI = lib.generators.toINI {};
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
packages = [pkgs.gammastep];
|
packages = [pkgs.gammastep];
|
||||||
files = {
|
files = {
|
||||||
|
@ -27,6 +27,7 @@ in {
|
||||||
wants = ["geoclue-agent.service"];
|
wants = ["geoclue-agent.service"];
|
||||||
wantedBy = ["graphical-session.target"];
|
wantedBy = ["graphical-session.target"];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
ExecStart = "${pkgs.gammastep}/bin/gammastep-indicator";
|
ExecStart = "${pkgs.gammastep}/bin/gammastep-indicator";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = 3;
|
RestartSec = 3;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
services = {
|
services = {
|
||||||
# needed for GNOME services outside of GNOME Desktop
|
# needed for GNOME services outside of GNOME Desktop
|
||||||
dbus.packages = with pkgs; [
|
dbus.packages = with pkgs; [
|
||||||
|
@ -13,5 +13,6 @@
|
||||||
|
|
||||||
gnome.gnome-keyring.enable = true;
|
gnome.gnome-keyring.enable = true;
|
||||||
};
|
};
|
||||||
|
programs.seahorse.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,8 @@ let
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop == "Hyprland") {
|
# TODO: perhaps turn this into a more generic module if we wanna use other wayland compositors
|
||||||
|
config = lib.mkIf config.local.modules.hyprland.enable {
|
||||||
services.greetd = {
|
services.greetd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
lib',
|
lib',
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (lib.lists) singleton;
|
||||||
|
inherit (lib.gvariant) mkInt32;
|
||||||
inherit (lib'.generators.gtk) finalGtk2Text toGtk3Ini;
|
inherit (lib'.generators.gtk) finalGtk2Text toGtk3Ini;
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
|
|
||||||
|
@ -25,12 +27,8 @@ in {
|
||||||
in {
|
in {
|
||||||
files = {
|
files = {
|
||||||
".gtkrc-2.0".text = finalGtk2Text {attrs = gtkSettings;};
|
".gtkrc-2.0".text = finalGtk2Text {attrs = gtkSettings;};
|
||||||
".config/gtk-3.0/settings.ini".text = toGtk3Ini {
|
".config/gtk-3.0/settings.ini".text = toGtk3Ini {Settings = gtkSettings;};
|
||||||
Settings = gtkSettings;
|
".config/gtk-4.0/settings.ini".text = toGtk3Ini {Settings = gtkSettings;};
|
||||||
};
|
|
||||||
".config/gtk-4.0/settings.ini".text = toGtk3Ini {
|
|
||||||
Settings = gtkSettings;
|
|
||||||
};
|
|
||||||
".config/gtk-3.0/gtk.css".source = gtkCss;
|
".config/gtk-3.0/gtk.css".source = gtkCss;
|
||||||
".config/gtk-4.0/gtk.css".source = gtkCss;
|
".config/gtk-4.0/gtk.css".source = gtkCss;
|
||||||
};
|
};
|
||||||
|
@ -38,24 +36,29 @@ in {
|
||||||
gtk.theme.package
|
gtk.theme.package
|
||||||
cursorTheme.package
|
cursorTheme.package
|
||||||
gtk.iconTheme.package
|
gtk.iconTheme.package
|
||||||
|
pkgs.adwaita-icon-theme # add as fallback
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.sessionVariables = {
|
environment.sessionVariables = {
|
||||||
GTK2_RC_FILES = "${config.hjem.users.${username}.directory}/.gtkrc-2.0";
|
GTK2_RC_FILES = "/home/${username}/.gtkrc-2.0";
|
||||||
GTK_THEME = "${gtkSettings.gtk-theme-name}";
|
GTK_THEME = "${gtkSettings.gtk-theme-name}"; # force a GTK theme on libadwaita apps
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.dconf.profiles.user.databases = [
|
programs.dconf = {
|
||||||
{
|
enable = true;
|
||||||
lockAll = false;
|
profiles.user.databases = singleton {
|
||||||
|
lockAll = true;
|
||||||
settings = {
|
settings = {
|
||||||
"org/gnome/desktop/interface" = {
|
"org/gnome/desktop/interface" = with styleCfg; {
|
||||||
color-scheme = "prefer-${styleCfg.scheme.variant}";
|
color-scheme = "prefer-${scheme.variant}";
|
||||||
gtk-theme = styleCfg.gtk.theme.name;
|
cursor-size = mkInt32 cursorTheme.size;
|
||||||
|
cursor-theme = cursorTheme.name;
|
||||||
|
gtk-theme = gtk.theme.name;
|
||||||
|
icon-theme = gtk.iconTheme.name;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
];
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
services.keyd = {
|
services.keyd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
keyboards.default = {
|
keyboards.default = {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
services.kmscon = {
|
services.kmscon = {
|
||||||
enable = true;
|
enable = true;
|
||||||
fonts = [
|
fonts = [
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop == "Hyprland") {
|
config = lib.mkIf config.local.modules.hyprland.enable {
|
||||||
location.provider = "geoclue2";
|
location.provider = "geoclue2";
|
||||||
|
|
||||||
services.geoclue2 = {
|
services.geoclue2 = {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
inputs.nix-gaming.nixosModules.pipewireLowLatency
|
inputs.nix-gaming.nixosModules.pipewireLowLatency
|
||||||
];
|
];
|
||||||
|
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
services = {
|
services = {
|
||||||
pulseaudio.enable = false;
|
pulseaudio.enable = false;
|
||||||
pipewire = {
|
pipewire = {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop != "none") {
|
config = lib.mkIf config.local.profiles.desktop.enable {
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
startAgent = true;
|
startAgent = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
inherit (config.local.systemVars) username;
|
inherit (config.local.systemVars) username;
|
||||||
inherit (lib') generateGtkColors;
|
inherit (lib') generateGtkColors;
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf (config.local.systemVars.desktop == "Hyprland") {
|
config = lib.mkIf config.local.modules.hyprland.enable {
|
||||||
hjem.users.${username} = {
|
hjem.users.${username} = {
|
||||||
files = {
|
files = {
|
||||||
".config/swaync/config.json".text = toJSON {
|
".config/swaync/config.json".text = toJSON {
|
||||||
|
@ -42,10 +42,11 @@ in {
|
||||||
partOf = ["graphical-session.target"];
|
partOf = ["graphical-session.target"];
|
||||||
wantedBy = ["graphical-session.target"];
|
wantedBy = ["graphical-session.target"];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
Type = "dbus";
|
||||||
BusName = "org.freedesktop.Notifications";
|
BusName = "org.freedesktop.Notifications";
|
||||||
ExecStart = "${pkgs.swaynotificationcenter}/bin/swaync";
|
ExecStart = "${pkgs.swaynotificationcenter}/bin/swaync";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
Type = "dbus";
|
Slice = "background-graphical.slice";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
45
shared/modules/hjem/collection/autostart.nix
Normal file
45
shared/modules/hjem/collection/autostart.nix
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.types) listOf package;
|
||||||
|
cfg = config.autostart;
|
||||||
|
|
||||||
|
# stolen from https://github.com/nix-community/home-manager/issues/3447#issuecomment-1328294558
|
||||||
|
mkAutostartEntries = builtins.listToAttrs (map
|
||||||
|
(pkg: {
|
||||||
|
name = ".config/autostart/" + pkg.pname + ".desktop";
|
||||||
|
value =
|
||||||
|
if pkg ? desktopItem
|
||||||
|
then {
|
||||||
|
# Application has a desktopItem entry.
|
||||||
|
# Assume that it was made with makeDesktopEntry, which exposes a
|
||||||
|
# text attribute with the contents of the .desktop file
|
||||||
|
inherit (pkg.desktopItem) text;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Application does *not* have a desktopItem entry. Try to find a
|
||||||
|
# matching .desktop name in /share/apaplications
|
||||||
|
source = pkg + "/share/applications/" + pkg.pname + ".desktop";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
cfg.programs);
|
||||||
|
in {
|
||||||
|
options.autostart = {
|
||||||
|
programs = mkOption {
|
||||||
|
type = listOf package;
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
A list of packages that will be started automatically,
|
||||||
|
according to the Desktop Application Autostart
|
||||||
|
Specification.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = mkIf (cfg.programs != []) {
|
||||||
|
files = mkAutostartEntries;
|
||||||
|
};
|
||||||
|
}
|
74
shared/modules/hjem/collection/programs/firefox.nix
Normal file
74
shared/modules/hjem/collection/programs/firefox.nix
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
|
inherit (lib.types) attrs lines package str;
|
||||||
|
|
||||||
|
toINI = lib.generators.toINI {};
|
||||||
|
|
||||||
|
cfg = config.programs.firefox;
|
||||||
|
firefox = pkgs.wrapFirefox cfg.package {
|
||||||
|
extraPolicies = cfg.policies;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.programs.firefox = {
|
||||||
|
enable = mkEnableOption "firefox module.";
|
||||||
|
package = mkOption {
|
||||||
|
type = package;
|
||||||
|
default = pkgs.firefox-esr-unwrapped;
|
||||||
|
example = pkgs.firefox-unwrapped;
|
||||||
|
description = ''
|
||||||
|
The Firefox package to use. As hjem's module implementation of Firefox uses wrapping, this package
|
||||||
|
is expected to be one of the unwrapped versions. Changing this is not recommended, as some policies
|
||||||
|
(i.e. SearchEngines) are only available on the ESR version of Firefox.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
policies = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {};
|
||||||
|
example = {
|
||||||
|
CaptivePortal = false;
|
||||||
|
DisableFirefoxStudies = true;
|
||||||
|
DisablePocket = true;
|
||||||
|
DisableTelemetry = true;
|
||||||
|
DisableFirefoxAccounts = true;
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
An attribute set of policies to add to Firefox. The full list of policies can be found
|
||||||
|
[here](https://mozilla.github.io/policy-templates/).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
extraConfig = mkOption {
|
||||||
|
type = lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Extra preferences to add to user.js.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
username = mkOption {
|
||||||
|
type = str;
|
||||||
|
example = "user";
|
||||||
|
description = ''
|
||||||
|
Name of the Firefox profile to be created.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
packages = [firefox];
|
||||||
|
files = {
|
||||||
|
".mozilla/firefox/profiles.ini".text = toINI {
|
||||||
|
Profile0 = {
|
||||||
|
Name = "${cfg.username}";
|
||||||
|
IsRelative = 1;
|
||||||
|
Path = "${cfg.username}";
|
||||||
|
Default = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
".mozilla/firefox/${cfg.username}/user.js".text = cfg.extraConfig;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
107
shared/modules/hjem/collection/programs/ghostty.nix
Normal file
107
shared/modules/hjem/collection/programs/ghostty.nix
Normal file
|
@ -0,0 +1,107 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.attrsets) isAttrs mapAttrs' mapAttrsToList nameValuePair;
|
||||||
|
inherit (lib.generators) mkKeyValueDefault mkValueStringDefault toINIWithGlobalSection;
|
||||||
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
|
inherit (lib.types) attrs attrsOf package;
|
||||||
|
|
||||||
|
mkKeyValue = key: value:
|
||||||
|
if isAttrs value
|
||||||
|
# ghostty's configuration format supports (so far) one level of nested keys as key1=key2=value
|
||||||
|
then builtins.concatStringsSep "\n" (mapAttrsToList (k: v: "${key}=${k}=${v}") value)
|
||||||
|
else (mkKeyValueDefault {mkValueString = mkValueStringDefault {};} "=" key value);
|
||||||
|
|
||||||
|
toGhosttyConf = toINIWithGlobalSection {
|
||||||
|
listsAsDuplicateKeys = true;
|
||||||
|
inherit mkKeyValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
cfg = config.programs.ghostty;
|
||||||
|
|
||||||
|
mkThemes = themes:
|
||||||
|
mapAttrs'
|
||||||
|
(name: value:
|
||||||
|
nameValuePair
|
||||||
|
".config/ghostty/themes/${name}"
|
||||||
|
{
|
||||||
|
text = toGhosttyConf {globalSection = value.${name};};
|
||||||
|
})
|
||||||
|
themes;
|
||||||
|
in {
|
||||||
|
options.programs.ghostty = {
|
||||||
|
enable = mkEnableOption "Ghostty";
|
||||||
|
package = mkOption {
|
||||||
|
type = package;
|
||||||
|
default = pkgs.ghostty;
|
||||||
|
description = ''
|
||||||
|
The Ghostty package to use.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
settings = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {};
|
||||||
|
example = {
|
||||||
|
theme = "example-theme";
|
||||||
|
font-size = 10;
|
||||||
|
keybind = {
|
||||||
|
"ctrl+h" = "goto_split:left";
|
||||||
|
"ctrl+l" = "goto_split:right";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
The configuration converted to INI and written to `${config.directory}/.config/ghostty/config`.
|
||||||
|
Please reference https://ghostty.org/docs/config/reference for config options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
themes = mkOption {
|
||||||
|
type = attrsOf attrs;
|
||||||
|
default = {};
|
||||||
|
example = {
|
||||||
|
example-theme = {
|
||||||
|
palette = {
|
||||||
|
"0" = "#51576d";
|
||||||
|
"1" = "#e78284";
|
||||||
|
"2" = "#a6d189";
|
||||||
|
"3" = "#e5c890";
|
||||||
|
"4" = "#8caaee";
|
||||||
|
"5" = "#f4b8e4";
|
||||||
|
"6" = "#81c8be";
|
||||||
|
"7" = "#a5adce";
|
||||||
|
"8" = "#626880";
|
||||||
|
"9" = "#e67172";
|
||||||
|
"10" = "#8ec772";
|
||||||
|
"11" = "#d9ba73";
|
||||||
|
"12" = "#7b9ef0";
|
||||||
|
"13" = "#f2a4db";
|
||||||
|
"14" = "#5abfb5";
|
||||||
|
"15" = "#b5bfe2";
|
||||||
|
};
|
||||||
|
|
||||||
|
background = "#303446";
|
||||||
|
foreground = "#c6d0f5";
|
||||||
|
cursor-color = "#f2d5cf";
|
||||||
|
cursor-text = "#c6d0f5";
|
||||||
|
selection-background = "#626880";
|
||||||
|
selection-foreground = "#c6d0f5";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
An attribute set of themes, with the key as the theme name.
|
||||||
|
Please reference https://ghostty.org/docs/features/theme for config options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
packages = [cfg.package];
|
||||||
|
files =
|
||||||
|
{
|
||||||
|
".config/ghostty/config".text = toGhosttyConf {globalSection = cfg.settings;};
|
||||||
|
}
|
||||||
|
// mkThemes cfg.themes;
|
||||||
|
};
|
||||||
|
}
|
57
shared/modules/hjem/collection/systemd-services.nix
Normal file
57
shared/modules/hjem/collection/systemd-services.nix
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (builtins) toString;
|
||||||
|
inherit (lib.attrsets) nameValuePair mapAttrs';
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.types) attrs attrsOf submodule;
|
||||||
|
inherit (lib.trivial) isBool boolToString;
|
||||||
|
inherit (lib.generators) toINI;
|
||||||
|
|
||||||
|
cfg = config.systemd;
|
||||||
|
|
||||||
|
toSystemdUnitFiles = services: let
|
||||||
|
toSystemdUnit = arg:
|
||||||
|
toINI {
|
||||||
|
listsAsDuplicateKeys = true;
|
||||||
|
mkKeyValue = key: value: let
|
||||||
|
value' =
|
||||||
|
if isBool value
|
||||||
|
then boolToString value
|
||||||
|
else toString value;
|
||||||
|
in "${key}=${value'}";
|
||||||
|
}
|
||||||
|
arg;
|
||||||
|
in
|
||||||
|
mapAttrs' (name: service:
|
||||||
|
nameValuePair ".config/systemd/user/${name}.service" {text = toSystemdUnit service.settings;})
|
||||||
|
services;
|
||||||
|
in {
|
||||||
|
options.systemd = {
|
||||||
|
services = mkOption {
|
||||||
|
type = attrsOf (submodule {
|
||||||
|
options = {
|
||||||
|
settings = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
The configuration of this unit. Each attribute in this set specifies an option
|
||||||
|
(documentation for available options can be found [here](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html)).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
Definition of systemd user service units.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (cfg.services != {}) {
|
||||||
|
files = toSystemdUnitFiles cfg.services;
|
||||||
|
};
|
||||||
|
}
|
11
shared/modules/hjem/nixos.nix
Normal file
11
shared/modules/hjem/nixos.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{lib}: let
|
||||||
|
inherit (lib.filesystem) listFilesRecursive;
|
||||||
|
in {
|
||||||
|
config = {
|
||||||
|
hjem.extraModules = [
|
||||||
|
{
|
||||||
|
imports = listFilesRecursive ./collection;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,208 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
stdenv,
|
|
||||||
fetchFromGitHub,
|
|
||||||
makeWrapper,
|
|
||||||
cmake,
|
|
||||||
ninja,
|
|
||||||
libarchive,
|
|
||||||
libz,
|
|
||||||
jdk17,
|
|
||||||
libcef,
|
|
||||||
luajit,
|
|
||||||
xorg,
|
|
||||||
mesa,
|
|
||||||
glib,
|
|
||||||
nss,
|
|
||||||
nspr,
|
|
||||||
atk,
|
|
||||||
at-spi2-atk,
|
|
||||||
libdrm,
|
|
||||||
expat,
|
|
||||||
libxkbcommon,
|
|
||||||
gtk3,
|
|
||||||
pango,
|
|
||||||
cairo,
|
|
||||||
alsa-lib,
|
|
||||||
dbus,
|
|
||||||
at-spi2-core,
|
|
||||||
cups,
|
|
||||||
systemd,
|
|
||||||
buildFHSEnv,
|
|
||||||
copyDesktopItems,
|
|
||||||
makeDesktopItem,
|
|
||||||
}: let
|
|
||||||
cef = libcef.overrideAttrs (_: {
|
|
||||||
installPhase = let
|
|
||||||
gl_rpath = lib.makeLibraryPath [
|
|
||||||
stdenv.cc.cc.lib
|
|
||||||
];
|
|
||||||
rpath = lib.makeLibraryPath [
|
|
||||||
glib
|
|
||||||
nss
|
|
||||||
nspr
|
|
||||||
atk
|
|
||||||
at-spi2-atk
|
|
||||||
libdrm
|
|
||||||
expat
|
|
||||||
xorg.libxcb
|
|
||||||
libxkbcommon
|
|
||||||
xorg.libX11
|
|
||||||
xorg.libXcomposite
|
|
||||||
xorg.libXdamage
|
|
||||||
xorg.libXext
|
|
||||||
xorg.libXfixes
|
|
||||||
xorg.libXrandr
|
|
||||||
mesa
|
|
||||||
gtk3
|
|
||||||
pango
|
|
||||||
cairo
|
|
||||||
alsa-lib
|
|
||||||
dbus
|
|
||||||
at-spi2-core
|
|
||||||
cups
|
|
||||||
xorg.libxshmfence
|
|
||||||
systemd
|
|
||||||
];
|
|
||||||
in ''
|
|
||||||
mkdir -p $out/lib/ $out/share/cef/
|
|
||||||
cp libcef_dll_wrapper/libcef_dll_wrapper.a $out/lib/
|
|
||||||
cp -r ../Resources/* $out/lib/
|
|
||||||
cp -r ../Release/* $out/lib/
|
|
||||||
patchelf --set-rpath "${rpath}" $out/lib/libcef.so
|
|
||||||
patchelf --set-rpath "${gl_rpath}" $out/lib/libEGL.so
|
|
||||||
patchelf --set-rpath "${gl_rpath}" $out/lib/libGLESv2.so
|
|
||||||
cp ../Release/*.bin $out/share/cef/
|
|
||||||
cp -r ../Resources/* $out/share/cef/
|
|
||||||
cp -r ../include $out
|
|
||||||
cp -r ../libcef_dll $out
|
|
||||||
cp -r ../cmake $out
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
|
|
||||||
bolt = stdenv.mkDerivation (finalAttrs: {
|
|
||||||
pname = "bolt-launcher";
|
|
||||||
version = "0.10.0";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "AdamCake";
|
|
||||||
repo = "bolt";
|
|
||||||
rev = finalAttrs.version;
|
|
||||||
fetchSubmodules = true;
|
|
||||||
hash = "sha256-2IoFzD+yhQv1Y7D+abeNUT23BC4P1xZTALF8Y+Zsg44=";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
cmake
|
|
||||||
ninja
|
|
||||||
luajit
|
|
||||||
makeWrapper
|
|
||||||
copyDesktopItems
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
mesa
|
|
||||||
xorg.libX11
|
|
||||||
xorg.libxcb
|
|
||||||
libarchive
|
|
||||||
libz
|
|
||||||
cef
|
|
||||||
jdk17
|
|
||||||
];
|
|
||||||
|
|
||||||
desktopItems = [
|
|
||||||
(makeDesktopItem {
|
|
||||||
inherit (bolt) name;
|
|
||||||
desktopName = "Bolt Launcher";
|
|
||||||
keywords = [
|
|
||||||
"Game"
|
|
||||||
];
|
|
||||||
exec = "${bolt.name}";
|
|
||||||
terminal = false;
|
|
||||||
categories = ["Game"];
|
|
||||||
icon = "bolt-launcher";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
"-D CMAKE_BUILD_TYPE=Release"
|
|
||||||
"-D BOLT_LUAJIT_INCLUDE_DIR=${luajit}/include"
|
|
||||||
"-G Ninja"
|
|
||||||
];
|
|
||||||
|
|
||||||
preConfigure = ''
|
|
||||||
ls -al
|
|
||||||
mkdir -p cef/dist/Release cef/dist/Resources cef/dist/include
|
|
||||||
|
|
||||||
ln -s ${cef}/lib/* cef/dist/Release
|
|
||||||
|
|
||||||
ln -s ${cef}/share/cef/*.pak cef/dist/Resources
|
|
||||||
ln -s ${cef}/share/cef/icudtl.dat cef/dist/Resources
|
|
||||||
ln -s ${cef}/share/cef/locales cef/dist/Resources
|
|
||||||
|
|
||||||
ln -s ${cef}/include/* cef/dist/include
|
|
||||||
ln -s ${cef}/libcef_dll cef/dist/libcef_dll
|
|
||||||
|
|
||||||
ln -s ${cef}/cmake cef/dist/cmake
|
|
||||||
ln -s ${cef}/CMakeLists.txt cef/dist
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
for size in 16 32 64 128 256; do
|
|
||||||
size_dir="''${size}x''${size}"
|
|
||||||
ls -al $src/icon
|
|
||||||
mkdir -p $out/share/icons/hicolor/''${size_dir}/apps
|
|
||||||
cp $src/icon/$size.png $out/share/icons/hicolor/''${size_dir}/apps/bolt-launcher.png
|
|
||||||
done
|
|
||||||
mkdir -p $out/share/icons/hicolor/scalable/apps/
|
|
||||||
cp $src/icon/bolt.svg $out/share/icons/hicolor/scalable/apps/bolt-launcher.svg
|
|
||||||
'';
|
|
||||||
postFixup = ''
|
|
||||||
makeWrapper "$out/opt/bolt-launcher/bolt" "$out/bin/${finalAttrs.pname}-${finalAttrs.version}" \
|
|
||||||
--set JAVA_HOME "${jdk17}"
|
|
||||||
ls -al $out/bin
|
|
||||||
mkdir -p $out/lib
|
|
||||||
cp $out/usr/local/lib/libbolt-plugin.so $out/lib
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
in
|
|
||||||
buildFHSEnv {
|
|
||||||
inherit (bolt) name version;
|
|
||||||
|
|
||||||
targetPkgs = pkgs:
|
|
||||||
[bolt]
|
|
||||||
++ (with pkgs; [
|
|
||||||
xorg.libSM
|
|
||||||
xorg.libXxf86vm
|
|
||||||
xorg.libX11
|
|
||||||
glib
|
|
||||||
pango
|
|
||||||
cairo
|
|
||||||
gdk-pixbuf
|
|
||||||
gtk2-x11
|
|
||||||
libz
|
|
||||||
libcap
|
|
||||||
libsecret
|
|
||||||
openssl_1_1
|
|
||||||
SDL2
|
|
||||||
libGL
|
|
||||||
]);
|
|
||||||
|
|
||||||
extraInstallCommands = ''
|
|
||||||
mkdir -p $out/share/applications $out/share/icons
|
|
||||||
ln -s ${bolt}/share/applications/*.desktop \
|
|
||||||
$out/share/applications/
|
|
||||||
ln -s ${bolt}/share/icons/hicolor \
|
|
||||||
$out/share/icons/hicolor
|
|
||||||
'';
|
|
||||||
|
|
||||||
runScript = "${bolt.name}";
|
|
||||||
meta = {
|
|
||||||
homepage = "https://github.com/Adamcake/Bolt";
|
|
||||||
description = "An alternative launcher for RuneScape";
|
|
||||||
license = lib.licenses.agpl3Plus;
|
|
||||||
maintainers = with lib.maintainers; [nezia];
|
|
||||||
platforms = lib.platforms.linux;
|
|
||||||
mainProgram = "${bolt.name}";
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue