From 7c10b096e11d4987c65e2c4d5302a6850c76bbad Mon Sep 17 00:00:00 2001 From: thek4n Date: Tue, 11 Aug 2026 10:52:50 +0300 Subject: [PATCH] fix(nix): fix nix config --- flake.nix | 22 +++++--- home/users/thek4n.nix | 90 +++++++++++++-------------------- hosts/default/configuration.nix | 14 ++--- hosts/thek4n/configuration.nix | 3 ++ hosts/thek4n/disko.nix | 30 +++++++++++ hosts/thek4n/hardware.nix | 1 - 6 files changed, 91 insertions(+), 69 deletions(-) create mode 100644 hosts/thek4n/configuration.nix create mode 100644 hosts/thek4n/disko.nix delete mode 100644 hosts/thek4n/hardware.nix diff --git a/flake.nix b/flake.nix index aaec901..609e0a5 100644 --- a/flake.nix +++ b/flake.nix @@ -9,15 +9,18 @@ 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 system = "x86_64-linux"; - # Функция создания хоста mkHost = { hostname, username, system ? "x86_64-linux", extraModules ? [ ] }: nixpkgs.lib.nixosSystem { inherit system; @@ -29,11 +32,15 @@ }; modules = [ - # Системные модули ./hosts/default/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 = { @@ -42,7 +49,6 @@ users.${username} = import ./home/users/${username}.nix; - # Дополнительные аргументы для home-manager extraSpecialArgs = { inherit inputs; hostname = hostname; @@ -54,8 +60,8 @@ in { nixosConfigurations = { - desktop = mkHost { - hostname = "thek4n.ru"; + thek4n = mkHost { + hostname = "thek4n"; username = "thek4n"; extraModules = [ ./hosts/thek4n/hardware.nix diff --git a/home/users/thek4n.nix b/home/users/thek4n.nix index 61de1b6..fe22353 100644 --- a/home/users/thek4n.nix +++ b/home/users/thek4n.nix @@ -1,62 +1,44 @@ { config, pkgs, inputs, ... }: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ]; + home.homeDirectory = "/home/thek4n"; + home.username = "thek4n"; - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; + home.stateVersion = "24.11"; - users.thek4n = { pkgs, ... }: { - home.homeDirectory = "/home/thek4n"; - home.username = "thek4n"; + home.packages = with pkgs; [ ]; - home.stateVersion = "24.11"; - - home.packages = with pkgs; [ ]; - - programs.git = { - enable = true; - userName = "thek4n"; - userEmail = "thek4n@yandex.ru"; - 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.git = { + enable = true; + settings = { + user.name = "thek4n"; + user.email = "thek4n@yandex.ru"; + init.defaultBranch = "main"; + pull.rebase = false; + core.editor = "nvim"; }; }; - }; -}; + + 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; + }; +} diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 05e4ea7..814026f 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -7,10 +7,8 @@ ../../modules/services/ssh.nix ]; - # Имя хоста networking.hostName = hostname; - # Пользователь users.users.${username} = { isNormalUser = true; description = username; @@ -26,9 +24,16 @@ man mpv noto-fonts p7zip poppler resvg ripgrep rofi slurp socat sway swaybg swayidle swaylock tmux tree-sitter ueberzug 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; services.greetd = { @@ -62,8 +67,5 @@ bindsym $mod+Return exec $term services.printing.enable = true; - services.rtkit.enable = true; - - # Системное состояние system.stateVersion = "26.05"; } diff --git a/hosts/thek4n/configuration.nix b/hosts/thek4n/configuration.nix new file mode 100644 index 0000000..3c3fc16 --- /dev/null +++ b/hosts/thek4n/configuration.nix @@ -0,0 +1,3 @@ +{ config, pkgs, inputs, hostname, username, ... }: + +{} diff --git a/hosts/thek4n/disko.nix b/hosts/thek4n/disko.nix new file mode 100644 index 0000000..6d8619f --- /dev/null +++ b/hosts/thek4n/disko.nix @@ -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 = "/"; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/thek4n/hardware.nix b/hosts/thek4n/hardware.nix deleted file mode 100644 index 84fa199..0000000 --- a/hosts/thek4n/hardware.nix +++ /dev/null @@ -1 +0,0 @@ -todo: