Satori: a.

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2022-03-28 04:57:27 +05:30
parent 04da549117
commit f89fefa53d
17 changed files with 221 additions and 152 deletions

78
flake.lock generated
View File

@@ -18,11 +18,11 @@
}, },
"emacs": { "emacs": {
"locked": { "locked": {
"lastModified": 1647537202, "lastModified": 1647914335,
"narHash": "sha256-Ku2gXwzaC9sZGcc8EuJzJLRSGRInkMy/D7O+6LvF4Mk=", "narHash": "sha256-6DcYfyQYb5chJkm3KPWvMTZrs1JtG4WMCtta1ocvlmg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "6fdb3c0cefe2574073b31b27d2b2f5df9532cd5a", "rev": "023ce0b1e29732c6d26a380ad5dc8298c298f99b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -49,11 +49,11 @@
}, },
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1638122382, "lastModified": 1644229661,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b", "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -97,11 +97,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1647545448, "lastModified": 1647903177,
"narHash": "sha256-Y6W0Pl+M8ewr1TFhi5dsrs0dTlE3AeGFesnpva1xSLM=", "narHash": "sha256-9aWSpW/F8POA/7cuVpoqhVGfjAgcGRIinwxUaXmUpkk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e01facc34045cf0026ba61d04e69c61e11f99408", "rev": "80b4360678fa7890964ba8e40a722985bf8d107e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -151,11 +151,11 @@
}, },
"master": { "master": {
"locked": { "locked": {
"lastModified": 1647560508, "lastModified": 1647935800,
"narHash": "sha256-AiRKvhxjZZWIYszcEs+FpvNEyxg5ywO3vH+SyX+14zI=", "narHash": "sha256-RluNemNWfuwj0o4uPi1whjFSl0v/x+7aNi8mdPYaQro=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b4f7a460fbf43787d1e1ed3b9cec2df00a55c882", "rev": "74c1fd0b5ee7d2a0bf9754dd2bc0f41a73ed32a7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -194,11 +194,11 @@
}, },
"locked": { "locked": {
"dir": "contrib", "dir": "contrib",
"lastModified": 1647494484, "lastModified": 1647877279,
"narHash": "sha256-8CWqEy8jpY0CJDjXKPbK9uYlZYT+vR6HQ39TQFXPcsY=", "narHash": "sha256-uvQvyj0XS4pOIkpfApDaMFVWClmVpsTLQRQxvTJcBLA=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "d238b8f6003d34cae7f65ff7585b48a2cd9449fb", "rev": "0c02e8a62b1570be15db01d45969d2759a7f37bf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -214,11 +214,11 @@
"utils": "utils_3" "utils": "utils_3"
}, },
"locked": { "locked": {
"lastModified": 1647368676, "lastModified": 1647879455,
"narHash": "sha256-pn262ck0TNbqYKO90smr3YgzWeCCkFriDOSJcTOkUW4=", "narHash": "sha256-BYZKNwl8DV+PRqLeCyY1ambhd4jxCAQeQSNG0dprtLY=",
"owner": "fufexan", "owner": "fufexan",
"repo": "nix-gaming", "repo": "nix-gaming",
"rev": "6e3f57f9c14ceb90ef83f1a40b96b14c85a8eede", "rev": "5258eb84d2b275f336a3b93026d406c8e1ebde04",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -287,11 +287,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1645162597, "lastModified": 1647734733,
"narHash": "sha256-S4sRtJBqVlBg4H7EPAv0NFofGNCayHEMpLnUzGNCCKM=", "narHash": "sha256-LFYY+NhTgx++EtehrktrY4ZcsEIgd3+8dd1ZYb9NyQo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b715fcd9d9e26b99182d902c6b5694be0daae6d5", "rev": "b8f8b90b90ac713eb7f5cc7eb2100141ee29751d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -318,11 +318,11 @@
}, },
"nixpkgs_7": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1647297614, "lastModified": 1647800324,
"narHash": "sha256-ulGq3W5XsrBMU/u5k9d4oPy65pQTkunR4HKKtTq0RwY=", "narHash": "sha256-rjwoxrk16zfrcO5Torh6CbAd5GHsHrXw+EwxOvh9AUI=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "73ad5f9e147c0d2a2061f1d4bd91e05078dc0b58", "rev": "9bc841fec1c0e8b9772afa29f934d2c7ce57da8e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -350,11 +350,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1647546024, "lastModified": 1647935829,
"narHash": "sha256-qu/RbUkx8WUYwwWRoHW9wAE61LQ17PMc93v9jZm6PDE=", "narHash": "sha256-a255Dx1BygB18ZMeD72KAsm0mDqX8rCwZw6dlc/ngrc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "5ad38a2b7522d3b18f73eab7a4c573244b90c18e", "rev": "d96e19df518dd14a873c1c2d09a77324bc26dcfe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -370,11 +370,11 @@
"nixpkgs": "nixpkgs_7" "nixpkgs": "nixpkgs_7"
}, },
"locked": { "locked": {
"lastModified": 1647504937, "lastModified": 1647936981,
"narHash": "sha256-zL+TCRbdypKSFxab09lU4uR52MusKf7vzo50ee6fVIs=", "narHash": "sha256-GhtaXevrBE/iMQ400UZZZWnGt8QEosO9HN2o13CSmNE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "1de1018a5810fd123f0f57798cac2a2a8df6bb85", "rev": "7d3571d6adc7968db62c9e78b039bd295c3ff33f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -423,11 +423,11 @@
"nixpkgs": "nixpkgs_8" "nixpkgs": "nixpkgs_8"
}, },
"locked": { "locked": {
"lastModified": 1647483960, "lastModified": 1647916392,
"narHash": "sha256-DotGgzHOm+MQjoCyOG56n02HBpTak1s7yDH9gyNI8ME=", "narHash": "sha256-xiZ4Bzj2KLzphnBh6zMBKm/Icc7grN8CcaFepXhx8y4=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "34dd07a5d195f33b7060468c854b0199b5f7b232", "rev": "a4ba09b440c10a45124aa75667c36549ddadac4d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -438,11 +438,11 @@
}, },
"stable": { "stable": {
"locked": { "locked": {
"lastModified": 1647282937, "lastModified": 1647624696,
"narHash": "sha256-K8Oo6QyFCfiEWTRpQVfzcwI3YNMKlz6Tu8rr+o3rzRQ=", "narHash": "sha256-6u7WHfTGPbo21p3j23hJmkE0CtJCklrRE/aHm0uavIg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "64fc73bd74f04d3e10cb4e70e1c65b92337e76db", "rev": "60779b2fde21d3d48bc1999fc0ce6540eba07924",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -487,11 +487,11 @@
"flake-utils": "flake-utils" "flake-utils": "flake-utils"
}, },
"locked": { "locked": {
"lastModified": 1639385028, "lastModified": 1647259887,
"narHash": "sha256-oqorKz3mwf7UuDJwlbCEYCB2LfcWLL0DkeCWhRIL820=", "narHash": "sha256-yEkMbEHVO9qydluQ3uHGWX1PkfZhgDKxnd1rhZYZ72w=",
"owner": "gytis-ivaskevicius", "owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus", "repo": "flake-utils-plus",
"rev": "be1be083af014720c14f3b574f57b6173b4915d0", "rev": "06dba5f3b4fa2cc0bfc98ce9cd6f9a4d8db11d46",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -56,7 +56,7 @@
( (
let let
personalModules = [ personalModules = [
./modules/nvidia-offload.nix ./modules/graphics.nix
./modules/sound.nix ./modules/sound.nix
./modules/xorg.nix ./modules/xorg.nix
]; ];

View File

@@ -17,7 +17,7 @@
padding = 5 padding = 5
text_icon_padding = 4 text_icon_padding = 4
frame_width = 3 frame_width = 3
frame_color = "#ebdbb2" frame_color = "#268bd2"
separator_color = frame separator_color = frame
sort = yes sort = yes
idle_threshold = 120 idle_threshold = 120
@@ -50,17 +50,17 @@
ignore_dbusclose = false ignore_dbusclose = false
[urgency_low] [urgency_low]
background = "#222222" background = "#6c71c4"
foreground = "#888888" foreground = "#eee8d5"
timeout = 10 timeout = 10
[urgency_normal] [urgency_normal]
background = "#285577" background = "#cb4b16"
foreground = "#ffffff" foreground = "#eee8d5"
timeout = 10 timeout = 10
[urgency_critical] [urgency_critical]
background = "#900000" background = "#dc322f"
foreground = "#ffffff" foreground = "#eee8d5"
frame_color = "#ff0000" frame_color = "#d33682"
timeout = 10 timeout = 10

View File

@@ -26,12 +26,10 @@ c-cyan-2 "#93a1a1"
c-white-2 "#fdf6e3") c-white-2 "#fdf6e3")
#+end_src #+end_src
* Settings * Settings
** Setting the default face ** Setting the default face
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq default-frame-alist '((font . "Monoid-12"))) (setq default-frame-alist '((font . "Monoid-12")))
#+end_src #+end_src
** Some mode settings based on personal preferences ** Some mode settings based on personal preferences
@@ -43,18 +41,22 @@ c-white-2 "#fdf6e3")
(fringe-mode 0) (fringe-mode 0)
;(cua-mode 1) ;(cua-mode 1)
(global-display-line-numbers-mode 1) (global-display-line-numbers-mode 1)
(xterm-mouse-mode 1)
#+end_src #+end_src
** Setting some variables ** Setting some variables
SCHEDULED: <2022-03-19 Sat>
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq initial-major-mode 'emacs-lisp-mode (setq initial-major-mode 'emacs-lisp-mode
frame-resize-pixelwise t frame-resize-pixelwise t
auto-window-vscroll nil auto-window-vscroll nil
scroll-step 1 scroll-step 1
display-line-numbers-type 'relative display-line-numbers-type 'relative
confirm-kill-processes nil confirm-kill-processes nil
inhibit-startup-screen t) dark-theme t
(setq dark-theme t) inhibit-startup-screen t)
(setq-default tab-width 2
indent-tabs-mode nil)
#+end_src #+end_src
** Emacs startup hook ** Emacs startup hook
@@ -63,7 +65,6 @@ c-white-2 "#fdf6e3")
(lambda () (delete-other-windows)) t) (lambda () (delete-other-windows)) t)
#+end_src #+end_src
* Packages * Packages
** Add Melpa to package archives ** Add Melpa to package archives
#+begin_src emacs-lisp #+begin_src emacs-lisp
@@ -129,11 +130,12 @@ Add orderless for selectrum
*** Configure evil mode *** Configure evil mode
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package evil (use-package evil
:init
(setq-default evil-shift-width 2)
:config :config
(evil-set-initial-state 'vterm-mode 'insert) (evil-set-initial-state 'vterm-mode 'insert)
(evil-set-undo-system 'undo-tree) (evil-set-undo-system 'undo-tree)
(evil-mode 1) (evil-mode 1))
(setq-default evil-shift-width 2))
#+end_src #+end_src
*** Configure undo tree *** Configure undo tree
@@ -155,16 +157,22 @@ To get colemak-dh bindings in evil mode
#+end_src #+end_src
** Treemacs ** Treemacs
*** Dependencies
#+begin_src emacs-lisp
(use-package cfrs)
#+end_src
*** Configure treemacs *** Configure treemacs
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package treemacs (use-package treemacs
:atfer cfrs
:config :config
(treemacs-filewatch-mode 1) (treemacs-filewatch-mode 1)
(treemacs-display-current-project-exclusively) (treemacs-display-current-project-exclusively)
(treemacs-git-mode 'deferred)) (treemacs-git-mode 'simple))
#+end_src #+end_src
** Configure treemacs-evil *** Configure treemacs-evil
Configure treemacs-evil to get colemak-dh bindings Configure treemacs-evil to get colemak-dh bindings
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package treemacs-evil :config (use-package treemacs-evil :config
@@ -175,9 +183,8 @@ Configure treemacs-evil to get colemak-dh bindings
(define-key evil-treemacs-state-map (kbd "M-N") #'treemacs-next-line-other-window) (define-key evil-treemacs-state-map (kbd "M-N") #'treemacs-next-line-other-window)
(define-key evil-treemacs-state-map (kbd "M-E") #'treemacs-previous-line-other-window) (define-key evil-treemacs-state-map (kbd "M-E") #'treemacs-previous-line-other-window)
; (define-key evil-treemacs-state-map (kbd "M") #'treemacs-collapse-parent-node) ; (define-key evil-treemacs-state-map (kbd "M") #'treemacs-collapse-parent-node)
(evil-define-key 'treemacs treemacs-mode-map (kbd "m") #'treemacs-COLLAPSE-action) (define-key evil-treemacs-state-map (kbd "m") #'treemacs-COLLAPSE-action)
(evil-define-key 'treemacs treemacs-mode-map (kbd "i") #'treemacs-RET-action) (define-key evil-treemacs-state-map (kbd "i") #'treemacs-RET-action)
(evil-define-key 'normal org-mode-map (kbd "<tab>") #'org-cycle)
) )
#+end_src #+end_src
@@ -211,6 +218,14 @@ Configure treemacs-evil to get colemak-dh bindings
(lsp-ui-doc-enable 1)) (lsp-ui-doc-enable 1))
#+end_src #+end_src
*** Configure flycheck
#+begin_src emacs-lisp
(use-package flycheck)
#+end_src
*** Configure dap-mode
#+begin_src emacs-lisp
(use-package dap-mode)
#+end_src
** Company ** Company
*** Configure company *** Configure company
For autocomplete For autocomplete
@@ -251,7 +266,7 @@ For autocomplete
:mode "\\.nix\\'") :mode "\\.nix\\'")
(use-package hcl-mode (use-package hcl-mode
:mode :mod
"\\.hcl\\'" "\\.hcl\\'"
"\\.nomad\\'") "\\.nomad\\'")
#+end_src #+end_src
@@ -261,7 +276,6 @@ For autocomplete
(use-package magit) (use-package magit)
#+end_src #+end_src
* VTerm * VTerm
** Configure vterm ** Configure vterm
#+begin_src emacs-lisp #+begin_src emacs-lisp
@@ -294,24 +308,6 @@ For autocomplete
(set-face-attribute 'tab-line nil :inherit 'centaur-tabs-unselected)) (set-face-attribute 'tab-line nil :inherit 'centaur-tabs-unselected))
#+end_src #+end_src
** Org
*** Add org-mode
#+begin_src emacs-lisp
(use-package org)
#+end_src
*** Add org-bullets
#+begin_src emacs-lisp
(use-package org-bullets
:config
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
#+end_src
*** Add helper packages for exporting
#+begin_src emacs-lisp
(use-package htmlize)
#+end_src
** Misc packages ** Misc packages
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package elcord (use-package elcord
@@ -330,11 +326,33 @@ For autocomplete
:config :config
(rainbow-mode 1)) (rainbow-mode 1))
(use-package all-the-icons) (use-package treemacs-all-the-icons)
(use-package general) (use-package general)
#+end_src #+end_src
* Org
** Add org-mode
#+begin_src emacs-lisp
(use-package org
:after evil
:config
(define-key org-mode-map (kbd "RET") 'org-return-and-maybe-indent)
(setq evil-want-C-i-jump nil)
(evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle))
#+end_src
** Add org-bullets
#+begin_src emacs-lisp
(use-package org-bullets
:config
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
#+end_src
** Add helper packages for exporting
#+begin_src emacs-lisp
(use-package htmlize)
#+end_src
* Mode specific hooks * Mode specific hooks
#+begin_src emacs-lisp #+begin_src emacs-lisp
@@ -342,7 +360,6 @@ For autocomplete
(add-hook 'c++-mode-hook 'lsp) (add-hook 'c++-mode-hook 'lsp)
#+end_src #+end_src
* Custom mode line * Custom mode line
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defface mode-line-buf-name (defface mode-line-buf-name
@@ -396,12 +413,11 @@ For autocomplete
((evil-normal-state-p) (cons c-fg c-bg)) ((evil-normal-state-p) (cons c-fg c-bg))
((buffer-modified-p) (cons c-blue c-fg)) ((buffer-modified-p) (cons c-blue c-fg))
(t default-color)))) (t default-color))))
(set-face-background 'bufname (car color)) (set-face-background 'mode-line-buf-name (car color))
(set-face-foreground 'bufname (cdr color)) (set-face-foreground 'mode-line-buf-name (cdr color))
)))) ))))
#+end_src #+end_src
* Pop-up terminal * Pop-up terminal
Stolen from [[https://www.reddit.com/r/emacs/comments/ft84xy/run_shell_command_in_new_vterm/][this]] reddit post Stolen from [[https://www.reddit.com/r/emacs/comments/ft84xy/run_shell_command_in_new_vterm/][this]] reddit post
#+begin_src emacs-lisp #+begin_src emacs-lisp
@@ -447,7 +463,6 @@ This returns the command to run in the terminal
("rs" (concat "rustc" full " -o " file " && " file " && rm " file))))) ("rs" (concat "rustc" full " -o " file " && " file " && rm " file)))))
#+end_src #+end_src
* Keybinds * Keybinds
** General ** General
#+begin_src emacs-lisp #+begin_src emacs-lisp

View File

@@ -72,5 +72,6 @@
mailcap mailcap
element-desktop element-desktop
syncplay syncplay
betterdiscordctl
]; ];
} }

View File

@@ -38,6 +38,8 @@
enable = true; enable = true;
mpdMusicDir = ~/Music; mpdMusicDir = ~/Music;
settings = { settings = {
albumart = "yes";
locked_screen_width_part = 25;
autocenter_mode = "yes"; autocenter_mode = "yes";
follow_now_playing_lyrics = "yes"; follow_now_playing_lyrics = "yes";
lyrics_directory = "~/.lyrics"; lyrics_directory = "~/.lyrics";
@@ -46,16 +48,16 @@
browser_sort_mode = "mtime"; browser_sort_mode = "mtime";
colors_enabled = "yes"; colors_enabled = "yes";
main_window_color = "white"; main_window_color = "white";
header_window_color = "143"; header_window_color = "green";
volume_color = "222"; volume_color = "yellow";
progressbar_color = "143"; progressbar_color = "green";
# progressbar_elapsed_color = ""; # progressbar_elapsed_color = "";
# statusbar_color = "43"; # statusbar_color = "43";
active_window_border = "blue"; active_window_border = "blue";
user_interface = "alternative"; user_interface = "alternative";
#song_list_format="(4)[230]{l}"; #song_list_format="(4)[230]{l}";
song_columns_list_format = "(4)[167]{l} (20)[109]{t} (12)[143]{a} (16)[139]{b}"; song_columns_list_format = "(4)[red]{l} (20)[cyan]{t} (25)[green]{a} (25)[magenta]{b}";
song_list_format = "$(222){%a} - $(109){%t}"; song_list_format = "$(yellow){%a} - $(blue){%t}";
#song_list_format = "{$7%a - $9}{$5%t$9}|{$5%f$9}$R{$6%b $9}{$3%l$9}"; #song_list_format = "{$7%a - $9}{$5%t$9}|{$5%f$9}$R{$6%b $9}{$3%l$9}";
song_status_format = " $6%a $7 $3%t $7 $4%b "; song_status_format = " $6%a $7 $3%t $7 $4%b ";
visualizer_data_source = "/tmp/g.fifo"; visualizer_data_source = "/tmp/g.fifo";

View File

@@ -86,6 +86,12 @@ in
type "pulse" type "pulse"
name "pulse audio" name "pulse audio"
} }
audio_output {
type "fifo"
name "Visualizer feed"
path "/tmp/g.fifo"
format "44100:16:2"
}
audio_output { audio_output {
encoder "vorbis" encoder "vorbis"
type "httpd" type "httpd"

View File

@@ -6,6 +6,7 @@
{ {
sessionVariables = { sessionVariables = {
LV2_PATH = lib.makeSearchPath "lib/lv2" (with pkgs; [ calf ]); LV2_PATH = lib.makeSearchPath "lib/lv2" (with pkgs; [ calf ]);
TERM = "st-24bits";
}; };
file = { file = {
dunstrc = { dunstrc = {

View File

@@ -1,15 +1,11 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
gtk.cursorTheme = {
package = pkgs.numix-cursor-theme;
name = "Numix";
};
xsession = { xsession = {
pointerCursor = {
package = pkgs.numix-cursor-theme;
name = "Numix";
};
windowManager = { windowManager = {
bspwm = {
enable = false;
extraConfig = builtins.readFile ./config/bspwm/bspwmrc;
};
xmonad = { xmonad = {
enable = true; enable = true;
enableContribAndExtras = true; enableContribAndExtras = true;

View File

@@ -1,3 +0,0 @@
Satori is my home laptop\
Marisa is my Raspberry Pi 4 (B)\
Remilia is my cloud VM

3
hosts/README.org Normal file
View File

@@ -0,0 +1,3 @@
+ Satori is my home laptop
+ Marisa is my Raspberry Pi 4 (B)
+ Remilia is my cloud VM

View File

@@ -7,7 +7,6 @@
bc bc
gnumake gnumake
pciutils pciutils
git
ntfs3g ntfs3g
python3 python3
htop htop
@@ -33,6 +32,8 @@
rnix-lsp rnix-lsp
python3Packages.python-lsp-server python3Packages.python-lsp-server
haskell-language-server haskell-language-server
vulkan-tools
vulkan-headers
(steam.override { (steam.override {
extraLibraries = pkgs: [ pkgs.pipewire ]; extraLibraries = pkgs: [ pkgs.pipewire ];
extraProfile = '' extraProfile = ''
@@ -50,6 +51,13 @@
pinentryFlavor = "curses"; pinentryFlavor = "curses";
}; };
}; };
git = {
enable = true;
package = pkgs.master.git.override {
sendEmailSupport = true;
withManual = false;
};
};
zsh = { zsh = {
enable = true; enable = true;
promptInit = '' promptInit = ''
@@ -67,7 +75,7 @@
elapsed=$(echo "scale=1; $elapsed/1000" | ${pkgs.bc}/bin/bc -l) elapsed=$(echo "scale=1; $elapsed/1000" | ${pkgs.bc}/bin/bc -l)
unit="s" unit="s"
fi fi
if (($(echo "$elapsed > 60" | bc -l ))); then if (( $(echo "$elapsed > 60" | ${pkgs.bc}/bin/bc -l) )) then
elapsed=$(echo "scale=2; $elapsed/60" | ${pkgs.bc}/bin/bc -l) elapsed=$(echo "scale=2; $elapsed/60" | ${pkgs.bc}/bin/bc -l)
unit="m" unit="m"
fi fi

View File

@@ -13,9 +13,13 @@
sessionVariables = { sessionVariables = {
QT_X11_NO_MITSHM = "1"; QT_X11_NO_MITSHM = "1";
QT_QPA_PLATFORMTHEME = "gtk3"; QT_QPA_PLATFORMTHEME = "gtk3";
HM_CONF_DIR = "/etc/nixos";
}; };
localBinInPath = true; localBinInPath = true;
shellAliases = rec {
ec = "emacsclient";
ecc = ec + " -c";
};
}; };
security = { security = {
sudo.enable = false; sudo.enable = false;

53
modules/graphics.nix Normal file
View File

@@ -0,0 +1,53 @@
{ config, pkgs, lib, ... }:
let
nvidia-offload = pkgs.writeShellScriptBin "nvi" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec -a "$0" "$@"
'';
in
{
environment.systemPackages = with pkgs; [
nvidia-offload
];
hardware = {
opengl =
let
fn = oa: with lib; {
nativeBuildInputs = oa.nativeBuildInputs ++ singleton pkgs.glslang;
mesonFlags = oa.mesonFlags ++ singleton "-Dvulkan-layers=device-select,overlay";
patches = oa.patches ++ singleton ./mesa-vulkan-layer-nvidia.patch;
postInstall = oa.postInstall + ''
mv $out/lib/libVkLayer* $drivers/lib
layer=VkLayer_MESA_device_select
substituteInPlace $drivers/share/vulkan/implicit_layer.d/''${layer}.json \
--replace "lib''${layer}" "$drivers/lib/lib''${layer}"
layer=VkLayer_MESA_overlay
substituteInPlace $drivers/share/vulkan/explicit_layer.d/''${layer}.json \
--replace "lib''${layer}" "$drivers/lib/lib''${layer}"
'';
};
in
with pkgs; {
driSupport32Bit = true;
enable = true;
package = (mesa.overrideAttrs fn).drivers;
package32 = (pkgsi686Linux.mesa.overrideAttrs fn).drivers;
};
nvidia = {
prime = {
# sync.enable = true;
offload = { enable = true; };
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
modesetting = { enable = true; };
};
};
services.xserver = {
videoDrivers = [ "nvidia" ];
dpi = 96;
};
}

View File

@@ -0,0 +1,17 @@
diff --color -u -r b/src/vulkan/device-select-layer/device_select_layer.c a/src/vulkan/device-select-layer/device_select_layer.c
--- b/src/vulkan/device-select-layer/device_select_layer.c 2022-03-22 11:18:04.309569433 +0530
+++ a/src/vulkan/device-select-layer/device_select_layer.c 2022-03-22 11:18:17.944644235 +0530
@@ -454,12 +454,8 @@
exit(0);
} else {
unsigned selected_index = get_default_device(info, selection, physical_device_count, physical_devices);
- selected_physical_device_count = physical_device_count;
+ selected_physical_device_count = 1;
selected_physical_devices[0] = physical_devices[selected_index];
- for (unsigned i = 0; i < physical_device_count - 1; ++i) {
- unsigned this_idx = i < selected_index ? i : i + 1;
- selected_physical_devices[i + 1] = physical_devices[this_idx];
- }
}
if (selected_physical_device_count == 0) {

View File

@@ -1,39 +0,0 @@
{config, pkgs, ... }:
let
nvidia-offload = pkgs.writeShellScriptBin "nvi" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec -a "$0" "$@"
'';
in
{
environment.systemPackages = with pkgs; [
nvidia-offload
];
hardware = {
opengl = {
driSupport32Bit = true;
# extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
enable = true;
};
nvidia = {
prime = {
# sync.enable = true;
offload = { enable = true; };
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
modesetting = { enable = true; };
/* powerManagement = {
enable = true;
finegrained = true;
};*/
};
};
services.xserver = {
videoDrivers = [ "nvidia" ];
dpi = 96;
};
}

View File

@@ -1,14 +1,19 @@
#!/usr/bin/env bash #!/usr/bin/env bash
flakeDir=$HM_CONF_DIR;
if [ -z "$HM_CONF_DIR" ]; then
echo "HM_CONF_DIR is unset, using current directory as the flake directory"
flakeDir=.
fi
echo "You're about to switch your home-manager configuration as '$USER'" echo "You're about to switch your home-manager configuration as '$USER'"
read -p "Continue (y/n)?" conf read -p "Continue (y/n)?" conf
if [[ ${conf,,} =~ ^(y|yes)$ ]]; then if [[ ${conf,,} =~ ^(y|yes)$ ]]; then
nix build .\#hm-configs.$USER.activationPackage -o hm-result && nix build "$flakeDir"\#hm-configs.$USER.activationPackage -o hm-result &&
./hm-result/activate ./hm-result/activate
unlink hm-result unlink hm-result
else else
echo "If this is not you, then log into your profile first!" echo "If this is not you, then log into your profile first!"
exit 1 exit 1
fi fi