diff --git a/README.md b/README.md index 3deb0a2..bb5e2b7 100644 --- a/README.md +++ b/README.md @@ -2,22 +2,33 @@ ## TODO 1. Add user specific traditional dotfiles. -2. ~~Try home-manager for nix~~ (Still in the middle of updating) +2. ~~Try home-manager~~ 3. ~~Try nix flakes~~ ## How install workey +either do ``` git clone https://github.com/natto1784/dotfiles cd dotfiles -nixos-rebuild switch --flake . +nixos-rebuild switch --flake .#Satori ``` +or +`nixos-rebuild switch --flake github:natto1784/dotfiles#Satori` +Replace Satori with whatever system you want or replace to whatever hostname you want in the config ## How home-manager workey -Either clone repo and do `./hm-switch` inside it (ofc change the username in the flake to yours dum dum)\ +Either clone repo and do `./hm-switch` inside it (login as the user you want to change config as!!!) or ``` -nix build github:natto1784/dotfiles#hm-configs.{USER}.activationPackage -o allah -./allah/activate +nix build github:natto1784/dotfiles#hm-configs.{USER}.activationPackage -o hm-result +./hm-result/activate ``` -You can unlink allah afterwards -(replace {USER} with 'natto' or whatever username there is in flake.nix, retard) +You can unlink "hm-result" after that +replace {USER} with 'natto' or whatever is availabe (or change it in the config) + +Following are the people whose configs I took inspiration from and learned stuff from +- @fufexan +- @NobbZ +- @dramforever + +I'm thankful to all of them diff --git a/configs/emacs.el b/configs/emacs.el new file mode 100644 index 0000000..d9d6199 --- /dev/null +++ b/configs/emacs.el @@ -0,0 +1,45 @@ +;;definitions +(defun install (a) (unless (package-installed-p a) (package-install a))) + + +;;settings +(global-display-line-numbers-mode 0) +(setq display-line-numbers-type 'relative) +(setq inhibit-startup-screen t) +(scroll-bar-mode 0) +(tool-bar-mode 0) +(menu-bar-mode 0) +;;(fringe-mode 0) +(set-face-attribute 'default nil :font "Fira Mono for Powerline" :height 120) +;;(set-face-background 'line-number-current-line nil :background t) + + +;;packages +(require 'package) +(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) +(package-initialize) + +(install 'use-package) +(setq use-package-always-ensure t) +(require 'use-package) + +;;install shit +(use-package elcord + :config + (elcord-mode 1)) +(use-package gruvbox-theme + :config + (load-theme 'gruvbox-dark-hard t)) +(use-package ivy + :bind (:map ivy-minibuffer-map + ("C-n" . ivy-next-line) + ("C-e" . ivy-previous-line) + ("C-i" . ivy-done)) + :config + (ivy-mode 1)) + +;;keybinds +;;ivy +;(define-key ivy-minibuffer-map (kbd "C-n") 'ivy-next-line) +;(define-key ivy-minibuffer-map (kbd "C-e") 'ivy-previous-line) +;(define-key ivy-minibuffer-map (kbd "C-i") 'ivy-done) diff --git a/flake.lock b/flake.lock index 9005e22..20a6a22 100644 --- a/flake.lock +++ b/flake.lock @@ -19,6 +19,21 @@ "type": "github" } }, + "emacs": { + "locked": { + "lastModified": 1621045111, + "narHash": "sha256-W76OW/gjCJQRV49PC5++vHucI0w3LmxELfvbjX6xM7c=", + "owner": "nix-community", + "repo": "emacs-overlay", + "rev": "7639cddd28b8ac0c9b5427f5e13c775534170428", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "emacs-overlay", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1600209923, @@ -102,10 +117,12 @@ "root": { "inputs": { "agenix": "agenix", + "emacs": "emacs", "home-manager": "home-manager", "nixpkgs": "nixpkgs_2", "nur": "nur", - "stable": "stable" + "stable": "stable", + "utils": "utils" } }, "stable": { @@ -123,6 +140,21 @@ "repo": "nixpkgs", "type": "github" } + }, + "utils": { + "locked": { + "lastModified": 1620759905, + "narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 9746ea1..a0e8d7c 100644 --- a/flake.nix +++ b/flake.nix @@ -11,45 +11,52 @@ inputs.nixpkgs.follows = "nixpkgs"; }; agenix.url = github:ryantm/agenix; + emacs = { + url = github:nix-community/emacs-overlay; + inputs.nixpkgs.follows = "nixpkgs"; + }; + utils.url = github:numtide/flake-utils; }; outputs = inputs@{self, nixpkgs, ... }: - + inputs.utils.lib.eachDefaultSystem (system: { + pkgs = import nixpkgs { + inherit system; + overlays = self.overlays ++ [ inputs.nur.overlay inputs.emacs.overlay ]; + config.allowUnfree = true; + }; + }) // + ( let - system = "x86_64-linux"; - ov = (builtins.attrValues self.overlays) ++ [ inputs.nur.overlay ]; in { - overlays = { - overridesandshit = import ./overlays/overridesandshit.nix; - packages = import ./overlays/packages.nix; - }; - + overlays = [ + (import ./overlays/overridesandshit.nix) + (import ./overlays/packages.nix) + ]; hm-configs = { natto = inputs.home-manager.lib.homeManagerConfiguration { - configuration = { pkgs, lib, ... }: { + system = "x86_64-linux"; + configuration = { lib, ... }: { imports = [ ./home/natto.nix ]; - nixpkgs.overlays = ov; + nixpkgs.overlays = self.pkgs.x86_64-linux.overlays; + nixpkgs.config.allowUnfree = true; }; - system = "${system}"; homeDirectory = "/home/natto"; username = "natto"; }; }; nixosConfigurations.Satori = nixpkgs.lib.nixosSystem { - system = "${system}"; + system = "x86_64-linux"; modules = [ ./satori.nix inputs.agenix.nixosModules.age inputs.home-manager.nixosModules.home-manager - { - nixpkgs.overlays = ov; - #environment.systemPackages = with inputs; [ claudius ]; - } + { nixpkgs.pkgs = self.pkgs.x86_64-linux; } ]; }; - }; + }); } diff --git a/home/natto.nix b/home/natto.nix index c3c173f..fc138b8 100644 --- a/home/natto.nix +++ b/home/natto.nix @@ -37,7 +37,6 @@ in curl pamixer mpdas - dunst pavucontrol anup proxychains @@ -52,11 +51,12 @@ in qbittorrent tor-browser-bundle-bin mpc_cli - flameshot hexchat luajit mpv jmtpfs + dunst + flameshot youtube-dl ]; diff --git a/modules/nvidia-offload.nix b/modules/nvidia-offload.nix index e86d7cf..883e425 100644 --- a/modules/nvidia-offload.nix +++ b/modules/nvidia-offload.nix @@ -1,4 +1,4 @@ -{lib, config, pkgs, ... }: +{config, pkgs, ... }: let nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' export __NV_PRIME_RENDER_OFFLOAD=1 @@ -27,4 +27,5 @@ in modesetting = { enable = true; }; }; }; + services.xserver.videoDrivers = [ "nvidia" ]; } diff --git a/modules/xorg.nix b/modules/xorg.nix index 20a93eb..16c46c3 100644 --- a/modules/xorg.nix +++ b/modules/xorg.nix @@ -35,7 +35,6 @@ # symbolsFile = ./colemak-dh; # }; # }; - videoDrivers = [ "nvidia" ]; layout = "us"; xkbVariant = "colemak"; }; diff --git a/overlays/customscripts/default.nix b/overlays/customscripts/default.nix index aac0eed..4cea0c7 100644 --- a/overlays/customscripts/default.nix +++ b/overlays/customscripts/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchFromGitHub, rage, curl, sox, ffmpeg}: +{lib, stdenv, fetchFromGitHub}: stdenv.mkDerivation rec{ name = "customscripts"; src = ./src; @@ -8,7 +8,6 @@ stdenv.mkDerivation rec{ rev = "a996a52831316cc2c282904352654bd20c82f7bd"; sha256 = "sha256-nw21YmcmQMF8NADnuHOc7eF2Yaj/r/1mYBn77fYK7s8="; };*/ - buildInputs = [ rage curl sox ffmpeg ]; unpackPhase = ":"; installPhase = '' mkdir -p $out/bin diff --git a/overlays/customscripts/src/agecrypt b/overlays/customscripts/src/agecrypt index d6ba81e..620f2a2 100644 --- a/overlays/customscripts/src/agecrypt +++ b/overlays/customscripts/src/agecrypt @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p rage if [ $# -eq 0 ]; then echo "bruh"; exit 1; fi FILE=$1 if [ $# -eq 2 ]; then diff --git a/overlays/customscripts/src/batspec b/overlays/customscripts/src/batspec index 72abb68..de59b78 100644 --- a/overlays/customscripts/src/batspec +++ b/overlays/customscripts/src/batspec @@ -1,2 +1,3 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p ffmpeg sox mkdir spectrals; cd spectrals; for x in ../*$1;do sox "$x" -n spectrogram -o "$(echo $(ffprobe -loglevel error -show_entries format_tags=track -of default=noprint_wrappers=1:nokey=1 "$x") - $(ffprobe -loglevel error -show_entries format_tags=TITLE -of default=noprint_wrappers=1:nokey=1 "$x")).png"; done diff --git a/overlays/customscripts/src/batspecup b/overlays/customscripts/src/batspecup index 4c74130..14206b3 100644 --- a/overlays/customscripts/src/batspecup +++ b/overlays/customscripts/src/batspecup @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p sox ffmpeg curl jq mkdir spectrals cd spectrals for x in ../*$1 diff --git a/overlays/customscripts/src/battrans b/overlays/customscripts/src/battrans index 7f673d4..a5e7704 100644 --- a/overlays/customscripts/src/battrans +++ b/overlays/customscripts/src/battrans @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p ffmpeg sox IFS=$'\n' for i in $(ls *$3) do diff --git a/overlays/customscripts/src/compmusic b/overlays/customscripts/src/compmusic index ebf6c29..e263988 100644 --- a/overlays/customscripts/src/compmusic +++ b/overlays/customscripts/src/compmusic @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p flac if [ $1 == "flac" ]; then for x in *.flac; do flac "$x" --compression-level-8 -o "bruh.$x" diff --git a/overlays/customscripts/src/compress b/overlays/customscripts/src/compress index 7ef7799..9f815b9 100644 --- a/overlays/customscripts/src/compress +++ b/overlays/customscripts/src/compress @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p ffmpeg target_video_size_KB="$2" origin_duration_s=$(ffprobe -v error -show_streams -select_streams a "$1" | grep -Po "(?<=^duration\=)\d*\.\d*") diff --git a/overlays/customscripts/src/fan b/overlays/customscripts/src/fan index 5417158..c3503ef 100644 --- a/overlays/customscripts/src/fan +++ b/overlays/customscripts/src/fan @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p mono #Script to control fans via nbfc in /opt/nbfc if [[ $1 = "a" ]]; then mono /opt/nbfc/nbfc.exe set -f 0 -a diff --git a/overlays/customscripts/src/killmpd b/overlays/customscripts/src/killmpd index bb7e97b..ceafb3d 100644 --- a/overlays/customscripts/src/killmpd +++ b/overlays/customscripts/src/killmpd @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash killall mpdas killall mpd_discord_richpresence systemctl stop mpd.socket --user diff --git a/overlays/customscripts/src/listalbum b/overlays/customscripts/src/listalbum index 5a72e9d..183b17c 100644 --- a/overlays/customscripts/src/listalbum +++ b/overlays/customscripts/src/listalbum @@ -1,3 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p ffmpeg for x in *$1;do echo $(ffprobe -loglevel error -show_entries format_tags=track -of default=noprint_wrappers=1:nokey=1 "$x") - $(ffprobe -loglevel error -show_entries format_tags=TITLE -of default=noprint_wrappers=1:nokey=1 "$x"); done diff --git a/overlays/customscripts/src/ncm b/overlays/customscripts/src/ncm index 96516e8..0cfae34 100644 --- a/overlays/customscripts/src/ncm +++ b/overlays/customscripts/src/ncm @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/usr/bin/env nix-shell +#! nix-shell -i sh -p ncmpcpp python39Packages.ueberzug #credits: https://github.com/alnj/ncmpcpp-ueberzug export FIFO_UEBERZUG="/tmp/mpd-ueberzug-${PPID}" diff --git a/overlays/customscripts/src/x0 b/overlays/customscripts/src/x0 index e553024..21faf75 100644 --- a/overlays/customscripts/src/x0 +++ b/overlays/customscripts/src/x0 @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p curl for x in $@; do curl -F "file=@\"$x\"" https://x0.at/ echo " " diff --git a/overlays/customscripts/src/ytmp3 b/overlays/customscripts/src/ytmp3 index 009f2fb..32e896e 100644 --- a/overlays/customscripts/src/ytmp3 +++ b/overlays/customscripts/src/ytmp3 @@ -1,7 +1,9 @@ -#!/usr/bin/env bash +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p ffmpeg youtube-dl youtube-dl -f bestaudio -o "ytmp3.%(title)s.%(ext)s" "$1" file=$(echo ytmp3.*.*) newfile=$(echo $file | cut -c 7-) mv "$file" "$newfile" ffmpeg -i "$newfile" -c:a mp3 "${newfile%.*}.mp3" rm "$newfile" +#trust me ive a reason for lossy->lossy transcoding diff --git a/satori.nix b/satori.nix index 441353f..608b39c 100644 --- a/satori.nix +++ b/satori.nix @@ -3,12 +3,12 @@ { imports = [ - ./Satori/hardware.nix - ./Satori/stuff.nix - ./Satori/pkgs.nix - ./Satori/networking.nix - ./Satori/boot.nix -# ./modules/nvidia-offload.nix + ./satori/hardware.nix + ./satori/stuff.nix + ./satori/pkgs.nix + ./satori/networking.nix + ./satori/boot.nix + ./modules/nvidia-offload.nix ./modules/pipewire.nix ./modules/xorg.nix ]; diff --git a/Satori/README.md b/satori/README.md similarity index 100% rename from Satori/README.md rename to satori/README.md diff --git a/Satori/boot.nix b/satori/boot.nix similarity index 97% rename from Satori/boot.nix rename to satori/boot.nix index 13d762f..ab99292 100644 --- a/Satori/boot.nix +++ b/satori/boot.nix @@ -23,7 +23,7 @@ }; grub = { enable = true; -# useOSProber = true; + useOSProber = true; efiSupport = true; device = "nodev"; splashImage = ../modules/cirno.png; diff --git a/Satori/hardware.nix b/satori/hardware.nix similarity index 96% rename from Satori/hardware.nix rename to satori/hardware.nix index 14bcfd3..eb71e8b 100644 --- a/Satori/hardware.nix +++ b/satori/hardware.nix @@ -9,7 +9,7 @@ fileSystems."/" = { device = "/dev/disk/by-uuid/4c02ddf5-d00e-4d84-856f-c327ae44d047"; fsType = "btrfs"; - options = ["compress=zstd:15"]; + options = ["compress=zstd:10"]; }; fileSystems."/boot/efi" = diff --git a/Satori/networking.nix b/satori/networking.nix similarity index 100% rename from Satori/networking.nix rename to satori/networking.nix diff --git a/Satori/pkgs.nix b/satori/pkgs.nix similarity index 96% rename from Satori/pkgs.nix rename to satori/pkgs.nix index a5055ed..33ddd86 100644 --- a/Satori/pkgs.nix +++ b/satori/pkgs.nix @@ -9,8 +9,6 @@ git glxinfo sxiv - jq - mono vim wineWowPackages.staging neofetch @@ -19,7 +17,7 @@ pciutils jdk ntfs3g - python38 + python3 htop nodejs wget diff --git a/Satori/stuff.nix b/satori/stuff.nix similarity index 89% rename from Satori/stuff.nix rename to satori/stuff.nix index 7591cf7..a249ec9 100644 --- a/Satori/stuff.nix +++ b/satori/stuff.nix @@ -1,9 +1,9 @@ {lib, config, agenix, pkgs, ... }: { imports = [ - ./Stuff/fonts.nix - ./Stuff/users.nix - ./Stuff/services.nix + ./stuff/fonts.nix + ./stuff/users.nix + ./stuff/services.nix ]; time.timeZone = "Asia/Kolkata"; environment = { diff --git a/Satori/Stuff/fonts.nix b/satori/stuff/fonts.nix similarity index 77% rename from Satori/Stuff/fonts.nix rename to satori/stuff/fonts.nix index c0b3caf..a79890f 100644 --- a/Satori/Stuff/fonts.nix +++ b/satori/stuff/fonts.nix @@ -6,5 +6,7 @@ font-awesome-ttf powerline-fonts vistafonts + noto-fonts-cjk + noto-fonts-emoji ]; } diff --git a/Satori/Stuff/services.nix b/satori/stuff/services.nix similarity index 100% rename from Satori/Stuff/services.nix rename to satori/stuff/services.nix diff --git a/Satori/Stuff/users.nix b/satori/stuff/users.nix similarity index 85% rename from Satori/Stuff/users.nix rename to satori/stuff/users.nix index ca6c0fb..4036d3b 100644 --- a/Satori/Stuff/users.nix +++ b/satori/stuff/users.nix @@ -1,4 +1,4 @@ -{lib, config, pkgs, ... }: +{config, pkgs, ... }: { users.users.natto = {