aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAargh Rai <aargh.rai+git@gmail.com>2025-10-18 10:33:00 +0530
committerAargh Rai <aargh.rai+git@gmail.com>2025-10-18 10:33:00 +0530
commit357e96e6603406d539d89f0c6ed12b1bf0287dca (patch)
tree8b8a3c998c62d65a03e77ef1654fc48bc86d0de0
parent85809c17dd2afde7005aecbcec59b4474aa54d1e (diff)
fuck cuda + added cloc + fixed the install script
now i have to make the username generic
-rw-r--r--README.md2
-rwxr-xr-x[-rw-r--r--]install.sh39
-rw-r--r--nixos/boot.nix1
-rw-r--r--nixos/cachix/cuda-maintainers.nix13
-rw-r--r--nixos/configuration.nix7
-rw-r--r--nixos/environment.nix1
-rw-r--r--nixos/hardware-configuration.nix38
-rw-r--r--nixos/nvidia.nix26
-rw-r--r--nixos/services.nix4
-rwxr-xr-xsync.sh4
10 files changed, 49 insertions, 86 deletions
diff --git a/README.md b/README.md
index 2713f00..c7eb6aa 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
<br>
</h1>
<h4 align="center">
- A configuration for NixOS + Hyprland + Nvidia CUDA setup<br>
+ A configuration for NixOS + Hyprland<br>
Minimalistic setup for F1 fans and programmers<br>
Tmux for terminal sessions
</h4>
diff --git a/install.sh b/install.sh
index 857406a..1e1baf3 100644..100755
--- a/install.sh
+++ b/install.sh
@@ -1,6 +1,43 @@
+#!/usr/bin/env bash
+
+echo "Inserting files..."
+mkdir -p ~/.config
sudo cp -r hypr foot nvim tmux waybar wofi yazi home-manager starship.toml ~/.config
-sudo cp -r nixos /etc
sudo cp -r Wallpapers ~/Pictures
+sudo cp -r nixos /etc
+sudo nixos-generate-config
+
+CHANNEL_FILE="nixos/nix-channel.txt"
+if [[ ! -f "$CHANNEL_FILE" ]]; then
+ echo "Error: Channel file not found at $CHANNEL_FILE"
+ exit 1
+fi
+current_channels=$(sudo nix-channel --list)
+
+# Read and process each channel from file
+while IFS= read -r line || [[ -n "$line" ]]; do
+ # Skip empty lines and comments
+ [[ -z "$line" ]] || [[ "$line" =~ ^[[:space:]]*# ]] && continue
+
+ # Parse channel name and URL (format: "name url")
+ channel_name=$(echo "$line" | awk '{print $1}')
+ channel_url=$(echo "$line" | awk '{print $2}')
+
+ # Check if channel already exists
+ if echo "$current_channels" | grep -q "^$channel_name "; then
+ echo "✓ Channel '$channel_name' already exists"
+ else
+ echo "Adding channel '$channel_name' from $channel_url"
+ sudo nix-channel --add "$channel_url" "$channel_name"
+ fi
+done < "$CHANNEL_FILE"
+
+# Update channels after adding new ones
+echo "Updating channels..."
+sudo nix-channel --update
+
+echo "Switching..."
sudo nixos-rebuild switch
home-manager switch
+
diff --git a/nixos/boot.nix b/nixos/boot.nix
index 92a7ae4..b404813 100644
--- a/nixos/boot.nix
+++ b/nixos/boot.nix
@@ -1,6 +1,5 @@
{ config, pkgs, ... }:
{
- fileSystems."/boot".device = "/dev/nvme0n1p6";
boot.loader = {
grub = {
enable = true;
diff --git a/nixos/cachix/cuda-maintainers.nix b/nixos/cachix/cuda-maintainers.nix
deleted file mode 100644
index b1d70d6..0000000
--- a/nixos/cachix/cuda-maintainers.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-
-{
- nix = {
- settings = {
- substituters = [
- "https://cuda-maintainers.cachix.org"
- ];
- trusted-public-keys = [
- "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
- ];
- };
- };
-}
diff --git a/nixos/configuration.nix b/nixos/configuration.nix
index 569d597..d12ccd3 100644
--- a/nixos/configuration.nix
+++ b/nixos/configuration.nix
@@ -3,9 +3,9 @@
imports =
[
./hardware-configuration.nix
+ ./cachix.nix
./boot.nix
./services.nix
- ./nvidia.nix
./home.nix
./desktop-environment.nix
./environment.nix
@@ -16,6 +16,11 @@
<home-manager/nixos>
];
+ nix.settings = {
+ cores = 6;
+ max-jobs = 2;
+ };
+
networking.hostName = "pegasus";
networking.networkmanager.enable = true;
diff --git a/nixos/environment.nix b/nixos/environment.nix
index a90c5ba..58da2ec 100644
--- a/nixos/environment.nix
+++ b/nixos/environment.nix
@@ -8,6 +8,7 @@
btop
yazi
scrcpy
+ cloc
wget
git
diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix
deleted file mode 100644
index fd119a3..0000000
--- a/nixos/hardware-configuration.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-# Do not modify this file! It was generated by ‘nixos-generate-config’
-# and may be overwritten by future invocations. Please make changes
-# to /etc/nixos/configuration.nix instead.
-{ config, lib, pkgs, modulesPath, ... }:
-
-{
- imports =
- [ (modulesPath + "/installer/scan/not-detected.nix")
- ];
-
- boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
- boot.initrd.kernelModules = [ ];
- boot.kernelModules = [ "kvm-intel" ];
-
- fileSystems."/" =
- { device = "/dev/disk/by-uuid/56ef1a1d-db2f-45e9-b66a-f70f673596bf";
- fsType = "ext4";
- };
-
- fileSystems."/boot" =
- { device = "/dev/nvme0n1p6";
- fsType = "vfat";
- options = [ "fmask=0077" "dmask=0077" ];
- };
-
- swapDevices = [ ];
-
- # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
- # (the default) this is the recommended approach. When using systemd-networkd it's
- # still possible to use this option, but it's recommended to use it in conjunction
- # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
- networking.useDHCP = lib.mkDefault true;
- # networking.interfaces.eno1.useDHCP = lib.mkDefault true;
- # networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
-
- nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
- hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
-}
diff --git a/nixos/nvidia.nix b/nixos/nvidia.nix
deleted file mode 100644
index c6f08a9..0000000
--- a/nixos/nvidia.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ config, pkgs, ... }:
-let unstable = import <nixos-unstable> { config.allowUnfree = true; };
-in {
- hardware.graphics.enable = true;
- hardware.nvidia = {
- modesetting.enable = true;
- package = config.boot.kernelPackages.nvidiaPackages.stable;
- nvidiaSettings = true;
- open = true;
- };
- boot.kernelParams = [ "acpi_backlight=video" ];
- boot.initrd.kernelModules = [ "nvidia" "hp_wmi" ];
- services.xserver.videoDrivers = [ "nvidia" ];
- nixpkgs.config.cudaSupport = true;
-
- environment.systemPackages = with pkgs; [
- linuxPackages.nvidia_x11
- unstable.cudaPackages.cuda_cudart
- unstable.cudaPackages.cudatoolkit
- ];
- environment.sessionVariables = {
- CUDA_HOME = "${pkgs.cudatoolkit}";
- CUDA_PATH = "${pkgs.cudatoolkit}";
- LD_LIBRARY_PATH = "${pkgs.linuxPackages.nvidia_x11}/lib";
- };
-}
diff --git a/nixos/services.nix b/nixos/services.nix
index 5705e9d..19df9cc 100644
--- a/nixos/services.nix
+++ b/nixos/services.nix
@@ -21,10 +21,6 @@
bind_ip = "127.0.0.1";
package = pkgs.mongodb;
};
- services.ollama = {
- enable = true;
- acceleration = "cuda";
- };
services.kanata = {
enable = true;
keyboards = {
diff --git a/sync.sh b/sync.sh
index 0afad7d..fe6ced6 100755
--- a/sync.sh
+++ b/sync.sh
@@ -3,7 +3,6 @@
sudo rm -rf hypr foot nixos nvim tmux waybar wofi yazi home-manager Wallpapers starship.toml
sudo cp -r ~/.config/hypr .
sudo cp -r ~/.config/foot .
-sudo cp -r /etc/nixos .
sudo cp -r ~/.config/nvim .
sudo cp -r ~/.config/tmux .
sudo cp -r ~/.config/waybar .
@@ -12,3 +11,6 @@ sudo cp -r ~/.config/yazi .
sudo cp -r ~/.config/home-manager .
sudo cp -r ~/.config/starship.toml .
sudo cp -r ~/Pictures/Wallpapers .
+
+sudo cp -r /etc/nixos .
+sudo rm -rf ./nixos/hardware-configuration.nix