fix(nix): fix nix config

This commit is contained in:
thek4n 2026-08-11 10:52:50 +03:00
parent 6375b8e31f
commit 7c10b096e1
6 changed files with 91 additions and 69 deletions

View File

@ -9,15 +9,18 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-26.05";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, home-manager, ... }@inputs: outputs = { self, nixpkgs, home-manager, disko ... }@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
# Функция создания хоста
mkHost = { hostname, username, system ? "x86_64-linux", extraModules ? [ ] }: mkHost = { hostname, username, system ? "x86_64-linux", extraModules ? [ ] }:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
inherit system; inherit system;
@ -29,11 +32,15 @@
}; };
modules = [ modules = [
# Системные модули
./hosts/default/configuration.nix ./hosts/default/configuration.nix
./hosts/${hostname}/configuration.nix ./hosts/${hostname}/configuration.nix
# Home Manager модуль disko.nixosModules.disko
{
disko.devices = import ./hosts/${hostname}/disko.nix;
}
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager = { home-manager = {
@ -42,7 +49,6 @@
users.${username} = import ./home/users/${username}.nix; users.${username} = import ./home/users/${username}.nix;
# Дополнительные аргументы для home-manager
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs; inherit inputs;
hostname = hostname; hostname = hostname;
@ -54,8 +60,8 @@
in { in {
nixosConfigurations = { nixosConfigurations = {
desktop = mkHost { thek4n = mkHost {
hostname = "thek4n.ru"; hostname = "thek4n";
username = "thek4n"; username = "thek4n";
extraModules = [ extraModules = [
./hosts/thek4n/hardware.nix ./hosts/thek4n/hardware.nix

View File

@ -1,62 +1,44 @@
{ config, pkgs, inputs, ... }: { config, pkgs, inputs, ... }:
{ {
imports = [ home.homeDirectory = "/home/thek4n";
inputs.home-manager.nixosModules.home-manager home.username = "thek4n";
];
home-manager = { home.stateVersion = "24.11";
useGlobalPkgs = true;
useUserPackages = true;
users.thek4n = { pkgs, ... }: { home.packages = with pkgs; [ ];
home.homeDirectory = "/home/thek4n";
home.username = "thek4n";
home.stateVersion = "24.11"; programs.git = {
enable = true;
home.packages = with pkgs; [ ]; settings = {
user.name = "thek4n";
programs.git = { user.email = "thek4n@yandex.ru";
enable = true; init.defaultBranch = "main";
userName = "thek4n"; pull.rebase = false;
userEmail = "thek4n@yandex.ru"; core.editor = "nvim";
extraConfig = {
init.defaultBranch = "main";
pull.rebase = false;
core.editor = "nvim";
};
};
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
};
programs.neovim = {
enable = true;
viAlias = true;
defaultEditor = true;
};
home.file = {
".config/sway".source = ../../configs/.config/sway;
".config/swaylock".source = ../../configs/.config/swaylock;
".config/waybar".source = ../../configs/.config/waybar;
".config/mako".source = ../../configs/.config/mako;
".config/kanshi".source = ../../configs/.config/kanshi;
".config/rofi".source = ../../configs/.config/rofi;
".config/yazi".source = ../../configs/.config/yazi;
".config/tmux".source = ../../configs/.config/tmux;
".config/alacritty".source = ../../configs/.config/alacritty;
".config/nvim".source = ../../configs/.config/nvim;
".config/zsh".source = ../../configs/.config/zsh;
".config/git".source = ../../configs/.config/git;
".zshenv".source = ../../configs/.zshenv;
".editorconfig".source = ../../configs/.editorconfig;
}; };
}; };
};
}; programs.neovim = {
enable = true;
viAlias = true;
defaultEditor = true;
};
home.file = {
".config/sway".source = ../../configs/.config/sway;
".config/swaylock".source = ../../configs/.config/swaylock;
".config/waybar".source = ../../configs/.config/waybar;
".config/mako".source = ../../configs/.config/mako;
".config/kanshi".source = ../../configs/.config/kanshi;
".config/rofi".source = ../../configs/.config/rofi;
".config/yazi".source = ../../configs/.config/yazi;
".config/tmux".source = ../../configs/.config/tmux;
".config/alacritty".source = ../../configs/.config/alacritty;
".config/nvim".source = ../../configs/.config/nvim;
".config/zsh".source = ../../configs/.config/zsh;
".config/git".source = ../../configs/.config/git;
".zshenv".source = ../../configs/.zshenv;
".editorconfig".source = ../../configs/.editorconfig;
};
}

View File

@ -7,10 +7,8 @@
../../modules/services/ssh.nix ../../modules/services/ssh.nix
]; ];
# Имя хоста
networking.hostName = hostname; networking.hostName = hostname;
# Пользователь
users.users.${username} = { users.users.${username} = {
isNormalUser = true; isNormalUser = true;
description = username; description = username;
@ -26,9 +24,16 @@
man mpv noto-fonts p7zip poppler resvg ripgrep rofi slurp man mpv noto-fonts p7zip poppler resvg ripgrep rofi slurp
socat sway swaybg swayidle swaylock tmux tree-sitter ueberzug socat sway swaybg swayidle swaylock tmux tree-sitter ueberzug
waybar wget wl-clipboard wlr-randr wtype yazi ydotool zoxide waybar wget wl-clipboard wlr-randr wtype yazi ydotool zoxide
docker httpie exa zsh docker httpie
]; ];
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
};
programs.firefox.enable = true; programs.firefox.enable = true;
services.greetd = { services.greetd = {
@ -62,8 +67,5 @@ bindsym $mod+Return exec $term
services.printing.enable = true; services.printing.enable = true;
services.rtkit.enable = true;
# Системное состояние
system.stateVersion = "26.05"; system.stateVersion = "26.05";
} }

View File

@ -0,0 +1,3 @@
{ config, pkgs, inputs, hostname, username, ... }:
{}

30
hosts/thek4n/disko.nix Normal file
View File

@ -0,0 +1,30 @@
{
disk = {
main = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
boot = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
}

View File

@ -1 +0,0 @@
todo: