Compare commits
17 Commits
bd1851f706
...
phosphorou
| Author | SHA1 | Date | |
|---|---|---|---|
| a88925cfa3 | |||
| 8ee748a997 | |||
| 4308b8eb16 | |||
| bf22e791d1 | |||
| 05fd14d48f | |||
| 1223b85aa4 | |||
| a5582a584f | |||
| e9cbd0d686 | |||
| ae90dbf4c9 | |||
| 2a0116c336 | |||
| b188e29dfd | |||
| 79ffcea64b | |||
| d10d239e2e | |||
| f3a9f8fe27 | |||
| 09302c1562 | |||
| 4e44a1618b | |||
| 44062a87b4 |
@@ -7,7 +7,7 @@ config here](https://github.com/Frost-Phoenix/nixos-config/tree/catppuccin)
|
||||
|
||||
## Gallery
|
||||
|
||||

|
||||

|
||||

|
||||
Screenshots up to date as of [this commit](https://github.com/pagedMov/nixos-config/commit/501aedc11976afe8c5386364c7a6e4b5b73af044)
|
||||
|
||||
|
||||
BIN
assets/fonts/Billyfont.zip
Normal file
BIN
assets/fonts/Noto_Sans_JP.zip
Normal file
187
assets/images/nix-snowflake-colours.svg
Normal file
@@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="535"
|
||||
height="535"
|
||||
viewBox="0 0 501.56251 501.56249"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"
|
||||
sodipodi:docname="nix-snowflake-colours.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5562">
|
||||
<stop
|
||||
style="stop-color:#699ad7;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop5564" />
|
||||
<stop
|
||||
id="stop5566"
|
||||
offset="0.24345198"
|
||||
style="stop-color:#7eb1dd;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#7ebae4;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop5568" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5053">
|
||||
<stop
|
||||
style="stop-color:#415e9a;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop5055" />
|
||||
<stop
|
||||
id="stop5057"
|
||||
offset="0.23168644"
|
||||
style="stop-color:#4a6baf;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#5277c3;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop5059" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5562"
|
||||
id="linearGradient4328"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(70.650339,-1055.1511)"
|
||||
x1="200.59668"
|
||||
y1="351.41116"
|
||||
x2="290.08701"
|
||||
y2="506.18814" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5053"
|
||||
id="linearGradient4330"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(864.69589,-1491.3405)"
|
||||
x1="-584.19934"
|
||||
y1="782.33563"
|
||||
x2="-496.29703"
|
||||
y2="937.71399" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.70904368"
|
||||
inkscape:cx="99.429699"
|
||||
inkscape:cy="195.33352"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer3"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1050"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="30"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:snap-global="true"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer3"
|
||||
inkscape:label="gradient-logo"
|
||||
style="display:inline;opacity:1"
|
||||
transform="translate(-156.41121,933.30685)">
|
||||
<g
|
||||
id="g2"
|
||||
transform="matrix(0.99994059,0,0,0.99994059,-0.06321798,33.188377)"
|
||||
style="stroke-width:1.00006">
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3336-6"
|
||||
d="m 309.54892,-710.38827 122.19683,211.67512 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4901 -33.22946,-57.8257 z"
|
||||
style="opacity:1;fill:url(#linearGradient4328);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.00018;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<use
|
||||
height="100%"
|
||||
width="100%"
|
||||
transform="rotate(60,407.11155,-715.78724)"
|
||||
id="use3439-6"
|
||||
inkscape:transform-center-y="151.59082"
|
||||
inkscape:transform-center-x="124.43045"
|
||||
xlink:href="#path3336-6"
|
||||
y="0"
|
||||
x="0"
|
||||
style="stroke-width:1.00006" />
|
||||
<use
|
||||
height="100%"
|
||||
width="100%"
|
||||
transform="rotate(-60,407.31177,-715.70016)"
|
||||
id="use3445-0"
|
||||
inkscape:transform-center-y="75.573958"
|
||||
inkscape:transform-center-x="-168.20651"
|
||||
xlink:href="#path3336-6"
|
||||
y="0"
|
||||
x="0"
|
||||
style="stroke-width:1.00006" />
|
||||
<use
|
||||
height="100%"
|
||||
width="100%"
|
||||
transform="rotate(180,407.41868,-715.7565)"
|
||||
id="use3449-5"
|
||||
inkscape:transform-center-y="-139.94592"
|
||||
inkscape:transform-center-x="59.669705"
|
||||
xlink:href="#path3336-6"
|
||||
y="0"
|
||||
x="0"
|
||||
style="stroke-width:1.00006" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient4330);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.00018;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 309.54892,-710.38827 122.19683,211.67512 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4901 -33.22946,-57.8256 z"
|
||||
id="path4260-0"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<use
|
||||
height="100%"
|
||||
width="100%"
|
||||
transform="rotate(120,407.33916,-716.08356)"
|
||||
id="use4354-5"
|
||||
xlink:href="#path4260-0"
|
||||
y="0"
|
||||
x="0"
|
||||
style="display:inline;stroke-width:1.00006" />
|
||||
<use
|
||||
height="100%"
|
||||
width="100%"
|
||||
transform="rotate(-120,407.28823,-715.86995)"
|
||||
id="use4362-2"
|
||||
xlink:href="#path4260-0"
|
||||
y="0"
|
||||
x="0"
|
||||
style="display:inline;stroke-width:1.00006" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.4 KiB |
40
assets/scripts/keyboard_sound_thing.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import evdev, random, subprocess, os, threading, socket
|
||||
|
||||
active_class = ""
|
||||
|
||||
def watch_hyprland():
|
||||
global active_class
|
||||
sig = os.environ["HYPRLAND_INSTANCE_SIGNATURE"]
|
||||
sock_path = f"{os.environ['XDG_RUNTIME_DIR']}/hypr/{sig}/.socket2.sock"
|
||||
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
s.connect(sock_path)
|
||||
for line in s.makefile():
|
||||
if line.startswith("activewindow>>"):
|
||||
active_class = line.split(">>")[1].split(",")[0]
|
||||
|
||||
threading.Thread(target=watch_hyprland, daemon=True).start()
|
||||
|
||||
dev = None
|
||||
|
||||
def is_target_window():
|
||||
return active_class == "kitty" or active_class == "neovide" or active_class == "discord" or active_class == "vesktop" or active_class == "firefox"
|
||||
|
||||
for path in evdev.list_devices():
|
||||
d = evdev.InputDevice(path)
|
||||
if 'keyd virtual keyboard' in d.name:
|
||||
dev = d
|
||||
break
|
||||
d.close()
|
||||
|
||||
if dev != None:
|
||||
for event in dev.read_loop():
|
||||
if event.type == 1 and event.value == 1 and is_target_window():
|
||||
if event.code == 28:
|
||||
subprocess.Popen(['pw-play', '/home/pagedmov/.sysflake/assets/sound/msg_finish.wav'])
|
||||
elif event.code == 14:
|
||||
subprocess.Popen(['pw-cat', '--playback', '--volume=0.5', '/home/pagedmov/.sysflake/assets/sound/low_hp.wav'])
|
||||
elif event.code == 1:
|
||||
subprocess.Popen(['pw-play', '/home/pagedmov/.sysflake/assets/sound/menu_close.wav'])
|
||||
else:
|
||||
pitch = random.randint(-50,50)
|
||||
subprocess.Popen(['play', '-q', '/home/pagedmov/.sysflake/assets/sound/msg.wav', 'pitch', str(pitch)])
|
||||
BIN
assets/sound/1_select.ogg
Normal file
BIN
assets/sound/2_accept.ogg
Normal file
BIN
assets/sound/3_delete.ogg
Normal file
BIN
assets/sound/4_select2.ogg
Normal file
BIN
assets/sound/6_select_all.ogg
Normal file
BIN
assets/sound/7_equip.ogg
Normal file
BIN
assets/sound/button.wav
Normal file
BIN
assets/sound/crystal.wav
Normal file
BIN
assets/sound/cursor.wav
Normal file
BIN
assets/sound/low_hp.wav
Normal file
BIN
assets/sound/menu_close.wav
Normal file
BIN
assets/sound/menu_open.wav
Normal file
BIN
assets/sound/msg.wav
Normal file
BIN
assets/sound/msg_finish.wav
Normal file
BIN
assets/wallpapers/selective_color/angles.png
Normal file
|
After Width: | Height: | Size: 602 KiB |
BIN
assets/wallpapers/selective_color/beachpurple.jpeg
Normal file
|
After Width: | Height: | Size: 2.4 MiB |
BIN
assets/wallpapers/selective_color/bus_stop.jpeg
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
assets/wallpapers/selective_color/crimson_great_wave.jpeg
Normal file
|
After Width: | Height: | Size: 150 KiB |
BIN
assets/wallpapers/selective_color/ferns.jpg
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
BIN
assets/wallpapers/selective_color/gameboy.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
assets/wallpapers/selective_color/glass.webp
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
assets/wallpapers/selective_color/grid.jpeg
Normal file
|
After Width: | Height: | Size: 9.0 MiB |
BIN
assets/wallpapers/selective_color/osaka.webp
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
assets/wallpapers/selective_color/overgrown.jpeg
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/wallpapers/selective_color/pcb.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
assets/wallpapers/selective_color/road.png
Normal file
|
After Width: | Height: | Size: 10 MiB |
BIN
assets/wallpapers/selective_color/sakura.jpg
Normal file
|
After Width: | Height: | Size: 6.8 MiB |
BIN
assets/wallpapers/selective_color/sunmountains.jpeg
Normal file
|
After Width: | Height: | Size: 1008 KiB |
BIN
assets/wallpapers/selective_color/tokyo_night.png
Normal file
|
After Width: | Height: | Size: 2.2 MiB |
@@ -81,7 +81,7 @@ included in my nixpkgs overlay as custom packages, and these packages are declar
|
||||
- *Usage*:
|
||||
- `vipkg <part of package name>`
|
||||
- **Example**:
|
||||
- `vipkg neofetch` - Opens `nixpkgs/pkgs/tools/misc/neofetch/default.nix`.
|
||||
- `vipkg fastfetch` - Opens `nixpkgs/pkgs/tools/misc/neofetch/default.nix`.
|
||||
- *Defined in*: `overlay/scripts/commands/vipkg.nix`
|
||||
|
||||
---
|
||||
|
||||
813
flake.lock
generated
1202
flake.lock.bak
Executable file
208
flake.nix
@@ -2,18 +2,17 @@
|
||||
description = "pagedMov's NixOS and Home Manager configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
#nixpkgs.url = "github:nixos/nixpkgs/a5ebaf35f8930361787bb491d49fc2e807e6d51e";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
hypr-contrib.url = "github:hyprwm/contrib";
|
||||
copyparty.url = "github:9001/copyparty";
|
||||
hyprpicker.url = "github:hyprwm/hyprpicker";
|
||||
stylix.url = "github:danth/stylix";
|
||||
disko.url = "github:nix-community/disko";
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
ghostty.url = "github:ghostty-org/ghostty";
|
||||
shed.url = "github:km-clay/shed";
|
||||
agenix.url = "github:ryantm/agenix";
|
||||
|
||||
nixvim = {
|
||||
url = "github:nix-community/nixvim";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nixvim.url = "github:nix-community/nixvim";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
@@ -32,176 +31,45 @@
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, home-manager, disko, nixpkgs, impermanence, nixvim, stylix, ... }@inputs:
|
||||
outputs =
|
||||
{ ... }@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
movLib = import ./lib {
|
||||
inherit inputs;
|
||||
username = "pagedmov";
|
||||
nixpkgsConfig = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
in {
|
||||
homeConfigurations = {
|
||||
oganessonHome = let host = "oganesson"; in home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = nixpkgsConfig;
|
||||
overlays = [
|
||||
(import ./overlay/overlay.nix { inherit host; root = self; })
|
||||
];
|
||||
};
|
||||
extraSpecialArgs = {
|
||||
inherit host self username inputs;
|
||||
};
|
||||
|
||||
modules = [
|
||||
./hosts/desktop/home.nix
|
||||
./modules/home
|
||||
stylix.homeModules.stylix
|
||||
nixvim.homeManagerModules.nixvim
|
||||
];
|
||||
};
|
||||
phosphorousHome = let host = "phosphorous"; in home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = nixpkgsConfig;
|
||||
overlays = [
|
||||
(import ./overlay/overlay.nix { inherit host; root = self; })
|
||||
];
|
||||
};
|
||||
extraSpecialArgs = {
|
||||
inherit host self username inputs;
|
||||
};
|
||||
|
||||
modules = [
|
||||
./hosts/work/home.nix
|
||||
./modules/home
|
||||
stylix.homeModules.stylix
|
||||
nixvim.homeManagerModules.nixvim
|
||||
];
|
||||
};
|
||||
|
||||
mercuryHome = let host = "mercury"; in home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = nixpkgsConfig;
|
||||
overlays = [
|
||||
(import ./overlay/overlay.nix { inherit host; root = self; })
|
||||
];
|
||||
};
|
||||
extraSpecialArgs = {
|
||||
inherit host self username inputs;
|
||||
};
|
||||
|
||||
modules = [
|
||||
./hosts/laptop/home.nix
|
||||
./modules/home
|
||||
stylix.homeModules.stylix
|
||||
nixvim.homeManagerModules.nixvim
|
||||
];
|
||||
};
|
||||
|
||||
xenonHome = let host = "xenon"; in home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = nixpkgsConfig;
|
||||
overlays = [
|
||||
(import ./overlay/overlay.nix { inherit host; root = self; })
|
||||
];
|
||||
};
|
||||
extraSpecialArgs = {
|
||||
inherit host self username inputs;
|
||||
};
|
||||
|
||||
modules = [
|
||||
./hosts/server/home.nix
|
||||
./modules/home
|
||||
stylix.homeModules.stylix
|
||||
nixvim.homeManagerModules.nixvim
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
oganesson = nixpkgs.lib.nixosSystem { # Desktop
|
||||
specialArgs = {
|
||||
inherit self inputs username;
|
||||
hosts = movLib.foldHosts [
|
||||
{
|
||||
host = "oganesson";
|
||||
overlays = [
|
||||
(import ./overlay/overlay.nix { root = self; })
|
||||
];
|
||||
};
|
||||
inherit system;
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = nixpkgsConfig;
|
||||
overlays = [
|
||||
(import ./overlay/overlay.nix { root = self; })
|
||||
];
|
||||
};
|
||||
modules = [
|
||||
./hosts/desktop/config.nix
|
||||
./modules/sys
|
||||
stylix.nixosModules.stylix
|
||||
];
|
||||
};
|
||||
|
||||
phosphorous = nixpkgs.lib.nixosSystem { # Desktop
|
||||
specialArgs = {
|
||||
inherit self inputs username;
|
||||
host = "oganesson";
|
||||
overlays = [
|
||||
(import ./overlay/overlay.nix { root = self; })
|
||||
];
|
||||
};
|
||||
inherit system;
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = nixpkgsConfig;
|
||||
overlays = [
|
||||
(import ./overlay/overlay.nix { root = self; })
|
||||
];
|
||||
};
|
||||
modules = [
|
||||
./hosts/work/config.nix
|
||||
./modules/sys
|
||||
stylix.nixosModules.stylix
|
||||
];
|
||||
};
|
||||
|
||||
mercury = nixpkgs.lib.nixosSystem { # Laptop
|
||||
specialArgs = {
|
||||
inherit self inputs username;
|
||||
hostDir = "desktop";
|
||||
kind = "both";
|
||||
}
|
||||
{
|
||||
host = "mercury";
|
||||
};
|
||||
inherit system;
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = nixpkgsConfig;
|
||||
};
|
||||
modules = [
|
||||
./hosts/laptop/config.nix
|
||||
./modules/sys
|
||||
stylix.nixosModules.stylix
|
||||
hostDir = "laptop";
|
||||
kind = "both";
|
||||
}
|
||||
{
|
||||
host = "phosphorous";
|
||||
hostDir = "work";
|
||||
kind = "both";
|
||||
extraNixosModules = [
|
||||
inputs.shed.nixosModules.shed
|
||||
inputs.copyparty.nixosModules.default
|
||||
inputs.agenix.nixosModules.default
|
||||
];
|
||||
};
|
||||
|
||||
xenon = nixpkgs.lib.nixosSystem { # Server
|
||||
specialArgs = {
|
||||
inherit self inputs username;
|
||||
host = "xenon";
|
||||
};
|
||||
inherit system;
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = nixpkgsConfig;
|
||||
};
|
||||
modules = [
|
||||
./hosts/server/config.nix
|
||||
./modules/sys
|
||||
./modules/server
|
||||
stylix.nixosModules.stylix
|
||||
extraHomeModules = [
|
||||
inputs.shed.homeModules.shed
|
||||
];
|
||||
};
|
||||
};
|
||||
extraOverlays = [
|
||||
inputs.shed.overlays.default
|
||||
inputs.copyparty.overlays.default
|
||||
];
|
||||
}
|
||||
];
|
||||
in
|
||||
{
|
||||
inherit (hosts) nixosConfigurations homeConfigurations;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
{ slash, pkgs, username, ... }:
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
shed = inputs.shed.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||
in
|
||||
{
|
||||
imports = [ ./hardware.nix ];
|
||||
|
||||
@@ -28,8 +36,14 @@
|
||||
};
|
||||
|
||||
environment = {
|
||||
variables = { PATH = "${pkgs.clang-tools}/bin:$PATH"; };
|
||||
shells = [ pkgs.myPkgs.slash pkgs.zsh pkgs.bash ];
|
||||
variables = {
|
||||
PATH = "${pkgs.clang-tools}/bin:$PATH";
|
||||
};
|
||||
shells = [
|
||||
pkgs.myPkgs.slash
|
||||
pkgs.zsh
|
||||
pkgs.bash
|
||||
];
|
||||
};
|
||||
|
||||
users = {
|
||||
@@ -39,8 +53,13 @@
|
||||
${username} = {
|
||||
isNormalUser = true;
|
||||
initialPassword = "1234";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [ "input" "wheel" "persist" "libvirtd" ];
|
||||
shell = shed;
|
||||
extraGroups = [
|
||||
"input"
|
||||
"wheel"
|
||||
"persist"
|
||||
"libvirtd"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,27 +1,43 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ahci"
|
||||
"xhci_pci"
|
||||
"virtio_pci"
|
||||
"virtio_scsi"
|
||||
"sr_mod"
|
||||
"virtio_blk"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/5d8dd8ba-6c4c-4227-adc5-f33bf0022fff";
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/5d8dd8ba-6c4c-4227-adc5-f33bf0022fff";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/6A3C-0A12";
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/6A3C-0A12";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
options = [
|
||||
"fmask=0022"
|
||||
"dmask=0022"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ username, ... }: {
|
||||
{ username, ... }:
|
||||
{
|
||||
home.username = "${username}";
|
||||
home.homeDirectory =
|
||||
"/home/${username}";
|
||||
home.homeDirectory = "/home/${username}";
|
||||
home.stateVersion = "25.05";
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
@@ -14,7 +14,10 @@
|
||||
envConfig = {
|
||||
hyprlandConfig = {
|
||||
enable = true;
|
||||
monitorNames = [ "HDMI-A-1" "DP-1" ];
|
||||
monitorNames = [
|
||||
"HDMI-A-1"
|
||||
"DP-1"
|
||||
];
|
||||
workspaceLayout = "dualmonitor";
|
||||
};
|
||||
userPkgs.enable = true;
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
{ username, pkgs, config, ... }: {
|
||||
{
|
||||
username,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ ./hardware.nix ];
|
||||
|
||||
boot = {
|
||||
kernelModules = [ "acpi_call" ];
|
||||
extraModulePackages = with config.boot.kernelPackages;
|
||||
[ acpi_call cpupower ] ++ [ pkgs.cpupower-gui ];
|
||||
extraModulePackages =
|
||||
with config.boot.kernelPackages;
|
||||
[
|
||||
acpi_call
|
||||
cpupower
|
||||
]
|
||||
++ [ pkgs.cpupower-gui ];
|
||||
};
|
||||
|
||||
movOpts = {
|
||||
@@ -27,9 +38,19 @@
|
||||
};
|
||||
|
||||
environment = {
|
||||
variables = { PATH = "${pkgs.clang-tools}/bin:$PATH"; };
|
||||
shells = with pkgs; [ zsh bash ];
|
||||
systemPackages = with pkgs; [ acpi brightnessctl cpupower-gui powertop ];
|
||||
variables = {
|
||||
PATH = "${pkgs.clang-tools}/bin:$PATH";
|
||||
};
|
||||
shells = with pkgs; [
|
||||
zsh
|
||||
bash
|
||||
];
|
||||
systemPackages = with pkgs; [
|
||||
acpi
|
||||
brightnessctl
|
||||
cpupower-gui
|
||||
powertop
|
||||
];
|
||||
};
|
||||
|
||||
users = {
|
||||
@@ -40,7 +61,11 @@
|
||||
isNormalUser = true;
|
||||
initialPassword = "1234";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [ "wheel" "persist" "libvirtd" ];
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"persist"
|
||||
"libvirtd"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules =
|
||||
[ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
@@ -23,7 +36,10 @@
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/sda2";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/home" = {
|
||||
@@ -42,6 +58,5 @@
|
||||
# networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{ host, pkgs, self, inputs, username, lib, config, ... }: {
|
||||
{
|
||||
host,
|
||||
pkgs,
|
||||
self,
|
||||
inputs,
|
||||
username,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.username = "${username}"; # Replace with your actual username
|
||||
home.homeDirectory =
|
||||
"/home/${username}"; # Replace with your actual home directory
|
||||
home.stateVersion =
|
||||
"24.05"; # Adjust this based on your system's NixOS version
|
||||
home.homeDirectory = "/home/${username}"; # Replace with your actual home directory
|
||||
home.stateVersion = "24.05"; # Adjust this based on your system's NixOS version
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
{ pkgs, username, ... }: {
|
||||
imports = [ ./hardware.nix ];
|
||||
movOpts = {
|
||||
sysEnv = {
|
||||
issue.enable = true;
|
||||
sddmConfig.enable = true;
|
||||
stylixConfig.enable = true;
|
||||
nixSettings.enable = true;
|
||||
};
|
||||
hardwareCfg = {
|
||||
networkModule.enable = true;
|
||||
bootLoader.enable = true;
|
||||
powerProfiles.enable = true;
|
||||
};
|
||||
softwareCfg = {
|
||||
sysPkgs.enable = true;
|
||||
sysProgs.enable = true;
|
||||
sysServices.enable = true;
|
||||
};
|
||||
serverCfg = {
|
||||
jellyfinConfig.enable = true;
|
||||
caddyConfig.enable = true;
|
||||
};
|
||||
};
|
||||
networking.firewall = { allowedTCPPorts = [ 443 8920 ]; };
|
||||
environment = {
|
||||
etc."tmpfiles.d/home-permissions.conf".text = ''
|
||||
d /home/pagedmov 0750 pagedmov users -
|
||||
'';
|
||||
variables = {
|
||||
PATH = "${pkgs.clang-tools}/bin:$PATH";
|
||||
TERM = "kitty";
|
||||
};
|
||||
shells = with pkgs; [ zsh bash ];
|
||||
};
|
||||
|
||||
users = {
|
||||
groups.persist = { };
|
||||
users = {
|
||||
root.initialPassword = "1234";
|
||||
${username} = {
|
||||
isNormalUser = true;
|
||||
initialPassword = "1234";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [ "wheel" "persist" "libvirtd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
security.sudo.extraConfig = ''
|
||||
${username} ALL=(ALL) NOPASSWD: /etc/profiles/per-user/${username}/bin/rebuild
|
||||
'';
|
||||
nix.settings.allowed-users = [ "${username}" ];
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules =
|
||||
[ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/c40b3b09-688d-4fe3-96f9-8e3d75b0a7b7";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-uuid/1048d206-0a27-4e4e-b9a4-4f068bab5439";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/357E-BCCD";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/b53ab583-f32e-4144-a2ee-f341e54f8233";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp10s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp11s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{ host, pkgs, self, inputs, lib, username, config, ... }: {
|
||||
|
||||
home.username = "${username}";
|
||||
home.homeDirectory =
|
||||
"/home/${username}";
|
||||
home.stateVersion =
|
||||
"24.05";
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
movOpts = {
|
||||
homeFiles.enable = true;
|
||||
|
||||
# modules/home/environment
|
||||
envConfig = {
|
||||
starshipConfig.enable = true;
|
||||
stylixHomeConfig.enable = true;
|
||||
userPkgs.enable = true;
|
||||
zshConfig = {
|
||||
shellAliases.enable = true;
|
||||
envVariables.enable = true;
|
||||
shellOptions.enable = true;
|
||||
extraConfig.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# modules/home/programs
|
||||
programConfigs = {
|
||||
autojumpConfig.enable = true;
|
||||
kittyConfig.enable = true;
|
||||
btopConfig.enable = true;
|
||||
ezaConfig.enable = true;
|
||||
fzfConfig.enable = true;
|
||||
gitConfig.enable = true;
|
||||
yaziConfig.enable = true;
|
||||
batConfig.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,13 @@
|
||||
{ slash, pkgs, username, ... }:
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
shed = inputs.shed.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
@@ -29,22 +38,42 @@
|
||||
};
|
||||
|
||||
environment = {
|
||||
variables = { PATH = "${pkgs.clang-tools}/bin:$PATH"; };
|
||||
shells = [ pkgs.myPkgs.slash pkgs.zsh pkgs.bash ];
|
||||
variables = {
|
||||
PATH = "${pkgs.clang-tools}/bin:$PATH";
|
||||
};
|
||||
shells = [
|
||||
pkgs.myPkgs.slash
|
||||
pkgs.zsh
|
||||
pkgs.bash
|
||||
];
|
||||
};
|
||||
|
||||
programs.shed.enable = true;
|
||||
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="event*", SUBSYSTEM=="input", MODE="0664", GROUP="input"
|
||||
'';
|
||||
|
||||
users = {
|
||||
groups.persist = { };
|
||||
groups.davfs2 = { };
|
||||
users = {
|
||||
root.initialPassword = "1234";
|
||||
${username} = {
|
||||
isNormalUser = true;
|
||||
initialPassword = "1234";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [ "input" "wheel" "persist" "libvirtd" ];
|
||||
shell = pkgs.shed;
|
||||
extraGroups = [
|
||||
"davfs2"
|
||||
"input"
|
||||
"wheel"
|
||||
"persist"
|
||||
"libvirtd"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
security.polkit.enable = true;
|
||||
security.sudo.extraConfig = ''
|
||||
${username} ALL=(ALL) NOPASSWD: /etc/profiles/per-user/${username}/bin/rebuild
|
||||
'';
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ slash, pkgs, username, ... }:
|
||||
{
|
||||
slash,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
kickstartServer =
|
||||
@@ -40,7 +45,8 @@ let
|
||||
in
|
||||
pkgs.buildFHSEnv {
|
||||
name = "srcds-env";
|
||||
targetPkgs = pkgs: with pkgs; [
|
||||
targetPkgs =
|
||||
pkgs: with pkgs; [
|
||||
steamcmd
|
||||
glibc
|
||||
zlib
|
||||
@@ -53,7 +59,8 @@ let
|
||||
# Optional: link compat
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
multiPkgs = pkgs: with pkgs.pkgsi686Linux; [
|
||||
multiPkgs =
|
||||
pkgs: with pkgs.pkgsi686Linux; [
|
||||
glibc
|
||||
zlib
|
||||
ncurses5
|
||||
@@ -84,7 +91,6 @@ in
|
||||
imports = [ ];
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
|
||||
services.openssh.enable = true;
|
||||
users.users.root.password = "root"; # For quick login, remove in prod
|
||||
|
||||
@@ -114,11 +120,19 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
# Optional: open ports on the container
|
||||
networking.firewall.allowedTCPPorts = [ 25565 ];
|
||||
networking.firewall.allowedUDPPorts = [ 25565 27005 27015 27020 ];
|
||||
networking.firewall.allowedUDPPorts = [
|
||||
25565
|
||||
27005
|
||||
27015
|
||||
27020
|
||||
];
|
||||
|
||||
system.stateVersion = "25.11"; # or your NixOS version
|
||||
};
|
||||
|
||||
71
hosts/work/hardware.nix
Normal file → Executable file
@@ -1,37 +1,76 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"nvme"
|
||||
"ahci"
|
||||
"uas"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/db4cf956-df00-4c26-851d-419136434eae";
|
||||
fsType = "ext4";
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/9a98748d-1953-4316-9788-07d11c5d0af6";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=root"
|
||||
"compress=zstd:3"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/336C-A94E";
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/5BA1-A9F8";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
options = [
|
||||
"fmask=0022"
|
||||
"dmask=0022"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/00fd7a7c-d916-4a61-abc1-8dde26b4413b";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"compress=zstd:3"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-uuid/7c03499c-e2a7-4352-8797-a21f094ef90b";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"compress=zstd:3"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
memoryPercent = 25;
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
|
||||
37
hosts/work/hardware.nix.bak
Normal file
@@ -0,0 +1,37 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/db4cf956-df00-4c26-851d-419136434eae";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/336C-A94E";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{ username, ... }: {
|
||||
{ username, ... }:
|
||||
{
|
||||
home.username = "${username}";
|
||||
home.homeDirectory =
|
||||
"/home/${username}";
|
||||
home.homeDirectory = "/home/${username}";
|
||||
home.stateVersion = "25.05";
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
@@ -14,7 +14,10 @@
|
||||
envConfig = {
|
||||
hyprlandConfig = {
|
||||
enable = true;
|
||||
monitorNames = [ "DP-3" "DP-1" ];
|
||||
monitorNames = [
|
||||
"DP-3"
|
||||
"DP-1"
|
||||
];
|
||||
workspaceLayout = "dualmonitor";
|
||||
};
|
||||
userPkgs.enable = true;
|
||||
|
||||
29
lib/default.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
inputs,
|
||||
username,
|
||||
nixpkgsConfig ? {
|
||||
allowUnfree = true;
|
||||
},
|
||||
}:
|
||||
|
||||
rec {
|
||||
mkHost = import ./mk_host.nix;
|
||||
foldHosts =
|
||||
hosts:
|
||||
inputs.nixpkgs.lib.foldl'
|
||||
(
|
||||
acc: host:
|
||||
let
|
||||
result = mkHost ({ inherit inputs username nixpkgsConfig; } // host);
|
||||
in
|
||||
{
|
||||
nixosConfigurations = acc.nixosConfigurations // result.nixosConfigurations;
|
||||
homeConfigurations = acc.homeConfigurations // result.homeConfigurations;
|
||||
}
|
||||
)
|
||||
{
|
||||
nixosConfigurations = { };
|
||||
homeConfigurations = { };
|
||||
}
|
||||
hosts;
|
||||
}
|
||||
76
lib/mk_host.nix
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
inputs,
|
||||
username,
|
||||
nixpkgsConfig ? {
|
||||
allowUnfree = true;
|
||||
},
|
||||
host,
|
||||
hostDir,
|
||||
system ? "x86_64-linux",
|
||||
kind,
|
||||
extraNixosModules ? [ ],
|
||||
extraHomeModules ? [ ],
|
||||
extraOverlays ? [ ],
|
||||
overlay ? true,
|
||||
}:
|
||||
|
||||
let
|
||||
nixosModules = [
|
||||
../hosts/${hostDir}/config.nix
|
||||
../modules/sys
|
||||
inputs.stylix.nixosModules.stylix
|
||||
]
|
||||
++ extraNixosModules;
|
||||
homeModules = [
|
||||
../hosts/${hostDir}/home.nix
|
||||
../modules/home
|
||||
inputs.stylix.homeModules.stylix
|
||||
inputs.nixvim.homeModules.nixvim
|
||||
]
|
||||
++ extraHomeModules;
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
config = nixpkgsConfig;
|
||||
overlays =
|
||||
extraOverlays
|
||||
++ (
|
||||
if overlay then
|
||||
[
|
||||
(import ../overlay/overlay.nix {
|
||||
inherit host;
|
||||
root = inputs.self;
|
||||
})
|
||||
]
|
||||
else
|
||||
[ ]
|
||||
);
|
||||
};
|
||||
specialArgs = {
|
||||
inherit inputs username host;
|
||||
self = inputs.self;
|
||||
};
|
||||
|
||||
nixosCfg =
|
||||
if kind == "nixos" || kind == "both" then
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
inherit system pkgs specialArgs;
|
||||
modules = nixosModules;
|
||||
}
|
||||
else
|
||||
null;
|
||||
|
||||
homeCfg =
|
||||
if kind == "home" || kind == "both" then
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
extraSpecialArgs = specialArgs;
|
||||
modules = homeModules;
|
||||
}
|
||||
else
|
||||
null;
|
||||
in
|
||||
{
|
||||
nixosConfigurations = if kind == "nixos" || kind == "both" then { ${host} = nixosCfg; } else { };
|
||||
homeConfigurations =
|
||||
if kind == "home" || kind == "both" then { ${host + "Home"} = homeCfg; } else { };
|
||||
}
|
||||
@@ -1,3 +1,18 @@
|
||||
{ env, inputs, nixpkgs, config, self, username, host, lib, ... }: {
|
||||
imports = [ ./programs ./environment ./files.nix ];
|
||||
{
|
||||
env,
|
||||
inputs,
|
||||
nixpkgs,
|
||||
config,
|
||||
self,
|
||||
username,
|
||||
host,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./programs
|
||||
./environment
|
||||
./files.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
{ host, nixvim, self, inputs, username, config, home-manager, ... }: {
|
||||
{
|
||||
host,
|
||||
nixvim,
|
||||
self,
|
||||
inputs,
|
||||
username,
|
||||
config,
|
||||
home-manager,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./gtk.nix
|
||||
./spicetify.nix
|
||||
@@ -6,9 +16,11 @@
|
||||
./userservices.nix
|
||||
./starship.nix
|
||||
./userpkgs.nix
|
||||
./zsh
|
||||
./swaync.nix
|
||||
./hyprland.nix
|
||||
./waybar.nix
|
||||
./zsh
|
||||
./shed
|
||||
./paperd
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
{ lib, config, pkgs, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
movOpts.envConfig.gtkConfig.enable =
|
||||
lib.mkEnableOption "enable my gtk options";
|
||||
movOpts.envConfig.gtkConfig.enable = lib.mkEnableOption "enable my gtk options";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.envConfig.gtkConfig.enable {
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
home.packages = with pkgs; [
|
||||
nerd-fonts.jetbrains-mono
|
||||
nerd-fonts.symbols-only
|
||||
cascadia-code
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
{ inputs, pkgs, lib, config, self, host, ... }:
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
self,
|
||||
host,
|
||||
...
|
||||
}:
|
||||
let
|
||||
desktop = host == "oganesson";
|
||||
screenshot_bind = if desktop then
|
||||
desktop = host == "oganesson" || host == "phosphorous";
|
||||
screenshot_bind =
|
||||
if desktop then
|
||||
[
|
||||
"super, print, exec, grimblast copy area"
|
||||
"super shift, print, exec, grimblast --freeze copy area"
|
||||
@@ -13,17 +22,25 @@ let
|
||||
];
|
||||
scheme = config.lib.stylix.colors;
|
||||
mons = config.movOpts.envConfig.hyprlandConfig.monitorNames;
|
||||
smartGapsWorkspaces = [
|
||||
"w[tv1], gapsout:0, gapsin:0"
|
||||
"f[1], gapsout:0, gapsin:0"
|
||||
];
|
||||
smartGapsWindowrules = [
|
||||
"bordersize 0, floating:0, onworkspace:w[tv1]"
|
||||
"rounding 0, floating:0, onworkspace:w[tv1]"
|
||||
"bordersize 0, floating:0, onworkspace:f[1]"
|
||||
"rounding 0, floating:0, onworkspace:f[1]"
|
||||
];
|
||||
in {
|
||||
#smartGapsWorkspaces = [
|
||||
#"w[tv1], gapsout:0, gapsin:0"
|
||||
#"f[1], gapsout:0, gapsin:0"
|
||||
#];
|
||||
#smartGapsWindowrules = [
|
||||
#"border_size 0, match:float 0, match:workspace w[tv1]"
|
||||
#"rounding 0, match:float 0, match:workspace w[tv1]"
|
||||
#"border_size 0, match:float 0, match:workspace f[1]"
|
||||
#"rounding 0, match:float 0, match:workspace f[1]"
|
||||
#];
|
||||
hostWorkspaces =
|
||||
if (host == "phosphorous") then
|
||||
[
|
||||
"m[DP-3], layoutopt:orientation:top"
|
||||
]
|
||||
else
|
||||
[ ];
|
||||
in
|
||||
{
|
||||
|
||||
options = {
|
||||
movOpts.envConfig.hyprlandConfig = {
|
||||
@@ -36,14 +53,17 @@ in {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
# The order of the monitor names matters for the purpose of workspace assignment
|
||||
# For instance, in a dual monitor setup, index 0 gets 4,5 and 6, while index 1 gets 1,2 and 3
|
||||
default = [ "DP-1" "HDMI-A-1" ];
|
||||
default = [
|
||||
"DP-1"
|
||||
"HDMI-A-1"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf config.movOpts.envConfig.hyprlandConfig.enable {
|
||||
home.packages = with pkgs; [
|
||||
swaybg
|
||||
inputs.hypr-contrib.packages.${pkgs.system}.grimblast
|
||||
inputs.hypr-contrib.packages.${pkgs.stdenv.hostPlatform.system}.grimblast
|
||||
hyprpicker
|
||||
grim
|
||||
slurp
|
||||
@@ -53,22 +73,31 @@ in {
|
||||
wayland
|
||||
direnv
|
||||
];
|
||||
systemd.user.targets.hyprland-session.Unit.Wants =
|
||||
[ "xdg-desktop-autostart.target" ];
|
||||
systemd.user.targets.hyprland-session.Unit.Wants = [ "xdg-desktop-autostart.target" ];
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
xwayland = { enable = true; };
|
||||
xwayland = {
|
||||
enable = true;
|
||||
};
|
||||
systemd.enable = true;
|
||||
extraConfig = ''
|
||||
source = ~/.local/state/sysflake/hyprland-colors.conf
|
||||
'';
|
||||
};
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
monitor = if (host == "oganesson") then [
|
||||
monitor =
|
||||
if (host == "oganesson") then
|
||||
[
|
||||
"DP-1, 1920x1080@144, 1920x0, 1"
|
||||
"HDMI-A-1, 1920x1080, 0x0, 1"
|
||||
] else if (host == "phosphorous") then [
|
||||
]
|
||||
else if (host == "phosphorous") then
|
||||
[
|
||||
"DP-1, highrr, 0x0, 1"
|
||||
"DP-3, highrr, -1080x-420, 1, transform, 3"
|
||||
] else
|
||||
]
|
||||
else
|
||||
[ "eDP-1, 1600x900, 0x0, 1" ];
|
||||
|
||||
exec-once = [
|
||||
@@ -76,86 +105,102 @@ in {
|
||||
"swaync &"
|
||||
"wl-paste --type text --watch cliphist store &"
|
||||
"wl-paste --type image --watch cliphist store &"
|
||||
"wl-clip-persist --clipboard both"
|
||||
"wl-clip-persist --clipboard regular"
|
||||
"systemctl --user import-environment &"
|
||||
"hash dbus-update-activation-environment 2>/dev/null &"
|
||||
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &"
|
||||
];
|
||||
|
||||
workspace = (if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "dualmonitor") then [
|
||||
workspace =
|
||||
hostWorkspaces
|
||||
++ (
|
||||
if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "dualmonitor") then
|
||||
[
|
||||
"1,persistent=true,monitor:${builtins.elemAt mons 0}"
|
||||
"2,persistent=true,monitor:${builtins.elemAt mons 0}"
|
||||
"3,persistent=true,monitor:${builtins.elemAt mons 0}"
|
||||
"4,persistent=true,monitor:${builtins.elemAt mons 1}"
|
||||
"5,persistent=true,monitor:${builtins.elemAt mons 1}"
|
||||
"6,persistent=true,monitor:${builtins.elemAt mons 1}"
|
||||
] else if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "singlemonitor") then [
|
||||
]
|
||||
else if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "singlemonitor") then
|
||||
[
|
||||
"1,persistent=true,monitor:${builtins.elemAt mons 0} "
|
||||
"2,persistent=true,monitor:${builtins.elemAt mons 0}"
|
||||
"3,persistent=true,monitor:${builtins.elemAt mons 0}"
|
||||
"4,persistent=true,monitor:${builtins.elemAt mons 0}"
|
||||
] else if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "trimonitor") then [
|
||||
]
|
||||
else if (config.movOpts.envConfig.hyprlandConfig.workspaceLayout == "trimonitor") then
|
||||
[
|
||||
"1,persistent=true,monitor:${builtins.elemAt mons 2}"
|
||||
"2,persistent=true,monitor:${builtins.elemAt mons 2}"
|
||||
"3,persistent=true,monitor:${builtins.elemAt mons 1}"
|
||||
"4,persistent=true,monitor:${builtins.elemAt mons 1}"
|
||||
"5,persistent=true,monitor:${builtins.elemAt mons 0}"
|
||||
"6,persistent=true,monitor:${builtins.elemAt mons 0}"
|
||||
] else [ ]) ++ smartGapsWorkspaces;
|
||||
]
|
||||
else
|
||||
[ ]
|
||||
);
|
||||
|
||||
env = [
|
||||
"XDG_CONFIG_HOME,$HOME/.config"
|
||||
"XDG_DATA_HOME,$HOME/.local/share"
|
||||
"XDG_CACHE_HOME,$HOME/.cache"
|
||||
];
|
||||
layerrule = [ "blur,waybar" "ignorezero,waybar" "blur,launcher" ];
|
||||
windowrulev2 = [
|
||||
"float, class:^(thunar)$,title:^(.*File Operation Progress.*)$"
|
||||
"float, class:^(firefox)$,title:^(Library)$"
|
||||
"float, class:^(thunar)$,title:^(File Operation Progress)$"
|
||||
"float, class:^(thunar)$,title:^(Confirm to replace files)$"
|
||||
"float, title:^(bwarn)$"
|
||||
"float, title:^(bwarn)$"
|
||||
"noinitialfocus, class:^(steam)$"
|
||||
"float, class:^(firefox)$,title:^(ログイン - Google アカウント — Mozilla Firefox)$"
|
||||
"float, class:^(firefox)$,title:^(Firefox — Sharing Indicator)$"
|
||||
"float, class:^(firefox)$,title:^(Firefox — 共有インジケーター)$"
|
||||
"float, class:(firefox), title:^(*.Sign in.*)$"
|
||||
layerrule = [
|
||||
"blur on, ignore_alpha 0, match:namespace waybar"
|
||||
"match:namespace = launcher, blur 1"
|
||||
];
|
||||
windowrule = [
|
||||
"float, class:^(qt5ct)$"
|
||||
"float, class:^(zoom)$"
|
||||
"float, class:^(Steam)$"
|
||||
"idleinhibit focus, class:mpv"
|
||||
"float, title:^(Picture-in-Picture)$"
|
||||
"float, class:^(nm-connection-editor)$"
|
||||
"float, class:^(waypaper)$"
|
||||
"float, title:^(Sign In)(.*)$"
|
||||
"float, title:^(Firefox — 共有インジケーター)$"
|
||||
"nofocus, title:^(Firefox — 共有インジケーター)$"
|
||||
"float, class:^(firefox)$,title^(Sign in - Google Accounts — Mozilla Firefox)$"
|
||||
"size 0 0, title:^(Firefox — 共有インジケーター)$"
|
||||
"move 100%-470 15,title:^(Firefox — Sharing Indicator)$"
|
||||
"move 100%-470 15,title:^(Firefox — 共有インジケーター)$"
|
||||
# From old windowrulev2
|
||||
"float true, match:class ^(thunar)$, match:title ^(.*File Operation Progress.*)$"
|
||||
"float true, match:class ^(firefox)$, match:title ^(Library)$"
|
||||
"float true, match:class ^(thunar)$, match:title ^(File Operation Progress)$"
|
||||
"float true, match:class ^(thunar)$, match:title ^(Confirm to replace files)$"
|
||||
"float true, match:title ^(bwarn)$"
|
||||
"no_initial_focus on, match:class ^(steam)$"
|
||||
"float true, match:class ^(firefox)$, match:title ^(ログイン - Google アカウント — Mozilla Firefox)$"
|
||||
"float true, match:class ^(firefox)$, match:title ^(Firefox — Sharing Indicator)$"
|
||||
"float true, match:class ^(firefox)$, match:title ^(Firefox — 共有インジケーター)$"
|
||||
"float true, match:class ^(firefox)$, match:title ^(.*Sign in.*)$"
|
||||
# From old windowrule
|
||||
"float true, match:class ^(qt5ct)$"
|
||||
"float true, match:class ^(zoom)$"
|
||||
"float true, match:class ^(Steam)$"
|
||||
"idle_inhibit focus, match:class ^(mpv)$"
|
||||
"float true, match:title ^(Picture-in-Picture)$"
|
||||
"float true, match:class ^(nm-connection-editor)$"
|
||||
"float true, match:class ^(waypaper)$"
|
||||
"float true, match:title ^(Sign In)(.*)$"
|
||||
"float true, match:title ^(Firefox — 共有インジケーター)$"
|
||||
"no_focus on, match:title ^(Firefox — 共有インジケーター)$"
|
||||
"float true, match:class ^(firefox)$, match:title ^(Sign in - Google Accounts — Mozilla Firefox)$"
|
||||
"size 0 0, match:title ^(Firefox — 共有インジケーター)$"
|
||||
"opacity 0.8, match:title ^(Neovide)$"
|
||||
"move 100%-470 15, match:title ^(Firefox — Sharing Indicator)$"
|
||||
"move 100%-470 15, match:title ^(Firefox — 共有インジケーター)$"
|
||||
];
|
||||
|
||||
] ++ smartGapsWindowrules;
|
||||
cursor = {
|
||||
no_hardware_cursors = true;
|
||||
};
|
||||
|
||||
input = {
|
||||
kb_layout = "us";
|
||||
follow_mouse = 1;
|
||||
accel_profile = "flat";
|
||||
follow_mouse_threshold = 5;
|
||||
force_no_accel = 1;
|
||||
sensitivity = 0;
|
||||
};
|
||||
general = {
|
||||
gaps_in = 5;
|
||||
gaps_out = 9;
|
||||
gaps_out = "0, 9, 9, 9"; # top, right, bottom, left
|
||||
border_size = 3;
|
||||
"col.active_border" = lib.mkForce "rgba(404042ff)";
|
||||
"col.inactive_border" = lib.mkForce "rgba(83858a00)";
|
||||
layout = "dwindle";
|
||||
layout = "master";
|
||||
resize_on_border = true;
|
||||
no_border_on_floating = false;
|
||||
|
||||
snap = {
|
||||
enabled = true;
|
||||
@@ -178,7 +223,6 @@ in {
|
||||
};
|
||||
|
||||
dwindle = {
|
||||
force_split = 2;
|
||||
pseudotile = "yes";
|
||||
preserve_split = "yes";
|
||||
};
|
||||
@@ -186,15 +230,23 @@ in {
|
||||
master = {
|
||||
new_status = "master";
|
||||
special_scale_factor = 1;
|
||||
mfact = 0.65;
|
||||
new_on_top = true;
|
||||
};
|
||||
|
||||
decoration = {
|
||||
rounding = 4;
|
||||
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 8;
|
||||
passes = 2;
|
||||
};
|
||||
|
||||
shadow = {
|
||||
enabled = true;
|
||||
ignore_window = true;
|
||||
range = 80;
|
||||
range = 20;
|
||||
render_power = 50;
|
||||
};
|
||||
};
|
||||
@@ -203,10 +255,6 @@ in {
|
||||
hide_on_key_press = true;
|
||||
};
|
||||
|
||||
experimental = {
|
||||
xx_color_management_v4 = true;
|
||||
};
|
||||
|
||||
animations = {
|
||||
enabled = true;
|
||||
|
||||
@@ -236,7 +284,10 @@ in {
|
||||
"super shift, m, exit,"
|
||||
"super, m, exec, fuzzel"
|
||||
"super, r, exec, neovide"
|
||||
"super, b, togglesplit, # dwindle"
|
||||
"super, b, layoutmsg, togglesplit, # dwindle"
|
||||
"super, comma, exec, hyprctl dispatch layoutmsg rollnext; hyprctl dispatch layoutmsg focusmaster"
|
||||
"super, period, exec, hyprctl dispatch layoutmsg rollprev; hyprctl dispatch layoutmsg focusmaster"
|
||||
"super, n, layoutmsg, swapwithmaster"
|
||||
"super, f, togglefloating"
|
||||
"super, g, fullscreen"
|
||||
"super, h, movefocus, l"
|
||||
@@ -262,9 +313,12 @@ in {
|
||||
"super shift, 6, movetoworkspace, 6"
|
||||
"super, s, togglespecialworkspace, magic"
|
||||
"super shift, s, movetoworkspace, special:magic"
|
||||
] ++ screenshot_bind;
|
||||
bindm =
|
||||
[ "super, mouse:272, movewindow" "super, mouse:273, resizewindow" ];
|
||||
]
|
||||
++ screenshot_bind;
|
||||
bindm = [
|
||||
"super, mouse:272, movewindow"
|
||||
"super, mouse:273, resizewindow"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
6
modules/home/environment/paperd/default.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./paperd.nix
|
||||
];
|
||||
}
|
||||
35
modules/home/environment/paperd/paperd.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
self,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
paperdScript = import ./paperd_script.nix { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
home.file.".config/paperd/config.toml".text = ''
|
||||
wallpaper_dir = "${self}/assets/wallpapers/selective_color"
|
||||
interval = 1800
|
||||
|
||||
[transition]
|
||||
type = "fade"
|
||||
duration = 3
|
||||
fps = 60
|
||||
'';
|
||||
systemd.user.services = {
|
||||
paperd = {
|
||||
Unit = {
|
||||
Description = "Paperd Wallpaper Daemon";
|
||||
After = [ "swww-daemon.service" ];
|
||||
Requires = [ "swww-daemon.service" ];
|
||||
};
|
||||
Install.WantedBy = [ "hyprland-session.target" ];
|
||||
Service = {
|
||||
Environment = "PYTHONUNBUFFERED=1";
|
||||
ExecStart = "${pkgs.myPython}/bin/python3 ${paperdScript}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
89
modules/home/environment/paperd/paperd_script.nix
Normal file
@@ -0,0 +1,89 @@
|
||||
{ pkgs }:
|
||||
|
||||
let
|
||||
themeBuilder = import ./theme_builder.nix { inherit pkgs; };
|
||||
in
|
||||
pkgs.writeText "paperd.py" /* python */ ''
|
||||
import tomllib
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
from collections import deque
|
||||
import subprocess
|
||||
from pynvim import attach
|
||||
|
||||
|
||||
config = None
|
||||
|
||||
with open(Path("~/.config/paperd/config.toml").expanduser(), "rb") as f:
|
||||
config = tomllib.load(f)
|
||||
|
||||
interval = config["interval"]
|
||||
paper_dir = Path(config["wallpaper_dir"])
|
||||
transition = config.get("transition", {})
|
||||
transition_type = transition.get("type")
|
||||
transition_fps = transition.get("fps")
|
||||
transition_duration = transition.get("duration")
|
||||
transition_angle = transition.get("angle")
|
||||
transition_step = transition.get("step")
|
||||
|
||||
exts = {".jpg", ".jpeg", ".png", ".webp"}
|
||||
images = deque([f for f in Path(paper_dir).iterdir() if f.suffix.lower() in exts])
|
||||
|
||||
if len(images) == 0:
|
||||
print("No images found in the specified directory.")
|
||||
sys.exit(1)
|
||||
|
||||
def get_command():
|
||||
command = ["${pkgs.swww}/bin/swww", "img"]
|
||||
if transition_type:
|
||||
command.append("--transition-type")
|
||||
command.append(transition_type)
|
||||
if transition_fps:
|
||||
command.append("--transition-fps")
|
||||
command.append(str(transition_fps))
|
||||
if transition_duration:
|
||||
command.append("--transition-duration")
|
||||
command.append(str(transition_duration))
|
||||
if transition_angle:
|
||||
command.append("--transition-angle")
|
||||
command.append(str(transition_angle))
|
||||
if transition_step:
|
||||
command.append("--transition-step")
|
||||
command.append(str(transition_step))
|
||||
command.append(str(images[0]))
|
||||
return command
|
||||
|
||||
|
||||
print(f"Found {len(images)} images. Starting wallpaper rotation every {interval} seconds.")
|
||||
current_time = int(time.time())
|
||||
|
||||
initial_idx = (current_time // interval) % len(images)
|
||||
|
||||
command = get_command()
|
||||
subprocess.run(command)
|
||||
subprocess.run(["${pkgs.myPython}/bin/python3", "${themeBuilder}", str(images[0])])
|
||||
|
||||
print(f"Setting wallpaper to {images[0]} with transition {transition_type} (fps: {transition_fps}, duration: {transition_duration}, angle: {transition_angle}, step: {transition_step})")
|
||||
|
||||
images.rotate(-1)
|
||||
last_check = current_time % interval
|
||||
time.sleep(5)
|
||||
|
||||
while True:
|
||||
current_time = int(time.time())
|
||||
if (current_time % interval) >= last_check:
|
||||
last_check = current_time % interval
|
||||
time.sleep(5)
|
||||
continue
|
||||
|
||||
command = get_command()
|
||||
|
||||
print(f"Setting wallpaper to {images[0]} with transition {transition_type} (fps: {transition_fps}, duration: {transition_duration}, angle: {transition_angle}, step: {transition_step})")
|
||||
|
||||
subprocess.run(command)
|
||||
subprocess.run(["${pkgs.myPython}/bin/python3", "${themeBuilder}", str(images[0])])
|
||||
images.rotate(-1)
|
||||
last_check = current_time % interval
|
||||
time.sleep(5)
|
||||
''
|
||||
474
modules/home/environment/paperd/theme_builder.nix
Normal file
@@ -0,0 +1,474 @@
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.writeText "theme-builder.py" ''
|
||||
from colorsys import rgb_to_hls, hls_to_rgb
|
||||
from collections import Counter
|
||||
from pathlib import Path
|
||||
from PIL import Image
|
||||
from pynvim import attach
|
||||
import subprocess
|
||||
import math
|
||||
import os
|
||||
import sys
|
||||
|
||||
STATE_DIR = Path(os.path.expanduser("~/.local/state/sysflake"))
|
||||
MULT = 2.5
|
||||
|
||||
GRAYSCALE = {
|
||||
"base00": "1a1a1a",
|
||||
"base01": "2a2a2a",
|
||||
"base02": "3a3a3a",
|
||||
"base03": "5a5a5a",
|
||||
"base04": "8a8a8a",
|
||||
"base05": "b0b0b0",
|
||||
"base06": "d0d0d0",
|
||||
"base07": "e8e8e8",
|
||||
"base08": "4a4a4a",
|
||||
"base09": "555555",
|
||||
"base0A": "606060",
|
||||
"base0B": "6b6b6b",
|
||||
"base0C": "767676",
|
||||
"base0D": "818181",
|
||||
"base0E": None, # accent slot
|
||||
"base0F": "8c8c8c",
|
||||
}
|
||||
|
||||
KITTY_MAP = {
|
||||
"background": "00", "foreground": "05", "cursor": "05",
|
||||
"selection_background": "02", "selection_foreground": "05",
|
||||
"color0": "00", "color1": "08", "color2": "0E", "color3": "0A",
|
||||
"color4": "0D", "color5": "0E", "color6": "0E", "color7": "05",
|
||||
"color8": "03", "color9": "08", "color10": "0E", "color11": "0A",
|
||||
"color12": "0D", "color13": "0E", "color14": "0E", "color15": "07",
|
||||
}
|
||||
|
||||
|
||||
def extract_accent(image_path):
|
||||
img = Image.open(image_path).resize((200, 200)).quantize(colors=32).convert("RGB")
|
||||
pixels = list(img.get_flattened_data())
|
||||
counts = Counter(pixels)
|
||||
total = len(pixels)
|
||||
|
||||
def score(color):
|
||||
_, l, s = rgb_to_hls(color[0] / 255, color[1] / 255, color[2] / 255)
|
||||
vibrancy = s * (1 - abs(l - 0.5) * 2)
|
||||
frequency = counts[color] / total
|
||||
return vibrancy * frequency
|
||||
|
||||
best = max(counts.keys(), key=score)
|
||||
h, l, s = rgb_to_hls(best[0] / 255, best[1] / 255, best[2] / 255)
|
||||
|
||||
new_s = min(max(s * MULT, 0.6), 0.7)
|
||||
|
||||
# Blue hues are perceptually darker — gradually boost lightness floor
|
||||
blue_center = 0.63
|
||||
blue_width = 0.09
|
||||
blue_factor = max(0, 1 - abs(h - blue_center) / blue_width)
|
||||
min_l = 0.45 + 0.2 * blue_factor
|
||||
|
||||
new_l = max(min_l, min(0.7, l))
|
||||
r, g, b = hls_to_rgb(h, new_l, new_s)
|
||||
return f"{int(r * 255):02x}{int(g * 255):02x}{int(b * 255):02x}"
|
||||
|
||||
|
||||
def build_scheme(accent):
|
||||
scheme = dict(GRAYSCALE)
|
||||
scheme["base0E"] = accent
|
||||
return scheme
|
||||
|
||||
|
||||
def write_scheme(scheme):
|
||||
path = STATE_DIR / "scheme.txt"
|
||||
with open(path, "w") as f:
|
||||
for key, val in scheme.items():
|
||||
f.write(f"{key} {val}\n")
|
||||
|
||||
|
||||
def write_kitty(scheme):
|
||||
path = STATE_DIR / "kitty-colors.conf"
|
||||
with open(path, "w") as f:
|
||||
for name, base in KITTY_MAP.items():
|
||||
f.write(f"{name} #{scheme['base' + base]}\n")
|
||||
|
||||
|
||||
VESKTOP_DIR = Path(os.path.expanduser("~/.config/vesktop/themes"))
|
||||
|
||||
|
||||
def hex_to_oklch(hex_color):
|
||||
"""Convert hex color to oklch (lightness, chroma, hue) values."""
|
||||
r = int(hex_color[0:2], 16) / 255
|
||||
g = int(hex_color[2:4], 16) / 255
|
||||
b = int(hex_color[4:6], 16) / 255
|
||||
|
||||
# sRGB to linear
|
||||
def to_linear(c):
|
||||
return c / 12.92 if c <= 0.04045 else ((c + 0.055) / 1.055) ** 2.4
|
||||
|
||||
lr, lg, lb = to_linear(r), to_linear(g), to_linear(b)
|
||||
|
||||
# Linear RGB to OKLab
|
||||
l_ = 0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb
|
||||
m_ = 0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb
|
||||
s_ = 0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb
|
||||
|
||||
l_ = l_ ** (1/3) if l_ >= 0 else -((-l_) ** (1/3))
|
||||
m_ = m_ ** (1/3) if m_ >= 0 else -((-m_) ** (1/3))
|
||||
s_ = s_ ** (1/3) if s_ >= 0 else -((-s_) ** (1/3))
|
||||
|
||||
L = 0.2104542553 * l_ + 0.7936177850 * m_ - 0.0040720468 * s_
|
||||
a = 1.9779984951 * l_ - 2.4285922050 * m_ + 0.4505937099 * s_
|
||||
bv = 0.0259040371 * l_ + 0.7827717662 * m_ - 0.8086757660 * s_
|
||||
|
||||
C = math.sqrt(a ** 2 + bv ** 2)
|
||||
H = math.degrees(math.atan2(bv, a)) % 360
|
||||
|
||||
return L, C, H
|
||||
|
||||
|
||||
def write_vesktop(scheme):
|
||||
VESKTOP_DIR.mkdir(parents=True, exist_ok=True)
|
||||
accent = scheme["base0E"]
|
||||
_, chroma, hue = hex_to_oklch(accent)
|
||||
|
||||
path = VESKTOP_DIR / "system24-dynamic.css"
|
||||
with open(path, "w") as f:
|
||||
f.write("""\
|
||||
/**
|
||||
* system24 dynamic theme — generated by theme-engine
|
||||
*/
|
||||
|
||||
@import url('https://refact0r.github.io/system24/build/system24.css');
|
||||
|
||||
:root {
|
||||
--colors: on;
|
||||
|
||||
/* override purple (accent) with extracted color */
|
||||
""")
|
||||
for i, lightness in enumerate([75, 70, 65, 60, 55], start=1):
|
||||
f.write(f" --purple-{i}: oklch({lightness}% {chroma:.4f} {hue:.1f});\n")
|
||||
|
||||
f.write("}\n")
|
||||
|
||||
|
||||
def write_nvim(scheme):
|
||||
accent = scheme["base0E"]
|
||||
path = STATE_DIR / "nvim-colors.lua"
|
||||
with open(path, "w") as f:
|
||||
f.write("require('base16-colorscheme').setup({\n")
|
||||
for key, val in scheme.items():
|
||||
f.write(f" {key} = '#{val}',\n")
|
||||
f.write("})\n\n")
|
||||
f.write(f"local accent = '#{accent}'\n")
|
||||
f.write(f"local light_gray = '#{scheme['base05']}'\n")
|
||||
for group in ["Statement", "Conditional", "Repeat", "Macro", "Function", "Exception",
|
||||
"TSMethod", "@lsp.type.method", "@lsp.type.function", "@lsp.type.macro",
|
||||
"DiagnosticUnderlineHint", "Boolean"]:
|
||||
f.write(f"vim.api.nvim_set_hl(0, '{group}', {{ fg = accent }})\n")
|
||||
for group in ["@lsp.type.variable", "@lsp.type.parameter", "@lsp.type.struct", "@lsp.type.class",
|
||||
"@lsp.type.selfTypeKeyword", "Identifier"]:
|
||||
f.write(f"vim.api.nvim_set_hl(0, '{group}', {{ fg = light_gray }})\n")
|
||||
for group in ["@lsp.type.enumMember", "@lsp.type.enum", "Number", "Integer"]:
|
||||
f.write(f"vim.api.nvim_set_hl(0, '{group}', {{ fg = '#{scheme['base04']}' }})\n")
|
||||
|
||||
|
||||
def write_swaync(scheme):
|
||||
accent = scheme["base0E"]
|
||||
path = STATE_DIR / "swaync-colors.css"
|
||||
with open(path, "w") as f:
|
||||
f.write(f"""\
|
||||
@define-color base #{scheme['base00']};
|
||||
@define-color mantle #{scheme['base01']};
|
||||
@define-color crust #{scheme['base00']};
|
||||
@define-color text #{scheme['base05']};
|
||||
@define-color subtext0 #{scheme['base04']};
|
||||
@define-color subtext1 #{scheme['base05']};
|
||||
@define-color surface0 #{scheme['base01']};
|
||||
@define-color surface1 #{scheme['base02']};
|
||||
@define-color surface2 #{scheme['base03']};
|
||||
@define-color overlay0 #{scheme['base03']};
|
||||
@define-color overlay1 #{scheme['base04']};
|
||||
@define-color overlay2 #{scheme['base04']};
|
||||
@define-color lavender #{accent};
|
||||
""")
|
||||
|
||||
|
||||
EZA_DIR = Path(os.path.expanduser("~/.config/eza"))
|
||||
|
||||
|
||||
def write_eza(scheme):
|
||||
EZA_DIR.mkdir(parents=True, exist_ok=True)
|
||||
accent = f'"#{scheme["base0E"]}"'
|
||||
file_color = f'"#{scheme["base05"]}"'
|
||||
dim = f'"#{scheme["base04"]}"'
|
||||
dimmer = f'"#{scheme["base03"]}"'
|
||||
dark = f'"#{scheme["base02"]}"'
|
||||
|
||||
path = EZA_DIR / "theme.yml"
|
||||
with open(path, "w") as f:
|
||||
f.write(f"""\
|
||||
filekinds:
|
||||
normal:
|
||||
foreground: {file_color}
|
||||
directory:
|
||||
foreground: {accent}
|
||||
is_bold: true
|
||||
is_underline: true
|
||||
symlink:
|
||||
foreground: {dim}
|
||||
pipe:
|
||||
foreground: {dimmer}
|
||||
block_device:
|
||||
foreground: {dim}
|
||||
char_device:
|
||||
foreground: {dim}
|
||||
socket:
|
||||
foreground: {dimmer}
|
||||
special:
|
||||
foreground: {dim}
|
||||
executable:
|
||||
foreground: {accent}
|
||||
is_bold: true
|
||||
mount_point:
|
||||
foreground: {accent}
|
||||
|
||||
perms:
|
||||
user_read:
|
||||
foreground: {file_color}
|
||||
user_write:
|
||||
foreground: {dim}
|
||||
user_execute_file:
|
||||
foreground: {accent}
|
||||
user_execute_other:
|
||||
foreground: {accent}
|
||||
group_read:
|
||||
foreground: {dim}
|
||||
group_write:
|
||||
foreground: {dimmer}
|
||||
group_execute:
|
||||
foreground: {dim}
|
||||
other_read:
|
||||
foreground: {dimmer}
|
||||
other_write:
|
||||
foreground: {dimmer}
|
||||
other_execute:
|
||||
foreground: {dimmer}
|
||||
special_user_file:
|
||||
foreground: {accent}
|
||||
special_other:
|
||||
foreground: {dimmer}
|
||||
attribute:
|
||||
foreground: {dimmer}
|
||||
|
||||
size:
|
||||
number_byte:
|
||||
foreground: {file_color}
|
||||
number_kilo:
|
||||
foreground: {dim}
|
||||
number_mega:
|
||||
foreground: {dim}
|
||||
number_giga:
|
||||
foreground: {accent}
|
||||
number_huge:
|
||||
foreground: {accent}
|
||||
unit_byte:
|
||||
foreground: {dimmer}
|
||||
unit_kilo:
|
||||
foreground: {dimmer}
|
||||
unit_mega:
|
||||
foreground: {dimmer}
|
||||
unit_giga:
|
||||
foreground: {dimmer}
|
||||
unit_huge:
|
||||
foreground: {dimmer}
|
||||
|
||||
users:
|
||||
user_you:
|
||||
foreground: {file_color}
|
||||
user_root:
|
||||
foreground: {accent}
|
||||
user_other:
|
||||
foreground: {dim}
|
||||
group_yours:
|
||||
foreground: {dim}
|
||||
group_other:
|
||||
foreground: {dimmer}
|
||||
group_root:
|
||||
foreground: {accent}
|
||||
|
||||
links:
|
||||
normal:
|
||||
foreground: {dim}
|
||||
multi_link_file:
|
||||
foreground: {accent}
|
||||
|
||||
git:
|
||||
new:
|
||||
foreground: {accent}
|
||||
modified:
|
||||
foreground: {dim}
|
||||
deleted:
|
||||
foreground: {dimmer}
|
||||
renamed:
|
||||
foreground: {dim}
|
||||
typechange:
|
||||
foreground: {dim}
|
||||
ignored:
|
||||
foreground: {dark}
|
||||
conflicted:
|
||||
foreground: {accent}
|
||||
|
||||
git_repo:
|
||||
branch_main:
|
||||
foreground: {file_color}
|
||||
branch_other:
|
||||
foreground: {dim}
|
||||
git_clean:
|
||||
foreground: {accent}
|
||||
git_dirty:
|
||||
foreground: {dim}
|
||||
|
||||
file_type:
|
||||
image:
|
||||
foreground: {dim}
|
||||
video:
|
||||
foreground: {dim}
|
||||
music:
|
||||
foreground: {dim}
|
||||
lossless:
|
||||
foreground: {dim}
|
||||
crypto:
|
||||
foreground: {dimmer}
|
||||
document:
|
||||
foreground: {file_color}
|
||||
compressed:
|
||||
foreground: {dimmer}
|
||||
temp:
|
||||
foreground: {dark}
|
||||
compiled:
|
||||
foreground: {dimmer}
|
||||
build:
|
||||
foreground: {dimmer}
|
||||
source:
|
||||
foreground: {file_color}
|
||||
|
||||
punctuation:
|
||||
foreground: {dimmer}
|
||||
date:
|
||||
foreground: {dim}
|
||||
inode:
|
||||
foreground: {dimmer}
|
||||
blocks:
|
||||
foreground: {dimmer}
|
||||
header:
|
||||
foreground: {file_color}
|
||||
octal:
|
||||
foreground: {dimmer}
|
||||
flags:
|
||||
foreground: {dim}
|
||||
|
||||
symlink_path:
|
||||
foreground: {dim}
|
||||
control_char:
|
||||
foreground: {dimmer}
|
||||
broken_symlink:
|
||||
foreground: {accent}
|
||||
broken_path_overlay:
|
||||
foreground: {dark}
|
||||
""")
|
||||
|
||||
|
||||
def write_waybar(scheme):
|
||||
accent = scheme["base0E"]
|
||||
bg = scheme["base00"]
|
||||
fg = scheme["base05"]
|
||||
path = STATE_DIR / "waybar-colors.css"
|
||||
with open(path, "w") as f:
|
||||
f.write(f"@define-color accent #{accent};\n")
|
||||
f.write(f"@define-color bg-dark #{bg};\n")
|
||||
f.write(f"@define-color fg-text #{fg};\n")
|
||||
|
||||
|
||||
def write_hyprland(scheme):
|
||||
accent = scheme["base0E"]
|
||||
inactive = scheme["base03"]
|
||||
path = STATE_DIR / "hyprland-colors.conf"
|
||||
with open(path, "w") as f:
|
||||
f.write(f"general:col.active_border = rgba({accent}ff)\n")
|
||||
f.write(f"general:col.inactive_border = rgba({inactive}ff)\n")
|
||||
|
||||
|
||||
def reload_apps():
|
||||
print("Reloading applications with new theme...")
|
||||
subprocess.run(["pkill", "-SIGUSR1", "kitty"], capture_output=True)
|
||||
print("Sent reload signal to Kitty.")
|
||||
|
||||
nvim_colors = STATE_DIR / "nvim-colors.lua"
|
||||
for sock in Path(os.environ.get("XDG_RUNTIME_DIR", "/run/user/1000")).glob("nvim.*.0"):
|
||||
try:
|
||||
nvim = attach('socket', path=str(sock))
|
||||
nvim.command(f"luafile {nvim_colors}")
|
||||
print(f"Sent reload command to Neovim instance at {sock}.")
|
||||
except Exception as e:
|
||||
print(f"Failed to connect to Neovim instance at {sock}: {e}")
|
||||
|
||||
# Live-update hyprland borders
|
||||
scheme = {}
|
||||
for line in open(STATE_DIR / "scheme.txt"):
|
||||
k, v = line.split()
|
||||
scheme[k] = v
|
||||
subprocess.run(["hyprctl", "keyword", "general:col.active_border", f"rgba({scheme['base0E']}ff)"], capture_output=True)
|
||||
subprocess.run(["hyprctl", "keyword", "general:col.inactive_border", f"rgba({scheme['base03']}ff)"], capture_output=True)
|
||||
print("Updated Hyprland border colors.")
|
||||
|
||||
# Reload swaync styles
|
||||
subprocess.run(["swaync-client", "-rs"], capture_output=True)
|
||||
print("Sent reload signal to Swaync.")
|
||||
|
||||
# Reload waybar
|
||||
subprocess.run(["pkill", "-SIGUSR2", "waybar"], capture_output=True)
|
||||
print("Sent reload signal to Waybar.")
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: theme-engine.py <image-path>", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
STATE_DIR.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
accent = extract_accent(sys.argv[1])
|
||||
scheme = build_scheme(accent)
|
||||
print(f"Extracted accent color: #{accent}")
|
||||
write_scheme(scheme)
|
||||
print("Scheme written to state directory.")
|
||||
write_kitty(scheme)
|
||||
print("Kitty config written.")
|
||||
write_vesktop(scheme)
|
||||
print("Vesktop theme written.")
|
||||
write_nvim(scheme)
|
||||
print("Neovim colors written.")
|
||||
write_hyprland(scheme)
|
||||
print("Hyprland colors written.")
|
||||
write_swaync(scheme)
|
||||
print("Swaync colors written.")
|
||||
write_eza(scheme)
|
||||
print("Eza theme written.")
|
||||
write_waybar(scheme)
|
||||
print("Waybar colors written.")
|
||||
reload_apps()
|
||||
print("Sent reload signals to applications.")
|
||||
|
||||
print(f"Accent: #{accent}")
|
||||
print(f"Scheme written to {STATE_DIR / 'scheme.txt'}")
|
||||
print(f"Kitty config written to {STATE_DIR / 'kitty-colors.conf'}")
|
||||
print(f"Vesktop theme written to {VESKTOP_DIR / 'system24-dynamic.css'}")
|
||||
print(f"Neovim colors written to {STATE_DIR / 'nvim-colors.lua'}")
|
||||
print(f"Hyprland colors written to {STATE_DIR / 'hyprland-colors.conf'}")
|
||||
print(f"Swaync colors written to {STATE_DIR / 'swaync-colors.css'}")
|
||||
print(f"Eza theme written to {EZA_DIR / 'theme.yml'}")
|
||||
print(f"Waybar colors written to {STATE_DIR / 'waybar-colors.css'}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
''
|
||||
42
modules/home/environment/shed/aliases.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.shed = {
|
||||
aliases = {
|
||||
mv = "mv -v";
|
||||
cp = "cp -vr";
|
||||
gt = "gtrash";
|
||||
gtp = "${pkgs.myScripts.playshellsound}/bin/playshellsound ${self}/assets/sound/rm.wav && gtrash put";
|
||||
diff = "diff --color=auto";
|
||||
sr = "source ~/.shedrc";
|
||||
psg = "ps aux | grep -v grep | grep -i -e VSZ -e";
|
||||
mkdir = "mkdir -p";
|
||||
pk = "pkill -9 -f";
|
||||
svc = "sudo systemctl";
|
||||
svcu = "systemctl --user";
|
||||
iv = "invoke";
|
||||
cfgfilecount = ''find ".\.nix" $FLAKEPATH | wc -l | toilet -f 3d | lolcat'';
|
||||
vide = "neovide";
|
||||
vi = "nvim";
|
||||
mkexe = "chmod +x";
|
||||
shortdate = "date +%m-%d-%y";
|
||||
suvi = "sudoedit";
|
||||
suvide = "EDITOR=neovide suvi";
|
||||
rustdev = "nix develop github:km-clay/devshells#rust";
|
||||
y = "yazi";
|
||||
|
||||
ga = "playshellsound ${self}/assets/sound/gitadd.wav; git add";
|
||||
gcomm = "gitcommit_sfx";
|
||||
gpush = "gitpush_sfx";
|
||||
gpull = "gitpull_sfx";
|
||||
grebase = "gitrebase_sfx";
|
||||
videconf = "EDITOR=neovide viconf";
|
||||
nix-shell = "command nix-shell --command 'exec shed'";
|
||||
};
|
||||
};
|
||||
}
|
||||
24
modules/home/environment/shed/autocmd.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ self, pkgs, ... }:
|
||||
let
|
||||
shellsound = "${pkgs.myScripts.playshellsound}/bin/playshellsound";
|
||||
color-commit = "${pkgs.myScripts.color-commit}/bin/color-commit";
|
||||
sndpath = "${self}/assets/sound";
|
||||
in
|
||||
{
|
||||
programs.shed = {
|
||||
autocmds = [
|
||||
{
|
||||
hooks = [ "post-cmd" ];
|
||||
command = "export PROMPT_GIT_LINE=\"$(prompt_git_line)\"";
|
||||
}
|
||||
{
|
||||
hooks = [ "on-history-open" ];
|
||||
command = ''[ -n "$_NUM_MATCHES" ] && [ "$_NUM_MATCHES" -gt 0 ] && ${shellsound} "${sndpath}/nvim.wav"; fi'';
|
||||
}
|
||||
{
|
||||
hooks = [ "on-completion-start" ];
|
||||
command = ''[ -n "$_NUM_MATCHES" ] && [ "$_NUM_MATCHES" -gt 1 ] && ${shellsound} "${sndpath}/nvim.wav"; fi'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
15
modules/home/environment/shed/complete.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
programs.shed = {
|
||||
extraCompletion = {
|
||||
cargo = {
|
||||
wordList = [
|
||||
"build"
|
||||
"test"
|
||||
"run"
|
||||
"clippy"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
14
modules/home/environment/shed/default.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./env.nix
|
||||
./complete.nix
|
||||
./aliases.nix
|
||||
./extraconfig.nix
|
||||
./options.nix
|
||||
./keymaps.nix
|
||||
./functions.nix
|
||||
./autocmd.nix
|
||||
];
|
||||
}
|
||||
20
modules/home/environment/shed/env.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
programs.shed = {
|
||||
environmentVars = {
|
||||
SOUNDS_ENABLED = "true";
|
||||
EDITOR = "nvim";
|
||||
SUDO_EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
LANG = "en_US.UTF-8";
|
||||
BROWSER = "firefox";
|
||||
FLAKEPATH = "$HOME/.sysflake";
|
||||
STEAMPATH = "$HOME/.local/share/Steam";
|
||||
|
||||
FZF_DEFAULT_COMMAND = "fd";
|
||||
FZF_DEFAULT_OPTS = "--height 40% --layout=reverse --border";
|
||||
|
||||
LESS = "-R"; # pager uses alt buffer
|
||||
};
|
||||
};
|
||||
}
|
||||
28
modules/home/environment/shed/extraconfig.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
self,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
shellsound = "${pkgs.myScripts.playshellsound}/bin/playshellsound";
|
||||
color-commit = "${pkgs.myScripts.color-commit}/bin/color-commit";
|
||||
sndpath = "${self}/assets/sound";
|
||||
in
|
||||
{
|
||||
programs.shed = {
|
||||
settings.extraPostConfig = /* bash */ ''
|
||||
export PS1="\@prompt "
|
||||
export PSR='\e[36;1m$\@shed_ver\e[0m'
|
||||
|
||||
export PROMPT_GIT_LINE="$(prompt_git_line)"
|
||||
|
||||
if [ "$0" = "-shed" ]; then
|
||||
${shellsound} $FLAKEPATH/assets/sound/login.wav
|
||||
fi
|
||||
|
||||
if [ -n "$LS_COLORS" ]; then unset LS_COLORS; fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
302
modules/home/environment/shed/functions.nix
Normal file
@@ -0,0 +1,302 @@
|
||||
{ self, pkgs, ... }:
|
||||
let
|
||||
shellsound = "${pkgs.myScripts.playshellsound}/bin/playshellsound";
|
||||
color-commit = "${pkgs.myScripts.color-commit}/bin/color-commit";
|
||||
sndpath = "${self}/assets/sound";
|
||||
in
|
||||
{
|
||||
programs.shed = {
|
||||
functions = {
|
||||
prompt_topline = /* bash */ ''
|
||||
local user_and_host="\e[0m\e[1m$USER\e[1;36m@\e[1;31m$HOST\e[0m"
|
||||
local mode_text="$(prompt_mode)"
|
||||
echo -n "\e[1;34m┏━ $user_and_host $mode_text\n"
|
||||
'';
|
||||
|
||||
prompt_mode = /* bash */ ''
|
||||
local mode=""
|
||||
local normal_fg='\e[0m\e[30m\e[1;43m'
|
||||
local normal_bg='\e[0m\e[33m'
|
||||
local insert_fg='\e[0m\e[30m\e[1;46m'
|
||||
local insert_bg='\e[0m\e[36m'
|
||||
local command_fg='\e[0m\e[30m\e[1;42m'
|
||||
local command_bg='\e[0m\e[32m'
|
||||
local visual_fg='\e[0m\e[30m\e[1;45m'
|
||||
local visual_bg='\e[0m\e[35m'
|
||||
local replace_fg='\e[0m\e[30m\e[1;41m'
|
||||
local replace_bg='\e[0m\e[31m'
|
||||
local search_fg='\e[0m\e[30m\e[1;47m'
|
||||
local search_bg='\e[0m\e[39m'
|
||||
local complete_fg='\e[0m\e[30m\e[1;47m'
|
||||
local complete_bg='\e[0m\e[39m'
|
||||
|
||||
|
||||
case "$SHED_VI_MODE" in
|
||||
"NORMAL")
|
||||
mode="$normal_bg''${normal_fg}NORMAL$normal_bg\e[0m"
|
||||
;;
|
||||
"INSERT")
|
||||
mode="$insert_bg''${insert_fg}INSERT$insert_bg\e[0m"
|
||||
;;
|
||||
"COMMAND")
|
||||
mode="$command_bg''${command_fg}COMMAND$command_bg\e[0m"
|
||||
;;
|
||||
"VISUAL")
|
||||
mode="$visual_bg''${visual_fg}VISUAL$visual_bg\e[0m"
|
||||
;;
|
||||
"REPLACE")
|
||||
mode="$replace_bg''${replace_fg}REPLACE$replace_bg\e[0m"
|
||||
;;
|
||||
"VERBATIM")
|
||||
mode="$replace_bg''${replace_fg}VERBATIM$replace_bg\e[0m"
|
||||
;;
|
||||
"COMPLETE")
|
||||
mode="$complete_bg''${complete_fg}COMPLETE$complete_bg\e[0m"
|
||||
;;
|
||||
"SEARCH")
|
||||
mode="$search_bg''${search_fg}SEARCH$search_bg\e[0m"
|
||||
;;
|
||||
*)
|
||||
mode=""
|
||||
;;
|
||||
esac
|
||||
|
||||
echo -en "$mode\n"
|
||||
'';
|
||||
|
||||
prompt_stat_line = /* bash */ ''
|
||||
local last_exit_code="$?"
|
||||
local last_cmd_status
|
||||
local last_cmd_runtime
|
||||
if [ "$last_exit_code" -eq "0" ]; then
|
||||
last_cmd_status="\e[1;32m"
|
||||
else
|
||||
last_cmd_status="\e[1;31m"
|
||||
fi
|
||||
local last_runtime_raw="$(echo -p "\t")"
|
||||
if [ -z "$last_runtime_raw" ]; then
|
||||
return 0
|
||||
else
|
||||
last_cmd_runtime="\e[1;38;2;249;226;175m ''${last_cmd_status}$(echo -p "\T")\e[0m"
|
||||
fi
|
||||
|
||||
echo -n "\e[1;34m┃ $last_cmd_runtime\e[0m\n"
|
||||
'';
|
||||
|
||||
prompt_git_line = /* bash */ ''
|
||||
local status="$(git status --porcelain -b 2>/dev/null)" || return
|
||||
|
||||
local branch="" gitsigns="" ahead=0 behind=0
|
||||
local header="''${status%%$'\n'*}"
|
||||
|
||||
branch="''${header#\#\# }"
|
||||
branch="''${branch%%...*}"
|
||||
case "$header" in
|
||||
*ahead*) ahead="''${header#*ahead }"; ahead="''${ahead%%[],]*}"; gitsigns="''${gitsigns}↑" ;;
|
||||
esac
|
||||
case "$header" in
|
||||
*behind*) behind="''${header#*behind }"; behind="''${behind%%[],]*}"; gitsigns="''${gitsigns}↓" ;;
|
||||
esac
|
||||
|
||||
case "$status" in
|
||||
*$'\n'" "[MAR]*) gitsigns="''${gitsigns}!" ;;
|
||||
esac
|
||||
case "$status" in
|
||||
*$'\n'"??"*) gitsigns="''${gitsigns}?" ;;
|
||||
esac
|
||||
case "$status" in
|
||||
*$'\n'" "[D]*) gitsigns="''${gitsigns}" ;;
|
||||
esac
|
||||
case "$status" in
|
||||
*$'\n'[MADR]*) gitsigns="''${gitsigns}+" ;;
|
||||
esac
|
||||
|
||||
local diff="$(git diff --shortstat 2>/dev/null)"
|
||||
|
||||
local diff="$(git diff --shortstat 2>/dev/null)"
|
||||
local changed="" add="" del=""
|
||||
if [ -n "$diff" ]; then
|
||||
changed="''${diff%% file*}"; changed="''${changed##* }"
|
||||
case "$diff" in
|
||||
*insertion*) add="''${diff#*, }"; add="''${add%% *}" ;;
|
||||
esac
|
||||
case "$diff" in
|
||||
*deletion*) del="''${diff% deletion*}"; del="''${del##* }" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ -n "$gitsigns" ] || [ -n "$branch" ]; then
|
||||
[ -n "$gitsigns" ] && gitsigns="\e[1;31m[$gitsigns]"
|
||||
[ -n "$changed" ] && [ "$changed" -gt 0 ] && changed="\e[1;34m~$changed \e[0m"
|
||||
[ -n "$add" ] && [ "$add" -gt 0 ] && add="\e[1;32m+$add \e[0m"
|
||||
[ -n "$del" ] && [ "$del" -gt 0 ] && del="\e[1;31m-$del\e[0m"
|
||||
echo -n "\e[1;34m┃ \e[1;35m $branch$gitsigns\e[0m $changed$add$del\n"
|
||||
fi
|
||||
'';
|
||||
|
||||
prompt_jobs_line = /* bash */ ''
|
||||
local job_count="$(echo -p '\j')"
|
||||
if [ "$job_count" -gt 0 ]; then
|
||||
echo -n "\e[1;34m┃ \e[1;33m $job_count job(s) running\e[0m\n"
|
||||
fi
|
||||
'';
|
||||
|
||||
prompt_ssh_line = /* bash */ ''
|
||||
local ssh_server="$(echo $SSH_CONNECTION | cut -f3 -d' ')"
|
||||
[ -n "$ssh_server" ] && echo -n "\e[1;34m┃ \e[1;39m🌐 $ssh_server\e[0m\n"
|
||||
'';
|
||||
|
||||
prompt_pwd_line = /* bash */ ''
|
||||
echo -p "\e[1;34m┣━━ \e[1;36m\W\e[1;32m/"
|
||||
'';
|
||||
|
||||
prompt_dollar_line = /* bash */ ''
|
||||
local dollar="$(echo -p "\$ ")"
|
||||
local dollar="$(echo -e "\e[1;32m$dollar\e[0m")"
|
||||
echo -n "\e[1;34m┗━ $dollar "
|
||||
'';
|
||||
|
||||
prompt = /* bash */ ''
|
||||
local statline="$(prompt_stat_line)"
|
||||
local topline="$(prompt_topline)"
|
||||
local jobsline="$(prompt_jobs_line)"
|
||||
local sshline="$(prompt_ssh_line)"
|
||||
local pwdline="$(prompt_pwd_line)"
|
||||
local dollarline="$(prompt_dollar_line)"
|
||||
local prompt="$topline$statline$PROMPT_GIT_LINE$jobsline$sshline$pwdline\n$dollarline"
|
||||
|
||||
echo -en "$prompt"
|
||||
'';
|
||||
|
||||
shed_ver = ''
|
||||
shed --version
|
||||
'';
|
||||
|
||||
encrypt = /* bash */ ''
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: encrypt <text> [recipient]"
|
||||
return 1
|
||||
fi
|
||||
if [ -z "$2" ]; then
|
||||
gpg --encrypt --armor -r "$1"
|
||||
else
|
||||
echo "$1" | gpg --encrypt --armor -r "$2"
|
||||
fi
|
||||
'';
|
||||
decrypt = /* bash */ ''
|
||||
if [ -z "$1" ]; then
|
||||
gpg --decrypt --quiet 2>/dev/null
|
||||
else
|
||||
echo "$1" | gpg --decrypt --quiet
|
||||
fi
|
||||
'';
|
||||
|
||||
viflake = /* bash */ ''
|
||||
filename="$(upfind flake.nix)"
|
||||
if [ -n "$filename" ]; then
|
||||
nvim "$filename"
|
||||
else
|
||||
echo "No flake.nix found in this directory or any parent directories."
|
||||
return 1
|
||||
fi
|
||||
'';
|
||||
|
||||
upfind = /* bash */ ''
|
||||
until [ "$#" -eq 0 ]; do
|
||||
filename="$1"
|
||||
(
|
||||
until [ -f "./$filename" ]; do
|
||||
builtin cd ..
|
||||
if [ "$PWD" = "/" ]; then
|
||||
echo "upsearch: failed to find file '$filename' in this directory or any parent directories." 1>&2
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -f "./$filename" ]; then
|
||||
realpath "./$filename"
|
||||
fi
|
||||
)
|
||||
shift 1
|
||||
done
|
||||
'';
|
||||
|
||||
nvim = /* bash */ ''
|
||||
${shellsound} ${sndpath}/nvim.wav
|
||||
command nvim "$@"
|
||||
'';
|
||||
neovide = /* bash */ ''
|
||||
${shellsound} ${sndpath}/nvim.wav
|
||||
command neovide "$@"
|
||||
'';
|
||||
grimblast = /* bash */ ''
|
||||
if command grimblast "$@"; then
|
||||
${shellsound} ${sndpath}/screenshot.wav
|
||||
fi
|
||||
'';
|
||||
gitcheckout_sfx = /* bash */ ''
|
||||
if git checkout "$@"; then
|
||||
${shellsound} ${sndpath}/gitcheckout.wav
|
||||
else
|
||||
${shellsound} ${sndpath}/error.wav
|
||||
fi
|
||||
'';
|
||||
gitrebase_sfx = /* bash */ ''
|
||||
if git rebase "$@"; then
|
||||
${shellsound} ${sndpath}/gitrebase.wav
|
||||
else
|
||||
${shellsound} ${sndpath}/error.wav
|
||||
fi
|
||||
'';
|
||||
gitcommit_sfx = /* bash */ ''
|
||||
local output="$(git commit "$@")"
|
||||
if [ "$?" -eq "0" ]; then
|
||||
${shellsound} ${sndpath}/gitcommit.wav
|
||||
echo "$output" | ${color-commit}
|
||||
return 0
|
||||
else
|
||||
${shellsound} ${sndpath}/error.wav
|
||||
echo "$output"
|
||||
return 1
|
||||
fi
|
||||
'';
|
||||
gitpush_sfx = /* bash */ ''
|
||||
if git push "$@"; then
|
||||
${shellsound} ${sndpath}/gitpush.wav
|
||||
else
|
||||
${shellsound} ${sndpath}/error.wav
|
||||
fi
|
||||
'';
|
||||
gitpull_sfx = /* bash */ ''
|
||||
if git pull "$@"; then
|
||||
${shellsound} ${sndpath}/gitpull.wav
|
||||
else
|
||||
${shellsound} ${sndpath}/error.wav
|
||||
fi
|
||||
'';
|
||||
|
||||
ls = /* bash */ ''
|
||||
eza -1 --group-directories-first --icons "$@"
|
||||
'';
|
||||
|
||||
mkcd = /* bash */ ''
|
||||
command mkdir -p "$1" && builtin cd "$1"
|
||||
'';
|
||||
|
||||
cd = /* bash */ ''
|
||||
eza -1 --group-directories-first --icons "$@" 2> /dev/null
|
||||
builtin cd "$@"
|
||||
'';
|
||||
|
||||
hyprsock = /* bash */ ''
|
||||
socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock
|
||||
'';
|
||||
|
||||
vipe = /* bash */ ''
|
||||
local tmp=$(mktemp)
|
||||
$EDITOR "$tmp" -R - >/dev/tty </dev/tty
|
||||
cat "$tmp"
|
||||
rm "$tmp"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
198
modules/home/environment/shed/keymaps.nix
Normal file
@@ -0,0 +1,198 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.shed = {
|
||||
functions = {
|
||||
_read_obj = /* bash */ ''
|
||||
_obj=""
|
||||
while read_key -v key; do
|
||||
if [[ "''${#_obj}" -ge 3 ]]; then return 1; fi
|
||||
case "$key" in
|
||||
i|a)
|
||||
if [ -n "$_obj" ]; then return 1; fi
|
||||
_obj="$key"
|
||||
;;
|
||||
b|e)
|
||||
if [ -n "$_obj" ]; then return 1; fi
|
||||
_obj="$key"
|
||||
break
|
||||
;;
|
||||
w|W)
|
||||
_obj="$_obj$key"
|
||||
break
|
||||
;;
|
||||
f|F)
|
||||
read_key -v char
|
||||
_obj="$key$char"
|
||||
break
|
||||
;;
|
||||
\(|\)|\[|\]|\{|\}|\"|\')
|
||||
if [ -z "$_obj" ]; then return 1; fi
|
||||
_obj="$_obj$key"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
'';
|
||||
_surround_1 = /* bash */ ''
|
||||
local _obj
|
||||
_read_obj
|
||||
_get_surround_target
|
||||
_KEYS="v$_obj"
|
||||
'';
|
||||
_surround_2 = /* bash */ ''
|
||||
local start
|
||||
local end
|
||||
if [ "$_ANCHOR" -lt "$_CURSOR" ]; then
|
||||
start=$_ANCHOR
|
||||
end=$_CURSOR
|
||||
else
|
||||
start=$_CURSOR
|
||||
end=$_ANCHOR
|
||||
fi
|
||||
end=$((end + 1))
|
||||
|
||||
delta=$((end - start))
|
||||
|
||||
left="''${_BUFFER:0:$start}"
|
||||
mid="''${_BUFFER:$start:$delta}"
|
||||
right="''${_BUFFER:$end}"
|
||||
_BUFFER="$left$_sl$mid$_sr$right"
|
||||
_CURSOR=$start
|
||||
'';
|
||||
|
||||
_get_surround_target = /* bash */ ''
|
||||
read_key -v _s_ch
|
||||
case "$_s_ch" in
|
||||
\(|\)) _sl='('; _sr=')' ;;
|
||||
\[|\]) _sl='['; _sr=']' ;;
|
||||
\{|\}) _sl='{'; _sr='}' ;;
|
||||
\<|\>) _sl='<'; _sr='>' ;;
|
||||
*) _sl="$_s_ch"; _sr="$_s_ch" ;;
|
||||
esac
|
||||
'';
|
||||
|
||||
_surround_del = /* bash */ ''
|
||||
_get_surround_target
|
||||
local left_buf="''${_BUFFER:0:$_CURSOR}"
|
||||
local right_buf="''${_BUFFER:$left}"
|
||||
local left=""
|
||||
local right=""
|
||||
_scan_left $_sl "$left_buf"
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
_scan_right $_sl "$right_buf"
|
||||
|
||||
[ "$?" -ne 0 ] && echo "No match found in left or right scan for char '$_sl' on $left_buf" 1>&2 && return 1
|
||||
left=$right
|
||||
fi
|
||||
|
||||
mid_start=$((left + 1))
|
||||
right=""
|
||||
left_buf="''${_BUFFER:0:$left}"
|
||||
right_buf="''${_BUFFER:$mid_start}"
|
||||
_scan_right $_sr "$right_buf"
|
||||
|
||||
[ "$?" -ne 0 ] && echo "No match found in right scan for char '$_sr'" 1>&2 && return 1
|
||||
|
||||
mid_end=$((mid_start + right))
|
||||
right_start=$((mid_end + 1))
|
||||
new_left_buf="''${_BUFFER:0:$left}"
|
||||
new_mid_buf="''${_BUFFER:$mid_start:$right}"
|
||||
new_right_buf="''${_BUFFER:$right_start}"
|
||||
|
||||
|
||||
_BUFFER="$new_left_buf$new_mid_buf$new_right_buf"
|
||||
'';
|
||||
|
||||
_scan_left = /* bash */ ''
|
||||
local needle="$1"
|
||||
local haystack="$2"
|
||||
local i=$((''${#haystack} - 1))
|
||||
|
||||
|
||||
while [ "$i" -ge 0 ]; do
|
||||
ch="''${haystack:$i:1}"
|
||||
if [ "$ch" = "$needle" ]; then
|
||||
left=$i
|
||||
return 0
|
||||
fi
|
||||
i=$((i - 1))
|
||||
done
|
||||
|
||||
return 1
|
||||
'';
|
||||
|
||||
_scan_right = /* bash */ ''
|
||||
local needle="$1"
|
||||
local haystack="$2"
|
||||
local i=0
|
||||
|
||||
|
||||
while [ "$i" -lt "''${#haystack}" ]; do
|
||||
ch="''${haystack:$i:1}"
|
||||
if [ "$ch" = "$needle" ]; then
|
||||
right="$i"
|
||||
return 0
|
||||
fi
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
return 1
|
||||
'';
|
||||
|
||||
_enum_chars = /* bash */ ''
|
||||
local i=0
|
||||
[ -z "$1" ] && return 1
|
||||
[ "''${#1}" -eq 1 ] && echo "0 $1" && return 0
|
||||
|
||||
while [ "$i" -lt ''${#1} ]; do
|
||||
echo -n "$i ''${1:$i:1} "
|
||||
i=$((i + 1))
|
||||
[ $i -ge "''${#1}" ] && break
|
||||
echo -n " "
|
||||
done
|
||||
echo
|
||||
'';
|
||||
|
||||
_enum_chars_rev = /* bash */ ''
|
||||
local i=$((''${#1} - 1))
|
||||
[ -z "$1" ] && return 1
|
||||
[ "''${#1}" -eq 1 ] && echo "0 $1" && return 0
|
||||
|
||||
while [ "$i" -ge 0 ]; do
|
||||
echo -n "$i ''${1:$i:1} "
|
||||
i=$((i - 1))
|
||||
[ $i -lt 0 ] && break
|
||||
echo -n " "
|
||||
done
|
||||
echo
|
||||
'';
|
||||
|
||||
_edit_line = /* bash */ ''
|
||||
tmp="$(mktemp)"
|
||||
echo -n "$_BUFFER" > "$tmp"
|
||||
$EDITOR "$tmp"
|
||||
_BUFFER="$(cat "$tmp")"
|
||||
rm "$tmp"
|
||||
'';
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
modes = [ "n" ];
|
||||
keys = "<leader>e";
|
||||
command = ":!_edit_line<CR>";
|
||||
}
|
||||
{
|
||||
modes = [ "n" ];
|
||||
keys = "ys";
|
||||
command = ":!_surround_1<CR>:!_surround_2<CR>";
|
||||
}
|
||||
{
|
||||
modes = [ "n" ];
|
||||
keys = "ds";
|
||||
command = ":!_surround_del<CR>";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
13
modules/home/environment/shed/options.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
programs.shed = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
autocd = true;
|
||||
autoHistory = true;
|
||||
maxHistoryEntries = -1;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,16 +1,21 @@
|
||||
{ lib, config, pkgs, inputs, ... }:
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
|
||||
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
scheme = config.lib.stylix.colors;
|
||||
in {
|
||||
in
|
||||
{
|
||||
imports = [ inputs.spicetify-nix.homeManagerModules.default ];
|
||||
options = {
|
||||
movOpts.envConfig.spicetifyConfig.enable =
|
||||
lib.mkEnableOption "enable my spicetify options";
|
||||
movOpts.envConfig.spicetifyConfig.enable = lib.mkEnableOption "enable my spicetify options";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.envConfig.spicetifyConfig.enable {
|
||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [ "spotify" ];
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "spotify" ];
|
||||
|
||||
programs.spicetify = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
{ config, lib, inputs, ... }: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
movOpts.envConfig.starshipConfig.enable =
|
||||
lib.mkEnableOption "enables my starship configuration";
|
||||
movOpts.envConfig.starshipConfig.enable = lib.mkEnableOption "enables my starship configuration";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.envConfig.starshipConfig.enable {
|
||||
programs.starship = {
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
{ lib, self, config, host, pkgs, ... }:
|
||||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
host,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
scheme = "ayu-dark";
|
||||
wallpaper = "${self}/assets/wallpapers/dark-waves.jpg";
|
||||
scheme = "seti";
|
||||
server = (host == "xenon");
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
movOpts.envConfig.stylixHomeConfig.enable =
|
||||
lib.mkEnableOption "enables my stylix Home-Manager options";
|
||||
movOpts.envConfig.stylixHomeConfig.enable = lib.mkEnableOption "enables my stylix Home-Manager options";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.envConfig.stylixHomeConfig.enable {
|
||||
stylix = {
|
||||
enable = true;
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/${scheme}.yaml";
|
||||
image = wallpaper;
|
||||
polarity = "dark";
|
||||
autoEnable = true;
|
||||
opacity.terminal = 1.0;
|
||||
targets = {
|
||||
waybar.enable = false;
|
||||
spicetify.enable = false;
|
||||
@@ -38,12 +42,12 @@ in {
|
||||
name = "EnvyCodeR Nerd Font Mono";
|
||||
};
|
||||
sansSerif = {
|
||||
package = pkgs.nerd-fonts.envy-code-r;
|
||||
name = "EnvyCodeR Nerd Font Mono";
|
||||
package = pkgs.myPkgs.noto-sans-jp;
|
||||
name = "Noto Sans JP";
|
||||
};
|
||||
serif = {
|
||||
package = pkgs.nerd-fonts.envy-code-r;
|
||||
name = "EnvyCodeR Nerd Font Mono";
|
||||
package = pkgs.myPkgs.noto-sans-jp;
|
||||
name = "Noto Sans JP";
|
||||
};
|
||||
sizes = {
|
||||
desktop = 10;
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
{ lib, config, pkgs, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
movOpts.envConfig.swayncConfig.enable =
|
||||
lib.mkEnableOption "enables my swaync configuration";
|
||||
movOpts.envConfig.swayncConfig.enable = lib.mkEnableOption "enables my swaync configuration";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.envConfig.swayncConfig.enable {
|
||||
home.packages = with pkgs; [ swaynotificationcenter ];
|
||||
@@ -608,6 +613,8 @@
|
||||
.right.overlay-indicator {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
@import url("file://${config.home.homeDirectory}/.local/state/sysflake/swaync-colors.css");
|
||||
'';
|
||||
xdg.configFile."swaync/config.json".text = ''
|
||||
{
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
{ lib, config, pkgs, self, ... }:
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
scripts = with pkgs; [
|
||||
@@ -10,6 +17,7 @@ let
|
||||
myScripts.viconf
|
||||
myScripts.vipkg
|
||||
myScripts.fetchfromgh
|
||||
myScripts.mkshell
|
||||
myScripts.garbage-collect
|
||||
myScripts.rebuild
|
||||
myScripts.chpaper
|
||||
@@ -24,16 +32,26 @@ let
|
||||
myScripts.color-commit
|
||||
myScripts.mntstack
|
||||
];
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
movOpts.envConfig.userPkgs.enable =
|
||||
lib.mkEnableOption "enables my default user packages";
|
||||
movOpts.envConfig.userPkgs.enable = lib.mkEnableOption "enables my default user packages";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.envConfig.userPkgs.enable {
|
||||
home.packages = with pkgs; [
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
cargo
|
||||
rustc
|
||||
clippy
|
||||
rust-analyzer
|
||||
nerd-fonts.envy-code-r
|
||||
clippy
|
||||
rust-analyzer
|
||||
nemo
|
||||
feh
|
||||
gtk3
|
||||
vicut
|
||||
imagemagick
|
||||
vlc
|
||||
lolcat
|
||||
@@ -42,35 +60,48 @@ in {
|
||||
zsh-syntax-highlighting
|
||||
zsh-history-substring-search
|
||||
zsh-autosuggestions
|
||||
libreoffice
|
||||
#libreoffice
|
||||
gtrash
|
||||
ripgrep
|
||||
wf-recorder
|
||||
toilet
|
||||
vkbasalt
|
||||
librewolf
|
||||
firefox
|
||||
spotify
|
||||
zathura
|
||||
tor
|
||||
tor-browser
|
||||
chromium
|
||||
obs-studio
|
||||
gparted
|
||||
dust
|
||||
porsmo
|
||||
rustup
|
||||
w3m
|
||||
sox
|
||||
neovide
|
||||
python3
|
||||
claude-code
|
||||
myPython
|
||||
monero-cli
|
||||
protonup-qt
|
||||
piper
|
||||
libratbag
|
||||
ghostty
|
||||
firefox
|
||||
fd
|
||||
delta
|
||||
glfw
|
||||
glxinfo
|
||||
mesa-demos
|
||||
xwayland
|
||||
discord
|
||||
cloc
|
||||
wine
|
||||
gimp
|
||||
fira-code
|
||||
nerd-fonts.fira-code
|
||||
nodejs_latest
|
||||
] ++ scripts;
|
||||
myPkgs.noto-sans-jp
|
||||
myPkgs.billy-font
|
||||
]
|
||||
++ scripts;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,38 +1,23 @@
|
||||
{ pkgs, self, ... }:
|
||||
|
||||
let
|
||||
keyboardSfxScript = "${self}/assets/scripts/keyboard_sound_thing.py";
|
||||
in
|
||||
{
|
||||
systemd.user = {
|
||||
timers = {
|
||||
maintenanceCheck = {
|
||||
Unit = { Description = "Timer for package maintenance check"; };
|
||||
Timer = {
|
||||
OnCalendar = "hourly";
|
||||
Persistent = true;
|
||||
};
|
||||
Install = { WantedBy = [ "timers.target" ]; };
|
||||
};
|
||||
};
|
||||
services = {
|
||||
loginSound = {
|
||||
Unit= {
|
||||
Description = "Plays a sound on login";
|
||||
After = [ "graphical-session.target" ];
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
swww-daemon = {
|
||||
Unit.Description = "Daemon for swww (sway wayland wallpaper manager)";
|
||||
Install.WantedBy = [ "hyprland-session.target" ];
|
||||
Service = {
|
||||
ExecStart = "${pkgs.alsa-utils}/bin/aplay -qN ${self}/assets/sound/login.wav";
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.swww}/bin/swww-daemon";
|
||||
};
|
||||
};
|
||||
maintenanceCheck = {
|
||||
Unit = {
|
||||
Description = "Check for updates in my maintained packages";
|
||||
};
|
||||
|
||||
kitty-keyboard-sounds = {
|
||||
Unit.Description = "Keyboard sound effects for kitty";
|
||||
Install.WantedBy = [ "hyprland-session.target" ];
|
||||
Service = {
|
||||
ExecStart = "${pkgs.nix}/bin/nix-shell -p python3Packages.requests --run '${pkgs.python311}/bin/python ${pkgs.myScripts.check_updates}/bin/checkupdates.py'";
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.myPython}/bin/python3 ${keyboardSfxScript}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
{ pkgs, host, lib, config, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
desktop = (host == "oganesson");
|
||||
layout = config.movOpts.envConfig.hyprlandConfig.workspaceLayout;
|
||||
workspaces = {
|
||||
format = "{icon}";
|
||||
@@ -28,248 +33,245 @@ let
|
||||
"20" = "20";
|
||||
};
|
||||
persistent-workspaces =
|
||||
if (layout == "singlemonitor") then {
|
||||
"${builtins.elemAt monitors 0}" = [ 1 2 3 4 ];
|
||||
} else if (layout == "dualmonitor") then {
|
||||
"${builtins.elemAt monitors 0}" = [ 1 2 3 ];
|
||||
"${builtins.elemAt monitors 1}" = [ 4 5 6 ];
|
||||
} else if (layout == "trimonitor") then {
|
||||
"${builtins.elemAt monitors 2}" = [ 1 2 ];
|
||||
"${builtins.elemAt monitors 1}" = [ 3 4 ];
|
||||
"${builtins.elemAt monitors 0}" = [ 5 6 ];
|
||||
} else
|
||||
if (layout == "singlemonitor") then
|
||||
{
|
||||
"${builtins.elemAt monitors 0}" = [
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
];
|
||||
}
|
||||
else if (layout == "dualmonitor") then
|
||||
{
|
||||
"${builtins.elemAt monitors 0}" = [
|
||||
1
|
||||
2
|
||||
3
|
||||
];
|
||||
"${builtins.elemAt monitors 1}" = [
|
||||
4
|
||||
5
|
||||
6
|
||||
];
|
||||
}
|
||||
else if (layout == "trimonitor") then
|
||||
{
|
||||
"${builtins.elemAt monitors 2}" = [
|
||||
1
|
||||
2
|
||||
];
|
||||
"${builtins.elemAt monitors 1}" = [
|
||||
3
|
||||
4
|
||||
];
|
||||
"${builtins.elemAt monitors 0}" = [
|
||||
5
|
||||
6
|
||||
];
|
||||
}
|
||||
else
|
||||
{ };
|
||||
|
||||
};
|
||||
|
||||
scheme = config.lib.stylix.colors;
|
||||
bg = {
|
||||
darkester = scheme.base00;
|
||||
darkest = scheme.base01;
|
||||
darker = scheme.base02;
|
||||
dark = scheme.base03;
|
||||
};
|
||||
fg = {
|
||||
lightester = scheme.base07;
|
||||
lightest = scheme.base06;
|
||||
lighter = scheme.base05;
|
||||
light = scheme.base04;
|
||||
};
|
||||
colors = {
|
||||
color0 = scheme.base08;
|
||||
color1 = scheme.base09;
|
||||
color2 = scheme.base0A;
|
||||
color3 = scheme.base0B;
|
||||
color4 = scheme.base0C;
|
||||
color5 = scheme.base0D;
|
||||
color6 = scheme.base0E;
|
||||
color7 = scheme.base0F;
|
||||
};
|
||||
monitors = config.movOpts.envConfig.hyprlandConfig.monitorNames;
|
||||
circle-gauge = [ "" "" "" "" "" "" "" "" "" ];
|
||||
cava-gauge = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ];
|
||||
battery-gauge = [ "" "" "" "" "" "" "" "" "" ];
|
||||
bar-gauge = [
|
||||
"░░░░░░░░"
|
||||
"█░░░░░░░"
|
||||
"██░░░░░░"
|
||||
"███░░░░░"
|
||||
"████░░░░"
|
||||
"█████░░░"
|
||||
"██████░░"
|
||||
"███████░"
|
||||
"████████"
|
||||
];
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
movOpts.envConfig.waybarConfig.enable =
|
||||
lib.mkEnableOption "enables my waybar configuration";
|
||||
movOpts.envConfig.waybarConfig.enable = lib.mkEnableOption "enables my waybar configuration";
|
||||
};
|
||||
config = {
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
package = pkgs.waybar.overrideAttrs (oa: {
|
||||
mesonFlags = (oa.mesonFlags or [ ]) ++ [ "-Dexperimental=true" ];
|
||||
});
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
output = if layout == "singlemonitor" then builtins.elemAt monitors 0
|
||||
else builtins.elemAt monitors 1;
|
||||
output = monitors;
|
||||
position = "top";
|
||||
name = "mainBar";
|
||||
name = "waybar";
|
||||
margin-left = 0;
|
||||
margin-top = 0;
|
||||
margin-right = 0;
|
||||
mode = "dock";
|
||||
exclusive = true;
|
||||
passthrough = false;
|
||||
"gtk-layer-shell" = true;
|
||||
|
||||
modules-left = [ "clock" "hyprland/workspaces" "tray" ];
|
||||
modules-center = [];
|
||||
modules-right = [ "cpu" "memory" "pulseaudio" "network" ];
|
||||
modules-left = [
|
||||
"tray"
|
||||
"hyprland/workspaces"
|
||||
];
|
||||
modules-center = [ "hyprland/window" ];
|
||||
|
||||
"hyprland/window" = {
|
||||
format = "<span color='#aaaaaa'>{title}</span>";
|
||||
};
|
||||
modules-right = [
|
||||
"cpu"
|
||||
"memory"
|
||||
"pulseaudio"
|
||||
"network"
|
||||
"clock"
|
||||
"image#nixicon"
|
||||
];
|
||||
|
||||
"hyprland/workspaces" = workspaces;
|
||||
|
||||
clock = {
|
||||
format = "[ CLK: {:%H.%M <span size='8pt'> %a %b %d</span>} ]";
|
||||
tooltip-format = "<tt>{calendar}</tt>";
|
||||
calendar = {
|
||||
mode = "month";
|
||||
weeks-pos = "";
|
||||
on-scroll = 1;
|
||||
format = {
|
||||
months = "<span size='16pt'><b>CAL: {}\n</b></span>";
|
||||
days = "<span size='16pt'><b>{}</b></span>";
|
||||
weeks = "<span size='16pt'><b>{}</b></span>";
|
||||
weekdays = "<span size='16pt'><b>{}</b></span>";
|
||||
today = "<span color='#E6E1CF'><b>{}</b></span>";
|
||||
};
|
||||
};
|
||||
actions = {
|
||||
on-scroll-up = "shift_down";
|
||||
on-scroll-down = "shift_up";
|
||||
};
|
||||
format = " <span color='#aaaaaa'>{:%H:%M}</span>";
|
||||
};
|
||||
|
||||
pulseaudio = {
|
||||
format = "VOL: [ <span color='#272D38'>{icon}</span> ] <span size='8pt'>{volume}%</span>";
|
||||
format = " <span color='#aaaaaa'>{volume}%</span>";
|
||||
tooltip = true;
|
||||
tooltip-format = "DEVICE: {desc}";
|
||||
format-muted = "VOL: <span color='#F07178'>[ XXXXXXXX ] <span size='8pt'>{volume}%</span></span>";
|
||||
tooltip-format = "{desc}";
|
||||
format-muted = " <span color='#aaaaaa'>{volume}%</span>";
|
||||
on-click = "if [ $(pamixer --get-mute) == true ]; then pamixer --unmute; else pamixer --mute; fi";
|
||||
on-scroll-up = "pamixer -i 2";
|
||||
on-scroll-down = "pamixer -d 2";
|
||||
scroll-step = 2;
|
||||
reverse-scrolling = true;
|
||||
format-icons = bar-gauge;
|
||||
};
|
||||
|
||||
network = {
|
||||
format-wifi = "[ <span color='#B8CC52'>ONLINE</span> ]";
|
||||
format-ethernet = "[ <span color='#B8CC52'>ONLINE</span> ]";
|
||||
format-wifi = " <span color='#aaaaaa'>{essid}</span>";
|
||||
format-ethernet = " <span color='#aaaaaa'>{ifname}</span>";
|
||||
tooltip-format-wifi = "ESSID\t: {essid}\nSTRNGTH\t: {signaldBm}\n\nADDRESS\t: {ipaddr}\nGATE\t: {gwaddr}\nMASK\t: {netmask} | {cidr}";
|
||||
tooltip-format-ethernet = "IFNAME: {ifname}\nADDRESS: {ipaddr}";
|
||||
format-disconnected = "[ <span color='#F07178'>XXXXXX</span> ]";
|
||||
format-disconnected = "";
|
||||
on-click = "nm-connection-editor";
|
||||
};
|
||||
|
||||
"image#nixicon" = {
|
||||
path = "${self}/assets/images/nix-snowflake-colours.svg";
|
||||
size = 28;
|
||||
};
|
||||
|
||||
memory = {
|
||||
interval = 20;
|
||||
format = "MEM: [ <span color='#272D38'>{icon}</span> ] <span size='8pt'>{percentage}%</span>";
|
||||
format = " <span color='#aaaaaa'>{percentage}%</span>";
|
||||
tooltip-format = "MEM_TOT\t: {total}GiB\nSWP_TOT\t: {swapTotal}GiB\n\nMEM_USD\t: {used:0.1f}GiB\nSWP_USD\t: {swapUsed:0.1f}GiB";
|
||||
format-icons = [
|
||||
"░░░░░░░░"
|
||||
"█░░░░░░░"
|
||||
"██░░░░░░"
|
||||
"███░░░░░"
|
||||
"████░░░░"
|
||||
"█████░░░"
|
||||
"██████░░"
|
||||
"<span color='#F07178'>!!!!!!!!</span>"
|
||||
"<span color='#F07178'>CRITICAL</span>"
|
||||
];
|
||||
};
|
||||
|
||||
cpu = {
|
||||
|
||||
interval = 1;
|
||||
format = "CPU: [ <span color='#272D38'>{icon}</span> ] <span size='8pt'>{usage}%</span>";
|
||||
format = " <span color='#aaaaaa'>{usage}%</span>";
|
||||
tooltip = true;
|
||||
format-icons = [
|
||||
"░░░░░░░░"
|
||||
"█░░░░░░░"
|
||||
"██░░░░░░"
|
||||
"███░░░░░"
|
||||
"████░░░░"
|
||||
"█████░░░"
|
||||
"██████░░"
|
||||
"<span color='#272D38'>!!!!!!!!</span>"
|
||||
"<span color='#272D38'>CRITICAL</span>"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
style = ''
|
||||
@define-color accent #CF1B30;
|
||||
@define-color bg-dark #1a1a1a;
|
||||
@define-color bg-island #2a2a2a;
|
||||
@define-color fg-dim #aaaaaa;
|
||||
@define-color fg-text #d0d0d0;
|
||||
|
||||
* {
|
||||
font-size: 14px;
|
||||
font-size: 20px;
|
||||
border: none;
|
||||
font-family: EnvyCodeR Nerd Font Mono;
|
||||
font-weight: Bold;
|
||||
font-weight: bold;
|
||||
min-height: 0;
|
||||
border-radius: 0px;
|
||||
padding: 2px;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
color: #${fg.lightest};
|
||||
background: #${bg.darkester};
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
color: @fg-text;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: #${bg.darkester};
|
||||
background: @bg-dark;
|
||||
border: 2px solid @accent;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
/* ── Tray island (far left) ── */
|
||||
#tray {
|
||||
background-color: @bg-dark;
|
||||
color: @accent;
|
||||
border: 2px solid @accent;
|
||||
border-radius: 8px;
|
||||
padding: 4px 8px;
|
||||
margin: 6px 4px 6px 10px;
|
||||
}
|
||||
|
||||
/* ── Workspaces island ── */
|
||||
#workspaces {
|
||||
background-color: @bg-dark;
|
||||
border: 2px solid @accent;
|
||||
border-radius: 8px;
|
||||
margin: 6px 4px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
color: #${fg.lightest};
|
||||
background: #${bg.darkester};
|
||||
color: @fg-dim;
|
||||
background: transparent;
|
||||
padding: 4px 8px;
|
||||
border-radius: 6px;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color: #${bg.darker};
|
||||
background: #${bg.darkester};
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
color: #${bg.dark};
|
||||
background: #${bg.darkester};
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
color: #${fg.lightest};
|
||||
background: #${bg.darkester};
|
||||
color: @bg-dark;
|
||||
background-color: @accent;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
color: #${fg.lightest};
|
||||
background: #${bg.darkester};
|
||||
color: @bg-dark;
|
||||
background-color: alpha(@accent, 0.5);
|
||||
}
|
||||
|
||||
#window,
|
||||
#clock,
|
||||
/* ── Right info modules island ── */
|
||||
#cpu,
|
||||
#memory,
|
||||
#pulseaudio,
|
||||
#network,
|
||||
#workspaces,
|
||||
#tray,
|
||||
#cpu {
|
||||
padding: 0px 10px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#tray {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
color: #${fg.lightest};
|
||||
}
|
||||
|
||||
#window {
|
||||
color: #${fg.lightest};
|
||||
}
|
||||
|
||||
#window,
|
||||
#clock {
|
||||
color: #${fg.lightest};
|
||||
background-color: @bg-dark;
|
||||
color: @accent;
|
||||
border-top: 2px solid @accent;
|
||||
border-bottom: 2px solid @accent;
|
||||
padding: 4px 10px;
|
||||
margin: 6px 0;
|
||||
}
|
||||
|
||||
#network {
|
||||
color: #${fg.lightest};
|
||||
/* ── Window title island (center) ── */
|
||||
#window {
|
||||
border-radius: 8px;
|
||||
border-left: 2px solid @accent;
|
||||
border-right: 2px solid @accent;
|
||||
margin: 6px 4px;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
color: #${fg.lightest};
|
||||
/* round left edge of first module in the group */
|
||||
#cpu {
|
||||
border-radius: 8px 0 0 8px;
|
||||
border-left: 2px solid @accent;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
/* round right edge of last module before nixicon */
|
||||
#clock {
|
||||
border-radius: 0 8px 8px 0;
|
||||
border-right: 2px solid @accent;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
/* ── NixOS icon island (far right, outlined) ── */
|
||||
#image {
|
||||
background-color: @bg-dark;
|
||||
color: @accent;
|
||||
border: 2px solid @accent;
|
||||
border-radius: 8px;
|
||||
padding: 4px 10px;
|
||||
margin: 6px 10px 6px 4px;
|
||||
}
|
||||
|
||||
@import url("file://${config.home.homeDirectory}/.local/state/sysflake/waybar-colors.css");
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
{ lib, config, self, ... }:
|
||||
{
|
||||
options.movOpts.envConfig.zshConfig.shellAliases.enable = lib.mkEnableOption "enables my zsh aliases";
|
||||
lib,
|
||||
config,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.movOpts.envConfig.zshConfig.shellAliases.enable =
|
||||
lib.mkEnableOption "enables my zsh aliases";
|
||||
config = lib.mkIf config.movOpts.envConfig.zshConfig.shellAliases.enable {
|
||||
programs.zsh = {
|
||||
shellAliases = {
|
||||
@@ -14,25 +20,29 @@
|
||||
gtp = "playshellsound ${self}/assets/sound/rm.wav; gtrash put";
|
||||
sr = "source ~/.zshrc && source ~/.zshenv";
|
||||
".." = "cd ..";
|
||||
rm = "echo 'use \"gtp\" instead'";
|
||||
psg = "ps aux | grep -v grep | grep -i -e VSZ -e";
|
||||
mkdir = "mkdir -p";
|
||||
pk = "pkill -9 -f";
|
||||
svcu = "systemctl --user";
|
||||
svc = "sudo systemctl";
|
||||
viflake = "nvim flake.nix";
|
||||
iv = "invoke";
|
||||
cfgfilecount = ''find ".\.nix" $FLAKEPATH | wc -l | toilet -f 3d | lolcat'';
|
||||
record = "wf-recorder";
|
||||
vide = "neovide";
|
||||
pk9 = "pkill -9";
|
||||
mkexe = "chmod +x";
|
||||
shortdate = "date '+%m-%d-%y'";
|
||||
suvi = "sudoedit";
|
||||
suvide = "EDITOR=neovide; suvi";
|
||||
rustdev = "nix develop github:km-clay/devshells#rust";
|
||||
claude = "RAW_SHELL=1 claude";
|
||||
|
||||
#git
|
||||
ga = "playshellsound ${self}/assets/sound/gitadd.wav; git add";
|
||||
gcomm = "gitcommit_sfx";
|
||||
gpush = "gitpush_sfx";
|
||||
gpull = "gitpull_sfx";
|
||||
greb = "gitrebase_sfx";
|
||||
rsh = "$HOME/Coding/projects/rust/rsh/target/debug/rsh";
|
||||
vide = "neovide";
|
||||
pk9 = "pkill -9";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ lib, config, self, ... }:
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
{
|
||||
options = {
|
||||
movOpts.envConfig.zshConfig.envVariables.enable = lib.mkEnableOption "enables my default session variables";
|
||||
movOpts.envConfig.zshConfig.envVariables.enable =
|
||||
lib.mkEnableOption "enables my default session variables";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.envConfig.zshConfig.envVariables.enable {
|
||||
programs.zsh = {
|
||||
@@ -15,6 +16,7 @@
|
||||
BROWSER = "firefox";
|
||||
FLAKEPATH = "$HOME/.sysflake";
|
||||
STEAMPATH = "$HOME/.local/share/Steam";
|
||||
TFPATH = "$STEAMPATH/steamapps/common/Team Fortress 2/";
|
||||
PATH = "$PATH:$HOME/.userpath/";
|
||||
FZF_DEFAULT_COMMAND = "fd";
|
||||
FZF_DEFAULT_OPTS = "--height 40% --layout=reverse --border";
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{ lib, config, self, pkgs, ... }:
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
self,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
shellsound = "${pkgs.myScripts.playshellsound}/bin/playshellsound";
|
||||
@@ -8,11 +14,39 @@ let
|
||||
in
|
||||
{
|
||||
options = {
|
||||
movOpts.envConfig.zshConfig.extraConfig.enable = lib.mkEnableOption "enables my extra shell configurations";
|
||||
movOpts.envConfig.zshConfig.extraConfig.enable =
|
||||
lib.mkEnableOption "enables my extra shell configurations";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.envConfig.zshConfig.extraConfig.enable {
|
||||
programs.zsh = {
|
||||
initContent = ''
|
||||
claude() {
|
||||
bash -c "claude $@"
|
||||
}
|
||||
logmeds() {
|
||||
date >> "$HOME"/medlog.txt
|
||||
}
|
||||
medlog() {
|
||||
cat "$HOME"/medlog.txt
|
||||
}
|
||||
encrypt() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: encrypt <text> [recipient]"
|
||||
return 1
|
||||
fi
|
||||
if [ -z "$2" ]; then
|
||||
gpg --encrypt --armor -r "$1"
|
||||
else
|
||||
echo "$1" | gpg --encrypt --armor -r "$2"
|
||||
fi
|
||||
}
|
||||
decrypt() {
|
||||
if [ -z "$1" ]; then
|
||||
gpg --decrypt --quiet 2>/dev/null
|
||||
else
|
||||
echo "$1" | gpg --decrypt --quiet
|
||||
fi
|
||||
}
|
||||
build-drv() { # Put the derivation path in $RESULT instead of making a 'result' symlink
|
||||
RESULT=$(nix-build "$@" --no-link)
|
||||
if [ -z "$RESULT" ]; then
|
||||
@@ -21,12 +55,9 @@ in
|
||||
export RESULT
|
||||
echo "\$RESULT = $RESULT"
|
||||
}
|
||||
precmd() { # Reset kitty color scheme
|
||||
if [ "$NIX_SHELL" = "false" ]; then # don't run this in a nix-shell
|
||||
trap 'NIX_SHELL=false kitty_theme' EXIT SIGINT SIGTERM SIGHUP
|
||||
else # but still apply ssh theme logic in nix-shell
|
||||
trap 'kitty_theme' EXIT SIGINT SIGTERM SIGHUP
|
||||
fi
|
||||
escaped() {
|
||||
# escapes regex chars
|
||||
sed 's/[^^]/[&]/g; s/\^/\\^/g' <<<"$1"
|
||||
}
|
||||
nix-shell() {
|
||||
NIX_SHELL=true command nix-shell "$@" --run zsh
|
||||
@@ -34,6 +65,18 @@ in
|
||||
nsp() {
|
||||
NIX_SHELL=true command nix-shell -p "$@" --run zsh
|
||||
}
|
||||
viflake() {
|
||||
(
|
||||
while ! [ -f ./flake.nix ]; do
|
||||
builtin cd ..
|
||||
if [ "$PWD" = "/" ]; then
|
||||
echo "No flake.nix found in this directory, or any parent directories."
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
nvim ./flake.nix
|
||||
)
|
||||
}
|
||||
nvim() {
|
||||
${shellsound} ${sndpath}/nvim.wav
|
||||
command nvim "$@"
|
||||
@@ -43,17 +86,6 @@ in
|
||||
command neovide "$@"
|
||||
}
|
||||
alias vi="nvim"
|
||||
kitty_theme() {
|
||||
if [ $TERM = "xterm-kitty" ]; then
|
||||
if [ -n "$SSH_CONNECTION" ]; then
|
||||
kitty @ set-colors -a ~/.config/kitty/ssh-theme.conf
|
||||
elif [ "$name" = "nix-shell-env" ] || [ "$NIX_SHELL" = "true" ]; then
|
||||
kitty @ set-colors -a ~/.config/kitty/nix-shell-theme.conf
|
||||
else
|
||||
kitty @ set-colors -a ~/.config/kitty/default-theme.conf
|
||||
fi
|
||||
fi
|
||||
}
|
||||
grimblast() {
|
||||
if command grimblast "$@"; then
|
||||
${shellsound} ${sndpath}/screenshot.wav
|
||||
@@ -109,6 +141,7 @@ in
|
||||
}
|
||||
unalias ls
|
||||
ls() {
|
||||
if [ "$RAW_SHELL" = "1" ]; then command ls; fi
|
||||
eza -1 --group-directories-first --icons "$@"
|
||||
${shellsound} ${sndpath}/ls.wav
|
||||
return 0
|
||||
@@ -128,14 +161,16 @@ in
|
||||
}
|
||||
|
||||
cd() {
|
||||
if [ "$RAW_SHELL" = "1" ]; then builtin cd "$@"; return $?; fi
|
||||
local prev_sounds_enabled="$SOUNDS_ENABLED"
|
||||
SOUNDS_ENABLED=0
|
||||
eza -1 --group-directories-first --icons "$@"
|
||||
SOUNDS_ENABLED=$prev_sounds_enabled
|
||||
builtin cd "$@"
|
||||
${shellsound} /nix/store/7a9w7np3qrvmzxjbs7xj05qq2yccgfsj-source/assets/sound/cd.wav
|
||||
${shellsound} ${sndpath}/cd.wav
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ ! -e $HOME/.zsh_history ]; then
|
||||
touch $HOME/.zsh_history
|
||||
chmod 600 $HOME/.zsh_history
|
||||
@@ -179,13 +214,12 @@ in
|
||||
source ${fzf-tab}/fzf-tab.plugin.zsh
|
||||
|
||||
bindkey -v
|
||||
kitty_theme
|
||||
type starship_zle-keymap-select >/dev/null || \
|
||||
{
|
||||
eval "$(starship init zsh)"
|
||||
}
|
||||
${shellsound} ${sndpath}/sh-source.wav
|
||||
[ ! -f $FLAKEPATH/flake.nix ] && echo "WARNING: flake.nix not found at \$FLAKEPATH. Shell aliases for editing config files won't work correctly!" && echo "Edit the FLAKEPATH session variable in zshell.nix to point to the path where you saved the system configuration flake."
|
||||
[ ! -f $FLAKEPATH/flake.nix ] && echo "WARNING: flake.nix not found at \$FLAKEPATH. Shell aliases for editing config files won't work correctly!" && echo "Edit the FLAKEPATH session variable in zsh/env.nix to point to the path where you saved the system configuration flake."
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
{
|
||||
options = {
|
||||
movOpts.envConfig.zshConfig.shellOptions.enable = lib.mkEnableOption "enables my default shell settings";
|
||||
movOpts.envConfig.zshConfig.shellOptions.enable =
|
||||
lib.mkEnableOption "enables my default shell settings";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.envConfig.zshConfig.shellOptions.enable {
|
||||
programs.zoxide = {
|
||||
|
||||
@@ -1,17 +1,26 @@
|
||||
{ pkgs, lib, self, config, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
# This folder is for programs that do not have existing configuration modules in NixOS.
|
||||
# Basically a to-do list for stuff I need to write my own modules for.
|
||||
let
|
||||
# Extract color scheme from base_16 yaml file
|
||||
extractSchemeFromYaml = base16_scheme: let
|
||||
extractSchemeFromYaml =
|
||||
base16_scheme:
|
||||
let
|
||||
scheme_path = "${pkgs.base16-schemes}/share/themes/${base16_scheme}.yaml";
|
||||
scheme_string = builtins.readFile scheme_path;
|
||||
scheme_list = lib.splitString "\n" scheme_string; # Split into a list
|
||||
colors =
|
||||
lib.filter (line: builtins.match "^ *base[0-9A-F]{2}: .*" line != null) # Get raw hex values from scheme list
|
||||
scheme_list;
|
||||
parsed_scheme = lib.lists.foldl' (acc: line: # Initialize attribute set and begin folding values into it
|
||||
parsed_scheme = lib.lists.foldl' (
|
||||
acc: line: # Initialize attribute set and begin folding values into it
|
||||
let
|
||||
splitLine = lib.splitString ": " line; # Split into keys (base00, base01, etc.) and values
|
||||
key = builtins.elemAt splitLine 0;
|
||||
@@ -19,26 +28,28 @@ let
|
||||
trimmedKey = lib.trim key; # Start cleaning values
|
||||
cleanValue_step1 = lib.splitString " " value;
|
||||
cleanValue_step2 = builtins.elemAt cleanValue_step1 0; # Get just the hex value, ignore comments etc.
|
||||
cleanValue_final =
|
||||
builtins.substring 1 (builtins.stringLength cleanValue_step2 - 2)
|
||||
cleanValue_step2;
|
||||
in acc // { "${trimmedKey}" = cleanValue_final; }) { } colors; # Accumulate keys/values into attribute set
|
||||
in parsed_scheme; # Return parsed color scheme
|
||||
cleanValue_final = builtins.substring 1 (
|
||||
builtins.stringLength cleanValue_step2 - 2
|
||||
) cleanValue_step2;
|
||||
in
|
||||
acc // { "${trimmedKey}" = cleanValue_final; }
|
||||
) { } colors; # Accumulate keys/values into attribute set
|
||||
in
|
||||
parsed_scheme; # Return parsed color scheme
|
||||
|
||||
ssh_scheme = extractSchemeFromYaml "atelier-cave";
|
||||
nix-shell_scheme = extractSchemeFromYaml "blueish";
|
||||
def_scheme = config.lib.stylix.colors;
|
||||
|
||||
|
||||
# Custom theme for nix-shell
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
movOpts.homeFiles.enable =
|
||||
lib.mkEnableOption "enables declared custom files";
|
||||
movOpts.homeFiles.enable = lib.mkEnableOption "enables declared custom files";
|
||||
};
|
||||
config = {
|
||||
home.file = {
|
||||
".config/neofetch/config.conf".text = ''
|
||||
".config/fastfetch/config.conf".text = ''
|
||||
username=$(whoami)
|
||||
name_length=''${#username}
|
||||
total_width=40
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, config, ... }: {
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options = {
|
||||
movOpts.programConfigs.autojumpConfig.enable =
|
||||
lib.mkEnableOption "enables my autojump options";
|
||||
movOpts.programConfigs.autojumpConfig.enable = lib.mkEnableOption "enables my autojump options";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.programConfigs.autojumpConfig.enable {
|
||||
programs.autojump = {
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
{ lib, config, inputs, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
movOpts.programConfigs.batConfig.enable =
|
||||
lib.mkEnableOption "enables my bat options";
|
||||
movOpts.programConfigs.batConfig.enable = lib.mkEnableOption "enables my bat options";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.programConfigs.batConfig.enable {
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
config = { pager = "less -FR"; };
|
||||
config = {
|
||||
pager = "less -FR";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
{ lib, config, pkgs, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
movOpts.programConfigs.btopConfig.enable =
|
||||
lib.mkEnableOption "enables my btop config";
|
||||
movOpts.programConfigs.btopConfig.enable = lib.mkEnableOption "enables my btop config";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.programConfigs.btopConfig.enable {
|
||||
programs.btop = {
|
||||
@@ -10,8 +15,7 @@
|
||||
settings = {
|
||||
update_ms = 500;
|
||||
vim_keys = true;
|
||||
color_theme = "nord";
|
||||
theme_background = true;
|
||||
color_theme = "TTY";
|
||||
temp_scale = "fahrenheit";
|
||||
graph_symbol = "block";
|
||||
disks_filter = "exclude=/boot /";
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{ lib, config, inputs, pkgs, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
movOpts.programConfigs.cavaConfig.enable =
|
||||
lib.mkEnableOption "enables my cava settings";
|
||||
movOpts.programConfigs.cavaConfig.enable = lib.mkEnableOption "enables my cava settings";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.programConfigs.cavaConfig.enable {
|
||||
programs.cava = { enable = true; };
|
||||
programs.cava = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +1,27 @@
|
||||
{ env, host, nixvim, self, inputs, username, config, home-manager, ... }: {
|
||||
imports = [ (import ./btop.nix) ] ++ [ (import ./yazi.nix) ]
|
||||
++ [ (import ./kitty.nix) ] ++ [ (import ./fuzzel.nix) ]
|
||||
++ [ (import ./eza.nix) ] ++ [ (import ./cava.nix) ]
|
||||
++ [ (import ./bat.nix) ] ++ [ (import ./fzf.nix) ]
|
||||
++ [ (import ./git.nix) ] ++ [ (import ./password-store.nix) ]
|
||||
++ [ (import ./autojump.nix) ] ++ [ (import ./nixvim) ];
|
||||
{
|
||||
env,
|
||||
host,
|
||||
nixvim,
|
||||
self,
|
||||
inputs,
|
||||
username,
|
||||
config,
|
||||
home-manager,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(import ./btop.nix)
|
||||
]
|
||||
++ [ (import ./yazi.nix) ]
|
||||
++ [ (import ./kitty.nix) ]
|
||||
++ [ (import ./fuzzel.nix) ]
|
||||
++ [ (import ./eza.nix) ]
|
||||
++ [ (import ./cava.nix) ]
|
||||
++ [ (import ./bat.nix) ]
|
||||
++ [ (import ./fzf.nix) ]
|
||||
++ [ (import ./git.nix) ]
|
||||
++ [ (import ./password-store.nix) ]
|
||||
++ [ (import ./autojump.nix) ]
|
||||
++ [ (import ./nixvim) ];
|
||||
}
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
{ lib, config, ... }: {
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options = {
|
||||
movOpts.programConfigs.ezaConfig.enable =
|
||||
lib.mkEnableOption "enables my eza options";
|
||||
movOpts.programConfigs.ezaConfig.enable = lib.mkEnableOption "enables my eza options";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.programConfigs.ezaConfig.enable {
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
enableZshIntegration = false;
|
||||
extraOptions = [ "-1" "-h" "--group-directories-first" ];
|
||||
extraOptions = [
|
||||
"-1"
|
||||
"-h"
|
||||
"--group-directories-first"
|
||||
];
|
||||
icons = "auto";
|
||||
git = true;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, lib, ... }: {
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
options = {
|
||||
movOpts.programConfigs.fuzzelConfig.enable =
|
||||
lib.mkEnableOption "enables my fuzzel configuration";
|
||||
movOpts.programConfigs.fuzzelConfig.enable = lib.mkEnableOption "enables my fuzzel configuration";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.programConfigs.fuzzelConfig.enable {
|
||||
programs.fuzzel = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ lib, config, ... }: {
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options = {
|
||||
movOpts.programConfigs.fzfConfig.enable =
|
||||
lib.mkEnableOption "enables my fzf options";
|
||||
movOpts.programConfigs.fzfConfig.enable = lib.mkEnableOption "enables my fzf options";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.programConfigs.fzfConfig.enable {
|
||||
programs.fzf = {
|
||||
|
||||
@@ -1,14 +1,30 @@
|
||||
{ lib, config, username, pkgs, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
username,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
movOpts.programConfigs.gitConfig.enable =
|
||||
lib.mkEnableOption "enables my git configuration";
|
||||
movOpts.programConfigs.gitConfig.enable = lib.mkEnableOption "enables my git configuration";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.programConfigs.gitConfig.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userEmail = "kylerclay@proton.me";
|
||||
userName = "${username}";
|
||||
extraConfig = {
|
||||
settings = {
|
||||
user = {
|
||||
email = "kylerclay@proton.me";
|
||||
name = "${username}";
|
||||
};
|
||||
alias = {
|
||||
draft = "!if git rev-parse > /dev/null 2>&1; then echo \"$1\" >> $(git rev-parse --git-dir)/DRAFT_MSG; else exit 1; fi #";
|
||||
};
|
||||
safe = {
|
||||
directory = [
|
||||
"${config.home.homeDirectory}/mnt/net"
|
||||
];
|
||||
};
|
||||
core.pager = "delta";
|
||||
interactive.diffFilter = "delta --color-only";
|
||||
delta.navigate = "true";
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
{ lib, config, pkgs, ... }: {
|
||||
{
|
||||
self,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
movOpts.programConfigs.kittyConfig.enable =
|
||||
lib.mkEnableOption "enables my kitty configuration";
|
||||
movOpts.programConfigs.kittyConfig.enable = lib.mkEnableOption "enables my kitty configuration";
|
||||
};
|
||||
config = lib.mkIf config.movOpts.programConfigs.kittyConfig.enable {
|
||||
programs.kitty = {
|
||||
@@ -9,16 +15,18 @@
|
||||
font = {
|
||||
package = lib.mkForce pkgs.nerd-fonts.envy-code-r;
|
||||
name = lib.mkForce "EnvyCodeR Nerd Font Mono";
|
||||
size = lib.mkForce 20;
|
||||
size = lib.mkForce 19;
|
||||
};
|
||||
|
||||
settings = {
|
||||
confirm_os_window_close = 0;
|
||||
background_opacity = lib.mkForce 0.65;
|
||||
window_padding_width = 4;
|
||||
scrollback_lines = 10000;
|
||||
enable_audio_bell = false;
|
||||
enable_audio_bell = true;
|
||||
allow_remote_control = true;
|
||||
mouse_hide_wait = 60;
|
||||
command_on_bell = "${pkgs.myScripts.playshellsound}/bin/playshellsound ${self}/assets/sound/bell.wav";
|
||||
|
||||
## Tabs
|
||||
tab_title_template = "{index}";
|
||||
@@ -29,6 +37,8 @@
|
||||
tab_powerline_style = "round";
|
||||
};
|
||||
|
||||
extraConfig = "include ~/.local/state/sysflake/kitty-colors.conf";
|
||||
|
||||
keybindings = {
|
||||
"ctrl+shift+l" = "next_tab";
|
||||
"ctrl+shift+h" = "previous_tab";
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
{ pkgs, self, ... }: {
|
||||
{ pkgs, self, ... }:
|
||||
{
|
||||
programs.nixvim = {
|
||||
autoCmd = [
|
||||
{
|
||||
command = "silent! mkview";
|
||||
event = [ "BufWinLeave" ];
|
||||
pattern = [ "*" ];
|
||||
desc =
|
||||
"Save session window settings to be loaded next time the file is opened";
|
||||
desc = "Save session window settings to be loaded next time the file is opened";
|
||||
}
|
||||
{
|
||||
command = "silent! loadview";
|
||||
event = [ "BufWinEnter" ];
|
||||
pattern = [ "*" ];
|
||||
desc =
|
||||
"Load previous session window settings for the opened file (folds, cursor pos, etc)";
|
||||
desc = "Load previous session window settings for the opened file (folds, cursor pos, etc)";
|
||||
}
|
||||
{
|
||||
command = "silent! FloatermNew --name=def_term --width=0.8 --height=0.8 --wintype=topright --silent";
|
||||
@@ -21,6 +20,31 @@
|
||||
pattern = [ "*" ];
|
||||
desc = "Start the floaterm window";
|
||||
}
|
||||
{
|
||||
pattern = [ "qf" ];
|
||||
event = [ "FileType" ];
|
||||
callback = {
|
||||
__raw = /* lua */ ''
|
||||
function()
|
||||
vim.keymap.set("n", "<CR>", "<CR>", { buffer = true })
|
||||
end'';
|
||||
};
|
||||
}
|
||||
{
|
||||
pattern = [ "nix" ];
|
||||
event = [ "FileType" ];
|
||||
callback = {
|
||||
__raw = /* lua */ ''
|
||||
function()
|
||||
require("otter").activate(
|
||||
{ "bash", "lua", "python" },
|
||||
true, -- completions
|
||||
true, -- diagnostics
|
||||
nil
|
||||
)
|
||||
end'';
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
{ env, config, pkgs, host, self, ... }: {
|
||||
programs.nixvim.extraPackages = [
|
||||
pkgs.cargo
|
||||
pkgs.rustc
|
||||
pkgs.rustup
|
||||
pkgs.rust-analyzer
|
||||
{
|
||||
env,
|
||||
config,
|
||||
pkgs,
|
||||
host,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
{
|
||||
programs.nixvim = {
|
||||
nixpkgs.useGlobalPackages = true;
|
||||
};
|
||||
imports = [
|
||||
./plugins
|
||||
./options.nix
|
||||
./keymaps.nix
|
||||
./autocmd.nix
|
||||
];
|
||||
imports = [ ./plugins ./options.nix ./keymaps.nix ./autocmd.nix ];
|
||||
}
|
||||
|
||||
@@ -36,6 +36,11 @@
|
||||
key = "<S-Tab>";
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = "zA";
|
||||
key = "<CR>";
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = "<C-w>w";
|
||||
key = "<Tab>";
|
||||
@@ -44,12 +49,145 @@
|
||||
{
|
||||
action = "<cmd>FloatermToggle def_term<CR>";
|
||||
key = "<F2>";
|
||||
mode = [ "n" "t" ];
|
||||
mode = [
|
||||
"n"
|
||||
"t"
|
||||
];
|
||||
}
|
||||
{
|
||||
action = "<cmd>COQnow<CR>";
|
||||
key = "!cq";
|
||||
mode = "n";
|
||||
action = "<cmd>lua require('treesj').toggle()<CR>";
|
||||
key = "<space>j";
|
||||
mode = [ "n" ];
|
||||
}
|
||||
{
|
||||
action = "<C-\\><C-n>";
|
||||
key = "<C-e>";
|
||||
mode = [ "t" ];
|
||||
}
|
||||
{
|
||||
action = ''"+y'';
|
||||
key = "<space>y";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action = ''"+p'';
|
||||
key = "<space>p";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ "function() require('opencode').prompt('test', {submit=true}) end";
|
||||
key = "<space>at";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ "function() require('opencode').select() end";
|
||||
key = "<space>as";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ "function() require('opencode').prompt('document', {submit=true}) end";
|
||||
key = "<space>ad";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ "function() require('opencode').prompt('review', {submit=true}) end";
|
||||
key = "<space>ar";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ "function() require('opencode').prompt('fix', {submit=true}) end";
|
||||
key = "<space>af";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ ''function() require('opencode').ask("@this ", {submit=true}) end'';
|
||||
key = "<space>aa";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ ''function() require('opencode').explain("@this ") end'';
|
||||
key = "<space>ae";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ ''function() require('opencode').command("session.half.page.up") end'';
|
||||
key = "<C-S-u>";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ ''function() require('opencode').command("session.half.page.down") end'';
|
||||
key = "<C-S-d>";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ ''function() require('opencode').command("prompt.clear") end'';
|
||||
key = "<C-c>";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ ''function() require('opencode').operator("@this ") end'';
|
||||
key = "go";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
{
|
||||
action.__raw = /* lua */ ''function() return require('opencode').operator("@this ") .. "_" end'';
|
||||
key = "goo";
|
||||
mode = [ "n" ];
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require('opencode').toggle()<CR>";
|
||||
key = "<C-.>";
|
||||
mode = [
|
||||
"n"
|
||||
"t"
|
||||
];
|
||||
}
|
||||
{
|
||||
action = "<cmd>lua require('opencode').select()<CR>";
|
||||
key = "<C-n>";
|
||||
mode = [
|
||||
"n"
|
||||
"x"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
{ config, ... }:
|
||||
|
||||
let scheme = config.lib.stylix.colors;
|
||||
in {
|
||||
let
|
||||
scheme = config.lib.stylix.colors;
|
||||
in
|
||||
{
|
||||
programs.nixvim = {
|
||||
colorschemes.base16 = {
|
||||
enable = true;
|
||||
colorscheme = "chalk";
|
||||
colorscheme = "seti";
|
||||
#colorscheme = {
|
||||
# base00 = "#${scheme.base00}";
|
||||
# base01 = "#${scheme.base01}";
|
||||
@@ -30,7 +32,12 @@ in {
|
||||
virtual_text = true;
|
||||
signs = false;
|
||||
};
|
||||
extraConfigLua = ''
|
||||
extraConfigLua = /* lua */ ''
|
||||
local theme_file = vim.fn.expand("~/.local/state/sysflake/nvim-colors.lua")
|
||||
if vim.fn.filereadable(theme_file) == 1 then
|
||||
dofile(theme_file)
|
||||
end
|
||||
|
||||
if vim.g.started_by_firenvim == true then
|
||||
vim.o.laststatus = 0
|
||||
end
|
||||
@@ -41,7 +48,14 @@ in {
|
||||
|
||||
vim.g.vimwiki_list = {{path = '~/vimwiki/', syntax = 'markdown', ext = '.md'}}
|
||||
|
||||
vim.filetype.add({
|
||||
filename = {
|
||||
[".shedrc"] = "sh",
|
||||
}
|
||||
})
|
||||
|
||||
vim.opt.number = true
|
||||
vim.opt.autochdir = false
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.incsearch = true
|
||||
@@ -50,16 +64,26 @@ in {
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.ruler = true
|
||||
vim.opt.scrolloff = 6
|
||||
vim.opt.foldlevelstart = 99
|
||||
vim.opt.undofile = true
|
||||
vim.opt.foldmethod = "manual"
|
||||
vim.opt.wrap = true
|
||||
vim.opt.linebreak = true
|
||||
vim.opt.textwidth = 0
|
||||
vim.opt.breakat = " \t!@*-+;:,./?"
|
||||
vim.opt.guifont = "Fira Code:h18"
|
||||
vim.opt.guifont = "EnvyCodeR Nerd Font Mono:h18"
|
||||
|
||||
vim.g.mapleader = "!"
|
||||
vim.g.mapleader = " "
|
||||
vim.g.rust_recommended_style = 0
|
||||
|
||||
vim.treesitter.query.set("nix", "injections", [[
|
||||
;; extends
|
||||
((comment) @injection.language
|
||||
.
|
||||
(indented_string_expression
|
||||
(string_fragment) @injection.content)
|
||||
(#gsub! @injection.language "^%s*/%*%s*(%S+)%s*%*/.*$" "%1"))
|
||||
]])
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
0
modules/home/programs/nixvim/plugins/alpha.nix
Executable file → Normal file
4
modules/home/programs/nixvim/plugins/barbar.nix
Executable file → Normal file
@@ -2,7 +2,9 @@
|
||||
programs.nixvim = {
|
||||
plugins.barbar = {
|
||||
enable = false;
|
||||
settings = { auto_hide = 1; };
|
||||
settings = {
|
||||
auto_hide = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||