Skip to content

Commit

Permalink
Merge pull request #83 from sbulav/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
sbulav authored May 8, 2024
2 parents cfbe0c4 + 89b5218 commit fd07793
Show file tree
Hide file tree
Showing 38 changed files with 576 additions and 355 deletions.
305 changes: 208 additions & 97 deletions nix/flake.lock

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
url = "github:homebrew/homebrew-cask";
flake = false;
};
hypridle = {
url = "github:hyprwm/Hypridle";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprlock = {
url = "github:hyprwm/Hyprlock";
inputs.nixpkgs.follows = "nixpkgs";
Expand All @@ -37,6 +33,10 @@
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprpaper = {
url = "github:hyprwm/hyprpaper";
inputs.nixpkgs.follows = "nixpkgs";
};

# Home manager
home-manager = {
Expand All @@ -48,6 +48,10 @@
url = "github:kamadorueda/alejandra/3.0.0";
inputs.nixpkgs.follows = "nixpkgs";
};

wallpapers-nix = {
url = "github:sbulav/wallpapers-nix";
};
};

outputs = inputs: let
Expand Down Expand Up @@ -76,7 +80,5 @@
overlays = with inputs; [];

systems.modules.nixos = with inputs; [];

templates = import ./templates {};
};
}
4 changes: 3 additions & 1 deletion nix/homes/aarch64-darwin/sab@mbp13/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ with lib.custom; {
};

cli-apps = {
home-manager = enabled;
argocd = enabled;
atuin = enabled;
bottom = enabled;
home-manager = enabled;
neovim = enabled;
yazi = enabled;
};
Expand Down
17 changes: 11 additions & 6 deletions nix/homes/x86_64-linux/sab@nz/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
lib,
pkgs,
config,
osConfig ? {},
format ? "unknown",
inputs,
pkgs,
...
}:
with lib.custom; {
with lib.custom; let
wallpapers = inputs.wallpapers-nix.packages.${pkgs.system}.catppuccin;
in {
custom = {
user = {
enable = true;
Expand All @@ -26,14 +27,17 @@ with lib.custom; {
wlogout = enabled;
hyprlock = disabled;
wezterm = enabled;
wallpaper = "${wallpapers}/share/wallpapers/catppuccin/bench.png";
};
};

cli-apps = {
argocd = enabled;
atuin = enabled;
yazi = enabled;
home-manager = enabled;
bottom = enabled;
fastfetch = enabled;
home-manager = enabled;
yazi = enabled;
};
tools = {
gh = enabled;
Expand All @@ -45,4 +49,5 @@ with lib.custom; {
vault = enabled;
};
};
home.stateVersion = "23.11";
}
2 changes: 1 addition & 1 deletion nix/modules/darwin/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in {
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
deploy-rs
nixfmt
nixfmt-rfc-style
nix-index
nix-prefetch-git
nvd
Expand Down
1 change: 1 addition & 0 deletions nix/modules/darwin/tools/homebrew/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ in {
casks = [
"raycast"
"vlc"
"xnviewmp"
];

# taps = [
Expand Down
2 changes: 1 addition & 1 deletion nix/modules/darwin/tools/lsp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ in {
environment.systemPackages = with pkgs; [
lua-language-server # LSP for lua
marksman # LSP for markdown
rnix-lsp # LSP for nix
nil # LSP for nix
tree-sitter
yamllint
nodejs_21 # Note for LSP servers
Expand Down
20 changes: 20 additions & 0 deletions nix/modules/home/cli-apps/argocd/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;

cfg = config.custom.cli-apps.argocd;
in {
options.custom.cli-apps.argocd = {
enable = mkEnableOption "argocd";
};

config = mkIf cfg.enable {
home.packages = with pkgs; [
argocd
];
};
}
20 changes: 20 additions & 0 deletions nix/modules/home/cli-apps/bottom/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;

cfg = config.custom.cli-apps.bottom;
in {
options.custom.cli-apps.bottom = {
enable = mkEnableOption "bottom";
};

config = mkIf cfg.enable {
home = {
packages = with pkgs; [bottom];
};
};
}
310 changes: 155 additions & 155 deletions nix/modules/home/cli-apps/yazi/configs/keymap.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion nix/modules/home/cli-apps/yazi/configs/theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ separator_style = { fg = "#5b6078" }

[help]
on = { fg = "#f5bde6" }
exec = { fg = "#8bd5ca" }
run = { fg = "#8bd5ca" }
desc = { fg = "#939ab7" }
hovered = { bg = "#5b6078", bold = true }
footer = { fg = "#494d64", bg = "#cad3f5" }
Expand Down
52 changes: 26 additions & 26 deletions nix/modules/home/desktop/addons/hypridle/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
inputs,
options,
config,
lib,
pkgs,
Expand All @@ -9,39 +7,41 @@
with lib;
with lib.custom; let
cfg = config.custom.desktop.addons.hypridle;
inherit (inputs) hypridle;
in {
imports = [hypridle.homeManagerModules.default];

options.custom.desktop.addons.hypridle = with types; {
enable = mkBoolOpt false "Whether to enable the hypridle";
options.custom.desktop.addons.hypridle = {
enable = mkBoolOpt false "Whether to enable hypridle in the desktop environment.";
};

config = mkIf cfg.enable {
services.hypridle = {
enable = true;
# package = pkgs.hypridle;

lockCmd = "${pkgs.swaylock-effects}/bin/swaylock -fF";
afterSleepCmd = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms on";
settings = {
general = {
lock_cmd = "${pkgs.swaylock-effects}/bin/swaylock -fF";
ignore_dbus_inhibit = false;
after_sleep_cmd = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms on";
};

# 5 min lock, 10min turn the screen off, 20 min suspend
listeners = [
{
timeout = 300;
onTimeout = "${pkgs.swaylock-effects}/bin/swaylock -fF";
}
{
timeout = 600;
onTimeout = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms off";
onResume = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms on";
}
{
timeout = 1200;
onTimeout = "${pkgs.systemd}/bin/systemctl suspend";
onResume = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms on";
}
];
# 5 min lock, 10min turn the screen off, 20 min suspend
listener = [
{
timeout = 300;
on-timeout = "${pkgs.swaylock-effects}/bin/swaylock -fF";
}
{
timeout = 600;
on-timeout = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms off";
on-resume = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms on";
}
{
timeout = 1200;
on-timeout = "${pkgs.systemd}/bin/systemctl suspend";
on-resume = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms on";
}
];
};
};
};
}
4 changes: 1 addition & 3 deletions nix/modules/home/desktop/addons/hyprlock/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
inputs,
options,
config,
lib,
pkgs,
...
}:
with lib;
Expand Down Expand Up @@ -43,7 +41,7 @@ in {

backgrounds = [
{
path = "/home/sab/Pictures/wallpaper.png";
path = config.custom.desktop.addons.wallpaper;
}
];
};
Expand Down
31 changes: 9 additions & 22 deletions nix/modules/home/desktop/addons/hyprpaper/default.nix
Original file line number Diff line number Diff line change
@@ -1,40 +1,27 @@
{
options,
inputs,
config,
lib,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.custom.desktop.addons.hyprpaper;
wallpaper = /home/sab/Pictures/cityscape2.jpg;
inherit (inputs) hyprpaper;
wallpaper = config.custom.desktop.addons.wallpaper;
in {
imports = [hyprpaper.homeManagerModules.default];
options.custom.desktop.addons.hyprpaper = with types; {
enable = mkBoolOpt false "Whether to enable the hyprpaper config";
};

config = mkIf cfg.enable {
xdg.configFile = {
"hypr/hyprpaper.conf".text = ''
preload = ${wallpaper}
wallpaper = eDP-1,${wallpaper}
wallpaper = DP-1,${wallpaper}
wallpaper = DP-2,${wallpaper}
'';
};
systemd.user.services.hyprpaper = {
Install.WantedBy = ["hyprland-session.target"];

Unit = {
Description = "Hyprpaper Service";
PartOf = ["graphical-session.target"];
};
services.hyprpaper = {
enable = true;

Service = {
ExecStart = "${getExe pkgs.hyprpaper}";
Restart = "always";
};
preloads = [wallpaper];
wallpapers = [", ${wallpaper}"];
ipc = false;
};
};
}
10 changes: 5 additions & 5 deletions nix/modules/home/desktop/addons/rofi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ in {
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland;
plugins = with pkgs; [
rofi-calc
];
# plugins = with pkgs; [
# rofi-calc
# ];
extraConfig = {
combi-hide-mode-prefix = true;
combi-modi = "drun,run,calc";
combi-modi = "drun,run";
disable-history = false;
display-Network = " 󰤨 Network";
display-drun = "  Apps ";
Expand All @@ -37,7 +37,7 @@ in {
drun-display-format = "{icon} {name}";
icon-theme = "Fluent";
location = 0;
modi = "run,drun,vpn:~/.config/rofi/rofi-vpn.sh,clip:~/.config/rofi/rofi-cliphist.sh,calc,";
modi = "run,drun,vpn:~/.config/rofi/rofi-vpn.sh,clip:~/.config/rofi/rofi-cliphist.sh,";
show-icons = true;
sidebar-mode = true;
sorting-method = "fzf";
Expand Down
2 changes: 1 addition & 1 deletion nix/modules/home/desktop/addons/swaylock/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ in {
enable = true;
package = pkgs.swaylock-effects;
settings = {
image = "$HOME/Pictures/wallpaper.png";
image = config.custom.desktop.addons.wallpaper;
color = "000000ff";
font-size = "24";
indicator-idle-visible = true;
Expand Down
17 changes: 17 additions & 0 deletions nix/modules/home/desktop/addons/wallpaper/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
inputs,
pkgs,
config,
lib,
...
}:
with lib;
with lib.custom; let
# cfg = config.system.wallpaper;
in {
options.custom.desktop.addons.wallpaper = mkOption {
type = types.oneOf [types.package types.path types.str];
default = inputs.wallpapers-nix.packages.${pkgs.system}.catppuccin;
description = "The wallpaper to use.";
};
}
8 changes: 7 additions & 1 deletion nix/modules/home/desktop/addons/wezterm/wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ if wezterm.config_builder then
config = wezterm.config_builder()
end

-- Disable wayland until this issue is fixed
-- https://github.com/wez/wezterm/issues/5197
config.enable_wayland = false

-- Fonts
-- {{{
config.adjust_window_size_when_changing_font_size = false
Expand All @@ -20,7 +24,9 @@ if wezterm.target_triple == "aarch64-apple-darwin" then
config.font_size = 18
-- Linux Setup
else
config.font_size = 14
-- Until issue with wayland is fixed
-- config.font_size = 14
config.font_size = 18
end
-- }}}
-- Windows
Expand Down
Loading

0 comments on commit fd07793

Please sign in to comment.