Refactor modules
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
3
user/configs/firefox.nix
Normal file
3
user/configs/firefox.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
programs.firefox.enable = true;
|
||||
}
|
22
user/configs/git.nix
Normal file
22
user/configs/git.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.git;
|
||||
in
|
||||
{
|
||||
options.git = {
|
||||
vars = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
description = "Variables for the user";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
userEmail = cfg.vars.email;
|
||||
userName = cfg.vars.fullName;
|
||||
};
|
||||
};
|
||||
}
|
81
user/configs/hyprland.nix
Normal file
81
user/configs/hyprland.nix
Normal file
@@ -0,0 +1,81 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.hyprland;
|
||||
in
|
||||
{
|
||||
options.hyprland = {
|
||||
initScript = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Script to execute on startup";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
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;
|
||||
};
|
||||
|
||||
exec-once = cfg.initScript;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
8
user/configs/kitty.nix
Normal file
8
user/configs/kitty.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
confirm_os_window_close 0
|
||||
'';
|
||||
};
|
||||
}
|
21
user/configs/stylix.nix
Normal file
21
user/configs/stylix.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.stylix;
|
||||
in
|
||||
{
|
||||
options.stylix = {
|
||||
wallpaper = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "The path to the wallpaper";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
stylix = {
|
||||
enable = true;
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/da-one-sea.yaml";
|
||||
image = cfg.wallpaper;
|
||||
};
|
||||
};
|
||||
}
|
15
user/configs/zsh.nix
Normal file
15
user/configs/zsh.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
}
|
92
user/default.nix
Normal file
92
user/default.nix
Normal file
@@ -0,0 +1,92 @@
|
||||
{ config, inputs, lib, 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}
|
||||
'';
|
||||
cfg = config.user;
|
||||
in
|
||||
{
|
||||
options.user = {
|
||||
vars = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
description = "Variables for the user";
|
||||
};
|
||||
|
||||
autologin = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Automatically log in the user on boot";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
users.users."${cfg.vars.user}" = {
|
||||
isNormalUser = true;
|
||||
createHome = true;
|
||||
home = "/home/${cfg.vars.user}";
|
||||
description = cfg.vars.fullName;
|
||||
hashedPassword = "***REMOVED***";
|
||||
extraGroups = [ "wheel" ];
|
||||
linger = true;
|
||||
uid = 1000;
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [ "d /persist/home/${cfg.vars.user} 0700 ${cfg.vars.user} users -" ];
|
||||
services.getty.autologinUser = lib.mkIf cfg.autologin cfg.vars.user;
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
home-manager.users."${cfg.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/${cfg.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";
|
||||
};
|
||||
|
||||
git.vars = cfg.vars;
|
||||
hyprland.initScript = "${init}/bin/hyprland-init";
|
||||
stylix.wallpaper = wallpaper;
|
||||
|
||||
systemd.user.startServices = "sd-switch";
|
||||
};
|
||||
};
|
||||
}
|
5
user/nick.nix
Normal file
5
user/nick.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
user = "nick";
|
||||
email = "nick@karaolidis.com";
|
||||
fullName = "Nikolaos Karaolidis";
|
||||
}
|
0
user/scripts/hyprland-init.sh
Normal file
0
user/scripts/hyprland-init.sh
Normal file
2
user/secrets/.gitignore
vendored
Normal file
2
user/secrets/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
3
user/wallpapers/car.jpg
Normal file
3
user/wallpapers/car.jpg
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a02be2cc6471cbb35f1a0ec657581578fe2e9fc2c8f2e1b0769b21f65dcfadec
|
||||
size 4656195
|
3
user/wallpapers/cats.jpg
Normal file
3
user/wallpapers/cats.jpg
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:63d92b63e616073e074684d756779b4491245ebc4c6fad63d87a02def12880a1
|
||||
size 319291
|
3
user/wallpapers/clouds.png
Normal file
3
user/wallpapers/clouds.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:eab8229ea4b6d29c3ee2ad601b09f883bc1d4b2ca555a411cb7b9b48fa0153d4
|
||||
size 2446726
|
3
user/wallpapers/girl.png
Normal file
3
user/wallpapers/girl.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:435df84b9561fd8453ec0790f500a7c8035da8a3618aa12c1c9ef065358f88a3
|
||||
size 4160621
|
3
user/wallpapers/mountain.jpg
Normal file
3
user/wallpapers/mountain.jpg
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4972b203699c641c43876b464962ac0934a6cdd521d33b33365afecfa760e4bb
|
||||
size 1005842
|
3
user/wallpapers/plane.jpg
Normal file
3
user/wallpapers/plane.jpg
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1a2962ac70c824d6f1baa3d642490454b1be7fa4e3c91742c75238d72713c7b4
|
||||
size 5570903
|
3
user/wallpapers/snow.jpg
Normal file
3
user/wallpapers/snow.jpg
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f965bd8e58c02d3ddebfe87e129ebe7934bc169bdfc723ae61fe6a67c1b00860
|
||||
size 944602
|
Reference in New Issue
Block a user