From 584132a2d51b22a6995a546fae83256261cf3581 Mon Sep 17 00:00:00 2001 From: coast Date: Fri, 31 Oct 2025 22:16:14 +0330 Subject: [PATCH] big nix changes 2 --- etc/nixos/README | 1 - etc/nixos/compose.nix | 71 -------------- etc/nixos/create.nix | 51 ---------- etc/nixos/flake.lock | 16 ---- etc/nixos/flake.nix | 22 ----- etc/nixos/home-configuration/home.nix | 127 +++++++++++++++++++++++++ etc/nixos/home.nix | 132 -------------------------- 7 files changed, 127 insertions(+), 293 deletions(-) delete mode 100644 etc/nixos/README delete mode 100644 etc/nixos/compose.nix delete mode 100644 etc/nixos/create.nix create mode 100644 etc/nixos/home-configuration/home.nix delete mode 100644 etc/nixos/home.nix diff --git a/etc/nixos/README b/etc/nixos/README deleted file mode 100644 index d2fbb10..0000000 --- a/etc/nixos/README +++ /dev/null @@ -1 +0,0 @@ -My new NixOS configuration. Still working on it. diff --git a/etc/nixos/compose.nix b/etc/nixos/compose.nix deleted file mode 100644 index 99d3406..0000000 --- a/etc/nixos/compose.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ pkgs, pkgsUnstable, ... }: - -let - unstable = pkgsUnstable; -in -{ - imports = [ ./hardware-configuration.nix ]; - - boot = { - readOnlyNixStore = true; - initrd.compressor = "zstd"; - loader.systemd-boot.enable = true; - loader.systemd-boot.editor = false; - loader.systemd-boot.configurationLimit = 25; - loader.efi.canTouchEfiVariables = true; - kernelParams = [ "nvidia_drm" "nvidia_modeset" "nvidia_uvm" "nvidia-drm.fbdev=1" "nvidia" ]; - }; - - networking.hostName = "core"; - networking.enableIPv6 = false; - networking.networkmanager.enable = true; - time.timeZone = "Asia/Tehran"; - - hardware = { - graphics.enable = true; - nvidia = { - modesetting.enable = true; - powerManagement.enable = true; - open = false; - nvidiaSettings = true; - package = pkgs.linuxPackages.nvidiaPackages.beta; - prime.offload = { - enable = true; - enableOffloadCmd = true; - }; - prime = { - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - }; - bluetooth.enable = true; - bluetooth.powerOnBoot = true; - }; - - security = { - sudo.enable = false; - sudo-rs.enable = true; - }; - - environment.systemPackages = with pkgs; [ - (lib.hiPrio unstable.uutils-coreutils-noprefix) - (lib.hiPrio unstable.uutils-findutils) - (lib.hiPrio unstable.uutils-diffutils) - (pkgs.runCommand "vim-wrapper" { } '' - mkdir -p $out/bin - ln -s ${pkgs.neovim}/bin/nvim $out/bin/vim - '') - unstable.firefox - unstable.git - unstable.adwaita-icon-theme - unstable.nil - jmtpfs - simple-mtpfs - android-tools - unstable.qbittorrent - unstable.zathura - unstable.kew - ]; - - nix.settings.experimental-features = [ "nix-command" "flakes" ]; -} diff --git a/etc/nixos/create.nix b/etc/nixos/create.nix deleted file mode 100644 index e5c048d..0000000 --- a/etc/nixos/create.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ pkgs, ... }: { - - services = { - xserver = { - enable = true; - videoDrivers = ["modesetting" "nvidia"]; - windowManager.qtile.enable = false; - }; - - displayManager.ly.enable = true; - blueman.enable = false; - printing.enable = false; - #pipewire - pipewire = { - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - }; - security.rtkit.enable = true; - - nixpkgs.config.allowUnfree = true; - - users.users.coast = { - isNormalUser = true; - extraGroups = [ "wheel" ]; - shell = pkgs.zsh; - }; - - programs = { - zsh.enable = true; - zsh.syntaxHighlighting.enable = true; - foot.enable = true; - nano.enable = false; - nekoray.enable = true; - nekoray.tunMode.enable = true; - sway.enable = true; - }; - - fonts.packages = with pkgs; [ - ubuntu-sans - ubuntu_font_family - nerd-fonts._0xproto - nerd-fonts.droid-sans-mono - nerd-fonts.jetbrains-mono - vazir-fonts - ]; - - services.openssh.enable = true; - system.stateVersion = "25.05"; -} diff --git a/etc/nixos/flake.lock b/etc/nixos/flake.lock index 64a9ee2..b7a152d 100644 --- a/etc/nixos/flake.lock +++ b/etc/nixos/flake.lock @@ -23,19 +23,11 @@ }, "nixpkgs": { "locked": { -<<<<<<< HEAD - "lastModified": 1759439645, - "narHash": "sha256-oiAyQaRilPk525Z5aTtTNWNzSrcdJ7IXM0/PL3CGlbI=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "879bd460b3d3e8571354ce172128fbcbac1ed633", -======= "lastModified": 1761597516, "narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=", "owner": "NixOS", "repo": "nixpkgs", "rev": "daf6dc47aa4b44791372d6139ab7b25269184d55", ->>>>>>> bd52954 (repush) "type": "github" }, "original": { @@ -47,19 +39,11 @@ }, "nixpkgs-unstable": { "locked": { -<<<<<<< HEAD - "lastModified": 1759381078, - "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee", -======= "lastModified": 1761672384, "narHash": "sha256-o9KF3DJL7g7iYMZq9SWgfS1BFlNbsm6xplRjVlOCkXI=", "owner": "NixOS", "repo": "nixpkgs", "rev": "08dacfca559e1d7da38f3cf05f1f45ee9bfd213c", ->>>>>>> bd52954 (repush) "type": "github" }, "original": { diff --git a/etc/nixos/flake.nix b/etc/nixos/flake.nix index baa0c75..5fd97c1 100644 --- a/etc/nixos/flake.nix +++ b/etc/nixos/flake.nix @@ -1,9 +1,5 @@ { -<<<<<<< HEAD - description = "Flakes once again"; -======= description = "Flake"; ->>>>>>> bd52954 (repush) inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; @@ -12,12 +8,7 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; -<<<<<<< HEAD - outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }: - let -======= outputs = { nixpkgs, nixpkgs-unstable, home-manager, ... }: let ->>>>>>> bd52954 (repush) system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; @@ -26,18 +17,6 @@ pkgsUnstable = import nixpkgs-unstable { inherit system; }; in { -<<<<<<< HEAD - nixosConfigurations.core = nixpkgs.lib.nixosSystem { - inherit system; - modules = [ - ./create.nix - (import ./compose.nix { inherit pkgs pkgsUnstable; }) - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.coast = import ./home.nix; - home-manager.backupFileExtension = "home-backup"; -======= nixosConfigurations.gloria = nixpkgs.lib.nixosSystem { inherit system; modules = [ @@ -56,7 +35,6 @@ ]; }; }; ->>>>>>> bd52954 (repush) } ]; }; diff --git a/etc/nixos/home-configuration/home.nix b/etc/nixos/home-configuration/home.nix new file mode 100644 index 0000000..dd50b06 --- /dev/null +++ b/etc/nixos/home-configuration/home.nix @@ -0,0 +1,127 @@ +{ + config, + pkgs, + ... +}: let + dotDir = "${config.home.homeDirectory}/.local/src/config/"; + mkSl = path: config.lib.file.mkOutOfStoreSymlink path; + configs = { + kitty = "kitty"; + foot = "foot"; + qtile = "qtile"; + mako = "mako"; + nvim = "nvim"; + eww = "eww"; + waybar = "waybar"; + }; +in { + xdg.configFile = builtins.mapAttrs (name: subpath: { + source = mkSl "${dotDir}/${subpath}"; + recursive = true; + }) configs; + + + home = { + username = "coast"; + homeDirectory = "/home/coast"; + stateVersion = "25.05"; + packages = with pkgs; [ + alsa-utils + nix-search-cli + neofetch + dysk + tree + wl-clipboard + appimage-run + libnotify + grim + slurp + yazi + mate.caja + htop + nixpkgs-fmt + swaybg + wmenu + mako + nwg-look + xorg.xkill + mpv + vesktop + wlr-randr + autotiling + nodejs + gcc_multi + gnumake + clang-tools + ruby_3_4 + pkg-config + dmd + dtools + rustup + python3 + python313Packages.pip + unzip + zip + go + tauon + gimp + waybar + ]; + }; + + programs.git = { + enable = true; + userEmail = "coasteen@proton.me"; + userName = "coast"; + }; + + programs.zsh = { + enable = true; + history = { + path = "/home/coast/.cache/zsh/history"; + size = 100000000; + save = 100000000; + append = true; + }; + enableCompletion = true; + shellAliases = { + nf = "neofetch"; + nrs = "sudo nixos-rebuild switch"; + emoji = "cat ~/.local/src/local/share/emoji | grep"; + ls = "ls --color=auto"; + smi = "nvidia-smi"; + battery = "sb-battery"; + weather = "curl wttr.in/masjedsoleyman"; + las = "ls"; + c = "clear"; + cear = "clear"; + ".." = "cd .."; + hotp = "htop"; + main = "man"; + mian = "man"; + mna = "man"; + delgen = "sudo nix-env --delete-generations old --profile /nix/var/nix/profiles/system"; + alsamixer = "alsamixer -c 0 --no-color"; + la = "ls --color=auto -la"; + sidp = "sudo"; + suod = "sudo"; + sduo = "sudo"; + sd = "sudo"; + }; + initContent = '' + autoload -U compinit + zstyle ':completion:*' menu select + zmodload zsh/complist + compinit + comp_options+=(globdots) + zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=12" + autoload -U colors && colors && setopt prompt_subst + source ~/.local/src/zsh.d/zsh-autosuggestions.zsh + export PATH="/usr/bin:$PATH" + export PATH="$HOME/.local/bin:$PATH" + EDITOR=vim + PS1="[%n in %m %~] " + ''; + }; +} diff --git a/etc/nixos/home.nix b/etc/nixos/home.nix deleted file mode 100644 index 54eb9aa..0000000 --- a/etc/nixos/home.nix +++ /dev/null @@ -1,132 +0,0 @@ -{ config, pkgs, ... }: let - dotDir = "${config.home.homeDirectory}/.local/src/config/"; - mkSl = path: config.lib.file.mkOutOfStoreSymlink path; - configs = { - kitty = "kitty"; - foot = "foot"; - qtile = "qtile"; - mako = "mako"; - nvim = "nvim"; - eww = "eww"; - }; - modifier = "Mod4"; - terminal = "${pkgs.wezterm}/bin/wezterm"; - menu = "${pkgs.wmenu}/bin/wmenu-run"; -in { - home.username = "coast"; - home.homeDirectory = "/home/coast"; - home.stateVersion = "25.05"; - - xdg.configFile = builtins.mapAttrs (name: subpath: { source = mkSl "${dotDir}/${subpath}"; recursive = true; }) configs; - - home.packages = with pkgs; [ - alsa-utils nix-search-cli neofetch dysk nsxiv tree wl-clipboard appimage-run libnotify grim slurp yazi mate.caja htop nixpkgs-fmt - swaybg wmenu mako nwg-look xorg.xkill - mpv vesktop wlr-randr autotiling wezterm - nodejs gcc_multi gnumake clang-tools ruby_3_4 pkg-config dmd dtools rustup python3 python313Packages.pip texliveMedium unzip zip - ]; - - wayland.windowManager.sway = { - enable = true; - wrapperFeatures.gtk = true; - config = { - modifier = "Mod4"; - gaps = { - inner = 5; - outer = 10; - }; - output.eDP-1.disable = ""; - keybindings = { - "${modifier}+Return" = "exec ${terminal}"; - "${modifier}+r" = "exec ${menu} -l 10"; - "${modifier}+s" = "kill"; - "${modifier}+Print" = "exec /home/coast/.local/src/local/bin/screenie-wlr"; - "${modifier}+1" = "workspace 1"; - "${modifier}+2" = "workspace 2"; - "${modifier}+3" = "workspace 3"; - "${modifier}+4" = "workspace 4"; - "${modifier}+5" = "workspace 5"; - "${modifier}+6" = "workspace 6"; - "${modifier}+7" = "workspace 7"; - "${modifier}+8" = "workspace 8"; - "${modifier}+9" = "workspace 9"; - "${modifier}+0" = "workspace 10"; - "${modifier}+Shift+1" = "move container to workspace 1"; - "${modifier}+Shift+2" = "move container to workspace 2"; - "${modifier}+Shift+3" = "move container to workspace 3"; - "${modifier}+Shift+4" = "move container to workspace 4"; - "${modifier}+Shift+5" = "move container to workspace 5"; - "${modifier}+Shift+6" = "move container to workspace 6"; - "${modifier}+Shift+7" = "move container to workspace 7"; - "${modifier}+Shift+8" = "move container to workspace 8"; - "${modifier}+Shift+9" = "move container to workspace 9"; - - "${modifier}+h" = "focus left"; - "${modifier}+j" = "focus down"; - "${modifier}+k" = "focus up"; - "${modifier}+l" = "focus right"; - - "${modifier}+Shift+i" = "exec caja"; - - "${modifier}+Shift+r" = "reload"; - - "${modifier}+Shift+q" = "exit"; - - "${modifier}+Shift+v" = "exec vesktop --ozone-platform=wayland"; - - "${modifier}+Shift+p" = "exec /home/coast/.local/src/local/bin/setwall.sh"; - }; - startup = [ - { command = "autotiling"; } - ]; - }; - }; - - programs.zsh = { - enable = true; - history = { - path = "/home/coast/.cache/zsh/history"; - size = 100000000; - save = 100000000; - append = true; - }; - enableCompletion = true; - shellAliases = { - nf = "neofetch"; - nrs = "sudo nixos-rebuild switch"; - emoji = "cat ~/.local/src/local/share/emoji | grep"; - ls = "ls --color=auto"; - smi = "nvidia-smi"; - battery = "sb-battery"; - weather = "curl wttr.in/masjedsoleyman"; - las = "ls"; - c = "clear"; - cear = "clear"; - ".." = "cd .."; - hotp = "htop"; - main = "man"; - mian = "man"; - mna = "man"; - dias = "sudo"; - delgen = "sudo nix-env --delete-generations old --profile /nix/var/nix/profiles/system"; - alsamixer = "alsamixer -c 0 --no-color"; - la = "ls --color=auto -la"; - }; - initContent = '' - autoload -U compinit - zstyle ':completion:*' menu select - zmodload zsh/complist - compinit - comp_options+=(globdots) - zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=12" - autoload -U colors && colors && setopt prompt_subst - PROMPT="[%n@%m %~]%% " - export LIBCLANG_PATH=/usr/lib/llvm/20/lib64 - export PATH=$PATH:/home/coast/.spicetify - source ~/.local/src/zsh.d/zsh-autosuggestions.zsh - export PATH="/usr/bin:$PATH" - export PATH="$HOME/.local/bin:$PATH" - ''; - }; -}