end of refactor for now

This commit is contained in:
2025-12-19 08:04:19 +03:00
parent aeb61e6690
commit 3e9e074cc5
12 changed files with 44 additions and 66 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
# ---------------- CONFIG ----------------
SRC_FOLDER="./nixos" # folder in your repo
DEST_FOLDER="/etc/nixos" # target folder
# ----------------------------------------
# Check for root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root (sudo)." 1>&2
exit 1
fi
echo "Copying files from '$SRC_FOLDER' to '$DEST_FOLDER'..."
# Backup existing /etc/nixos (optional)
BACKUP_DIR="/etc/nixos.bak.$(date +%Y%m%d%H%M%S)"
echo "Backing up current /etc/nixos to $BACKUP_DIR"
cp -r "$DEST_FOLDER" "$BACKUP_DIR"
# Copy files
cp -a "$SRC_FOLDER/." "$DEST_FOLDER/"
echo "Done! Files from '$SRC_FOLDER' have been copied to '$DEST_FOLDER'."
# echo "You may now run 'sudo nixos-rebuild switch' if needed."
nixos-rebuild switch --fast
echo "Done!"
-8
View File
@@ -43,7 +43,6 @@
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${username} = import ./home-manager/home.nix;
home-manager.extraSpecialArgs = {
inherit inputs username gitName gitEmail;
@@ -54,13 +53,6 @@
pkgsFor = system: nixpkgs.legacyPackages.${system};
in {
# homeConfigurations.${username} =
# home-manager.lib.homeManagerConfiguration {
# pkgs = pkgsFor "x86_64-linux";
# modules = [ ./home-manager/home.nix ];
# extraSpecialArgs = { inherit inputs username gitName gitEmail; };
# };
nixosConfigurations = {
loki-nixos = mkHost {
hostName = "loki-nixos";
@@ -12,6 +12,10 @@
"noblur, opacity 1 1, onworkspace:special:s1"
"workspace 1, class:.*zen.*"
"idleinhibit fullscreen, class:^(*)$"
"idleinhibit fullscreen, title:^(*)$"
"idleinhibit fullscreen, fullscreen:1"
];
workspace = [
@@ -16,7 +16,6 @@ REMOTE_HASH=$(git rev-parse @{u})
if [ "$LOCAL_HASH" = "$REMOTE_HASH" ]; then
echo "The repository is already up to date."
exit 0
else
echo "Updates are available. Pulling latest changes..."
if ! git pull; then
@@ -29,7 +28,5 @@ chmod -R u+rwX "$REPO_DIR"
sudo ./update-nixos.sh
./update-home-manager.sh
echo "System update from git completed successfully."
-1
View File
@@ -21,7 +21,6 @@
bat
ripgrep
entr
busybox
];
home.file.".p10k.zsh".source = ./p10k.zsh;
+8 -20
View File
@@ -1,7 +1,7 @@
{ config, pkgs, ... }:
{
networking.hostName = "fenrir-nixos"; # Define your hostname.
networking.hostName = "fenrir-nixos";
imports = [ ../../nixos/custom.nix ./hardware-configuration.nix ];
fileSystems."/".options = [ "ssd" "noatime" "compress=zstd" ];
@@ -41,19 +41,7 @@
services.thermald.enable = true;
services.power-profiles-daemon.enable = false;
services.auto-cpufreq = {
enable = true;
settings = {
battery = {
governor = "powersave";
turbo = "never";
};
charger = {
governor = "powersave";
turbo = "auto";
};
};
};
services.auto-cpufreq = { enable = true; };
# boot.blacklistedKernelModules =
# [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ];
@@ -122,13 +110,13 @@
hardware.nvidia = {
open = true;
modesetting.enable = true; # полезно и для Wayland/tearing
prime = {
offload.enable = true;
offload.enableOffloadCmd = true; # добавит скрипт `nvidia-offload`
# prime = {
# offload.enable = true;
# offload.enableOffloadCmd = true; # добавит скрипт `nvidia-offload`
# intelBusId = "PCI:0:2:0"; # <-- подставь свои
# nvidiaBusId = "PCI:1:0:0"; # <-- подставь свои
};
# # intelBusId = "PCI:0:2:0"; # <-- подставь свои
# # nvidiaBusId = "PCI:1:0:0"; # <-- подставь свои
# };
};
programs.uwsm.enable = true;
-3
View File
@@ -98,9 +98,6 @@
];
};
# Install firefox.
programs.firefox.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
+1 -30
View File
@@ -1,30 +1 @@
#!/usr/bin/env bash
set -euo pipefail
# ---------------- CONFIG ----------------
SRC_FOLDER="./nixos" # folder in your repo
DEST_FOLDER="/etc/nixos" # target folder
# ----------------------------------------
# Check for root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root (sudo)." 1>&2
exit 1
fi
echo "Copying files from '$SRC_FOLDER' to '$DEST_FOLDER'..."
# Backup existing /etc/nixos (optional)
BACKUP_DIR="/etc/nixos.bak.$(date +%Y%m%d%H%M%S)"
echo "Backing up current /etc/nixos to $BACKUP_DIR"
cp -r "$DEST_FOLDER" "$BACKUP_DIR"
# Copy files
cp -a "$SRC_FOLDER/." "$DEST_FOLDER/"
echo "Done! Files from '$SRC_FOLDER' have been copied to '$DEST_FOLDER'."
# echo "You may now run 'sudo nixos-rebuild switch' if needed."
nixos-rebuild switch --fast
echo "Done!"
sudo nixos-rebuild switch --flake .#$(hostname)