nix-update

This commit is contained in:
kp2pml30 2025-01-12 14:35:10 +00:00
parent 94da1ce936
commit 284b131058
24 changed files with 7276 additions and 161 deletions

76
nix/personal/default.nix Normal file
View file

@ -0,0 +1,76 @@
{ config
, pkgs
, inputs
, lib
, ...
}@args:
let
cfg = config.kp2pml30;
in {
options.kp2pml30 = {
username = lib.mkOption {
type = lib.types.string;
default = "kp2pml30";
};
xserver = lib.mkEnableOption "";
vscode = lib.mkEnableOption "";
kitty = lib.mkEnableOption "";
opera = lib.mkEnableOption "";
steam = lib.mkEnableOption "";
};
imports = [
./graphical
./home.nix
./user.nix
./neovim.nix
];
config = {
boot.supportedFilesystems = [ "zfs" ];
boot.zfs.forceImportRoot = false;
services.logind.extraConfig = ''
HandlePowerKey=poweroff
HandleLidSwitch=hibernate
'';
i18n.supportedLocales = [
"C.UTF-8/UTF-8"
"en_US.UTF-8/UTF-8"
"ru_RU.UTF-8/UTF-8"
];
programs = {
fish.enable = true;
tmux.enable = true;
yazi.enable = true;
};
environment.systemPackages = with pkgs; [
fish
fishPlugins.grc
fishPlugins.bass
grc
fira-code
fira-code-nerdfont
#nerd-fonts.fira-code
];
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (pkgs.lib.getName pkg) [
"vscode"
"steam"
"steam-run"
"steam-original"
"steam-unwrapped"
"nvidia-x11"
"nvidia-settings"
"nvidia-persistenced"
"opera"
];
};
}

View file

@ -0,0 +1,17 @@
{ pkgs
, lib
, config
, ...
}:
let
cfg = config.kp2pml30;
in {
imports = [
./x.nix
./kitty.nix
./vscode.nix
./opera.nix
./steam.nix
];
}

View file

@ -0,0 +1,14 @@
{ pkgs
, lib
, rootPath
, config
, ...
}:
let
cfg = config.kp2pml30;
in lib.mkIf cfg.kitty {
home-manager.users.${cfg.username}.programs.kitty = {
enable = true;
extraConfig = builtins.readFile (rootPath + "/home/.config/kitty/kitty.conf");
};
}

View file

@ -0,0 +1,18 @@
{ pkgs
, lib
, rootPath
, config
, ...
}:
let
cfg = config.kp2pml30;
in lib.mkIf cfg.opera {
home-manager.users.${cfg.username}.home = {
packages = with pkgs; [
(opera.override { proprietaryCodecs = true; })
];
file.".config/opera/Default/Preferences" = { source = rootPath + "/home/.config/opera/Default/Preferences"; };
file.".config/opera/Default/Bookmarks" = { source = rootPath + "/home/.config/opera/Default/Bookmarks"; };
};
}

View file

@ -0,0 +1,16 @@
{ pkgs
, lib
, rootPath
, config
, ...
}:
let
cfg = config.kp2pml30;
in lib.mkIf cfg.steam {
programs.steam = {
enable = true;
remotePlay.openFirewall = false;
dedicatedServer.openFirewall = false;
localNetworkGameTransfers.openFirewall = false;
};
}

View file

@ -0,0 +1,47 @@
{ pkgs
, lib
, rootPath
, config
, ...
}:
let
cfg = config.kp2pml30;
in lib.mkIf cfg.vscode {
home-manager.users.${cfg.username} = {
programs.vscode = {
enable = true;
package = pkgs.vscode;
mutableExtensionsDir = false;
userSettings = lib.importJSON("${rootPath}/vscode/settings.json");
extensions = [
pkgs.vscode-extensions.eamodio.gitlens
pkgs.vscode-extensions.streetsidesoftware.code-spell-checker
(pkgs.vscode-utils.buildVscodeMarketplaceExtension {
mktplcRef = {
name = "code-spell-checker-russian";
publisher = "streetsidesoftware";
version = "0.2.2";
sha256 = "a3b00c76a4aafecb962d6c292a3b9240a27d84b17de2119bb8007d0ad90ab443";
};
meta = {
license = lib.licenses.mit;
};
})
(pkgs.vscode-utils.buildVscodeMarketplaceExtension {
mktplcRef = {
name = "vscode-lldb";
publisher = "vadimcn";
version = "1.11.1";
sha256 = "urWkXVwD6Ad7DFVURc6sLQhhc6iKCgY89IovIWByz9U=";
};
meta = {
license = lib.licenses.mit;
};
})
];
};
};
}

View file

@ -0,0 +1,42 @@
{ pkgs
, config
, lib
, rootPath
, ...
}:
let
cfg = config.kp2pml30;
in lib.mkIf cfg.xserver {
services.displayManager.ly.enable = true;
services.libinput.enable = true;
services.xserver = {
enable = true;
displayManager.startx.enable = true;
xkb = {
layout = "us,ru";
variant = ",";
options = "grp:win_space_toggle";
};
windowManager.awesome = {
enable = true;
luaModules = with pkgs.luaPackages; [
luarocks
luadbi-mysql
];
};
excludePackages = lib.optionals (!cfg.kitty) [
pkgs.xterm
];
};
environment.systemPackages = with pkgs; [
xclip
];
home-manager.users.${cfg.username} = {
home.file.".config/awesome/rc.lua" = { source = rootPath + "/home/.config/awesome/rc.lua"; };
programs.rofi = {
enable = true;
};
};
}

View file

@ -1,50 +1,67 @@
{ pkgs
, config
, lib
, inputs
, rootPath
, ...
}@args:
{
home.stateVersion = "24.05";
}:
let
cfg = config.kp2pml30;
in {
imports = [
inputs.home-manager.nixosModules.home-manager
];
home = {
username = "kp2pml30";
homeDirectory = "/home/kp2pml30";
packages = with pkgs; [
starship
jq
];
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "bak";
nix.gc = {
automatic = true;
frequency = "weekly";
};
home-manager.users.${cfg.username} = {
home = {
stateVersion = "24.05";
username = cfg.username;
homeDirectory = "/home/${cfg.username}";
packages = with pkgs; [
jq
];
programs = {
git = {
enable = true;
userName = "kp2pml30";
userEmail = "kp2pml30@gmail.com";
lfs.enable = true;
extraConfig = {
init.defaultBranch = "main";
sessionVariables = {
TERMINAL = "kitty";
};
};
fish = {
enable = true;
nix.gc = {
automatic = true;
frequency = "weekly";
};
starship = {
enable = true;
settings = {
add_newline = false;
format = "$cmd_duration$username$hostname$git_branch$git_commit$git_state$git_status$directory$status\n$character";
hostname.ssh_only = true;
cmd_duration.format = "took [$duration]($style)\n";
programs = {
git = {
enable = true;
userName = cfg.username;
userEmail = "kp2pml30@gmail.com";
lfs.enable = true;
extraConfig = {
init.defaultBranch = "main";
};
};
fish = {
enable = true;
shellInitLast = builtins.readFile (rootPath + "/home/.config/fish/minimal.fish");
};
starship = {
enable = true;
settings = {
add_newline = false;
format = "$cmd_duration$username$hostname$git_branch$git_commit$git_state$git_status$directory$status\n$character";
hostname.ssh_only = true;
cmd_duration.format = "took [$duration]($style)\n";
};
};
home-manager.enable = true;
};
home-manager.enable = true;
neovim = import ./neovim.nix args;
};
}

View file

@ -1,9 +1,11 @@
{ pkgs
, lib
, rootPath
, config
, ...
}:
let
cfg = config.kp2pml30;
fromGitHub = rev: repo: pkgs.vimUtils.buildVimPlugin {
pname = "${lib.strings.sanitizeDerivationName repo}";
version = rev;
@ -15,19 +17,21 @@ let
nvimConfig = builtins.readFile (rootPath + "/home/.config/nvim/base.vim");
in
{
enable = true;
defaultEditor = true;
plugins = with pkgs.vimPlugins; [
nvim-treesitter.withAllGrammars
nvim-autopairs
nerdtree
tokyonight-nvim
barbar-nvim
feline-nvim
(fromGitHub "d63c811337b2f75de52f16efee176695f31e7fbc" "timakro/vim-yadi")
(fromGitHub "aafa5c187a15701a7299a392b907ec15d9a7075f" "nvim-tree/nvim-web-devicons")
];
home-manager.users.${cfg.username}.programs.neovim = {
enable = true;
defaultEditor = true;
extraConfig = nvimConfig;
plugins = with pkgs.vimPlugins; [
nvim-treesitter.withAllGrammars
nvim-autopairs
nerdtree
tokyonight-nvim
barbar-nvim
feline-nvim
(fromGitHub "d63c811337b2f75de52f16efee176695f31e7fbc" "timakro/vim-yadi")
(fromGitHub "aafa5c187a15701a7299a392b907ec15d9a7075f" "nvim-tree/nvim-web-devicons")
];
extraConfig = nvimConfig;
};
}

View file

@ -1,7 +1,16 @@
{ pkgs, ... }:
{
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
shell = pkgs.fish;
hashedPassword = "$6$UK6oHr2gPRYD4Rak$lgF.mYReC0jahNuI4kt0j/CsrajVzMprvp3HgjKwwsjYHU6/Ur9jfROXZbKhhpyCLRmnlCpWeRCbHEYO/jhIv/";
{ pkgs
, config
, lib
, inputs
, ...
}:
let
cfg = config.kp2pml30;
in {
users.users.${cfg.username} = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
shell = pkgs.fish;
hashedPassword = "$6$UK6oHr2gPRYD4Rak$lgF.mYReC0jahNuI4kt0j/CsrajVzMprvp3HgjKwwsjYHU6/Ur9jfROXZbKhhpyCLRmnlCpWeRCbHEYO/jhIv/";
};
}