added niri flake

This commit is contained in:
willifan 2024-12-29 14:30:24 +01:00
parent b9c0d470c3
commit 36d90ef1a2
10 changed files with 208 additions and 41 deletions

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, attrs, system, ... }:
{ lib, config, pkgs, inputs, system, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages =
@ -33,7 +33,7 @@ lib.mkIf config.desktop.enable {
])
++
[
attrs.zen.packages.${system}.specific
inputs.zen.packages.${system}.specific
];
}

View file

@ -8,7 +8,7 @@ lib.mkIf config.desktop.autologin.enable {
enable = true;
settings = rec {
initial_session = {
command = ''Hyprland'';
command = config.desktop.windowManager;
user = "willifan";
};
default_session = initial_session;

View file

@ -2,9 +2,9 @@
{
imports = [
./applications.nix
./autostart.nix
./boot.nix
./emulation.nix
./hyprland.nix
./keyboard.nix
./nfs-client.nix
./nix-ld.nix

View file

@ -1,9 +1,15 @@
{ lib, ... }:
{
options = {
desktop.enable = lib.mkOption {
default = false;
type = lib.types.bool;
desktop = {
enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
windowManager = lib.mkOption {
default = "Hyprland";
type = lib.types.str;
};
};
server.enable = lib.mkOption {
default = false;

View file

@ -3,6 +3,7 @@
imports = [
./hyprland
./niri
./options.nix
./kitty.nix

View file

@ -0,0 +1,8 @@
{ inputs, ... }:
{
nixpkgs.overlays = [ inputs.niri.overlays.niri ];
imports = [
./niri.nix
];
}

View file

@ -0,0 +1,35 @@
{ ... }:
let
SCRIPTS = "$XDG_CONFIG_HOME/desktop-utils/scripts";
in
{
programs.niri.enable = true;
home-manager.users.willifan = {
programs.niri.settings = {
outputs."eDP-1".scale = 1.6;
binds = {
"Mod+Q".action.spawn = [ "kitty" ];
"Mod+C".action.close-window = { };
"Mod+M".action.quit = { };
"Mod+E".action.spawn = [ "thunar" ];
"Mod+R".action.spawn = [ "fuzzel" ];
"Mod+P".action.spawn = [ "Enpass" ];
"Mod+F".action.fullscreen-window = { };
"XF86AudioMute".action.spawn = [ "wpctl" "set-mute" "DEFAULT_AUDIO_SINK@" "toggle" ];
"XF86AudioLowerVolume".action.spawn = [ "sh" "-c" "${SCRIPTS}/volume.sh -5" ];
"XF86AudioRaiseVolume".action.spawn = [ "sh" "-c" "${SCRIPTS}/volume.sh 5" ];
"XF86AudioPrev".action.spawn = [ "playerctl" "previous" ];
"XF86AudioPlay".action.spawn = [ "playerctl" "play-pause" ];
"XF86AudioNext".action.spawn = [ "playerctl" "next" ];
"XF86MonBrightnessDown".action.spawn = [ "sh" "-c" "${SCRIPTS}/brightness.sh -4800" ];
"XF86MonBrightnessUp".action.spawn = [ "sh" "-c" "${SCRIPTS}/brightness.sh 4800" ];
};
};
};
}