Add initial config

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-06-13 01:31:33 +03:00
parent 45e6e7fc21
commit 1b34ac63ff
25 changed files with 804 additions and 91 deletions

View File

@@ -0,0 +1,3 @@
{
programs.firefox.enable = true;
}

View File

@@ -0,0 +1,11 @@
let
vars = import ../vars.nix;
in
{
programs.git = {
enable = true;
lfs.enable = true;
userEmail = vars.email;
userName = vars.fullName;
};
}

View File

@@ -0,0 +1,64 @@
{
wayland.windowManager.hyprland = {
enable = true;
settings = {
"$mod" = "SUPER";
"$term" = "kitty";
bind = [
"$mod, Return, exec, $term"
"$mod, r, exec, rofi -show drun"
"$mod, b, exec, firefox"
"$mod, left, movefocus, l"
"$mod, h, movefocus, l"
"$mod, down, movefocus, d"
"$mod, j, movefocus, d"
"$mod, up, movefocus, u"
"$mod, k, movefocus, u"
"$mod, right, movefocus, r"
"$mod, l, movefocus, r"
"$mod_SHIFT, left, movewindow, l"
"$mod_SHIFT, h, movewindow, l"
"$mod_SHIFT, down, movewindow, d"
"$mod_SHIFT, j, movewindow, d"
"$mod_SHIFT, up, movewindow, u"
"$mod_SHIFT, k, movewindow, u"
"$mod_SHIFT, right, movewindow, r"
"$mod_SHIFT, l, movewindow, r"
"$mod_CTRL, left, resizeactive, -20 0"
"$mod_CTRL, h, resizeactive, -20 0"
"$mod_CTRL, down, resizeactive, 0 20"
"$mod_CTRL, j, resizeactive, 0 20"
"$mod_CTRL, up, resizeactive, 0 -20"
"$mod_CTRL, k, resizeactive, 0 -20"
"$mod_CTRL, right, resizeactive, 20 0"
"$mod_CTRL, l, resizeactive, 20 0"
"$mod, Tab, cyclenext"
"$mod, Tab, bringactivetotop"
"$mod_SHIFT, Tab, cyclenext, prev"
"$mod_SHIFT, Tab, bringactivetotop"
"$mod, f, fullscreen, 0"
"$mod, Space, togglefloating"
"$mod, Space, centerwindow"
"$mod, q, killactive"
"CTRL_ALT, Delete, exit"
];
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
misc = {
"disable_hyprland_logo" = true;
"disable_splash_rendering" = true;
};
};
};
}

View File

@@ -0,0 +1,8 @@
{
programs.kitty = {
enable = true;
extraConfig = ''
confirm_os_window_close 0
'';
};
}

View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
stylix = {
enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/da-one-sea.yaml";
};
}

View File

@@ -0,0 +1,15 @@
{
programs.zsh = {
enable = true;
autocd = true;
history.expireDuplicatesFirst = true;
historySubstringSearch.enable = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
loginExtra = ''
if [ -z "''${WAYLAND_DISPLAY}" ] && [ ! -z "''${XDG_VTNR}" ] && [ "''${XDG_VTNR}" -eq 1 ]; then
hyprland &> /tmp/hyprland.log
fi
'';
};
}

76
users/nick/home.nix Normal file
View File

@@ -0,0 +1,76 @@
{ inputs, pkgs, ... }:
let
wallpaper = ./wallpapers/clouds.png;
init = pkgs.pkgs.writeShellScriptBin "hyprland-init" ''
${pkgs.swww}/bin/swww-daemon &> /tmp/swww.log &
while ! swww query &> /dev/null; do
sleep 0.1
done
${pkgs.swww}/bin/swww img ${wallpaper}
'';
vars = import ./vars.nix;
in
{
users.users."${vars.user}" = {
isNormalUser = true;
createHome = true;
home = "/home/${vars.user}";
description = vars.fullName;
hashedPassword = "***REMOVED***";
extraGroups = [ "wheel" ];
linger = true;
uid = 1000;
};
systemd.tmpfiles.rules = [ "d /persist/home/${vars.user} 0700 ${vars.user} users -" ];
programs.hyprland.enable = true;
home-manager.users."${vars.user}" = {
imports = [
inputs.impermanence.nixosModules.home-manager.impermanence
inputs.stylix.homeManagerModules.stylix
./configs/stylix.nix
./configs/hyprland.nix
./configs/zsh.nix
./configs/kitty.nix
./configs/firefox.nix
./configs/git.nix
];
home = {
persistence."/persist/home/${vars.user}" = {
directories = [
"Documents"
"Downloads"
"Music"
"Pictures"
"Videos"
"Templates"
"VMs"
"git"
".mozilla"
];
files = [
".zsh_history"
];
allowOther = true;
};
packages = with pkgs; [
rofi-wayland
swww
];
stateVersion = "24.05";
};
stylix.image = wallpaper;
wayland.windowManager.hyprland.settings.exec-once = "${init}/bin/hyprland-init";
systemd.user.startServices = "sd-switch";
};
}

View File

2
users/nick/secrets/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

5
users/nick/vars.nix Normal file
View File

@@ -0,0 +1,5 @@
{
user = "nick";
email = "nick@karaolidis.com";
fullName = "Nikolaos Karaolidis";
}

2
users/nick/wallpapers/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore