fix(nix): fix nix config
This commit is contained in:
parent
6375b8e31f
commit
7c10b096e1
22
flake.nix
22
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
|
||||
|
||||
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
@ -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";
|
||||
}
|
||||
|
||||
3
hosts/thek4n/configuration.nix
Normal file
3
hosts/thek4n/configuration.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{ config, pkgs, inputs, hostname, username, ... }:
|
||||
|
||||
{}
|
||||
30
hosts/thek4n/disko.nix
Normal file
30
hosts/thek4n/disko.nix
Normal 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 = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
todo:
|
||||
Loading…
x
Reference in New Issue
Block a user