Home-manager to module

This commit is contained in:
Black_Raven committed 2025-11-25 21:33:52 +03:00
1 parent 3a2ea724c0
commit 1d45ec9cab
52 files changed
+372 -347

No files matched your search

+1 -15
View File
@@ -58,22 +58,8 @@
};
inherit inputs system;
};
modules = [
./nixos/hosts/WhiteRaven/configuration.nix
];
modules = [ ./host/WhiteRaven/configuration.nix ];
};
};
homeConfigurations.kirill = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = {
inherit inputs;
};
pkgs = nixpkgs.legacyPackages.${system};
modules = [
./home-manager/home.nix
inputs.sops-nix.homeManagerModules.sops
inputs.stylix.homeManagerModules.stylix
];
};
};
}
-17
View File
@@ -1,17 +0,0 @@
{config, pkgs, ...}: {
imports = [
./hyprland.nix
./ags.nix
./style.nix
./git.nix
./mako.nix
./yazi.nix
./sleepMode.nix
./ghostty.nix
./home-aps.nix
./zed-idea.nix
./wofi.nix
./tex.nix
./btop.nix
];
}
-32
View File
@@ -1,32 +0,0 @@
{config, pkgs, ...}: {
imports = [
./zsh.nix
./data/pkgs.nix
];
home.file.".icons/default".source = "${pkgs.vanilla-dmz}/share/icons/Vanilla-DMZ";
home = {
username = "kirill";
homeDirectory = "/home/kirill";
stateVersion = "23.11";
};
programs.bash = {
enable = true;
shellAliases = {
rebuild = "sudo nixos-rebuild switch --flake ~/.config/f#usconfig";
deleteGenerations = "sudo nix-collect-garbage -d";
openHome = "vim .config/f/home-manager/home.nix";
rebuildHome = "home-manager switch --flake ~/.config/f";
openConfiguration = "sudo nano ~/.config/f/nixos/hosts/usconfig/configuration.nix";
openHyprland = "vim .config/f/home-manager/data/hyprland.nix";
openZSH = "vim .config/f/home-manager/zsh.nix";
openWayBar = "vim .config/home-manager/f/data/waybar.nix";
rebuildFlake = "sudo nixos-rebuild switch --flake /home/kirill/.config/f --impure";
openFlake = "vim /home/kirill/.config/f/flake.nix";
swichWalls = "python3 /nix/store/6czqsnf0gbvvm472lipndyg34qhnfpis-wallpaper_changer/bin/wallpaper_changer";
screenshot_f="grimblast save screen ~/screenshot_$(date +\%Y-\%m-\%d_\%H-\%M-\%S).png";
screenshot="grimblast save area ~/screenshot_$(date +\%Y-\%m-\%d_\%H-\%M-\%S).png";
};
};
}
+28
View File
@@ -0,0 +1,28 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, pkgs-stable, lib, inputs, ... }:
{
imports = [
./modules/grab.nix
(import ../modules/common.nix {
inherit lib;
inherit inputs;
hostname = "WhiteRaven";
})
(import ../../user/common.nix {
inherit config;
inherit pkgs;
inherit pkgs-stable;
inherit lib;
inherit inputs;
name = "kirill";
fullname = "Black Raven";
})
];
hardware.bluetooth.enable = true;
}
File renamed without changes.
+20
View File
@@ -0,0 +1,20 @@
{ lib, inputs, hostname }: {
imports = [
inputs.sops-nix.nixosModules.sops
../${hostname}/hardware-configuration.nix
../../modules/host.nix
./packages.nix
];
options = {
host.laptop = lib.mkEnableOption "laptop mode";
};
config = {
networking.hostName = hostname;
time.timeZone = lib.mkDefault "Europe/Moscow";
i18n.defaultLocale = lib.mkDefault "ru_RU.UTF-8";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "24.05";
};
}
+27
View File
@@ -0,0 +1,27 @@
{ config, pkgs, lib, ... }: {
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [nvidia-vaapi-driver intel-media-driver];
extraPackages32 = with pkgs.pkgsi686Linux; [nvidia-vaapi-driver intel-media-driver];
};
nvidia = {
modesetting.enable = true;
powerManagement = {
enable = true;
finegrained = false;
};
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.beta;
prime = lib.optionalAttrs config.host.laptop {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
};
}
+34
View File
@@ -0,0 +1,34 @@
{ pkgs, inputs, ... }: {
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
file
tree
wget
git
(btop.override { cudaSupport = true; })
unzip
yazi
zip
lazygit
httpie
ncdu
tldr
helix
];
fonts.packages = with pkgs; [
jetbrains-mono
noto-fonts
noto-fonts-emoji
noto-fonts-cjk-sans
twemoji-color-font
font-awesome
powerline-fonts
powerline-symbols
ubuntu_font_family
unifont
nerd-fonts.symbols-only
corefonts
];
}
File renamed without changes.
+18
View File
@@ -0,0 +1,18 @@
{
imports = [
./host/bluetooth.nix
./host/bootloader.nix
./host/env.nix
./host/gamemode.nix
./host/sound.nix
./host/vpn.nix
./host/postgresql.nix
];
programs.hyprland.enable = true;
services = {
udisks2.enable = true;
fstrim.enable = true;
};
networking.networkmanager.enable = true;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+17
View File
@@ -0,0 +1,17 @@
{
security.rtkit.enable = true;
services = {
pulseaudio.enable = false;
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
};
};
}
File renamed without changes.
+15
View File
@@ -0,0 +1,15 @@
{config, pkgs, ...}: {
imports = [
./user/hyprland.nix
./user/ags.nix
./user/mako.nix
./user/yazi.nix
./user/sleepMode.nix
./user/ghostty.nix
./user/home-aps.nix
./user/zed-idea.nix
./user/wofi.nix
./user/tex.nix
./user/btop.nix
];
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,14 @@
{ pkgs, lib, config, ... }: {
{ pkgs, lib, config, folder, swww_flags, inputs }: {
home.packages = with pkgs; [
ghostty
pamixer
wofi
clipse
wl-clipboard
wl-clip-persist
xclip
];
wayland.windowManager.hyprland =
let
colors = config.lib.stylix.colors;
@@ -10,33 +20,40 @@
from random import choice
from os import system, listdir
folder = "/home/kirill/wallpapers"
filename = choice(listdir(folder))
system(f"swww img {folder}/{filename} --transition-type center")
system(f"${lib.getExe pkgs.swww} img {folder}/{filename} ${swww_flags}")
'';
in {
enable = true;
xwayland.enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
plugins = with inputs.hyprland-plugins.packages.${pkgs.system}; [
hyprbars
];
settings = {
"$mainMod" = "SUPER";
monitor = ",preferred,auto,1";
env = [
"LIBVA_DRIVER_NAME,nvidia"
"XDG_SESSION_TYPE,wayland"
"GBM_BACKEND,nvidia"
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
"WLR_NO_HARDWARE_CURSORS,1"
"XDG_CURRENT_DESKTOP,Hyprland"
"GBM_BACKEND,nvidia"
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
"XCURSOR_SIZE,36"
"QT_QPA_PLATFORM,wayland"
"XDG_CURRENT_DESKTOP,Hyprland"
"XDG_SESSION_DESKTOP,Hyprland"
"WLR_NO_HARDWARE_CURSORS,1"
"XCURSOR_SIZE,36"
"XDG_SCREENSHOTS_DIR,~/screens"
];
cursor.no_hardware_cursors = true;
debug = {
disable_logs = false;
enable_stdout_logs = true;
@@ -44,6 +61,7 @@
input = {
kb_layout = "us,ru";
kb_variant = "lang";
kb_options = "grp:caps_toggle";
follow_mouse = 1;
@@ -55,94 +73,36 @@
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
};
general = {
gaps_in = 5;
gaps_out = 20;
border_size = 3;
"col.active_border" = "rgba(${colors.base0C}ee) rgba(${colors.base0B}ee) 45deg";
"col.inactive_border" = "rgba(${colors.base05}aa)";
layout = "dwindle";
};
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 16;
passes = 2;
new_optimizations = true;
};
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
# bezier = "myBezier, 0.33, 0.82, 0.9, -0.08";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
];
};
dwindle = {
pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
smart_split = true;
};
master = {
new_status = "master";
};
gestures = {
workspace_swipe_invert = true;
workspace_swipe_distance = 200;
workspace_swipe_forever = true;
};
gesture = [
"3, horizontal, workspace"
windowrule = [
"float, ^(imv)$"
"float, ^(feh)$"
"float, ^(mpv)$"
"float, ^(nmtui)$"
"float, title:^(Список друзей)"
"move onscreen cursor -50% -50%, ^(xdragon)$"
];
misc = {
animate_manual_resizes = true;
animate_mouse_windowdragging = true;
enable_swallow = true;
disable_hyprland_logo = false;
};
windowrule = [
"float, class:^(imv)$"
"float, class:^(feh)$"
"float, class:^(mpv)$"
"float, class:^(nmtui)"
"float, title:^(Список друзей)"
windowrulev2 = [
"float, class:(clipse)"
"size 622 652, class:(clipse)"
];
exec-once = [
"systemctl --user start plasma-polkit-agent"
"swww-daemon"
"python3 ${lib.getExe wallpaper_changer}"
"${lib.getExe' pkgs.udiskie "udiskie"}"
"wl-paste --type text --watch cliphist store"
"wl-paste --type image --watch cliphist store"
"systemctl --user start plasma-polkit-agent"
"${lib.getExe' pkgs.swww "swww-daemon"}"
"${lib.getExe wallpaper_changer}"
"wl-clip-persist --clipboard both"
"clipse -listen"
"${lib.getExe' pkgs.udiskie "udiskie"}"
];
bind = [
"$mainMod, V, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy"
"$mainMod, V, exec, kitty --class clipse -e clipse"
"$mainMod, Return, exec, ghostty"
"$mainMod, Return, exec, kitty"
"$mainMod, Q, killactive,"
"$mainMod, M, exit,"
"$mainMod, E, exec, ghostty -e sh -c yazi"
"$mainMod, E, exec, kitty -e sh -c yazi"
"$mainMod, F, togglefloating,"
"$mainMod, D, exec, wofi --show drun"
"$mainMod, P, pseudo, # dwindle"
@@ -191,6 +151,7 @@
"$mainMod SHIFT, 0, movetoworkspacesilent, 10"
"$mainMod SHIFT, F, fullscreen"
# Scroll through existing workspaces with mainMod + scroll
"$mainMod, mouse_down, workspace, e+1"
"$mainMod, mouse_up, workspace, e-1"
@@ -209,26 +170,11 @@
", XF86MonBrightnessDown, exec, brightnessctl set 5%- "
", XF86MonBrightnessUp, exec, brightnessctl set +5% "
# Configuration files
''$mainMod ALT, N, exec, ghostty -e sh -c "rb"''
''$mainMod ALT, C, exec, ghostty -e sh -c "conf"''
''$mainMod ALT, H, exec, ghostty -e sh -c "$EDITOR ~/nix/home-manager/modules/wms/hyprland.nix"''
''$mainMod ALT, W, exec, ghostty -e sh -c "$EDITOR ~/nix/home-manager/modules/wms/waybar.nix"''
'', Print, exec, grim -g "$(slurp)" - | swappy -f -''
# Waybar
"$mainMod, B, exec, pkill -SIGUSR1 waybar"
#"$mainMod, W, exec, pkill -SIGUSR2 waybar"
"$mainMod, W, exec, python3 ${lib.getExe wallpaper_changer}"
# Disable all effects
"$mainMod Shift, G, exec, ~/.config/hypr/gamemode.sh "
# Screens
''$mainMod Shift, S, exec, grimblast --notify --freeze copy area''
'', F11, exec, ghostty -e sh -c "hyprlock"''
"$mainMod, W, exec, ${lib.getExe wallpaper_changer}"
];
# Move/resize windows with mainMod + LMB/RMB and dragging
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
-164
View File
@@ -1,164 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, libs, lib, inputs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./pockets.nix
./hardware-configuration.nix
./models/bluetooth.nix
./models/gamemode.nix
./models/postgresql.nix
./models/env.nix
./bootloader.nix
./grab.nix
./models/docker.nix
./flackePkgs.nix
./models/vpn.nix
];
#home.packages = [ pkgs.callPackage ./pockets/thingsboard.nix {} ];
services.upower.enable = true;
networking.hostName = "WhiteRaven"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
networking.extraHosts = ''
10.10.146.10 it-camp.innoca.local
'';
# Set your time zone.
time.timeZone = "Europe/Moscow";
# Select internationalisation properties.
i18n.defaultLocale = "ru_RU.UTF-8";
programs.hyprland.enable = true;
programs.zsh.enable = true;
#services.xserver = { enable = true; };
# Enable the X11 windowing system.
#services.xserver.displayManager.lightdm.enable = true;
#services.xserver.desktopManager.deepin.enable = true;
# Enable the Deepin Desktop Environment.
# Configure keymap in X11
services.xserver.xkb = {
layout = "ru";
variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users = {
defaultUserShell = pkgs.zsh;
users.kirill = {
isNormalUser = true;
description = "Kirill";
extraGroups = [ "networkmanager" "wheel" "input" "libvirtd" ];
};
};
services.greetd = let
tuigreet = pkgs.lib.getExe pkgs.greetd.tuigreet;
session = lib.getExe pkgs.hyprland;
username = "kirill";
in {
enable = true;
settings = {
initial_session = {
command = "${session}";
user = "${username}";
};
default_session = {
command = "${tuigreet} --greeting 'Welcome to NixOS!' --asterisks --remember --remember-user-session --time -cmd ${session}";
user = "greeter";
};
};
};
# Enable automatic login for the user.
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "kirill";
hardware.bluetooth.enable = true; # enables support for Bluetooth
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
services.udisks2.enable = true;
# Install firefox.
programs.firefox.enable = true;
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.settings.trusted-users = [ "kirill" ];
programs.partition-manager.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}
-6
View File
@@ -1,6 +0,0 @@
{ pkgs, inputs, ... }:
{
environment.systemPackages = [
inputs.compose2nix.packages.x86_64-linux.default
];
}
-9
View File
@@ -1,9 +0,0 @@
{config, pkgs, ... }:{
virtualisation.docker = {
enable = true;
# Set up resource limits
daemon.settings = {
experimental = true;
};
};
}
+62
View File
@@ -0,0 +1,62 @@
{ pkgs, pkgs-stable, lib, inputs, name, fullname ? name, ... }: {
imports = [
inputs.home-manager.nixosModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${name} = {
imports = [
inputs.sops-nix.homeManagerModules.sops
inputs.stylix.homeManagerModules.stylix
../modules/user.nix
./${name}/modules/git.nix
./${name}/modules/hyprland.nix
./${name}/modules/style.nix
./${name}/home.nix
];
home = {
username = name;
homeDirectory = "/home/${name}";
stateVersion = "23.11";
};
};
#extraSpecialArgs = {
# inherit inputs;
# inherit pkgs-stable;
#};
};
}
];
programs.zsh.enable = true;
users = {
defaultUserShell = pkgs.zsh;
users."${name}" = {
isNormalUser = true;
description = fullname;
extraGroups = [ "networkmanager" "wheel" "input" "libvirtd" ];
};
};
services.greetd = let
tuigreet = lib.getExe pkgs.greetd.tuigreet;
session = lib.getExe inputs.hyprland.packages.${pkgs.system}.default;
in {
enable = true;
settings = {
initial_session = {
command = "${session}";
user = "${name}";
};
default_session = {
command = "${tuigreet} --greeting 'Welcome to NixOS!' --asterisks --remember --remember-user-session --time -cmd ${session}";
user = "greeter";
};
};
};
nix.settings.trusted-users = [ name ];
}
+3
View File
@@ -0,0 +1,3 @@
{
programs.hyprlock.enable = true;
}
File renamed without changes.
+97
View File
@@ -0,0 +1,97 @@
{ pkgs, lib, config, inputs, ... }: {
imports = [(
import ../../../modules/user/hyprland.nix {
inherit lib;
inherit pkgs;
inherit config;
inherit inputs;
folder = "${config.home.homeDirectory}/wallpapers";
swww_flags = "--transition-type center";
}
)];
wayland.windowManager.hyprland = let
colors = config.lib.stylix.colors;
in {
settings = {
monitor = [
"DP-3, 3440x1440@165.00Hz, auto-right, 1"
# "HDMI-A-1, 3840x2160@60.00Hz, auto-left, 2"
"HDMI-A-1, disabled"
",preferred,auto,1"
];
general = {
gaps_in = 5;
gaps_out = 20;
border_size = 3;
"col.active_border" = "rgba(${colors.base0C}ee) rgba(${colors.base0B}ee) 45deg";
"col.inactive_border" = "rgba(${colors.base05}aa)";
layout = "dwindle";
};
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 16;
passes = 2;
new_optimizations = true;
};
shadow = {
enabled = true;
range = 4;
render_power = 3;
color = "rgba(1a1a1aee)";
};
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
];
};
dwindle = {
pseudotile = true;
smart_split = true;
};
master.new_status = "master";
gestures = {
workspace_swipe = true;
workspace_swipe_fingers = 3;
workspace_swipe_invert = true;
workspace_swipe_distance = 200;
workspace_swipe_forever = true;
};
misc = {
animate_manual_resizes = true;
animate_mouse_windowdragging = true;
enable_swallow = true;
render_ahead_of_time = false;
disable_hyprland_logo = false;
};
bind = [
" , Print, exec, grimblast --notify --freeze copy output"
"CTRL, Print, exec, grimblast --notify --freeze copy area"
"ALT , Print, exec, grimblast --notify --freeze copy active"
];
};
};
}
File renamed without changes.