mirror of
https://github.com/kp2pml30/dotfiles.git
synced 2026-02-16 23:34:42 +04:00
nix-update
This commit is contained in:
parent
94da1ce936
commit
284b131058
24 changed files with 7276 additions and 161 deletions
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
users.mutableUsers = false;
|
||||
|
||||
console.keyMap = "us";
|
||||
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
|
|
|
|||
28
nix/hardware/common.nix
Normal file
28
nix/hardware/common.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ pkgs
|
||||
, inputs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
{
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
boot = {
|
||||
loader.grub = {
|
||||
enable = true;
|
||||
devices = [ "nodev" ];
|
||||
efiSupport = true;
|
||||
useOSProber = true;
|
||||
};
|
||||
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
initrd.kernelModules = [ ];
|
||||
extraModulePackages = [ ];
|
||||
};
|
||||
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
useDHCP = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
42
nix/hardware/ideapad.nix
Normal file
42
nix/hardware/ideapad.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ pkgs
|
||||
, inputs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
{
|
||||
imports = [ ./common.nix ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/cad54483-783b-4210-9722-7355184866c3";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/steam" = {
|
||||
device = "/dev/disk/by-uuid/7a3a64c3-66ae-4a11-962c-e5a831a17d91";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/0BBD-231D";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
|
||||
swapDevices = [ { device = "/dev/disk/by-uuid/3231b9fd-4afe-41cf-a3ee-e71ceb774c1b"; } ];
|
||||
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
|
||||
hardware = {
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
amdgpu.amdvlk = {
|
||||
enable = true;
|
||||
support32Bit.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
{ pkgs
|
||||
, inputs
|
||||
, ...
|
||||
}@args:
|
||||
{
|
||||
imports = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.kp2pml30 = import ./personal/home.nix args;
|
||||
|
||||
users.users.kp2pml30 = import ./personal/user.nix args;
|
||||
|
||||
programs = {
|
||||
fish.enable = true;
|
||||
tmux.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
fish
|
||||
fishPlugins.grc
|
||||
grc
|
||||
|
||||
fira-code
|
||||
nerd-fonts.fira-code
|
||||
];
|
||||
}
|
||||
76
nix/personal/default.nix
Normal file
76
nix/personal/default.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
}
|
||||
17
nix/personal/graphical/default.nix
Normal file
17
nix/personal/graphical/default.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.kp2pml30;
|
||||
in {
|
||||
imports = [
|
||||
./x.nix
|
||||
./kitty.nix
|
||||
./vscode.nix
|
||||
|
||||
./opera.nix
|
||||
./steam.nix
|
||||
];
|
||||
}
|
||||
14
nix/personal/graphical/kitty.nix
Normal file
14
nix/personal/graphical/kitty.nix
Normal 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");
|
||||
};
|
||||
}
|
||||
18
nix/personal/graphical/opera.nix
Normal file
18
nix/personal/graphical/opera.nix
Normal 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"; };
|
||||
};
|
||||
}
|
||||
16
nix/personal/graphical/steam.nix
Normal file
16
nix/personal/graphical/steam.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
47
nix/personal/graphical/vscode.nix
Normal file
47
nix/personal/graphical/vscode.nix
Normal 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;
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
42
nix/personal/graphical/x.nix
Normal file
42
nix/personal/graphical/x.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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/";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,23 @@
|
|||
{ pkgs
|
||||
, inputs
|
||||
, rootPath
|
||||
, ...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
inputs.nixos-wsl.nixosModules.default
|
||||
#inputs.vscode-server.nixosModules.default
|
||||
];
|
||||
wsl = {
|
||||
enable = true;
|
||||
defaultUser = "kp2pml30";
|
||||
wslConf.interop.appendWindowsPath = false;
|
||||
};
|
||||
|
||||
#services.vscode-server.enable = true;
|
||||
#home-manager.users.kp2pml30.home.file.".vscode-server/server-env-setup" = {
|
||||
# enable = false;
|
||||
# executable = true;
|
||||
# text = builtins.readFile("${rootPath}/nix/wsl/vscode-patch.sh");
|
||||
#};
|
||||
}
|
||||
|
|
|
|||
38
nix/wsl/vscode-patch.sh
Normal file
38
nix/wsl/vscode-patch.sh
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# inspired by https://github.com/sonowz/vscode-remote-wsl-nixos
|
||||
|
||||
# This shell script is run before checking for vscode version updates.
|
||||
# If a newer version is downloaded, this script won't patch that version,
|
||||
# resulting in error. Therefore retry is required to patch it.
|
||||
|
||||
echo "== '~/.vscode-server/server-env-setup' SCRIPT START =="
|
||||
|
||||
# Make sure that basic commands are available
|
||||
PATH=$PATH:/run/current-system/sw/bin/
|
||||
|
||||
# This shell script uses nixpkgs branch from OS version.
|
||||
# If you want to change this behavior, change environment variable below.
|
||||
# e.g. NIXOS_VERSION=unstable
|
||||
NIXOS_VERSION=$(nixos-version | cut -d "." -f1,2)
|
||||
echo "NIXOS_VERSION detected as \"$NIXOS_VERSION\""
|
||||
|
||||
NIXPKGS_BRANCH=nixos-$NIXOS_VERSION
|
||||
PKGS_EXPRESSION=nixpkgs/$NIXPKGS_BRANCH#pkgs
|
||||
|
||||
# Get directory where this shell script is located
|
||||
VSCODE_SERVER_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
echo "Got vscode directory : $VSCODE_SERVER_DIR"
|
||||
echo "If the directory is incorrect, you can hardcode it on the script."
|
||||
|
||||
echo "Patching nodejs binaries..."
|
||||
nix shell $PKGS_EXPRESSION.patchelf $PKGS_EXPRESSION.stdenv.cc -c bash -c "
|
||||
for f in \$(find \"$VSCODE_SERVER_DIR/bin/\" -type f -executable)
|
||||
do
|
||||
if file \"\$f\" | grep -Pi 'elf.*executable' > /dev/null
|
||||
then
|
||||
patchelf --set-interpreter \"\$(cat \$(nix eval --raw $PKGS_EXPRESSION.stdenv.cc)/nix-support/dynamic-linker)\" --set-rpath \"\$(nix eval --raw $PKGS_EXPRESSION.stdenv.cc.cc.lib)/lib/\" \"\$f\"
|
||||
fi
|
||||
done
|
||||
"
|
||||
|
||||
echo "== '~/.vscode-server/server-env-setup' SCRIPT END =="
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue