Skip to content

Commit

Permalink
updated locks and modules
Browse files Browse the repository at this point in the history
- Updated wayper module to new project module
- Integrated agenix
- updated taskwarrior to use encrypted secrets
  • Loading branch information
luqmanishere committed Mar 18, 2024
1 parent a9c0987 commit a991319
Show file tree
Hide file tree
Showing 18 changed files with 997 additions and 550 deletions.
1,157 changes: 783 additions & 374 deletions flake.lock

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,23 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs";

hyprland = {
url = "github:hyprwm/Hyprland/v0.35.0";
url = "github:hyprwm/Hyprland/v0.37.1";
inputs.nixpkgs.follows = "nixpkgs"; # MESA/OpenGL HW workaround
};
hypridle = {
url = "github:hyprwm/hypridle/4395339a2dc410bcf49f3e24f9ed3024fdb25b0a";
};
hyprlock = {
url = "github:hyprwm/hyprlock/2ae79757d5e5c48de2f4284992a6bfa265853a2d";
};

wayper.url = "github:luqmanishere/wayper";
anyrun.url = "github:Kirottu/anyrun";
anyrun.inputs.nixpkgs.follows = "nixpkgs";
xremap-flake.url = "github:xremap/nix-flake";
ags.url = "github:Aylur/ags";

homeage.url = "github:jordanisaacs/homeage";
homeage.inputs.nixpkgs.follows = "nixpkgs";

wayper.url = "github:luqmanishere/wayper";
agenix.url = "github:ryantm/agenix";

nix-doom-emacs.url = "github:nix-community/nix-doom-emacs";
emacs-overlay.url = "github:nix-community/emacs-overlay";
Expand Down
2 changes: 1 addition & 1 deletion home-manager/graphical.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ in {
libreoffice
logseq

# prismlauncher
prismlauncher
#inputs.prismlauncher.packages.${pkgs.system}.prismlauncher
#osu-lazer
gamescope
Expand Down
46 changes: 21 additions & 25 deletions home-manager/hyprland.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
{
inputs,
outputs,
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.hyprland;
lock = "${pkgs.swaylock-effects}/bin/swaylock -f --clock --indicator --indicator-idle-visible --fade-in 1 -c 000000";
screenoff = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off";
screenon = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on";
lockscreenoff = "${pkgs.procps}/bin/pgrep swaylock && ${pkgs.hyprland}/bin/hyprctl dispatch dpms off";
lockscreenon = "${pkgs.procps}/bin/pgrep swaylock && ${pkgs.hyprland}/bin/hyprctl dispatch dpms on";
in {
imports = [
inputs.hyprland.homeManagerModules.default
inputs.hypridle.homeManagerModules.default
inputs.hyprlock.homeManagerModules.default
./waybar.nix
./wayper.nix
];

options.hyprland = {
Expand Down Expand Up @@ -55,35 +50,36 @@ in {
# package = pkgs.hyprland-hidpi;
};

services.swayidle = {
programs.hyprlock = {
enable = true;
systemdTarget = "hyprland-session.target";

events = [
{
event = "before-sleep";
command = "${lock}";
}
general = {
disable_loading_bar = false;
};
backgrounds = [
{
event = "lock";
command = "${lock}";
path = "/home/luqman/wallpapers/notseiso/horizontal/suisei-member-july.png";
}
];
};

timeouts = [
services.hypridle = {
enable = true;
lockCmd = "${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock";
listeners = [
# turn off screen after 5 minutes
{
timeout = 360;
command = "${lock}";
timeout = 300;
onTimeout = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off";
onResume = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on";
}
{
timeout = 300;
command = "${screenoff}";
resumeCommand = "${screenon}";
timeout = 360;
onTimeout = "pgrep hyprlock || loginctl lock-session";
}
{
timeout = 15;
command = "${lockscreenoff}";
resumeCommand = "${lockscreenon}";
onTimeout = "pgrep hyprlock && ${pkgs.hyprland}/bin/hyprctl dispatch dpms off";
onResume = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on";
}
];
};
Expand Down
20 changes: 8 additions & 12 deletions home-manager/luqman-desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@

# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
./modules/wayland-shell/ags
./modules/browsers/firefox.nix
./modules
./nvim/lazyvim-nvim.nix
./graphical.nix
./emacs.nix
./mpd.nix
./syncthing.nix
./modules/tools/oci.nix
./task.nix
./neomutt.nix
./modules/editors/astronvim/astronvim.nix
./modules/terminals/zellij.nix
Expand All @@ -35,7 +33,6 @@
outputs.overlays.modifications
outputs.overlays.additions
inputs.hyprland.overlays.default
inputs.wayper.overlays.default
inputs.nil.overlays.default
inputs.alejandra.overlays.default
#inputs.emacs-overlay.overlays.default
Expand Down Expand Up @@ -125,6 +122,9 @@
shellAbbrs = {
psg = "ps ax | grep -i";
};
shellInit = ''
set -U fish_greeting "Welcome SolemnAttic. System initialized."
'';
interactiveShellInit = "
set -U XDG_DATA_DIRS $XDG_DATA_DIRS /var/lib/flatpak/exports/share /home/luqman/.local/share/flatpak/exports/share
";
Expand Down Expand Up @@ -297,13 +297,9 @@

graphical.enable = true;
hyprland.enable = true;
wayper = {
enable = true;
systemdIntegration = {
enable = true;
#target = "hyprland-session.target";
};
};

modules.wayland-shell.wayper.enable = true;

kitty-conf.enable = true;
wezterm-conf.enable = true;
dunst.enable = true;
Expand All @@ -322,7 +318,7 @@
doom.doomConfigFiles = ./doom-emacs;
};

modules.cli.taskwarrior.enable = true;
modules.tools.taskwarrior.enable = true;
modules.terminals.zellij.enable = true;

xdg.userDirs.enable = true;
Expand Down
8 changes: 6 additions & 2 deletions home-manager/modules/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
# browsers = ./browsers;
wayland-shell = ./wayland-shell;
imports = [
./browsers/firefox.nix
./tools/task.nix
./wayland-shell/ags/default.nix
./wayland-shell/wayper.nix
];
}
20 changes: 12 additions & 8 deletions home-manager/task.nix → home-manager/modules/tools/task.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
config,
lib,
pkgs,
outputs,
...
}:
with lib; let
cfg = config.modules.cli.taskwarrior;
cfg = config.modules.tools.taskwarrior;
in {
imports = [];
imports = [outputs.homeManagerModules.secrets];

options.modules.cli.taskwarrior = {
options.modules.tools.taskwarrior = {
enable = mkOption {
description = "Enable taskwarrior";
default = false;
Expand Down Expand Up @@ -51,13 +52,16 @@ in {
filter = "+today status:pending -WAITING -BLOCKED -notify_only";
};

taskd.certificate = "/home/luqman/.task/private.certificate.pem";
taskd.key = "/home/luqman/.task/private.key.pem";
taskd.ca = "/home/luqman/.task/ca.cert.pem";
taskd.server = "inthe.am:53589";
taskd.credentials = "inthe_am/luqmanulhakim1720/65bcddea-fc27-4af8-8cad-8582f385d4fa";
taskd.trust = "strict";
taskd.server = "app.wingtask.com:53589";
taskd.key = config.age.secrets.taskd_key.path;
taskd.ca = config.age.secrets.taskd_ca.path;
taskd.certificate = config.age.secrets.taskd_cert.path;
# taskd.credentials = config.age.secrets.taskd_credentials.path;
};
extraConfig = ''
include ${config.age.secrets.taskd_credentials.path}
'';
};

services.taskwarrior-sync.enable = true;
Expand Down
42 changes: 42 additions & 0 deletions home-manager/modules/wayland-shell/wayper.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
config,
inputs,
lib,
...
}:
with lib; let
cfg = config.modules.wayland-shell.wayper;
in {
imports = [inputs.wayper.homeManagerModules.default];

options.modules.wayland-shell.wayper = {
enable = mkOption {
description = "wayper, a wallpaper setter for wayland";
default = false;
type = types.bool;
};
};

config = mkIf (cfg.enable) {
services.wayper = {
enable = true;
monitorConfigs = [
{
name = "eDP-1";
duration = 60;
path = "/home/luqman/wallpapers/notseiso/horizontal";
}
{
name = "HDMI-A-1";
duration = 60;
path = "/home/luqman/wallpapers/seiso/horizontal";
}
{
name = "DP-1";
duration = 60;
path = "/home/luqman/wallpapers/seiso/horizontal";
}
];
};
};
}
61 changes: 0 additions & 61 deletions home-manager/wayper.nix

This file was deleted.

1 change: 1 addition & 0 deletions modules/home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
# List your module files here
# my-module = import ./my-module.nix;
a2ln = import ./a2ln.nix;
secrets = import ./secrets/module.nix;
}
22 changes: 22 additions & 0 deletions modules/home-manager/secrets/module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
inputs,
config,
lib,
pkgs,
...
}: {
imports = [
inputs.agenix.homeManagerModules.default
];

age = {
identityPaths = ["/home/luqman/.ssh/agenix"];
secretsDir = "${config.home.homeDirectory}/.agenix/agenix";
secretsMountPoint = "${config.home.homeDirectory}/.agenix/agenix.d";

secrets.taskd_credentials.file = ./taskd_credentials.age;
secrets.taskd_ca.file = ./taskd_ca.age;
secrets.taskd_key.file = ./taskd_key.age;
secrets.taskd_cert.file = ./taskd_cert.age;
};
}
8 changes: 8 additions & 0 deletions modules/home-manager/secrets/secrets.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
let
general_pub = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDW+oXpKYSILzxc4O5Nrlf1oObQQc4XrawHWQmd5yvspQI6G5138KhX4woq65P1dGRguLvj3wWwJt5zKf533995radcusma9G1YDMWgkq+bKz+eNvY4n3zkA3EeKAlLsdwf/bA1ydLqK/LOTmBjTQqoxJsiQ7sqWCQFKZxRPlaRKsEnL8PmhkQNll8sJJ0GY559kODKArAjqYxNVPnOjijfl80WjIplrxKOdlaK79zJxv955lQTRNotI/wITnbOSpi2IMrbhCXQ5IViVj1fr5CwxPO1hrz5wRaycUhErtxzQS+Cvfkp5ooaOJSNRtmxoGC0hPxO8Vi+SrL28mH8ziPn";
agenix_pub = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPS7So2hAtYNZQNkqTzq0+b2wDgsx++VpKLMttkA4F00 luqman@asuna";
in {
"taskd_credentials.age".publicKeys = [general_pub agenix_pub];
"taskd_ca.age".publicKeys = [general_pub agenix_pub];
"taskd_key.age".publicKeys = [general_pub agenix_pub];
}
Binary file added modules/home-manager/secrets/taskd_ca.age
Binary file not shown.
Binary file added modules/home-manager/secrets/taskd_cert.age
Binary file not shown.
Binary file added modules/home-manager/secrets/taskd_credentials.age
Binary file not shown.
Binary file added modules/home-manager/secrets/taskd_key.age
Binary file not shown.
Loading

0 comments on commit a991319

Please sign in to comment.