├── .editorconfig
├── .gitattributes
├── .github
├── dependabot.yaml
└── workflows
│ └── cachix.yml
├── LICENSE
├── README.md
├── config
├── aarch64Dev.nix
├── base-desktop.nix
├── cli-extras.nix
├── cli.nix
├── containers.nix
├── dev.nix
├── k3s.nix
├── personal.nix
├── sway.nix
├── winapps.nix
└── xorg.nix
├── flake.lock
├── flake.nix
├── home-manager
├── common.nix
├── dunst.nix
├── git.nix
├── i3-sway.nix
├── i3.nix
├── keybindings.nix
├── sway.nix
└── wallpapers
│ ├── mountains1.jpg
│ ├── mountains2.jpg
│ ├── mountains3.jpg
│ └── space1.jpg
├── hosts
├── GytisOS.host.nix
├── Monday.host.nix
├── Morty.host.nix
├── NixyServer.host.nix
├── gytis-ivaskevicius.host.nix
└── work
│ ├── Wallpapers
│ ├── mountains1.jpg
│ ├── mountains2.jpg
│ ├── mountains3.jpg
│ └── space1.jpg
│ ├── dunst.conf
│ ├── i3
│ ├── autotiling.sh
│ ├── default.nix
│ └── i3config
│ ├── i3rice.nix
│ ├── modules.nix
│ ├── polybar.conf
│ ├── settings.ini
│ └── sxhkd.conf
├── modules
├── cachix.nix
├── clean-home.nix
├── nix-compose.nix
└── runtimes.nix
├── overlays
├── default.nix
├── dunst.conf
├── g-alacritty
│ ├── alacritty.toml
│ └── default.nix
├── g-firefox
│ └── default.nix
├── g-lf
│ ├── default.nix
│ └── draw.sh
├── g-neovim
│ ├── airline.vim
│ ├── coc.vim
│ ├── default.nix
│ ├── highlightSearch.vim
│ ├── nerdtree.vim
│ ├── preserveCursor.vim
│ ├── qualityOfLifeBindings.vim
│ ├── signify.vim
│ └── trimSpacesOnWrite.vim
├── g-pistol
│ └── default.nix
├── g-polybar
│ ├── default.nix
│ └── polybar.conf
├── g-rofi
│ ├── default.nix
│ └── rofi.rasi
├── g-termite
│ ├── default.nix
│ └── termite.conf
├── shell-config
│ ├── default.nix
│ ├── nix-args.sh
│ └── starship.toml
└── zsh-forgit
│ └── default.nix
├── setup-btrfs.sh
├── setup-zfs.sh
└── suites.nix
/.editorconfig:
--------------------------------------------------------------------------------
1 | root=true
2 |
3 | [*]
4 | charset=utf-8
5 | end_of_line=lf
6 | indent_size=2
7 | indent_style=space
8 | insert_final_newline=true
9 | trim_trailing_whitespace=true
10 |
11 | [*.md]
12 | max_line_length=off
13 | trim_trailing_whitespace=false
14 |
15 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.secret.nix filter=crypt diff=crypt
2 |
--------------------------------------------------------------------------------
/.github/dependabot.yaml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "github-actions"
4 | directory: "/"
5 | schedule:
6 | interval: "daily"
7 |
--------------------------------------------------------------------------------
/.github/workflows/cachix.yml:
--------------------------------------------------------------------------------
1 | name: "Cachix"
2 |
3 | on:
4 | pull_request:
5 | push:
6 | workflow_dispatch:
7 |
8 | jobs:
9 | builds:
10 | name: Build configuration
11 | runs-on: ubuntu-latest
12 | steps:
13 | - uses: actions/checkout@v3.1.0
14 | with:
15 | fetch-depth: 0 # Nix Flakes doesn't work on shallow clones
16 | - uses: cachix/install-nix-action@v18
17 | with:
18 | install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-3.0pre20201007_5257a25/install
19 | extra_nix_config: |
20 | experimental-features = nix-command flakes
21 | - uses: cachix/cachix-action@v12
22 | with:
23 | name: gytix
24 | authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
25 | - run: nix build .#nixosConfigurations.GytisOS.config.system.build.toplevel -L
26 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Gytis Ivaskevicius
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # A highly awesome system configuration
3 | [](https://builtwithnix.org)
4 |
5 | ### File structure
6 | 1. `config` - Main system configuration. `base-desktop.nix` contains lots of useful defaults.
7 | 2. `home-manager` - Holds most of the desktop configuration.
8 | 3. `modules` - A couple of custom options.
9 | 4. `overlays` - Contains riced and custom packages. Riced packages have the name prefix `g-`.
10 | 5. `hosts` - Contains host specific configuration.
11 | 6. `flake.nix` - Kickass flake config ;)
12 |
13 |
14 | # ZFS Cheatsheet
15 |
16 | ## Create pool
17 | ```bash
18 | zpool create -o ashift=12 -o autotrim=on -O compression=zstd -O acltype=posixacl -O xattr=sa -O atime=off -O mountpoint=legacy zroot sdx2
19 |
20 | # with two mirrored drives
21 | zpool create -o ashift=12 -o autotrim=on -O compression=zstd -O acltype=posixacl -O xattr=sa -O atime=off -O mountpoint=legacy zroot mirror sdx2 sdy2
22 | ```
23 |
24 | - `autotrim` - Should be omitted for non-SSD storage.
25 | - `ashift` - Requires research. this setting is device-specific, and many drives will lie.
26 |
27 |
28 | ## Setup partitions
29 | ```bash
30 | mkfs.vfat -n BOOT -F32 /dev/sdx1
31 | parted /dev/sdx set 1 boot on
32 |
33 | mkdir /mnt/{home,boot,nix}
34 |
35 | zfs create -o encryption=on -o keyformat=passphrase zroot/locker
36 | zfs create zroot/locker/home
37 | zfs create zroot/locker/nix
38 | zfs create zroot/locker/os
39 |
40 | mount -t zfs zroot/locker/os /mnt
41 | mount -t zfs zroot/locker/home /mnt/home
42 | mount -t zfs zroot/locker/nix /mnt/nix
43 | mount /dev/sdx1 /mnt/boot
44 | ```
45 |
46 | ## NixOS config
47 | ```nix
48 | {
49 | # needed for zfs. 4 random bytes (in hex)
50 | networking.hostId = "12345678";
51 |
52 | # or nicer implementation
53 | networking.hostId = builtins.substring 0 8 (builtins.hashString "md5" config.networking.hostName);
54 |
55 | # nixos documentation recommends setting these to false
56 | boot = {
57 | zfs.forceImportAll = false;
58 | zfs.forceImportRoot = false;
59 | };
60 | }
61 | ```
62 |
63 |
64 | ## unmount and export all zfs stuff before leaving the live installer!!!
65 | ```bash
66 | zpool export zroot
67 | ```
68 |
--------------------------------------------------------------------------------
/config/aarch64Dev.nix:
--------------------------------------------------------------------------------
1 | { pkgs, lib, ... }:
2 |
3 | {
4 |
5 | boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
6 |
7 | environment.systemPackages = with pkgs; [ tio ];
8 |
9 | nix.settings = {
10 | substituters = [ "https://arm.cachix.org/" ];
11 | trusted-public-keys = [ "arm.cachix.org-1:5BZ2kjoL1q6nWhlnrbAl+G7ThY7+HaBRD9PZzqZkbnM=" ];
12 | };
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/config/base-desktop.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, lib, ... }: {
2 | #powerManagement.powertop.enable = true;
3 | powerManagement.cpuFreqGovernor = "performance";
4 | console.keyMap = "us";
5 | i18n.defaultLocale = "en_US.UTF-8";
6 | nix.settings.auto-optimise-store = false;
7 | system.stateVersion = "24.11";
8 | time.timeZone = "Europe/Vilnius";
9 |
10 | #gytix.cachix.enable = true;
11 | gytix.cleanHome.enable = true;
12 |
13 | systemd.tmpfiles.rules = [
14 | "L+ /lib64/ld-linux-x86-64.so.2 - - - - ${pkgs.glibc}/lib64/ld-linux-x86-64.so.2"
15 | ];
16 |
17 | # Limits start limit burst to 1sec instead of 5 since it was causing issues with rapid logout/login and units restart
18 | systemd.user.extraConfig = ''
19 | DefaultStartLimitBurst=1
20 | '';
21 |
22 | networking = {
23 | #firewall.enable = false;
24 | #firewall.allowedTCPPorts = [ 8080 9090 ];
25 | firewall.allowPing = false;
26 | hostId = builtins.substring 0 8
27 | (builtins.hashString "md5" config.networking.hostName);
28 | nameservers = [ "192.168.30.11" "192.168.30.12" ];
29 | useDHCP = false;
30 | networkmanager.enable = true;
31 | };
32 |
33 | environment.systemPackages = [
34 | pkgs.vulkan-validation-layers
35 | pkgs.bluez ];
36 |
37 | services.resolved = {
38 | enable = true;
39 | extraConfig = ''
40 | DNS=1.1.1.1 1.0.0.1
41 | '';
42 | };
43 |
44 | programs.ssh.startAgent = true;
45 |
46 | nix.gc = {
47 | automatic = true;
48 | options = "--delete-older-than 40d";
49 | dates = "weekly";
50 | };
51 |
52 | boot = {
53 | # Imporved networking
54 | kernelModules = [ "tcp_bbr" "amdgpu" ];
55 | kernel.sysctl."net.ipv4.tcp_congestion_control" = "bbr";
56 | kernel.sysctl."net.core.default_qdisc" = "fq";
57 |
58 | kernel.sysctl = {
59 | "vm.swappiness" = 5;
60 | "fs.inotify.max_user_watches" = 524288;
61 | };
62 | #zfs.enableUnstable = true;
63 | #kernelParams = [ "quiet" "loglevel=3" ];
64 | tmp.cleanOnBoot = true;
65 | loader.systemd-boot.enable = true;
66 | initrd.systemd.enable = true;
67 | initrd.availableKernelModules = [ "amdgpu" ];
68 | initrd.kernelModules = [ "amdgpu" ];
69 | loader.timeout = 2;
70 | tmp.useTmpfs = true;
71 | };
72 |
73 | services = {
74 | fwupd.enable = true;
75 | dbus.packages = with pkgs; [ dconf ];
76 | zfs.autoSnapshot.enable = true;
77 | zfs.autoScrub.enable = true;
78 | openssh.enable = true;
79 | openssh.settings.PasswordAuthentication = false;
80 | printing.enable = true;
81 | tlp.enable = true;
82 | };
83 | #services.xserver.enable = true;
84 | services.xserver.videoDrivers = [ "amdgpu" ];
85 | services.xserver.deviceSection = ''
86 | Option "VariableRefresh" "true"
87 | '';
88 |
89 | zramSwap.enable = true;
90 |
91 | fonts = {
92 | enableDefaultPackages = true;
93 | packages = builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts);
94 | #packages = [pkgs.nerdfonts];
95 | };
96 |
97 | security.rtkit.enable = true;
98 | services.pipewire = {
99 | enable = true;
100 | alsa.enable = true;
101 | alsa.support32Bit = true;
102 | pulse.enable = true;
103 | };
104 |
105 | xdg.portal = {
106 | enable = true;
107 | #gtkUsePortal = true;
108 | extraPortals = with pkgs; [ xdg-desktop-portal-wlr xdg-desktop-portal-gtk ];
109 | };
110 |
111 | programs.gnupg.agent.enable = true;
112 |
113 | hardware.amdgpu.amdvlk.enable = true;
114 | hardware.amdgpu.amdvlk.support32Bit.enable = true;
115 |
116 | hardware = {
117 | enableRedistributableFirmware = true;
118 | enableAllFirmware = true;
119 | graphics = {
120 | enable = lib.mkDefault true;
121 | enable32Bit = config.hardware.graphics.enable;
122 | extraPackages = with pkgs;
123 | [
124 | # rocm-opencl-icd
125 | # rocm-opencl-runtime
126 | #amdvlk
127 | vaapiVdpau
128 | libvdpau-va-gl
129 | ];
130 | #extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ];
131 | };
132 | cpu.amd.updateMicrocode = true;
133 | #cpu.intel.updateMicrocode = true;
134 | };
135 | }
136 |
--------------------------------------------------------------------------------
/config/cli-extras.nix:
--------------------------------------------------------------------------------
1 | { pkgs, lib, ... }: {
2 |
3 | programs.adb.enable = true;
4 |
5 | environment.systemPackages = with pkgs; [
6 | #android-file-transfer
7 | binutils
8 | dmidecode
9 | dnsutils
10 | ffmpeg
11 | g-lf
12 | ijq
13 | manix
14 | mediainfo
15 | neofetch
16 | nix-index
17 | nmap
18 | ntfs3g
19 | openssl
20 | patchelf
21 | python3
22 | rclone
23 | sshfs
24 | sshpass
25 | sshuttle
26 | steam-run
27 | tmate
28 | tmux
29 | usbutils
30 | yt-dlp
31 | zellij
32 | ];
33 | }
34 |
--------------------------------------------------------------------------------
/config/cli.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, lib, inputs, ... }: {
2 |
3 | environment.variables = {
4 | EDITOR = "nvim";
5 | LC_ALL = "en_US.UTF-8";
6 | TERM = "xterm-256color";
7 | };
8 |
9 | users.defaultUserShell = lib.getExe pkgs.zsh;
10 |
11 | programs.direnv = {
12 | enable = true;
13 | package = pkgs.direnv;
14 | silent = false;
15 | loadInNixShell = true;
16 | direnvrcExtra = "";
17 | nix-direnv = {
18 | enable = true;
19 | package = pkgs.nix-direnv;
20 | };
21 | };
22 |
23 | programs.zsh = {
24 | enableBashCompletion = true;
25 | autosuggestions.enable = true;
26 | autosuggestions.extraConfig.ZSH_AUTOSUGGEST_USE_ASYNC = "y";
27 | enable = true;
28 | enableCompletion = true;
29 | histFile = "$HOME/.cache/.zsh_history";
30 | histSize = 100000;
31 | syntaxHighlighting.enable = true;
32 | syntaxHighlighting.highlighters = [ "main" "brackets" "pattern" "root" "line" ];
33 | ohMyZsh.enable = true;
34 | ohMyZsh.plugins = [ "sudo" "z" "aws" ];
35 | shellInit = ''
36 | source ${pkgs.zsh-forgit}/share/zsh/zsh-forgit/forgit.plugin.zsh
37 | chat() {
38 | echo
39 | ${lib.getExe pkgs.chatgpt-cli} "$@" | ${lib.getExe pkgs.bat} --language=md --decorations=never
40 | }
41 | '';
42 | promptInit = ''
43 | ${builtins.readFile (pkgs.shell-config.override {
44 | dockerAliasEnabled = config.virtualisation.docker.enable;
45 | })}
46 | autoload -U promptinit && promptinit && prompt pure
47 | complete -o nospace -C ${pkgs.terraform}/bin/terraform terraform
48 | complete -o nospace -C ${pkgs.awscli}/bin/aws_completer aws
49 | source ~/.zshrc
50 | '';
51 |
52 | setOptions = [
53 | "AUTO_CD"
54 | "BANG_HIST"
55 | "EXTENDED_HISTORY"
56 | "HIST_EXPIRE_DUPS_FIRST"
57 | "HIST_FIND_NO_DUPS"
58 | "HIST_IGNORE_ALL_DUPS"
59 | "HIST_IGNORE_DUPS"
60 | "HIST_IGNORE_SPACE"
61 | "HIST_REDUCE_BLANKS"
62 | "HIST_SAVE_NO_DUPS"
63 | "INC_APPEND_HISTORY"
64 | "NOAUTOMENU"
65 | "NOMENUCOMPLETE"
66 | "SHARE_HISTORY"
67 | ];
68 |
69 | };
70 |
71 | environment.shellAliases = {
72 | ga = "git add";
73 | gc = "git commit";
74 | gcm = "git commit -m";
75 | gs = "git status";
76 | gsb = "git status -sb";
77 | grep = "grep --color=auto";
78 | diff = "diff --color=auto";
79 | nixos-rebuild = "sudo nixos-rebuild";
80 | auto-nix-rebuild = "ls /etc/nixos/**/*.nix | entr sudo bash -c 'nixos-rebuild switch && printf \"DONE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\"'";
81 | personal = "sudo $EDITOR /etc/nixos/personal.nix";
82 | opt = "manix '' | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --ansi --preview=\"manix '{}' | sed 's/type: /> type: /g' | bat -l Markdown --color=always --plain\"";
83 |
84 | burn = "pkill -9";
85 | external-ip = "dig +short myip.opendns.com @resolver1.opendns.com";
86 | v = "$EDITOR $(fzf)";
87 | sv = "sudo $EDITOR $(fzf)";
88 | killall = "pkill";
89 | q = "exit";
90 | sc = "sudo systemctl";
91 | scu = "systemctl --user ";
92 | svi = "sudo $EDITOR";
93 | net = "ip -c -br addr";
94 |
95 | mkdir = "mkdir -p";
96 | rm = "rm -Iv --preserve-root";
97 | wget = "wget -c";
98 |
99 | c = "xclip -selection clipboard";
100 | cm = "xclip"; # Copy to middle click clipboard
101 | l = "ls -lF --time-style=long-iso";
102 | la = "l -a";
103 | ls = "eza -h --git --color=auto --group-directories-first -s extension";
104 | lstree = "ls --tree";
105 | tree = "lstree";
106 |
107 | ".." = "cd ..";
108 | "..." = "cd ../../";
109 | "...." = "cd ../../../";
110 | "....." = "cd ../../../../";
111 | "......" = "cd ../../../../../";
112 | };
113 |
114 | environment.systemPackages = with pkgs; [
115 | bat
116 | curl
117 | entr
118 | eza
119 | fd
120 | file
121 | fup-repl
122 | fzf
123 | gcc
124 | git
125 | git-lfs
126 | github-cli
127 | htop
128 | inetutils
129 | iotop
130 | jq
131 | lm_sensors
132 | lshw
133 | lsof
134 | man
135 | nettools
136 | nix-top
137 | nix-tree
138 | nix2vimDemo
139 | nixfmt-rfc-style
140 | nixpkgs-fmt
141 | nushell
142 | p7zip
143 | parted
144 | pciutils
145 | psmisc
146 | pure-prompt
147 | ranger
148 | ripgrep
149 | statix
150 | unzip
151 | wget
152 | which
153 | zip
154 | chatgpt-cli
155 | ];
156 | }
157 |
--------------------------------------------------------------------------------
/config/containers.nix:
--------------------------------------------------------------------------------
1 | { pkgs, lib, ... }:
2 |
3 | {
4 |
5 | virtualisation.docker = {
6 | autoPrune.enable = true;
7 | enable = true;
8 | enableOnBoot = false;
9 | liveRestore = false;
10 | };
11 |
12 | virtualisation.podman.enable = true;
13 | virtualisation.containers.registries.search = [ "docker.io" ];
14 |
15 | nix-compose.definitions.test-stack2.compose = {
16 |
17 | services.hello.image = pkgs.dockerTools.buildImage {
18 | name = "hello-docker";
19 | config = { Cmd = [ "${pkgs.hello}/bin/hello" ]; };
20 | };
21 |
22 | #services.nginx3 = {
23 | # image = "nginx";
24 | # ports = [ "8083:80" ];
25 | # volumes = [
26 | # (bind "/usr/share/nginx/html/index.html" (pkgs.writeText "index.html" "Man, SCREW WORLD!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"))
27 | # (volume "test-volume" "/my-volume")
28 | # (volume "test-volume2" "/my-volume2")
29 | # ];
30 | #};
31 |
32 |
33 |
34 |
35 | services.nginx3 = {
36 | image = "nginx";
37 | ports = [ "8083:80" ];
38 | volumes = [
39 | {
40 | source = pkgs.writeText "index.html" "Man, SCREW WORLD!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
41 | target = "/usr/share/nginx/html/index.html";
42 | }
43 | {
44 | volumeName = "test-volume";
45 | target = "/my-volume";
46 | }
47 | {
48 | volumeName = "test-volume2";
49 | target = "/my-volume2";
50 | }
51 | {
52 | volumeName = "test-volume3";
53 | target = "/my-volume3";
54 | }
55 | ];
56 |
57 | };
58 |
59 | volumes = {
60 | test = { };
61 | };
62 |
63 | };
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/config/dev.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, lib, ... }:
2 |
3 | {
4 | #virtualisation.podman.enable = true;
5 |
6 | environment.systemPackages = with pkgs; [
7 | #jetbrains.idea-ultimate
8 | #podman-compose
9 | awscli2
10 | kubectl
11 | kubernetes-helm
12 | k9s
13 | ];
14 |
15 | ## Docker
16 | virtualisation.docker = {
17 | autoPrune.enable = true;
18 | enable = true;
19 | #enableNvidia = true;
20 | enableOnBoot = false;
21 | liveRestore = false;
22 | };
23 |
24 | ## VirtualBox
25 | virtualisation.virtualbox = {
26 | host.enable = false;
27 |
28 | # Takes quite a while to compile. It adds support for:
29 | # USB 2.0/3.0 devices, VirtualBox RDP, disk encryption, NVMe and PXE boot for Intel cards
30 | host.enableExtensionPack = true;
31 |
32 | # VirtualBox Guest additions
33 | #virtualisation.virtualbox.guest.enable = true;
34 | };
35 |
36 | ### Java
37 | gytix.java.additionalPackages = {
38 | #inherit (pkgs) jdk11 jdk8;
39 | };
40 | programs.java.enable = true;
41 | programs.java.package = pkgs.jdk;
42 |
43 | ### Node
44 | programs.npm.enable = true;
45 | programs.npm.package = pkgs.nodejs;
46 | gytix.node.additionalPackages = {
47 | #inherit (pkgs) nodejs-16_x;
48 | };
49 | }
50 |
--------------------------------------------------------------------------------
/config/k3s.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 | {
3 | services.k3s.enable = true;
4 | services.k3s.extraFlags = toString [
5 | "--disable metrics-server"
6 | "--disable traefik"
7 | ];
8 |
9 | #boot.kernel.sysctl."net.ipv6.conf.enp1s0f0.accept_ra" = "2";
10 |
11 | environment.systemPackages = [ pkgs.iptables ];
12 | systemd.services.k3s.path = [ pkgs.ipset ];
13 | }
14 |
--------------------------------------------------------------------------------
/config/personal.nix:
--------------------------------------------------------------------------------
1 | { pkgs, lib, ... }:
2 |
3 | {
4 | #services.tailscale.enable = true;
5 | services.zerotierone.enable = false;
6 | services.zerotierone.joinNetworks = [ "9bee8941b5c7428a" "12ac4a1e710088c5" ];
7 |
8 | nix.settings.trusted-users = [ "gytis" ];
9 |
10 | users.extraUsers.gytis = {
11 | shell = pkgs.zsh;
12 | isNormalUser = true;
13 | description = "Gytis Ivaskevicius";
14 | extraGroups = [
15 | "audio"
16 | "video"
17 | "dialout"
18 | "adbusers"
19 | "wheel"
20 | "networkmanager"
21 | "docker"
22 | "vboxusers"
23 | "libvirt"
24 | "libvirtd"
25 | "kvm"
26 | ];
27 | initialPassword = "toor";
28 | };
29 |
30 | users.extraUsers.guest = {
31 | shell = pkgs.zsh;
32 | isNormalUser = true;
33 | description = "Guest user";
34 | extraGroups = [ "wheel" ];
35 | initialPassword = "toor";
36 | };
37 |
38 | environment.systemPackages = with pkgs; [ ];
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/config/sway.nix:
--------------------------------------------------------------------------------
1 | { pkgs, lib, ... }:
2 |
3 | {
4 |
5 | services.upower.enable = true;
6 |
7 | programs.sway = {
8 | enable = true;
9 | extraPackages = [ ];
10 | wrapperFeatures = {
11 | base = true;
12 | gtk = true;
13 | };
14 | extraSessionCommands = ''
15 | export SDL_VIDEODRIVER=wayland
16 | export QT_QPA_PLATFORM=wayland
17 | export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
18 | export _JAVA_AWT_WM_NONREPARENTING=1
19 | export SUDO_ASKPASS="${pkgs.ksshaskpass}/bin/ksshaskpass"
20 | export SSH_ASKPASS="${pkgs.ksshaskpass}/bin/ksshaskpass"
21 | export XDG_SESSION_TYPE=wayland
22 | export XDG_CURRENT_DESKTOP=sway
23 | '';
24 | };
25 |
26 | environment.variables = {
27 | XDG_SESSION_TYPE = "wayland";
28 | XDG_CURRENT_DESKTOP = "sway";
29 | };
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/config/winapps.nix:
--------------------------------------------------------------------------------
1 | { pkgs, lib, ... }: {
2 | environment.systemPackages = with pkgs; [ bc freerdp3 ];
3 |
4 | programs.virt-manager.enable = true;
5 | virtualisation = {
6 | libvirtd = {
7 | enable = true;
8 | #qemuRunAsRoot = false;
9 | #onBoot = "ignore";
10 | #allowedBridges = [
11 | # "virbr0"
12 | # "virbr1"
13 | # "virbr0-nic"
14 | # "docker0"
15 | #];
16 | };
17 |
18 | spiceUSBRedirection.enable = true;
19 | };
20 |
21 | users.groups.libvirt = { };
22 |
23 | virtualisation.oci-containers = {
24 | backend = "docker";
25 | containers = {
26 | windows = {
27 | hostname = "winvm";
28 | autoStart = true;
29 | image = "dockurr/windows";
30 | volumes = [
31 | "/mnt/shared:/shared"
32 | "/home/docker/windows/data:/storage"
33 | "/etc/nixos/scripts:/oem"
34 | ];
35 | ports = [ "8006:8006" "3389:3389" ];
36 | environment = {
37 | VERSION = "win11e";
38 | USERNAME = "gytis";
39 | PASSWORD = "toor";
40 | DISK_SIZE = "128G";
41 | RAM_SIZE = "16G";
42 | CPU_CORES = "8";
43 | };
44 | extraOptions =
45 | [ "--cap-add=NET_ADMIN" "--device=/dev/kvm" "--stop-timeout=120" ];
46 | };
47 | windows-v2 = {
48 | hostname = "winvm-v2";
49 | autoStart = false;
50 | image = "dockurr/windows";
51 | volumes = [
52 | "/mnt/windows:/shared"
53 | "/home/docker/windows-v2/data:/storage"
54 | "/etc/nixos/windows-v2/:/oem"
55 | ];
56 | ports = [ "8000:8006" "3333:3389" ];
57 | environment = {
58 | VERSION = "win11e";
59 | USERNAME = "gytis";
60 | PASSWORD = "toor";
61 | DISK_SIZE = "128G";
62 | RAM_SIZE = "16G";
63 | CPU_CORES = "8";
64 | };
65 | extraOptions =
66 | [ "--cap-add=NET_ADMIN" "--device=/dev/kvm" "--stop-timeout=120" ];
67 | };
68 | };
69 | };
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/config/xorg.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | xdg.mime.enable = true;
5 | environment.systemPackages = with pkgs; [ xclip ];
6 |
7 | fonts.fonts = with pkgs; [ nerdfonts noto-fonts-emoji noto-fonts ];
8 | services.xserver = {
9 | enable = true;
10 | layout = "us";
11 | xkbOptions = "terminate:ctrl_alt_bksp,caps:escape,altwin:swap_alt_win";
12 | libinput = {
13 | enable = true;
14 | # Left + right click emulates middle button.
15 | middleEmulation = true;
16 | #naturalScrolling = true;
17 | };
18 |
19 | # Make auto-repeat on key hold work faster.
20 | displayManager.xserverArgs = [ "-ardelay 300" "-arinterval 20" ];
21 |
22 | displayManager.lightdm = {
23 | enable = true;
24 | greeters.enso.enable = true;
25 | greeters.enso.theme.name = "Numix";
26 | greeters.enso.theme.package = pkgs.numix-gtk-theme;
27 |
28 | #background
29 | #greeters.enso.blur
30 | #greeters.enso.brightness
31 | #greeters.enso.cursorTheme.name
32 | #greeters.enso.cursorTheme.package
33 | #greeters.enso.extraConfig
34 | #greeters.enso.iconTheme.name
35 | #greeters.enso.iconTheme.package
36 | };
37 | };
38 |
39 | # TODO: Does not work well 20.09, needs to be fixed at some point
40 | # To make sure all local SSH sessions are closed after a laptop lid is shut.
41 | #powerManagement.powerDownCommands = ''
42 | #{pkgs.procps}/bin/pgrep ssh | IFS= read -r pid; do
43 | # "$(readlink "/proc/$pid/exe")" = "${pkgs.openssh}/bin/ssh" ] && kill "$pid"
44 | #one
45 | #'';
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/flake.lock:
--------------------------------------------------------------------------------
1 | {
2 | "nodes": {
3 | "devshell": {
4 | "inputs": {
5 | "nixpkgs": [
6 | "nixpkgs"
7 | ]
8 | },
9 | "locked": {
10 | "lastModified": 1735644329,
11 | "narHash": "sha256-tO3HrHriyLvipc4xr+Ewtdlo7wM1OjXNjlWRgmM7peY=",
12 | "owner": "numtide",
13 | "repo": "devshell",
14 | "rev": "f7795ede5b02664b57035b3b757876703e2c3eac",
15 | "type": "github"
16 | },
17 | "original": {
18 | "owner": "numtide",
19 | "repo": "devshell",
20 | "type": "github"
21 | }
22 | },
23 | "flake-utils": {
24 | "inputs": {
25 | "systems": "systems"
26 | },
27 | "locked": {
28 | "lastModified": 1694529238,
29 | "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
30 | "owner": "numtide",
31 | "repo": "flake-utils",
32 | "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
33 | "type": "github"
34 | },
35 | "original": {
36 | "owner": "numtide",
37 | "repo": "flake-utils",
38 | "type": "github"
39 | }
40 | },
41 | "forgit-git": {
42 | "flake": false,
43 | "locked": {
44 | "lastModified": 1738130647,
45 | "narHash": "sha256-vVsJe/MycQrwHLJOlBFLCuKuVDwQfQSMp56Y7beEUyg=",
46 | "owner": "wfxr",
47 | "repo": "forgit",
48 | "rev": "bb83b3cba0ec009cf0e8d5dc5abf8cd82bced76e",
49 | "type": "github"
50 | },
51 | "original": {
52 | "owner": "wfxr",
53 | "repo": "forgit",
54 | "type": "github"
55 | }
56 | },
57 | "home-manager": {
58 | "inputs": {
59 | "nixpkgs": [
60 | "nixpkgs"
61 | ]
62 | },
63 | "locked": {
64 | "lastModified": 1738610386,
65 | "narHash": "sha256-yb6a5efA1e8xze1vcdN2HBxqYr340EsxFMrDUHL3WZM=",
66 | "owner": "nix-community",
67 | "repo": "home-manager",
68 | "rev": "066ba0c5cfddbc9e0dddaec73b1561ad38aa8abe",
69 | "type": "github"
70 | },
71 | "original": {
72 | "owner": "nix-community",
73 | "repo": "home-manager",
74 | "type": "github"
75 | }
76 | },
77 | "nix2vim": {
78 | "inputs": {
79 | "flake-utils": [
80 | "utils"
81 | ],
82 | "nixpkgs": []
83 | },
84 | "locked": {
85 | "lastModified": 1732820845,
86 | "narHash": "sha256-YPXk41l4PzKb5rtcxkYhymwjHJG95fxl4iXIzXnftr8=",
87 | "owner": "gytis-ivaskevicius",
88 | "repo": "nix2vim",
89 | "rev": "e2c511ea553418dd432005875c649b09d56b7e58",
90 | "type": "github"
91 | },
92 | "original": {
93 | "owner": "gytis-ivaskevicius",
94 | "repo": "nix2vim",
95 | "type": "github"
96 | }
97 | },
98 | "nixos-hardware": {
99 | "locked": {
100 | "lastModified": 1738471961,
101 | "narHash": "sha256-cgXDFrplNGs7bCVzXhRofjD8oJYqqXGcmUzXjHmip6Y=",
102 | "owner": "NixOS",
103 | "repo": "nixos-hardware",
104 | "rev": "537286c3c59b40311e5418a180b38034661d2536",
105 | "type": "github"
106 | },
107 | "original": {
108 | "owner": "NixOS",
109 | "ref": "master",
110 | "repo": "nixos-hardware",
111 | "type": "github"
112 | }
113 | },
114 | "nixpkgs": {
115 | "locked": {
116 | "lastModified": 1739617548,
117 | "narHash": "sha256-zy+H5dnl67YHon2dzTTjqb7sN3Q86lxe4nVqqK/h4i4=",
118 | "owner": "NixOS",
119 | "repo": "nixpkgs",
120 | "rev": "bc5f6735097505c1b201383b8393c03458632916",
121 | "type": "github"
122 | },
123 | "original": {
124 | "owner": "NixOS",
125 | "repo": "nixpkgs",
126 | "type": "github"
127 | }
128 | },
129 | "root": {
130 | "inputs": {
131 | "devshell": "devshell",
132 | "forgit-git": "forgit-git",
133 | "home-manager": "home-manager",
134 | "nix2vim": "nix2vim",
135 | "nixos-hardware": "nixos-hardware",
136 | "nixpkgs": "nixpkgs",
137 | "unstable": "unstable",
138 | "utils": "utils"
139 | }
140 | },
141 | "systems": {
142 | "locked": {
143 | "lastModified": 1681028828,
144 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
145 | "owner": "nix-systems",
146 | "repo": "default",
147 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
148 | "type": "github"
149 | },
150 | "original": {
151 | "owner": "nix-systems",
152 | "repo": "default",
153 | "type": "github"
154 | }
155 | },
156 | "unstable": {
157 | "locked": {
158 | "lastModified": 1739617548,
159 | "narHash": "sha256-zy+H5dnl67YHon2dzTTjqb7sN3Q86lxe4nVqqK/h4i4=",
160 | "owner": "NixOS",
161 | "repo": "nixpkgs",
162 | "rev": "bc5f6735097505c1b201383b8393c03458632916",
163 | "type": "github"
164 | },
165 | "original": {
166 | "owner": "NixOS",
167 | "repo": "nixpkgs",
168 | "type": "github"
169 | }
170 | },
171 | "utils": {
172 | "inputs": {
173 | "flake-utils": "flake-utils"
174 | },
175 | "locked": {
176 | "lastModified": 1738591040,
177 | "narHash": "sha256-4WNeriUToshQ/L5J+dTSWC5OJIwT39SEP7V7oylndi8=",
178 | "owner": "gytis-ivaskevicius",
179 | "repo": "flake-utils-plus",
180 | "rev": "afcb15b845e74ac5e998358709b2b5fe42a948d1",
181 | "type": "github"
182 | },
183 | "original": {
184 | "owner": "gytis-ivaskevicius",
185 | "repo": "flake-utils-plus",
186 | "type": "github"
187 | }
188 | }
189 | },
190 | "root": "root",
191 | "version": 7
192 | }
193 |
--------------------------------------------------------------------------------
/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "A highly awesome system configuration.";
3 |
4 | inputs = {
5 | #nixpkgs.url = "/home/gytis/nixpkgs/";
6 | #unstable.url = "/home/gytis/nixpkgs";
7 |
8 | nixpkgs.url = "/home/gytis/nixpkgs";
9 | unstable.url = "github:NixOS/nixpkgs";
10 |
11 | nixos-hardware.url = "github:NixOS/nixos-hardware/master";
12 |
13 |
14 | utils.url = github:gytis-ivaskevicius/flake-utils-plus;
15 | #utils.url = "/home/gytis/Projects/flake-utils-plus";
16 | devshell.url = "github:numtide/devshell";
17 | devshell.inputs.nixpkgs.follows = "nixpkgs";
18 | devshell.inputs.flake-utils.follows = "utils";
19 |
20 | nix2vim.url = "/home/gytis/Projects/nix2vim";
21 | #nix2vim.url = "github:gytis-ivaskevicius/nix2vim";
22 | nix2vim.inputs.nixpkgs.follows = "";
23 | nix2vim.inputs.flake-utils.follows = "utils";
24 |
25 | home-manager = {
26 | url = "github:nix-community/home-manager";
27 | inputs.nixpkgs.follows = "nixpkgs";
28 | inputs.utils.follows = "utils";
29 | };
30 |
31 | forgit-git = {
32 | url = "github:wfxr/forgit";
33 | flake = false;
34 | };
35 |
36 | };
37 |
38 | outputs =
39 | inputs@{
40 | self,
41 | nix2vim,
42 | utils,
43 | home-manager,
44 | nixos-hardware,
45 | ...
46 | }:
47 | let
48 | pkgs = self.pkgs.x86_64-linux.nixpkgs;
49 | mkApp = utils.lib.mkApp;
50 | suites = import ./suites.nix { inherit utils; };
51 | in
52 | with suites.nixosModules;
53 | utils.lib.mkFlake {
54 | inherit self inputs;
55 | inherit (suites) nixosModules;
56 |
57 | supportedSystems = [
58 | "aarch64-linux"
59 | "x86_64-linux"
60 | ];
61 | channelsConfig.allowUnfree = true;
62 | channelsConfig.allowBroken = false;
63 |
64 | channels.nixpkgs.overlaysBuilder = channels: [
65 | (final: prev: {
66 | #inherit (channels.unstable) pure-prompt neovim-unwrapped linuxPackages_latest gcc11Stdenv layan-gtk-theme;
67 | })
68 | ];
69 |
70 | hosts.GytisOS.modules = suites.desktopModules ++ [
71 | #aarch64Dev
72 | dev
73 | {
74 | security.apparmor.enable = true;
75 | }
76 |
77 | ./hosts/GytisOS.host.nix
78 | ];
79 |
80 | hosts.Monday.modules = suites.desktopModules ++ [
81 | aarch64Dev
82 | dev
83 | ./hosts/Monday.host.nix
84 | nixos-hardware.nixosModules.common-pc
85 | nixos-hardware.nixosModules.common-pc-ssd
86 | nixos-hardware.nixosModules.common-hidpi
87 | nixos-hardware.nixosModules.common-gpu-amd
88 | nixos-hardware.nixosModules.common-cpu-amd-pstate
89 | nixos-hardware.nixosModules.common-cpu-amd-zenpower
90 | #./config/k3s.nix
91 | ];
92 |
93 | hosts."gytis-ivaskevicius".modules = suites.desktopModules ++ [
94 | dev
95 | ./hosts/gytis-ivaskevicius.host.nix
96 | ];
97 |
98 | hosts.Morty.modules = suites.desktopModules ++ [
99 | ./hosts/Morty.host.nix
100 | ];
101 |
102 | hosts.NixyServer.modules = [
103 | containers
104 | ./hosts/NixyServer.host.nix
105 | ];
106 |
107 | sharedOverlays = [
108 | self.overlay
109 | nix2vim.overlay
110 | (final: prev: {
111 | #nix2vimDemo = prev.g-neovim;
112 | firefox = prev.g-firefox;
113 | })
114 | ];
115 |
116 | hostDefaults.modules = [
117 | home-manager.nixosModules.home-manager
118 | ] ++ suites.sharedModules;
119 |
120 |
121 | #############################
122 | ### Flake package outputs ###
123 | #############################
124 |
125 | outputsBuilder = channels: with channels.nixpkgs;{
126 |
127 | packages = {
128 | repl = pkgs.callPackage utils.blueprints.fup-repl { };
129 | inherit
130 | nix2vimDemo
131 | g-alacritty
132 | g-firefox
133 | g-lf
134 | g-pistol
135 | g-polybar
136 | g-rofi
137 | g-termite
138 | shell-config
139 | zsh-forgit
140 | ;
141 | };
142 |
143 | devShell = mkShell {
144 | buildInputs = [ git transcrypt ];
145 | };
146 | };
147 |
148 | overlay = import ./overlays;
149 |
150 | };
151 | }
152 |
153 |
--------------------------------------------------------------------------------
/home-manager/common.nix:
--------------------------------------------------------------------------------
1 | { pkgs, lib, config, ... }:
2 |
3 | with lib;
4 | with pkgs;
5 | let
6 | #browser = [ "firefox.desktop" ];
7 | #browser = [ "chromium-browser.desktop" ];
8 | browser = [ "chromium.desktop" ];
9 | associations = {
10 | "text/html" = browser;
11 | "x-scheme-handler/http" = browser;
12 | "x-scheme-handler/https" = browser;
13 | "x-scheme-handler/ftp" = browser;
14 | "x-scheme-handler/chrome" = browser;
15 | "x-scheme-handler/about" = browser;
16 | "x-scheme-handler/unknown" = browser;
17 | "application/x-extension-htm" = browser;
18 | "application/x-extension-html" = browser;
19 | "application/x-extension-shtml" = browser;
20 | "application/xhtml+xml" = browser;
21 | "application/x-extension-xhtml" = browser;
22 | "application/x-extension-xht" = browser;
23 | "image/*" = "org.gnome.eog.desktop";
24 |
25 | #"text/*" = [ "emacs.desktop" ];
26 | "audio/*" = [ "vlc.desktop" ];
27 | "video/*" = [ "vlc.dekstop" ];
28 | #"image/*" = [ "ahoviewer.desktop" ];
29 | #"text/calendar" = [ "thunderbird.desktop" ]; # ".ics" iCalendar format
30 | "application/json" = browser; # ".json" JSON format
31 | "application/pdf" = browser; # ".pdf" Adobe Portable Document Format (PDF)
32 | "x-scheme-handler/tg" = "userapp-Telegram Desktop-95VAQ1.desktop";
33 | };
34 | in
35 | {
36 | home.stateVersion = "24.11";
37 | home.keyboard.options = [ "terminate:ctrl_alt_bksp" "caps:escape" "altwin:swap_alt_win" ];
38 |
39 |
40 | services.network-manager-applet.enable = true;
41 |
42 | home.sessionVariables = {
43 | BROWSER = "chromium";
44 | TERMINAL = "alacritty";
45 | NIXPKGS_ALLOW_UNFREE = 1;
46 | };
47 |
48 | xdg.mimeApps.enable = true;
49 | xdg.mimeApps.associations.added = associations;
50 | xdg.mimeApps.defaultApplications = associations;
51 |
52 | fonts.fontconfig.enable = true;
53 |
54 | gtk = {
55 | enable = true;
56 | iconTheme.package = pkgs.papirus-icon-theme;
57 | iconTheme.name = "ePapirus";
58 | theme.package = pkgs.layan-gtk-theme;
59 | theme.name = "Layan-Dark-Solid";
60 | font.name = "Roboto";
61 | font.package = pkgs.noto-fonts;
62 | gtk3.extraConfig = {
63 | gtk-application-prefer-dark-theme = true;
64 | gtk-button-images = false;
65 | gtk-menu-images = false;
66 | gtk-toolbar-style = "GTK_TOOLBAR_ICONS";
67 | };
68 | };
69 |
70 | home.pointerCursor = {
71 | gtk.enable = true;
72 | package = pkgs.oreo-cursors-plus;
73 | name = "oreo_black_cursors";
74 | size = 30;
75 | };
76 |
77 | home.packages = with pkgs; [
78 | xdg-utils # Multiple packages depend on xdg-open at runtime. This includes Discord and JetBrains
79 | brave
80 | nautilus
81 | discord
82 | firefox
83 | g-alacritty
84 | eog
85 | pavucontrol
86 | vlc
87 | ];
88 |
89 | systemd.user.services.polkit-gnome = {
90 | Unit = {
91 | Description = "PolicyKit Authentication Agent";
92 | After = [ "graphical-session-pre.target" ];
93 | PartOf = [ "graphical-session.target" ];
94 | };
95 |
96 | Service = {
97 | ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
98 | };
99 |
100 | Install = {
101 | WantedBy = [ "graphical-session.target" ];
102 | };
103 | };
104 |
105 | }
106 |
--------------------------------------------------------------------------------
/home-manager/dunst.nix:
--------------------------------------------------------------------------------
1 | { config, ... }:
2 |
3 | {
4 |
5 | services.dunst = {
6 | enable = true;
7 | iconTheme = config.gtk.theme;
8 |
9 | settings = {
10 | global = {
11 | monitor = 0;
12 | follow = "mouse";
13 | geometry = "320x5-15+15";
14 | indicate_hidden = "yes";
15 | shrink = "no";
16 | transparency = 0;
17 | notification_height = 0;
18 | separator_height = 2;
19 | padding = 10;
20 | horizontal_padding = 10;
21 | frame_width = 1;
22 | frame_color = "#232323";
23 | separator_color = "frame";
24 | sort = "yes";
25 | idle_threshold = 120;
26 | font = "Source Sans Pro 10";
27 | line_height = 0;
28 | markup = "full";
29 | format = "%s %p\n%b";
30 | alignment = "left";
31 | show_age_threshold = 60;
32 | word_wrap = "yes";
33 | ellipsize = "middle";
34 | ignore_newline = "no";
35 | stack_duplicates = true;
36 | hide_duplicate_count = false;
37 | show_indicators = "yes";
38 | icon_position = "left";
39 | max_icon_size = 32;
40 | sticky_history = "yes";
41 | history_length = 20;
42 | always_run_script = true;
43 | startup_notification = false;
44 | verbosity = "mesg";
45 | corner_radius = 0;
46 | force_xinerama = false;
47 | mouse_left_click = "close_current";
48 | mouse_middle_click = "do_action";
49 | mouse_right_click = "close_all";
50 | };
51 |
52 | shortcuts = {
53 | close = "ctrl+space";
54 | close_all = "ctrl+shift+space";
55 | history = "ctrl+grave";
56 | context = "ctrl+shift+period";
57 | };
58 |
59 | urgency_low = {
60 | background = "#232323";
61 | foreground = "#a8a8a8";
62 | timeout = 10;
63 | };
64 |
65 | urgency_normal = {
66 | background = "#232323";
67 | foreground = "#a8a8a8";
68 | timeout = 10;
69 | };
70 |
71 | urgency_critical = {
72 | background = "#d64e4e";
73 | foreground = "#f0e0e0";
74 | frame_color = "#d64e4e";
75 | timeout = 0;
76 | icon = "/run/current-system/sw/share/icons/Papirus/16x16@2x/status/package-purge.svg";
77 | };
78 | };
79 | };
80 | }
81 |
--------------------------------------------------------------------------------
/home-manager/git.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }: {
2 |
3 | programs.git = {
4 | enable = true;
5 | #delta.enable = true;
6 | lfs.enable = true;
7 | userEmail = "me@gytis.io";
8 | userName = "Gytis Ivaškevičius";
9 | signing.signByDefault = true;
10 | signing.key = "DFAF982C85779001E06E1B1D5680CA190BD2B15B";
11 |
12 | aliases = {
13 | graph = "log --graph --decorate --oneline";
14 | map = "!git graph --all";
15 | watch = "!watch -ct 'git -c color.status=always status -s && echo && git map --color'";
16 | };
17 | };
18 | }
19 |
--------------------------------------------------------------------------------
/home-manager/i3-sway.nix:
--------------------------------------------------------------------------------
1 | { wm, config, lib, pkgs, ... }:
2 | with lib;
3 | with pkgs;
4 | let
5 | autotiling = writeShellScript "i3-autotiling.sh" ''
6 | #!/usr/bin/env bash
7 |
8 | REGEX="([0-9]+)x([0-9]+)"
9 |
10 | update_split(){
11 | OUTPUT="$(${xdotool}/bin/xdotool getwindowfocus getwindowgeometry)"
12 |
13 | if [[ $OUTPUT =~ $REGEX ]]
14 | then
15 | WIDTH="''${BASH_REMATCH[1]}"
16 | HEIGHT="''${BASH_REMATCH[2]}"
17 | if [ $WIDTH -gt $HEIGHT ];
18 | then
19 | ${config.xsession.windowManager.i3.package}/bin/i3-msg "split h"
20 | else
21 | ${config.xsession.windowManager.i3.package}/bin/i3-msg "split v"
22 | fi
23 | fi
24 | }
25 |
26 | while read -r line
27 | do
28 | LAYOUT="$(${config.xsession.windowManager.i3.package}/bin/i3-msg -t get_tree | ${jq}/bin/jq -r 'recurse(.nodes[]; .nodes != null) | select(.nodes[].focused).layout')"
29 | if [ "$LAYOUT" = "splitv" ] || [ "$LAYOUT" = "splith" ]; then
30 | update_split
31 | fi
32 | done < <(xprop -spy -root _NET_ACTIVE_WINDOW)
33 | '';
34 | left = "h";
35 | down = "j";
36 | up = "k";
37 | right = "l";
38 | bg-color = "#424242";
39 | inactive-bg-color = "#424242";
40 | text-color = "#4f97d7";
41 | inactive-text-color = "#676E7D";
42 | urgent-bg-color = "#E53935";
43 | isI3 = wm == "i3";
44 | isSway = wm == "sway";
45 | in
46 | {
47 |
48 | enable = true;
49 | extraConfig = mkIf isI3 ''
50 | exec --no-startup-id ${autotiling}
51 | set $movemouse "sh -c 'eval `${pkgs.xdotool}/bin/xdotool getactivewindow getwindowgeometry --shell`; ${pkgs.xdotool}/bin/xdotool mousemove $((X+WIDTH/2)) $((Y+HEIGHT/2))'"
52 | '';
53 | package = if isI3 then pkgs.i3-gaps else pkgs.sway;
54 | config = {
55 | modifier = "Mod4";
56 | floating.modifier = "Mod4";
57 | floating.border = 0;
58 | window.border = 0;
59 | focus.forceWrapping = false;
60 | focus.followMouse = false;
61 | fonts = [ "RobotoMono 9" ];
62 | terminal = lib.getExe pkgs.alacritty;
63 | startup = mkIf isI3 [
64 | {
65 | command = "systemctl --user restart polybar";
66 | always = true;
67 | notification = false;
68 | }
69 | {
70 | command = "autorandr -c";
71 | always = true;
72 | notification = false;
73 | }
74 | #{ command = "waybar"; always = true; notification = false; }
75 | ];
76 |
77 | colors.focused = {
78 | border = bg-color;
79 | childBorder = bg-color;
80 | background = bg-color;
81 | text = text-color;
82 | indicator = "#00ff00";
83 | };
84 | colors.unfocused = {
85 | border = inactive-bg-color;
86 | childBorder = inactive-bg-color;
87 | background = inactive-bg-color;
88 | text = inactive-text-color;
89 | indicator = "#00ff00";
90 | };
91 | colors.focusedInactive = {
92 | border = inactive-bg-color;
93 | childBorder = inactive-bg-color;
94 | background = inactive-bg-color;
95 | text = inactive-text-color;
96 | indicator = "#00ff00";
97 | };
98 | colors.urgent = {
99 | border = urgent-bg-color;
100 | childBorder = urgent-bg-color;
101 | background = urgent-bg-color;
102 | text = text-color;
103 | indicator = "#00ff00";
104 | };
105 |
106 | menu = pkgs.writeShellScript "rofi-menu.sh" ''
107 | monitor="$(swaymsg -t get_outputs | jq '[.[].focused] | index(true)')"
108 | ${pkgs.g-rofi}/bin/rofi -show drun -modi drun -monitor "$monitor" $@
109 | '';
110 |
111 | #menu = "${pkgs.g-rofi}/bin/rofi -show drun -modi drun -m 1";
112 | modes.resize = {
113 | Escape = "mode default";
114 | Return = "mode default";
115 | ${down} = "resize grow height 10 px or 10 ppt";
116 | ${left} = "resize shrink width 10 px or 10 ppt";
117 | ${right} = "resize grow width 10 px or 10 ppt";
118 | ${up} = "resize shrink height 10 px or 10 ppt";
119 | };
120 |
121 | # bars = mkForce [ ];
122 | bars = if isSway then [{ "command" = "${waybar}/bin/waybar"; }] else [ ];
123 | keybindings = mkOptionDefault (import ./keybindings.nix { inherit pkgs; });
124 | };
125 | }
126 |
--------------------------------------------------------------------------------
/home-manager/i3.nix:
--------------------------------------------------------------------------------
1 | { lib, pkgs, config, options, ... }:
2 |
3 | with lib;
4 | with pkgs;
5 | let
6 | in
7 | {
8 | imports = [ ./common.nix ./dunst.nix ];
9 |
10 | home.packages = with pkgs; [
11 | arandr
12 | autorandr
13 | pavucontrol
14 | ];
15 |
16 | home.sessionVariables = {
17 | MOZ_X11_EGL = "1";
18 | };
19 |
20 | xsession.enable = true;
21 | xsession.initExtra = "unset __NIXOS_SET_ENVIRONMENT_DONE";
22 | xsession.windowManager.i3 = (import ./i3-sway.nix { inherit lib pkgs config; wm = "i3"; });
23 |
24 | #programs.autorandr = {
25 | # enable = true;
26 | # profiles = {
27 | # home = {
28 | # fingerprint = {
29 | # DP-2 = "00ffffffffffff0004726107ffffffffff1d0104b55927783bee01af4f41ac260f5054210800010101010101010101010101010101014c9a00a0f0402e60302035007a843100001a000000ff002341534d685451455663615464000000fd000190f6f663010a202020202020000000fc0058333820500a20202020202020023b020320f12309070183010000654b04000101e305c000e2006ae6060501605a2831dd00a0f0404260302035007a843100001a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006670137903000f000aa4140e0e07012045000002010d31fb6a4f1b74ac61e20e01455403013c933d0104ff0e9f002f801f003f065d0002000400a4810104ff0e9f002f801f003f067100020004001b060104ff0e9f002f801f003f064d000200040000000000000000000000000000000000000000000000000000000000002d90";
30 | # };
31 | # config.DP-2 = {
32 | # enable = true;
33 | # position = "0x0";
34 | # primary = true;
35 | # rate = "144.00";
36 | # mode = "3840x1600";
37 | # };
38 | # };
39 | # };
40 | #};
41 |
42 | services.flameshot.enable = true;
43 | services.polybar.enable = true;
44 | services.polybar.script = "polybar &";
45 | services.polybar.package = pkgs.g-polybar;
46 |
47 | services.random-background = {
48 | enable = true;
49 | interval = "1h";
50 | imageDirectory = "${./wallpapers}";
51 | };
52 |
53 | systemd.user.services.polkit-gnome = {
54 | Unit = {
55 | Description = "PolicyKit Authentication Agent";
56 | After = [ "graphical-session-pre.target" ];
57 | PartOf = [ "graphical-session.target" ];
58 | };
59 |
60 | Service = {
61 | ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
62 | };
63 |
64 | Install = {
65 | WantedBy = [ "graphical-session.target" ];
66 | };
67 | };
68 |
69 |
70 | services.picom = {
71 | enable = true;
72 | backend = "glx";
73 | shadow = true;
74 | vSync = true;
75 | shadowExclude = [
76 | "_GTK_FRAME_EXTENTS@:c"
77 | "class_g = '.ulauncher-wrapped'"
78 | "class_g = 'Conky'"
79 | "class_g = 'Peek'"
80 | "class_g = 'Ulauncher'"
81 | "class_g = 'gromit-mpx'"
82 | "class_g = 'i3-frame'"
83 | "name = 'Polybar tray window'"
84 | "name = 'polybar-blur-noshadow'"
85 | "name = 'polybar-noblur-noshadow'"
86 | ];
87 | };
88 | }
89 |
--------------------------------------------------------------------------------
/home-manager/keybindings.nix:
--------------------------------------------------------------------------------
1 | { pkgs }:
2 |
3 | with pkgs;
4 | let
5 | modifier = "Mod4";
6 | left = "h";
7 | down = "j";
8 | up = "k";
9 | right = "l";
10 | _ = pkgs.lib.getExe;
11 |
12 | ocrScript = pkgs.writeShellScript "ocr.sh" ''
13 | ${_ pkgs.grim} -g "$(${_ slurp})" -t ppm - | ${_ tesseract} - - | ${wl-clipboard}/bin/wl-copy
14 | ${_ libnotify} "$(${wl-clipboard}/bin/wl-paste)"
15 | '';
16 | in
17 | {
18 | "${modifier}+p" = ''exec /bin/sh -c "cat /home/gytis/notes | ${pkgs.g-rofi}/bin/rofi -dmenu | ${pkgs.findutils}/bin/xargs ${pkgs.wtype}/bin/wtype"'';
19 | Print = ''exec ${grim}/bin/grim -g "$(${slurp}/bin/slurp -d)" - | ${wl-clipboard}/bin/wl-copy -t image/png'';
20 | XF86AudioMute = "exec ${pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
21 | XF86AudioPlay = "exec ${playerctl}/bin/playerctl play";
22 | XF86AudioPause = "exec ${playerctl}/bin/playerctl pause";
23 | XF86AudioNext = "exec ${playerctl}/bin/playerctl next";
24 | XF86AudioPrev = "exec ${playerctl}/bin/playerctl prev";
25 | XF86AudioRaiseVolume = "exec ${pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
26 | XF86AudioLowerVolume = "exec ${pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
27 | XF86MonBrightnessUp = "exec ${xorg.xbacklight} -inc 20";
28 | XF86MonBrightnessDown = "exec ${xorg.xbacklight} -dec 20";
29 |
30 | "${modifier}+o" = "exec ${ocrScript}";
31 | "${modifier}+b" = "exec chromium";
32 | "${modifier}+shift+b" = "exec chromium --incognito";
33 | "${modifier}+z" = "exec ${autorandr}/bin/autorandr -c -f";
34 |
35 | #"${modifier}+t" = ''[class="scratchterm"] scratchpad show, move position center'';
36 | #"${modifier}+b" = ''[class="scratchbrowser"] scratchpad show, move position center '';
37 |
38 | #"${modifier}+Return" = "exec ${g-alacritty}/bin/alacritty";
39 | "${modifier}+q" = "kill";
40 | #"${modifier}+d" = "exec ${cfg.config.menu}";
41 |
42 | "${modifier}+${left}" = "focus left; exec $movemouse";
43 | "${modifier}+${down}" = "focus down; exec $movemouse";
44 | "${modifier}+${up}" = "focus up; exec $movemouse";
45 | "${modifier}+${right}" = "focus right; exec $movemouse";
46 |
47 | "${modifier}+Ctrl+${left}" = "move workspace to output left";
48 | "${modifier}+Ctrl+${down}" = "move workspace to output down";
49 | "${modifier}+Ctrl+${up}" = "move workspace to output up";
50 | "${modifier}+Ctrl+${right}" = "move workspace to output right";
51 |
52 | "${modifier}+Shift+${left}" = "move left";
53 | "${modifier}+Shift+${down}" = "move down";
54 | "${modifier}+Shift+${up}" = "move up";
55 | "${modifier}+Shift+${right}" = "move right";
56 |
57 | "${modifier}+c" = "split h";
58 | #"${modifier}+v" = "split v";
59 | #"${modifier}+f" = "fullscreen toggle";
60 |
61 | #"${modifier}+s" = "layout stacking";
62 | "${modifier}+t" = "layout tabbed";
63 | #"${modifier}+e" = "layout toggle split";
64 |
65 | #"${modifier}+Shift+space" = "floating toggle";
66 | #"${modifier}+space" = "focus mode_toggle";
67 |
68 | #"${modifier}+a" = "focus parent";
69 |
70 | #"${modifier}+Shift+minus" = "move scratchpad";
71 | #"${modifier}+minus" = "scratchpad show";
72 |
73 | #"${modifier}+1" = "workspace number 1";
74 | #"${modifier}+2" = "workspace number 2";
75 | #"${modifier}+3" = "workspace number 3";
76 | #"${modifier}+4" = "workspace number 4";
77 | #"${modifier}+5" = "workspace number 5";
78 | #"${modifier}+6" = "workspace number 6";
79 | #"${modifier}+7" = "workspace number 7";
80 | #"${modifier}+8" = "workspace number 8";
81 | #"${modifier}+9" = "workspace number 9";
82 | "${modifier}+0" = "workspace number 10";
83 |
84 | #"${modifier}+Shift+1" = "move container to workspace number 1";
85 | #"${modifier}+Shift+2" = "move container to workspace number 2";
86 | #"${modifier}+Shift+3" = "move container to workspace number 3";
87 | #"${modifier}+Shift+4" = "move container to workspace number 4";
88 | #"${modifier}+Shift+5" = "move container to workspace number 5";
89 | #"${modifier}+Shift+6" = "move container to workspace number 6";
90 | #"${modifier}+Shift+7" = "move container to workspace number 7";
91 | #"${modifier}+Shift+8" = "move container to workspace number 8";
92 | #"${modifier}+Shift+9" = "move container to workspace number 9";
93 | "${modifier}+Shift+0" = "move container to workspace number 10";
94 |
95 | #"${modifier}+Shift+c" = "reload";
96 | "${modifier}+Shift+r" = "restart";
97 | #"${modifier}+Shift+e" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
98 |
99 | #"${modifier}+r" = "mode resize";
100 | }
101 |
--------------------------------------------------------------------------------
/home-manager/sway.nix:
--------------------------------------------------------------------------------
1 | { lib, pkgs, config, options, ... }:
2 |
3 | with lib;
4 | with pkgs;
5 | let
6 | rofi-menu = pkgs.writeShellScript "rofi-menu.sh" ''
7 | monitor="$(swaymsg -t get_outputs | jq '.[] | select(.focused) | .name' -r)"
8 | ${pkgs.g-rofi}/bin/rofi -show drun -modi drun -monitor "$monitor" $@
9 | '';
10 | left = "h";
11 | down = "j";
12 | up = "k";
13 | right = "l";
14 | bg-color = "#424242";
15 | inactive-bg-color = "#424242";
16 | text-color = "#4f97d7";
17 | inactive-text-color = "#676E7D";
18 | urgent-bg-color = "#E53935";
19 |
20 | colorSchemeDark = rec {
21 | primary = {
22 | normal = {
23 | background = "181818";
24 | foreground = "b9b9b9";
25 | };
26 | bright = {
27 | background = bright.black;
28 | foreground = bright.white;
29 | };
30 | };
31 | normal = {
32 | black = "252525";
33 | gray = "5b5b5b";
34 | red = "ed4a46";
35 | green = "70b433";
36 | yellow = "dbb32d";
37 | blue = "368aeb";
38 | magenta = "eb6eb7";
39 | cyan = "3fc5b7";
40 | white = "777777";
41 | };
42 | bright = {
43 | black = "3b3b3b";
44 | gray = "7b7b7b";
45 | red = "ff5e56";
46 | green = "83c746";
47 | yellow = "efc541";
48 | blue = "4f9cfe";
49 | magenta = "ff81ca";
50 | cyan = "56d8c9";
51 | white = "dedede";
52 | };
53 | };
54 |
55 | colorScheme = colorSchemeDark;
56 | font = "Roboto";
57 |
58 | bgColor = colorScheme.primary.normal.background;
59 | fgColor = colorScheme.primary.bright.foreground;
60 | acColor = colorScheme.normal.red;
61 | acColor2 = colorScheme.normal.yellow;
62 |
63 | monospaced = text: '''' + text + "";
64 | in
65 | {
66 | imports = [ ./git.nix ./common.nix ./dunst.nix ];
67 |
68 | home.packages = with pkgs; [
69 | wl-clipboard
70 | wlr-randr
71 | ];
72 |
73 | home.sessionVariables = {
74 | MOZ_ENABLE_WAYLAND = "1";
75 | MOZ_USE_XINPUT2 = "1";
76 | XDG_SESSION_TYPE = "wayland";
77 | XDG_CURRENT_DESKTOP = "sway";
78 | XKB_DEFAULT_OPTIONS = "terminate:ctrl_alt_bksp,caps:escape,altwin:swap_alt_win";
79 | SDL_VIDEODRIVER = "wayland";
80 |
81 | # needs qt5.qtwayland in systemPackages
82 | QT_QPA_PLATFORM = "wayland";
83 | QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
84 |
85 | # Fix for some Java AWT applications (e.g. Android Studio),
86 | # use this if they aren't displayed properly:
87 | _JAVA_AWT_WM_NONREPARENTING = 1;
88 |
89 | # gtk applications on wayland
90 | # export GDK_BACKEND=wayland
91 | };
92 |
93 | wayland.windowManager.sway = {
94 |
95 | extraSessionCommands = ''
96 | unset __NIXOS_SET_ENVIRONMENT_DONE
97 | '';
98 |
99 | extraConfig = ''
100 |
101 | seat * xcursor_theme oreo_black_cursors 30
102 | input "type:keyboard" {
103 | xkb_layout us,de
104 | xkb_options terminate:ctrl_alt_bksp,caps:escape,altwin:swap_alt_win
105 | }
106 |
107 | #output HDMI-A-1 {
108 | # mode 1920x1080@74.973Hz
109 | # pos 0 0
110 | # scale 0.75
111 | # scale_filter nearest
112 | # adaptive_sync on
113 | #}
114 |
115 | #output HDMI-A-1 disable
116 | set $soundbar 'Harris Corporation JBL Bar 2.x 0x01010101'
117 | output $soundbar resolution 640x480@60Hz pos -10000 0
118 | workspace "99999" output $soundbar
119 | for_window [workspace="^99999$"] move container to output $monitor_center; focus output $monitor_center
120 |
121 | output DP-2 {
122 | mode 3840x1600@143.998001Hz
123 | #pos 2560 0
124 | }
125 |
126 | input * {
127 | repeat_delay 250
128 | repeat_rate 35
129 | }
130 | exec wl-paste -t text --watch ${pkgs.clipman} store
131 | '';
132 |
133 | enable = true;
134 | config = {
135 | #input = {
136 | #"*" = {
137 | #"repeat_delay" = "230";
138 | #"repeat_rate" = "23";
139 | #};
140 | #};
141 | modifier = "Mod4";
142 | floating.modifier = "Mod4";
143 | floating.border = 0;
144 | window.border = 0;
145 | focus.forceWrapping = false;
146 | focus.followMouse = false;
147 | fonts = {
148 | names = [ "RobotoMono" ];
149 | size = 9.0;
150 | };
151 | terminal = "${pkgs.g-alacritty}/bin/alacritty";
152 | startup = [
153 | #{ command = "waybar"; always = true; notification = false; }
154 | ];
155 |
156 | colors.focused = {
157 | border = bg-color;
158 | childBorder = bg-color;
159 | background = bg-color;
160 | text = text-color;
161 | indicator = "#00ff00";
162 | };
163 | colors.unfocused = {
164 | border = inactive-bg-color;
165 | childBorder = inactive-bg-color;
166 | background = inactive-bg-color;
167 | text = inactive-text-color;
168 | indicator = "#00ff00";
169 | };
170 | colors.focusedInactive = {
171 | border = inactive-bg-color;
172 | childBorder = inactive-bg-color;
173 | background = inactive-bg-color;
174 | text = inactive-text-color;
175 | indicator = "#00ff00";
176 | };
177 | colors.urgent = {
178 | border = urgent-bg-color;
179 | childBorder = urgent-bg-color;
180 | background = urgent-bg-color;
181 | text = text-color;
182 | indicator = "#00ff00";
183 | };
184 |
185 | menu = "${rofi-menu}";
186 | modes.resize = {
187 | Escape = "mode default";
188 | Return = "mode default";
189 | "${down}" = "resize grow height 10 px or 10 ppt";
190 | "${left}" = "resize shrink width 10 px or 10 ppt";
191 | "${right}" = "resize grow width 10 px or 10 ppt";
192 | "${up}" = "resize shrink height 10 px or 10 ppt";
193 | };
194 |
195 | # bars = mkForce [ ];
196 | bars = [{
197 | "command" = "${waybar}/bin/waybar";
198 | }];
199 | keybindings = mkOptionDefault (import ./keybindings.nix { inherit pkgs; });
200 | };
201 | };
202 |
203 |
204 | programs.waybar =
205 | let
206 | swayEnabled = config.wayland.windowManager.sway.enable;
207 | in
208 | {
209 | enable = config.wayland.windowManager.sway.enable || config.wayland.windowManager.hikari.enable;
210 | settings = [{
211 | layer = "top";
212 | position = "top";
213 | modules-left = if swayEnabled then [ "sway/workspaces" ] else [ ];
214 | modules-center = if swayEnabled then [ "sway/window" ] else [ ];
215 | modules-right =
216 | [ "pulseaudio" "cpu" "memory" "temperature" "clock" "tray" ];
217 | clock.format = "{:%Y-%m-%d %H:%M}";
218 | "tray" = { spacing = 8; };
219 | "cpu" = { format = "cpu {usage}"; };
220 | "memory" = { format = "mem {}"; };
221 | "temperature" = {
222 | hwmon-path = "/sys/class/hwmon/hwmon1/temp2_input";
223 | format = "tmp {temperatureC}C";
224 | };
225 | "pulseaudio" = {
226 | format = "vol {volume} {format_source}";
227 | format-bluetooth = "volb {volume} {format_source}";
228 | format-bluetooth-muted = "volb {format_source}";
229 | format-muted = "vol {format_source}";
230 | format-source = "mic {volume}";
231 | format-source-muted = "mic";
232 | };
233 | }];
234 | style =
235 | let
236 | makeBorder = color: "border-bottom: 3px solid #${color};";
237 | makeInfo = color: ''
238 | color: #${color};
239 | ${makeBorder color}
240 | '';
241 |
242 | clockColor = colorScheme.bright.magenta;
243 | cpuColor = colorScheme.bright.green;
244 | memColor = colorScheme.bright.blue;
245 | pulseColor = {
246 | normal = colorScheme.bright.cyan;
247 | muted = colorScheme.bright.gray;
248 | };
249 | tmpColor = {
250 | normal = colorScheme.bright.yellow;
251 | critical = colorScheme.bright.red;
252 | };
253 | in
254 | ''
255 | * {
256 | border: none;
257 | border-radius: 0;
258 | /* `otf-font-awesome` is required to be installed for icons */
259 | font-family: ${font};
260 | font-size: 13px;
261 | min-height: 0;
262 | }
263 | window#waybar {
264 | background-color: #${bgColor};
265 | /* border-bottom: 0px solid rgba(100, 114, 125, 0.5); */
266 | color: #${fgColor};
267 | transition-property: background-color;
268 | transition-duration: .5s;
269 | }
270 | #workspaces button {
271 | padding: 0 5px;
272 | background-color: transparent;
273 | color: #${fgColor};
274 | border-bottom: 3px solid transparent;
275 | }
276 | /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
277 | #workspaces button:hover {
278 | background: rgba(0, 0, 0, 0.2);
279 | box-shadow: inherit;
280 | border-bottom: 3px solid #ffffff;
281 | }
282 | #workspaces button.focused {
283 | border-bottom: 3px solid #${acColor};
284 | }
285 | #workspaces button.urgent {
286 | background-color: #${acColor};
287 | color: #${bgColor};
288 | }
289 | #mode {
290 | background-color: #64727D;
291 | border-bottom: 3px solid #ffffff;
292 | }
293 | #clock,
294 | #battery,
295 | #cpu,
296 | #memory,
297 | #temperature,
298 | #backlight,
299 | #network,
300 | #pulseaudio,
301 | #custom-media,
302 | #tray,
303 | #mode,
304 | #idle_inhibitor,
305 | #mpd {
306 | padding: 0 10px;
307 | margin: 0 4px;
308 | background-color: transparent;
309 | ${makeInfo fgColor}
310 | }
311 | label:focus {
312 | color: #000000;
313 | }
314 | #clock {
315 | ${makeInfo clockColor}
316 | }
317 | #cpu {
318 | ${makeInfo cpuColor}
319 | }
320 | #memory {
321 | ${makeInfo memColor}
322 | }
323 | #pulseaudio {
324 | ${makeInfo pulseColor.normal}
325 | }
326 | #pulseaudio.muted {
327 | ${makeInfo pulseColor.muted}
328 | }
329 | #temperature {
330 | ${makeInfo tmpColor.normal}
331 | }
332 | #temperature.critical {
333 | ${makeInfo tmpColor.critical}
334 | }
335 | '';
336 | };
337 |
338 | xdg.configFile."xdg-desktop-portal-wlr/config".text = ''
339 | [screencast]
340 | output_name=
341 | max_fps=30
342 | chooser_cmd=${pkgs.slurp}/bin/slurp -f %o -or
343 | chooser_type=simple
344 | '';
345 |
346 | }
347 |
--------------------------------------------------------------------------------
/home-manager/wallpapers/mountains1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gytis-ivaskevicius/nixfiles/8383dff647a4cb0f26c7321bfe3b8718810881f6/home-manager/wallpapers/mountains1.jpg
--------------------------------------------------------------------------------
/home-manager/wallpapers/mountains2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gytis-ivaskevicius/nixfiles/8383dff647a4cb0f26c7321bfe3b8718810881f6/home-manager/wallpapers/mountains2.jpg
--------------------------------------------------------------------------------
/home-manager/wallpapers/mountains3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gytis-ivaskevicius/nixfiles/8383dff647a4cb0f26c7321bfe3b8718810881f6/home-manager/wallpapers/mountains3.jpg
--------------------------------------------------------------------------------
/home-manager/wallpapers/space1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gytis-ivaskevicius/nixfiles/8383dff647a4cb0f26c7321bfe3b8718810881f6/home-manager/wallpapers/space1.jpg
--------------------------------------------------------------------------------
/hosts/GytisOS.host.nix:
--------------------------------------------------------------------------------
1 | { config, builtins, lib, pkgs, modulesPath, ... }:
2 |
3 | {
4 |
5 | boot.kernelParams = [ "idle=nomwait" "processor.max_cstate=5" ];
6 | boot.kernelModules = [ "kvm-amd" ];
7 | boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "sd_mod" ];
8 |
9 | fileSystems."/boot" = { device = "/dev/disk/by-uuid/1E86-D505"; fsType = "vfat"; };
10 | fileSystems."/" = { device = "/dev/disk/by-uuid/1a61535f-0099-415b-af78-51913eb9e4d2"; fsType = "ext4"; };
11 |
12 | imports = [
13 | #./work/modules.nix
14 | #./work/i3rice.nix
15 | ];
16 |
17 | programs.ssh.startAgent = true;
18 | programs.dconf.enable = true;
19 |
20 | hardware.bluetooth.enable = true;
21 | environment.variables = {
22 | BROWSER = "brave";
23 | TERMINAL = "alacritty";
24 | };
25 |
26 | environment.systemPackages = with pkgs; [
27 | brave
28 | discord
29 | firefox
30 | g-alacritty
31 | gnome.eog
32 | pavucontrol
33 | vlc
34 | xdg-utils # Multiple packages depend on xdg-open at runtime. This includes Discord and JetBrains
35 | pulseaudio
36 | chromium
37 | #exodus
38 | discord-for-poor-people
39 | element-for-poor-people
40 | rnix-lsp
41 | distrobox
42 | obs-studio
43 | tdesktop
44 | prismlauncher
45 | ];
46 |
47 | services.tailscale.enable = true;
48 | networking.firewall.checkReversePath = "loose";
49 | programs.steam.enable = true;
50 | services.flatpak.enable = true;
51 |
52 | environment.shellAliases = { vv = "${pkgs.neovim-unwrapped}/bin/nvim"; };
53 | #programs.noisetorch.enable = true;
54 |
55 | security.chromiumSuidSandbox.enable = true;
56 | programs.chromium = {
57 | # defaultSearchProviderSuggestURL = "https://encrypted.google.com/complete/search?output=chrome&q={searchTerms}";
58 | # defaultSearchProviderSearchURL = "https://encrypted.google.com/search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:searchClient}{google:sourceId}{google:instantExtendedEnabledParameter}ie={inputEncoding}";
59 | # https://chromeenterprise.google/policies
60 | enable = true;
61 | homepageLocation = "about:blank";
62 |
63 | extensions = [
64 | "chklaanhfefbnpoihckbnefhakgolnmc" # JSONView
65 | "cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
66 | "ckkdlimhmcjmikdlpkmbgfkaikojcbjk" # Markdown Viewer
67 | "dbepggeogbaibhgnhhndojpepiihcmeb" # Vimium.
68 | #"eimadpbcbfnmbkopoojfekhnkhdbieeh" # Dark Reader
69 | "fdjamakpfbbddfjaooikfcpapjohcfmg" # Dashlane
70 | "fihnjjcciajhdojfnbdddfaoknhalnja" # I don't care about cookies
71 | #"gcbommkclmclpchllfjekcdonpmejbdp" # Https everywhere
72 | "gneobebnilffgkejpfhlgkmpkipgbcno" # Death To _blank
73 | "hokcepcfcicnhalinladgknhaljndhpc" # Witchcraft
74 | #"iipjdmnoigaobkamfhnojmglcdbnfaaf" # Clutter Free - Prevent duplicate tabs
75 | "jfnifeihccihocjbfcfhicmmgpjicaec" # https://chrome.google.com/webstore/detail/gsconnect/jfnifeihccihocjbfcfhicmmgpjicaec
76 | "kbfnbcaeplbcioakkpcpgfkobkghlhen" # Grammarly
77 | "kljmejbpilkadikecejccebmccagifhl" # Image search options
78 | "lckanjgmijmafbedllaakclkaicjfmnk" # ClearURLs
79 | "lifgeihcfpkmmlfjbailfpfhbahhibba" # Smart TOC
80 | "mgijmajocgfcbeboacabfgobmjgjcoja" # Google Dictionary (by Google)
81 | "opokoaglpekkimldnlggpoagmjegichg" # ViolentMonkey
82 | ];
83 |
84 | extraOpts = {
85 | CloudPrintSubmitEnabled = false;
86 | EnableMediaRouter = false;
87 | HideWebStoreIcon = true;
88 | MetricsReportingEnabled = false;
89 | NewTabPageLocation = "about:blank";
90 | PasswordManagerEnabled = false;
91 | RestoreOnStartup = 1; # 5 = Open New Tab Page 1 = Restore the last session 4 = Open a list of URLs
92 | SpellcheckEnabled = true;
93 | SpellcheckLanguage = [ "lt" "en-US" ];
94 | WelcomePageOnOSUpgradeEnabled = false;
95 | };
96 |
97 | };
98 | }
99 |
--------------------------------------------------------------------------------
/hosts/Monday.host.nix:
--------------------------------------------------------------------------------
1 | { config, builtins, lib, pkgs, modulesPath, ... }:
2 |
3 | {
4 |
5 | boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
6 | boot.initrd.kernelModules = [ ];
7 | boot.kernelModules = [ "kvm-amd" ];
8 | boot.extraModulePackages = [ ];
9 |
10 | fileSystems."/" =
11 | { device = "tank/locker/os";
12 | fsType = "zfs";
13 | };
14 |
15 | fileSystems."/home" =
16 | { device = "tank/locker/home";
17 | fsType = "zfs";
18 | };
19 |
20 | fileSystems."/nix" =
21 | { device = "tank/locker/nix";
22 | fsType = "zfs";
23 | };
24 |
25 | fileSystems."/boot" =
26 | { device = "/dev/disk/by-uuid/D90A-71C8";
27 | fsType = "vfat";
28 | };
29 |
30 |
31 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
32 | hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
33 | hardware.enableRedistributableFirmware = lib.mkDefault true;
34 |
35 | programs.ssh.startAgent = true;
36 | programs.dconf.enable = true;
37 |
38 | gytix.cachix.enable = true;
39 |
40 | hardware.bluetooth.enable = true;
41 | environment.variables = {
42 | BROWSER = "chromium";
43 | TERMINAL = "alacritty";
44 | };
45 |
46 | nix.settings.max-jobs = 128;
47 | nix.settings.cores = 128;
48 |
49 | environment.systemPackages = with pkgs; [
50 | remmina
51 | brave
52 | discord
53 | firefox
54 | g-alacritty
55 | eog
56 | pavucontrol
57 | vlc
58 | xdg-utils # Multiple packages depend on xdg-open at runtime. This includes Discord and JetBrains
59 | pulseaudio
60 | chromium
61 | #exodus
62 | discord-for-poor-people
63 | element-for-poor-people
64 | obs-studio
65 | prismlauncher
66 | helix
67 | ];
68 |
69 | services.tailscale.enable = true;
70 | networking.firewall.checkReversePath = "loose";
71 | programs.steam.enable = true;
72 | services.flatpak.enable = true;
73 |
74 | environment.shellAliases = {
75 | vv = "${pkgs.neovim-unwrapped}/bin/nvim";
76 | };
77 | #programs.noisetorch.enable = true;
78 |
79 |
80 | security.chromiumSuidSandbox.enable = true;
81 | programs.chromium = {
82 | # defaultSearchProviderSuggestURL = "https://encrypted.google.com/complete/search?output=chrome&q={searchTerms}";
83 | # defaultSearchProviderSearchURL = "https://encrypted.google.com/search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:searchClient}{google:sourceId}{google:instantExtendedEnabledParameter}ie={inputEncoding}";
84 | # https://chromeenterprise.google/policies
85 | enable = true;
86 | homepageLocation = "https://github.com/notifications";
87 |
88 | extensions = [
89 | "chklaanhfefbnpoihckbnefhakgolnmc" # JSONView
90 | "cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
91 | "ckkdlimhmcjmikdlpkmbgfkaikojcbjk" # Markdown Viewer
92 | "dbepggeogbaibhgnhhndojpepiihcmeb" # Vimium.
93 | #"eimadpbcbfnmbkopoojfekhnkhdbieeh" # Dark Reader
94 | "fihnjjcciajhdojfnbdddfaoknhalnja" # I don't care about cookies
95 | #"gcbommkclmclpchllfjekcdonpmejbdp" # Https everywhere
96 | "gneobebnilffgkejpfhlgkmpkipgbcno" # Death To _blank
97 | "hokcepcfcicnhalinladgknhaljndhpc" # Witchcraft
98 | #"iipjdmnoigaobkamfhnojmglcdbnfaaf" # Clutter Free - Prevent duplicate tabs
99 | "jfnifeihccihocjbfcfhicmmgpjicaec" # https://chrome.google.com/webstore/detail/gsconnect/jfnifeihccihocjbfcfhicmmgpjicaec
100 | "kbfnbcaeplbcioakkpcpgfkobkghlhen" # Grammarly
101 | "kljmejbpilkadikecejccebmccagifhl" # Image search options
102 | "lckanjgmijmafbedllaakclkaicjfmnk" # ClearURLs
103 | "lifgeihcfpkmmlfjbailfpfhbahhibba" # Smart TOC
104 | "mgijmajocgfcbeboacabfgobmjgjcoja" # Google Dictionary (by Google)
105 | "opokoaglpekkimldnlggpoagmjegichg" # ViolentMonkey
106 | ];
107 |
108 | extraOpts = {
109 | CloudPrintSubmitEnabled = false;
110 | EnableMediaRouter = false;
111 | HideWebStoreIcon = true;
112 | MetricsReportingEnabled = false;
113 | NewTabPageLocation = "https://github.com/notifications";
114 | PasswordManagerEnabled = false;
115 | RestoreOnStartup = 1; # 5 = Open New Tab Page 1 = Restore the last session 4 = Open a list of URLs
116 | SpellcheckEnabled = true;
117 | SpellcheckLanguage = [ "lt" "en-US" ];
118 | WelcomePageOnOSUpgradeEnabled = false;
119 | };
120 |
121 | };
122 | }
123 |
--------------------------------------------------------------------------------
/hosts/Morty.host.nix:
--------------------------------------------------------------------------------
1 | { config, builtins, lib, pkgs, modulesPath, ... }:
2 |
3 | {
4 |
5 |
6 | boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" "rtsx_usb_sdmmc" ];
7 | boot.kernelModules = [ "kvm-intel" ];
8 |
9 | fileSystems."/" = {
10 | device = "/dev/disk/by-uuid/e60905dc-aadf-4c1b-b78f-51c5bceb91c4";
11 | options = [ "compress_algorithm=lz4" ];
12 | fsType = "f2fs";
13 | };
14 | fileSystems."/boot" = { device = "/dev/disk/by-uuid/F0D4-8A70"; fsType = "vfat"; };
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/hosts/NixyServer.host.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 |
5 |
6 | fileSystems."/" = { device = "zroot/locker/os"; fsType = "zfs"; };
7 | fileSystems."/home" = { device = "zroot/locker/home"; fsType = "zfs"; };
8 | fileSystems."/nix/store" = { device = "zroot/store"; fsType = "zfs"; };
9 | fileSystems."/boot" = { device = "/dev/disk/by-uuid/8BCE-4FF4"; fsType = "vfat"; };
10 |
11 | boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
12 | boot.kernelModules = [ "kvm-intel" "tcp_bbr" ];
13 | boot.kernelPackages = pkgs.linuxPackages_latest;
14 |
15 | # Rest of this file is tweaked/slimed down base.nix copy-paste
16 | console.keyMap = "us";
17 | i18n.defaultLocale = "en_US.UTF-8";
18 | system.stateVersion = "20.09";
19 | time.timeZone = lib.mkDefault "Europe/Vilnius";
20 | gytix.cachix.enable = true;
21 |
22 | systemd.network.enable = true;
23 | networking = {
24 | useDHCP = false;
25 | interfaces.enp3s0.useDHCP = true;
26 | firewall.allowPing = lib.mkDefault false;
27 | firewall.allowedTCPPorts = [ 3000 4200 8080 8081 8082 8083 ];
28 |
29 |
30 | hostId = builtins.substring 0 8 (builtins.hashString "md5" config.networking.hostName);
31 | nameservers = lib.mkDefault [ "1.1.1.1" "1.0.0.1" ];
32 | };
33 |
34 | nix.gc = {
35 | automatic = true;
36 | options = "--delete-older-than 20d";
37 | dates = "04:00";
38 | };
39 |
40 | boot = {
41 | # Imporved networking
42 | kernel.sysctl."net.ipv4.tcp_congestion_control" = "bbr";
43 | kernel.sysctl."net.core.default_qdisc" = "fq";
44 |
45 | kernelParams = [ "quiet" "loglevel=3" ];
46 | cleanTmpDir = true;
47 | loader.systemd-boot.enable = true;
48 | loader.timeout = 2;
49 | tmpOnTmpfs = lib.mkDefault true;
50 | };
51 |
52 | services = {
53 | zfs.autoSnapshot.enable = true;
54 | zfs.autoScrub.enable = true;
55 | openssh.enable = lib.mkDefault true;
56 | openssh.passwordAuthentication = lib.mkDefault false;
57 | tlp.enable = lib.mkDefault true;
58 | };
59 |
60 | zramSwap = {
61 | enable = lib.mkDefault true;
62 | algorithm = "zstd";
63 | };
64 |
65 | hardware.cpu.intel.updateMicrocode = true;
66 | }
67 |
--------------------------------------------------------------------------------
/hosts/gytis-ivaskevicius.host.nix:
--------------------------------------------------------------------------------
1 | { config, builtins, lib, pkgs, modulesPath, ... }:
2 |
3 | {
4 | imports = [
5 | ./work/modules.nix
6 | ./work/i3rice.nix
7 | ];
8 | programs.ssh.startAgent = true;
9 |
10 |
11 | hardware.bluetooth.enable = true;
12 | environment.variables = {
13 | BROWSER = "brave";
14 | TERMINAL = "alacritty";
15 | };
16 |
17 | environment.systemPackages = with pkgs; [
18 | brave
19 | #cinnamon.nemo
20 | discord
21 | #firefox
22 | g-alacritty
23 | #gnome3.eog
24 | pavucontrol
25 | #python
26 | #tdesktop
27 | #vlc
28 | xdg-utils # Multiple packages depend on xdg-open at runtime. This includes Discord and JetBrains
29 | ];
30 |
31 |
32 | boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" "sr_mod" "rtsx_usb_sdmmc" ];
33 | boot.kernelModules = [ "kvm-intel" ];
34 |
35 | fileSystems."/" = { device = "/dev/disk/by-uuid/f578dbd2-d5a4-405b-aca5-530285ab1403"; fsType = "ext4"; };
36 | fileSystems."/boot" = { device = "/dev/disk/by-uuid/1C61-078B"; fsType = "vfat"; };
37 |
38 |
39 | powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
40 |
41 |
42 | services.tailscale.enable = true;
43 |
44 |
45 | # networking.extraHosts = ''
46 | # 10.232.254.232 ozas.vrm.lt
47 | # 10.232.254.232 nsis2pldb.vrm.lt
48 | # 10.232.254.232 nsis2appdev.vrm.lt
49 | # '';
50 | }
51 |
--------------------------------------------------------------------------------
/hosts/work/Wallpapers/mountains1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gytis-ivaskevicius/nixfiles/8383dff647a4cb0f26c7321bfe3b8718810881f6/hosts/work/Wallpapers/mountains1.jpg
--------------------------------------------------------------------------------
/hosts/work/Wallpapers/mountains2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gytis-ivaskevicius/nixfiles/8383dff647a4cb0f26c7321bfe3b8718810881f6/hosts/work/Wallpapers/mountains2.jpg
--------------------------------------------------------------------------------
/hosts/work/Wallpapers/mountains3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gytis-ivaskevicius/nixfiles/8383dff647a4cb0f26c7321bfe3b8718810881f6/hosts/work/Wallpapers/mountains3.jpg
--------------------------------------------------------------------------------
/hosts/work/Wallpapers/space1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gytis-ivaskevicius/nixfiles/8383dff647a4cb0f26c7321bfe3b8718810881f6/hosts/work/Wallpapers/space1.jpg
--------------------------------------------------------------------------------
/hosts/work/dunst.conf:
--------------------------------------------------------------------------------
1 | [global]
2 | monitor = 0
3 | follow = mouse
4 | geometry = "320x5-15+15"
5 | indicate_hidden = yes
6 | shrink = no
7 | transparency = 0
8 | notification_height = 0
9 | separator_height = 2
10 | padding = 10
11 | horizontal_padding = 10
12 | frame_width = 1
13 | frame_color = "#232323"
14 | separator_color = frame
15 | sort = yes
16 | idle_threshold = 120
17 | font = Source Sans Pro 10
18 | line_height = 0
19 | markup = full
20 | format = "%s %p\n%b"
21 | alignment = left
22 | show_age_threshold = 60
23 | word_wrap = yes
24 | ellipsize = middle
25 | ignore_newline = no
26 | stack_duplicates = true
27 | hide_duplicate_count = false
28 | show_indicators = yes
29 | icon_position = left
30 | max_icon_size = 32
31 | icon_path = /usr/share/icons/Paper/16x16/status/:/usr/share/icons/Paper/16x16/devices/:/usr/share/icons/Paper/16x16/apps/
32 | sticky_history = yes
33 | history_length = 20
34 | always_run_script = true
35 | startup_notification = false
36 | verbosity = mesg
37 | corner_radius = 0
38 | force_xinerama = false
39 | mouse_left_click = close_current
40 | mouse_middle_click = do_action
41 | mouse_right_click = close_all
42 |
43 | [shortcuts]
44 | close = ctrl+space
45 | close_all = ctrl+shift+space
46 | history = ctrl+grave
47 | context = ctrl+shift+period
48 |
49 | [urgency_low]
50 | background = "#232323"
51 | foreground = "#a8a8a8"
52 | timeout = 10
53 |
54 | [urgency_normal]
55 | background = "#232323"
56 | foreground = "#a8a8a8"
57 | timeout = 10
58 |
59 | [urgency_critical]
60 | background = "#d64e4e"
61 | foreground = "#f0e0e0"
62 | frame_color = "#d64e4e"
63 | timeout = 0
64 | icon = /usr/share/icons/Papirus/16x16/status/package-purge.svg
65 |
66 |
--------------------------------------------------------------------------------
/hosts/work/i3/autotiling.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | REGEX="([0-9]+)x([0-9]+)"
4 |
5 | update_split(){
6 | OUTPUT="$(xdotool getwindowfocus getwindowgeometry)"
7 |
8 | if [[ $OUTPUT =~ $REGEX ]]
9 | then
10 | WIDTH="${BASH_REMATCH[1]}"
11 | HEIGHT="${BASH_REMATCH[2]}"
12 | if [ $WIDTH -gt $HEIGHT ];
13 | then
14 | i3-msg "split h"
15 | else
16 | i3-msg "split v"
17 | fi
18 | fi
19 | }
20 |
21 | while read -r line
22 | do
23 | LAYOUT="$(i3-msg -t get_tree | jq -r 'recurse(.nodes[]; .nodes != null) | select(.nodes[].focused).layout')"
24 | if [ "$LAYOUT" = "splitv" ] || [ "$LAYOUT" = "splith" ]; then
25 | update_split
26 | fi
27 | done < <(xprop -spy -root _NET_ACTIVE_WINDOW)
28 |
--------------------------------------------------------------------------------
/hosts/work/i3/default.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | environment.etc = {
5 | "i3/autotiling.sh".source = ./autotiling.sh;
6 | };
7 | xdg.mime.enable = true;
8 |
9 | services.xserver = {
10 |
11 | enable = true;
12 | layout = "us";
13 | xkbOptions = "terminate:ctrl_alt_bksp,caps:escape,altwin:swap_alt_win";
14 | libinput = {
15 | enable = true;
16 |
17 | # Left + right click emulates middle button.
18 | touchpad.middleEmulation = true;
19 | #naturalScrolling = true;
20 | };
21 |
22 | # Make auto-repeat on key hold work faster.
23 | displayManager.xserverArgs = [ "-ardelay 300" "-arinterval 20" ];
24 |
25 | displayManager.lightdm = {
26 | enable = true;
27 | greeters.enso.enable = lib.mkDefault true;
28 | greeters.enso.theme.name = lib.mkDefault "Numix";
29 | greeters.enso.theme.package = lib.mkDefault pkgs.numix-gtk-theme;
30 |
31 | #background
32 | #greeters.enso.blur
33 | #greeters.enso.brightness
34 | #greeters.enso.cursorTheme.name
35 | #greeters.enso.cursorTheme.package
36 | #greeters.enso.extraConfig
37 | #greeters.enso.iconTheme.name
38 | #greeters.enso.iconTheme.package
39 | };
40 |
41 | windowManager.i3 = {
42 | enable = true;
43 | configFile = ./i3config;
44 | extraPackages = [ pkgs.i3lock ];
45 | extraSessionCommands = "systemd --user restart autostart.target";
46 | package = lib.mkDefault pkgs.i3-gaps;
47 | };
48 | };
49 |
50 | environment.systemPackages = with pkgs; [ wmctrl xclip xdotool ];
51 |
52 | # TODO: Does not work well 20.09, needs to be fixed at some point
53 | # To make sure all local SSH sessions are closed after a laptop lid is shut.
54 | #powerManagement.powerDownCommands = ''
55 | #{pkgs.procps}/bin/pgrep ssh | IFS= read -r pid; do
56 | # "$(readlink "/proc/$pid/exe")" = "${pkgs.openssh}/bin/ssh" ] && kill "$pid"
57 | #one
58 | #'';
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/hosts/work/i3/i3config:
--------------------------------------------------------------------------------
1 |
2 | exec systemctl --user import-environment; systemctl --user restart autostart.target
3 | exec --no-startup-id /etc/i3/autotiling.sh
4 |
5 | set $mod Mod4
6 |
7 | set $left h
8 | set $down j
9 | set $up k
10 | set $right l
11 |
12 | set $ws1 "1"
13 | set $ws2 "2"
14 | set $ws3 "3"
15 | set $ws4 "4"
16 | set $ws5 "5"
17 | set $ws6 "6"
18 | set $ws7 "7"
19 | set $ws8 "8"
20 | set $ws9 "9"
21 | set $ws10 "10"
22 |
23 |
24 | ## Style
25 | smart_gaps on
26 | font pango:RobotoMono 9
27 |
28 | new_window pixel
29 | default_border pixel 0
30 |
31 | set $bg-color #424242
32 | set $inactive-bg-color #424242
33 | set $text-color #4f97d7
34 | set $inactive-text-color #676E7D
35 | set $urgent-bg-color #E53935
36 |
37 | # border background text indicator
38 | client.focused $bg-color $bg-color $text-color #00ff00
39 | client.unfocused $inactive-bg-color $inactive-bg-color $inactive-text-color #00ff00
40 | client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color #00ff00
41 | client.urgent $urgent-bg-color $urgent-bg-color $text-color
42 |
43 | focus_follows_mouse no
44 |
45 | ## KEYBINDINGS ##
46 | floating_modifier $mod
47 |
48 | bindsym Ctrl+Shift+l exec i3lock-pixeled
49 |
50 | set $movemouse "sh -c 'eval `xdotool getactivewindow getwindowgeometry --shell`; xdotool mousemove $((X+WIDTH/2)) $((Y+HEIGHT/2))'"
51 |
52 | # change focus
53 | bindsym $mod+$left focus left; exec $movemouse
54 | bindsym $mod+$down focus down; exec $movemouse
55 | bindsym $mod+$up focus up; exec $movemouse
56 | bindsym $mod+$right focus right; exec $movemouse
57 |
58 | # move focused window
59 | bindsym $mod+Shift+$left move left
60 | bindsym $mod+Shift+$down move down
61 | bindsym $mod+Shift+$up move up
62 | bindsym $mod+Shift+$right move right
63 |
64 | # layout manipulation
65 | bindsym $mod+c split h
66 | bindsym $mod+v split v
67 |
68 | bindsym $mod+f fullscreen toggle
69 |
70 | bindsym $mod+s layout stacking
71 | bindsym $mod+t layout tabbed
72 | bindsym $mod+e layout toggle split
73 |
74 |
75 | bindsym $mod+Shift+x floating toggle
76 | bindsym $mod+x focus mode_toggle
77 | bindsym $mod+a focus parent
78 |
79 | # Reload/Restart
80 | bindsym $mod+Shift+c reload
81 | bindsym $mod+Shift+r restart
82 |
83 | # Modes
84 | bindsym $mod+r mode "resize"
85 | bindsym $mod+Shift+g mode "$mode_gaps"
86 |
87 | # exit i3 (logs you out of your X session)
88 | bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Do you wish to exit i3?' -B 'Yes, exit i3' 'i3-msg exit'"
89 |
90 | # workspaces
91 | bindsym $mod+1 workspace $ws1
92 | bindsym $mod+2 workspace $ws2
93 | bindsym $mod+3 workspace $ws3
94 | bindsym $mod+4 workspace $ws4
95 | bindsym $mod+5 workspace $ws5
96 | bindsym $mod+6 workspace $ws6
97 | bindsym $mod+7 workspace $ws7
98 | bindsym $mod+8 workspace $ws8
99 | bindsym $mod+9 workspace $ws9
100 | bindsym $mod+0 workspace $ws10
101 |
102 | bindsym $mod+Shift+1 move container to workspace $ws1
103 | bindsym $mod+Shift+2 move container to workspace $ws2
104 | bindsym $mod+Shift+3 move container to workspace $ws3
105 | bindsym $mod+Shift+4 move container to workspace $ws4
106 | bindsym $mod+Shift+5 move container to workspace $ws5
107 | bindsym $mod+Shift+6 move container to workspace $ws6
108 | bindsym $mod+Shift+7 move container to workspace $ws7
109 | bindsym $mod+Shift+8 move container to workspace $ws8
110 | bindsym $mod+Shift+9 move container to workspace $ws9
111 | bindsym $mod+Shift+0 move container to workspace $ws10
112 |
113 | bindsym $mod+Ctrl+h move workspace to output right
114 | bindsym $mod+Ctrl+j move workspace to output down
115 | bindsym $mod+Ctrl+k move workspace to output up
116 | bindsym $mod+Ctrl+l move workspace to output left
117 |
118 | for_window [title="win0"] floating enable
119 |
120 | ## MODES ##
121 |
122 | # Gaps
123 | set $mode_gaps Gaps: 0 | + | -
124 |
125 | mode "$mode_gaps" {
126 | bindsym plus gaps inner current plus 5
127 | bindsym minus gaps inner current minus 5
128 | bindsym 0 gaps inner current set 0
129 |
130 | bindsym Return mode "$mode_gaps"
131 | bindsym Escape mode "default"
132 | }
133 |
134 | # Resize
135 | mode "resize" {
136 | bindsym $left resize shrink width 10 px or 10 ppt
137 | bindsym $down resize grow height 10 px or 10 ppt
138 | bindsym $up resize shrink height 10 px or 10 ppt
139 | bindsym $right resize grow width 10 px or 10 ppt
140 |
141 | bindsym $left+Shift resize shrink width 3 px or 3 ppt
142 | bindsym $down+Shift resize grow height 3 px or 3 ppt
143 | bindsym $up+Shift resize shrink height 3 px or 3 ppt
144 | bindsym $right+Shift resize grow width 3 px or 3 ppt
145 |
146 | bindsym Return mode "default"
147 | bindsym Escape mode "default"
148 | bindsym $mod+r mode "default"
149 | }
150 |
151 |
--------------------------------------------------------------------------------
/hosts/work/i3rice.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, ... }:
2 |
3 | {
4 | imports = [ ./i3 ./modules.nix ];
5 |
6 | }
7 |
--------------------------------------------------------------------------------
/hosts/work/modules.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, lib, ... }:
2 |
3 | let
4 | polybar = pkgs.polybar.override {
5 | i3GapsSupport = true;
6 | alsaSupport = true;
7 | };
8 | execWithEnv = pkgs.writeScriptBin "execWithEnv"
9 | ''#!${pkgs.stdenv.shell}
10 |
11 | unset __NIXOS_SET_ENVIRONMENT_DONE
12 | source /etc/profile
13 | exec "$@"'';
14 |
15 | in
16 | {
17 |
18 | systemd.user.targets.autostart = {
19 | description = "Target to bind applications that should be started after VM";
20 | };
21 |
22 | environment.systemPackages = with pkgs; [
23 | execWithEnv
24 | dunst
25 | autorandr
26 | flameshot
27 | polybar
28 | feh
29 | networkmanagerapplet
30 | #pantheon.pantheon-agent-polkit
31 | numix-gtk-theme
32 | papirus-icon-theme
33 | qt5.qtbase
34 | i3lock-fancy-rapid
35 | sxhkd
36 | g-rofi
37 | ];
38 |
39 | environment.etc = {
40 | "xdg/dunst/dunstrc".source = ./dunst.conf;
41 | "xdg/gtk-3.0/settings.ini".source = ./settings.ini;
42 | };
43 |
44 | systemd.user.services.sxhkd = {
45 | description = "Simple X hotkey daemon";
46 | wantedBy = [ "autostart.target" ];
47 | serviceConfig = {
48 | Restart = "always";
49 | ExecStart = "/run/current-system/sw/bin/execWithEnv ${pkgs.sxhkd}/bin/sxhkd -c ${./sxhkd.conf}";
50 | };
51 | };
52 |
53 | systemd.user.services.polybar = {
54 | description = "Polybar system status bar";
55 | wantedBy = [ "autostart.target" ];
56 | serviceConfig = {
57 | Restart = "always";
58 | ExecStart = "${polybar}/bin/polybar -c ${./polybar.conf} main";
59 | };
60 | };
61 |
62 | fonts = {
63 | enableFontDir = true;
64 | fonts = with pkgs; [
65 | #dejavu_fonts
66 | #ubuntu_font_family
67 | #source-code-pro
68 | noto-fonts
69 | #noto-fonts-extra
70 | #noto-fonts-cjk
71 | #twitter-color-emoji
72 | #fira-code
73 | #fira-code-symbols
74 | nerdfonts
75 | ];
76 |
77 | fontconfig.enable = true;
78 | fontconfig.defaultFonts = {
79 | monospace = lib.mkDefault [ "RobotoMono Nerd Font" "DejaVu Sans Mono" ];
80 | sansSerif = lib.mkDefault [ "Roboto" "DejaVu Sans" ];
81 | serif = lib.mkDefault [ "Roboto" "DejaVu Serif" ];
82 | emoji = lib.mkDefault [ "Twitter Color Emoji" ];
83 | };
84 | };
85 |
86 | console.packages = with pkgs; [ terminus_font ];
87 | console.font = "ter-v12n";
88 |
89 | systemd.user.services.autorandr = {
90 | description = "Autorandr execution hook";
91 | wantedBy = [ "autostart.target" ];
92 | serviceConfig = {
93 | Type = "oneshot";
94 | ExecStart = "/run/current-system/sw/bin/execWithEnv ${pkgs.autorandr}/bin/autorandr --change";
95 | };
96 | };
97 |
98 | systemd.user.services.flameshot = {
99 | description = "Flameshot";
100 | wantedBy = [ "autostart.target" ];
101 | serviceConfig = {
102 | Restart = "always";
103 | ExecStart = "/run/current-system/sw/bin/execWithEnv ${pkgs.flameshot}/bin/flameshot";
104 | };
105 | };
106 |
107 |
108 | systemd.user.services.nm-applet = {
109 | description = "Network Manager Applet";
110 | wantedBy = [ "autostart.target" ];
111 | serviceConfig = {
112 | Restart = "always";
113 | ExecStart = "${pkgs.networkmanagerapplet}/bin/nm-applet";
114 | };
115 | };
116 |
117 |
118 |
119 | systemd.user.services.polkit-ui = {
120 | description = "Polkit UI popup";
121 | wantedBy = [ "autostart.target" ];
122 | serviceConfig = {
123 | Restart = "always";
124 | ExecStart = "${pkgs.pantheon.pantheon-agent-polkit}/libexec/policykit-1-pantheon/io.elementary.desktop.agent-polkit";
125 | };
126 | };
127 |
128 |
129 | systemd.user.services.feh = {
130 | description = "Feh";
131 | wantedBy = [ "autostart.target" ];
132 | serviceConfig = {
133 | Type = "oneshot";
134 | ExecStart = "${pkgs.feh}/bin/feh --randomize --no-fehbg --bg-fill ${./Wallpapers}";
135 | };
136 | };
137 |
138 |
139 | services.compton = {
140 | enable = true;
141 | backend = "glx";
142 | shadow = true;
143 | vSync = true;
144 | shadowExclude = [
145 | "_GTK_FRAME_EXTENTS@:c"
146 | "class_g = '.ulauncher-wrapped'"
147 | "class_g = 'Conky'"
148 | "class_g = 'Peek'"
149 | "class_g = 'Ulauncher'"
150 | "class_g = 'gromit-mpx'"
151 | "class_g = 'i3-frame'"
152 | "name = 'Polybar tray window'"
153 | "name = 'polybar-blur-noshadow'"
154 | "name = 'polybar-noblur-noshadow'"
155 | ];
156 |
157 | settings.blur-background-exclude = [
158 | "!(name = 'polybar-blur-shadow' || name = 'polybar-blur-noshadow' || name = 'polybar-backdrop' || class_g = 'URxvt' || class_g = 'Rofi' || class_g = 'Dunst' || class_g = 'Atom' || class_g = 'VSCodium' || class_g = 'Termite' || class_g = 'Conky' || name = 'Polybar tray window')"
159 | ];
160 |
161 | };
162 |
163 | }
164 |
--------------------------------------------------------------------------------
/hosts/work/polybar.conf:
--------------------------------------------------------------------------------
1 | ;-------------------------------------------------------------------------------
2 | ; V A R I A B L E S
3 | ;-------------------------------------------------------------------------------
4 |
5 | [colors]
6 | background = #131313
7 | background-alt = #333
8 |
9 | foreground = #b2b2b2
10 | foreground-alt = #ee3333
11 |
12 | trans = #DA292b2e
13 | white = #eee
14 | grey = #444444
15 | pink = #d75f87
16 | blue = #4f97d7
17 | purple = #875faf
18 | green = #20ad80
19 | red = #ee3333
20 |
21 | ;-------------------------------------------------------------------------------
22 | ; B A R S
23 | ;-------------------------------------------------------------------------------
24 |
25 | [bar/main]
26 | width = 100%
27 | height = 16
28 | radius = 1.0
29 | padding-left = 1
30 | fixed-center = true
31 |
32 | background = ${colors.trans}
33 | foreground = ${colors.foreground}
34 |
35 | font-0 = Roboto:pixelsize=9;2
36 | font-1 = "3270Medium Nerd Font:style=Medium:size=11;3"
37 | font-2 = Roboto:pixelsize=9:weight=bold;2
38 |
39 | modules-left = powermenu arrow0 i3 arrow
40 | modules-center = music
41 | modules-right = arrow8 xkeyboard arrow7 memory arrow6 cpu arrow7 battery arrow6 volume arrow7 date arrow6
42 |
43 | tray-position = right
44 | tray-background = ${colors.background}
45 | tray-padding = 8
46 |
47 |
48 | ;-------------------------------------------------------------------------------
49 | ; D E C O R A T I O N S
50 | ;-------------------------------------------------------------------------------
51 |
52 |
53 | [module/arrow]
54 | ; background to trans
55 | type = custom/text
56 | content = " "
57 | content-foreground = ${colors.background}
58 | content-background = ${colors.trans}
59 |
60 | [module/arrow0]
61 | ; background to trans
62 | type = custom/text
63 | content = " "
64 | content-foreground = ${colors.trans}
65 | content-background = ${colors.background}
66 |
67 | [module/arrow1]
68 | ; grey to Blue
69 | type = custom/text
70 | content = " "
71 | content-foreground = ${colors.blue}
72 | content-background = ${colors.grey}
73 |
74 | [module/arrow2]
75 | ; Blue to Purple
76 | type = custom/text
77 | content = " "
78 | content-foreground = ${colors.purple}
79 | content-background = ${colors.blue}
80 |
81 | [module/arrow3]
82 | ; Purple to pink
83 | type = custom/text
84 | content = " "
85 | content-foreground = ${colors.pink}
86 | content-background = ${colors.purple}
87 |
88 | [module/arrow4]
89 | ; pink to green
90 | type = custom/text
91 | content = " "
92 | content-foreground = ${colors.green}
93 | content-background = ${colors.pink}
94 |
95 | [module/arrow5]
96 | ; green to grey
97 | type = custom/text
98 | content = " "
99 | content-foreground = ${colors.grey}
100 | content-background = ${colors.green}
101 |
102 | [module/arrow6]
103 | ; grey to bg
104 | type = custom/text
105 | content = " "
106 | content-foreground = ${colors.background}
107 | content-background = ${colors.grey}
108 |
109 | [module/arrow7]
110 | ; bg to grey
111 | type = custom/text
112 | content = " "
113 | content-foreground = ${colors.grey}
114 | content-background = ${colors.background}
115 |
116 | [module/arrow8]
117 | ; grey to bg
118 | type = custom/text
119 | content = " "
120 | content-foreground = ${colors.background}
121 | content-background = ${colors.trans}
122 |
123 | ;-------------------------------------------------------------------------------
124 | ; M O D U L E S
125 | ;-------------------------------------------------------------------------------
126 |
127 | [module/xkeyboard]
128 | type = internal/xkeyboard
129 | blacklist-0 = num lock
130 |
131 | format-prefix = " KEY "
132 | format-prefix-foreground = ${colors.blue}
133 | format-prefix-background = ${colors.background}
134 |
135 | label-layout = %layout%
136 | label-layout-foreground = ${colors.blue}
137 | label-layout-background = ${colors.background}
138 |
139 |
140 | [module/i3]
141 | type = internal/i3
142 | format =
143 | index-sort = true
144 |
145 | label-mode-foreground = ${colors.pink}
146 | label-mode-background = ${colors.background}
147 |
148 | label-visible = " %name% "
149 | label-visible-foreground = ${colors.pink}
150 | label-visible-background = ${colors.background}
151 |
152 | label-focused = " %name% "
153 | label-focused-font = 3
154 | label-focused-foreground = ${colors.pink}
155 | label-focused-background = ${colors.background}
156 |
157 | label-urgent = " %name% "
158 | label-urgent-background = ${colors.background}
159 | label-urgent-foreground = ${colors.white}
160 |
161 | label-unfocused = " %name% "
162 | label-unfocused-foreground = ${colors.pink}
163 | label-unfocused-background = ${colors.background}
164 |
165 |
166 | [module/cpu]
167 | type = internal/cpu
168 | interval = 3
169 | format-prefix = " CPU "
170 | format-prefix-foreground = ${colors.purple}
171 | format-prefix-background = ${colors.background}
172 | label = %percentage%%
173 | label-foreground = ${colors.purple}
174 | label-background = ${colors.background}
175 |
176 |
177 | [module/memory]
178 | type = internal/memory
179 | interval = 3
180 | format-prefix = " RAM "
181 | format-prefix-foreground = ${colors.pink}
182 | format-prefix-background = ${colors.grey}
183 | label = %percentage_used%%
184 | label-foreground = ${colors.pink}
185 | label-background = ${colors.grey}
186 |
187 |
188 | [module/date]
189 | type = internal/date
190 | interval = 5
191 |
192 | date = " %Y-%m-%d"
193 | time= %H:%M
194 |
195 | label = %date% %time%
196 | label-foreground = ${colors.white}
197 | label-background = ${colors.grey}
198 |
199 |
200 | [module/volume]
201 | type = internal/alsa
202 |
203 | mapping = true
204 | format-volume =
205 | master-soundcard = default
206 | speaker-soundcard = default
207 | headphone-soundcard = default
208 |
209 | label-volume = %percentage%%
210 | label-volume-foreground = ${colors.blue}
211 | label-volume-background = ${colors.background}
212 | label-muted = " MUTED "
213 | label-muted-foreground = ${colors.blue}
214 | label-muted-background = ${colors.background}
215 |
216 | ramp-volume-0 = " VOL "
217 | ramp-volume-0-foreground = ${colors.blue}
218 | ramp-volume-0-background = ${colors.background}
219 | ramp-volume-1 = " VOL "
220 | ramp-volume-1-foreground = ${colors.blue}
221 | ramp-volume-1-background = ${colors.background}
222 | ramp-volume-2 = " VOL "
223 | ramp-volume-2-foreground = ${colors.blue}
224 | ramp-volume-2-background = ${colors.background}
225 | ramp-volume-3 = " VOL "
226 | ramp-volume-3-foreground = ${colors.blue}
227 | ramp-volume-3-background = ${colors.background}
228 |
229 |
230 | [module/battery]
231 | interval = 5
232 | type = internal/battery
233 | battery = BAT0
234 | adapter = AC
235 | full-at = 100
236 |
237 | format-charging =
238 | format-charging-foreground = ${colors.green}
239 | format-charging-background = ${colors.grey}
240 | format-discharging =
241 | format-discharging-foreground = ${colors.green}
242 | format-discharging-background = ${colors.grey}
243 | format-full =
244 | format-full-foreground = ${colors.green}
245 | format-full-background = ${colors.grey}
246 |
247 | label-charging = "CHR %percentage%%"
248 | label-discharging = "BAT %percentage%%"
249 | label-discharging-foreground = ${colors.green}
250 | label-full = "BAT %percentage%%"
251 |
252 | ramp-capacity-0 =
253 | ramp-capacity-0-foreground = ${colors.red}
254 | ramp-capacity-1 =
255 | ramp-capacity-1-foreground = ${colors.red}
256 | ramp-capacity-2 =
257 | ramp-capacity-3 =
258 | ramp-capacity-4 =
259 | animation-charging-0 =
260 | animation-charging-1 =
261 | animation-charging-2 =
262 | animation-charging-3 =
263 | animation-charging-4 =
264 | animation-charging-framerate = 750
265 |
266 |
267 | [module/powermenu]
268 | type = custom/menu
269 |
270 | label-open = ""
271 | label-open-padding = 2
272 | label-open-foreground = ${colors.white}
273 |
274 | label-close = ""
275 | label-close-padding-left = 3
276 | label-close-foreground = ${colors.white}
277 |
278 | label-separator = " "
279 |
280 | menu-0-0 = ""
281 | menu-0-0-foreground = ${colors.white}
282 | menu-0-0-exec = systemctl poweroff
283 |
284 | menu-0-1 = ""
285 | menu-0-1-foreground = ${colors.white}
286 | menu-0-1-exec = systemctl reboot
287 |
288 | menu-0-2 = " "
289 | menu-0-2-foreground = ${colors.white}
290 | menu-0-2-exec = systemctl suspend
291 |
292 | menu-0-3 = ""
293 | menu-0-3-foreground = ${colors.white}
294 | menu-0-3-exec = i3lock-fancy
295 |
296 | menu-0-4 = " "
297 | menu-0-4-foreground = ${colors.white}
298 | menu-0-4-exec = i3-msg exit
299 |
300 |
301 | [settings]
302 | screenchange-reload = true
303 |
304 |
305 | ; ############################################################
306 | ; Unused
307 | ; ############################################################
308 |
309 | [module/music]
310 | type = custom/script
311 | interval = 1
312 |
313 | label = %output:0:45:...%
314 | ;exec = ~/comfy_guration/scripts/polybar/poly_music.sh
315 |
316 |
317 |
318 |
--------------------------------------------------------------------------------
/hosts/work/settings.ini:
--------------------------------------------------------------------------------
1 | [Settings]
2 | gtk-application-prefer-dark-theme=true
3 | gtk-button-images=0
4 | gtk-cursor-theme-name=breeze_cursors
5 | gtk-fallback-icon-theme=ePapirus
6 | gtk-icon-theme-name=ePapirus
7 | gtk-menu-images=0
8 | gtk-primary-button-warps-slider=0
9 | gtk-theme-name=Numix
10 | gtk-toolbar-style=GTK_TOOLBAR_ICONS
11 |
12 |
13 |
--------------------------------------------------------------------------------
/hosts/work/sxhkd.conf:
--------------------------------------------------------------------------------
1 | # Audio
2 | XF86Audio{RaiseVolume,LowerVolume}
3 | pactl set-sink-volume @DEFAULT_SINK@ {+5%,-5%}
4 |
5 | XF86AudioMute
6 | pactl set-sink-mute @DEFAULT_SINK@ toggle
7 |
8 | XF86Audio{Play,Pause,Next,Prev}
9 | playerctl {play,pause,next,previous}
10 |
11 |
12 | # Brightness
13 | XF86MonBrightness{Up,Down}
14 | xbacklight -{inc,dec} 20
15 |
16 | # Autorandr
17 | super + z
18 | autorandr -c -f
19 |
20 | # Applications
21 | super + Return
22 | $TERMINAL
23 |
24 | super + w
25 | $TERMINAL -e ranger
26 |
27 | super + q
28 | wmctrl -c :ACTIVE:
29 |
30 | super + b
31 | $BROWSER
32 |
33 | super + shift + b
34 | $BROWSER --incognito
35 |
36 | super + g
37 | google-chrome-stable
38 |
39 | super + k
40 | gitkraken
41 |
42 | super + i
43 | idea-ultimate
44 |
45 | super + shift + g
46 | google-chrome-stable --incognito
47 |
48 | Print
49 | flameshot gui
50 |
51 | alt + shift + l
52 | i3lock-fancy-rapid 3 3
53 |
54 | super + d
55 | rofi -show drun -modi drun
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/modules/cachix.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, lib, ... }:
2 |
3 | with lib;
4 | let cfg = config.gytix.cachix;
5 | in {
6 | options = {
7 | gytix.cachix.enable = mkEnableOption "Enable custom cachix configuration";
8 | };
9 |
10 | config = mkIf cfg.enable {
11 |
12 | #environment.systemPackages = with pkgs; [ cachix ];
13 |
14 | nix.extraOptions = "gc-keep-outputs = true";
15 | nix.settings = {
16 | substituters = [
17 | "https://cache.iog.io"
18 | ];
19 | trusted-public-keys = [
20 | "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
21 | ];
22 | };
23 | };
24 | }
25 |
--------------------------------------------------------------------------------
/modules/clean-home.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, lib, ... }:
2 |
3 | with lib;
4 | let
5 | cfg = config.gytix.cleanHome;
6 | XDG_CACHE_HOME = "$HOME/.cache";
7 | XDG_CONFIG_HOME = "$HOME/.config";
8 | XDG_DATA_HOME = "$HOME/.local/share";
9 | in
10 | {
11 | options = {
12 | gytix.cleanHome.enable = mkEnableOption "Enable environment variables to reduce clutter in $HOME";
13 |
14 |
15 | gytix.cleanHome.variables = lib.mkOption {
16 | default = {
17 | ANDROID_AVD_HOME = "${XDG_CONFIG_HOME}/android";
18 | ANDROID_SDK_HOME = "${XDG_CONFIG_HOME}/android";
19 | ANSIBLE_CONFIG = "${XDG_CONFIG_HOME}/ansible/ansible.cfg";
20 | CARGO_HOME = "${XDG_DATA_HOME}/cargo";
21 | ERRFILE = "${XDG_CACHE_HOME}/.xsession-errors";
22 | GOPATH = "${XDG_DATA_HOME}/go";
23 | GRADLE_USER_HOME = "${XDG_DATA_HOME}/gradle";
24 | GTK2_RC_FILES = "${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0";
25 | HISTFILE = "${XDG_CACHE_HOME}/history";
26 | INPUTRC = "${XDG_CONFIG_HOME}/inputrc";
27 | LESSHISTFILE = "-";
28 | MINIKUBE_HOME = "${XDG_CONFIG_HOME}/minikube";
29 | XCOMPOSECACHE = "${XDG_CACHE_HOME}/X11/xcompose";
30 | XCOMPOSEFILE = "${XDG_CONFIG_HOME}/X11/xcompose";
31 | ZDOTDIR = "${XDG_CONFIG_HOME}/zsh";
32 | #TMUX_TMPDIR="$XDG_RUNTIME_DIR";
33 | #WGETRC="${XDG_CONFIG_HOME}/wget/wgetrc";
34 | #XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"; # This line will break some DMs.
35 | };
36 | type = with types; attrsOf (either str (listOf str));
37 | };
38 | };
39 |
40 | config = mkIf cfg.enable {
41 | environment.variables = cfg.variables;
42 | };
43 | }
44 |
--------------------------------------------------------------------------------
/modules/nix-compose.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, lib, ... }:
2 |
3 | with lib;
4 | with pkgs;
5 | with builtins;
6 | let
7 | cfg = config.nix-compose;
8 |
9 | getImageName = image: if isDerivation image then "${image.imageName}:${image.imageTag}" else image;
10 | volumesPath = "/nix/compose";
11 |
12 | mkContainer = composeName: compose:
13 | let
14 | imageDeriviations = mapAttrsFlatten
15 | (_: it: it.image)
16 | (filterAttrs (_: it: isDerivation it.image) compose.services);
17 |
18 | buildVolumePath = volumeName: volumesPath + "/" + composeName + "/" + volumeName;
19 |
20 | resolveVolumes = volumes: map
21 | (volume@{ volumeName ? null, source ? null, target }:
22 | if isStorePath source then {
23 | target = toString target;
24 | source = toString source;
25 | type = "bind";
26 | read_only = true;
27 | }
28 | else if volumeName != null then {
29 | target = toString target;
30 | source = buildVolumePath volumeName;
31 | type = "bind";
32 | } else volume)
33 | volumes;
34 |
35 | resolveService = service: service // {
36 | image = getImageName service.image;
37 | volumes = if service ? volumes then resolveVolumes service.volumes else [ ];
38 | };
39 |
40 | parsedServices = mapAttrs (_: service: resolveService service) compose.services;
41 | volumes = flatten (mapAttrsFlatten (_: service: if service ? volumes then service.volumes else [ ]) compose.services);
42 |
43 | nixVolumes = filter (it: it ? volumeName) volumes;
44 | pathsToCreate = map (it: buildVolumePath it.volumeName) nixVolumes;
45 |
46 | docker-compose = writeText composeName
47 | (toJSON (compose // { services = parsedServices; }));
48 | in
49 | {
50 | enable = true;
51 | preStart = ''
52 | ${concatStringsSep "\n" (map (it: "${podman}/bin/podman load -i ${it}") imageDeriviations)}
53 | mkdir -p ${concatStringsSep " " pathsToCreate}
54 |
55 | '';
56 | path = [ zfs podman shadow ];
57 | serviceConfig = {
58 | ExecStart = "${podman-compose}/bin/podman-compose --transform_policy=identity -f ${docker-compose} up";
59 | ExecStopPost = "${podman-compose}/bin/podman-compose -f ${docker-compose} down";
60 | Restart = "on-failure";
61 | };
62 | wantedBy = [ "multi-user.target" ];
63 | };
64 |
65 | composeOpts = { name, config, ... }: {
66 | options = {
67 | enable = mkEnableOption "Is configuration supposed to be enabled?" // { default = true; };
68 |
69 | compose = mkOption {
70 | type = types.attrs;
71 | default = { };
72 | example = {
73 | services.nginx = {
74 | image = "nginx";
75 | ports = [ "8080:80" ];
76 | };
77 | };
78 | };
79 |
80 | };
81 | };
82 | in
83 | {
84 |
85 | options = {
86 |
87 | nix-compose.definitions = mkOption {
88 | default = { };
89 | type = with types; attrsOf (submodule composeOpts);
90 | description = '' '';
91 | };
92 |
93 | };
94 |
95 | config = {
96 | systemd.services = mapAttrs (name: value: mkContainer name value.compose) config.nix-compose.definitions;
97 | };
98 |
99 | }
100 |
--------------------------------------------------------------------------------
/modules/runtimes.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, lib, ... }:
2 | with lib;
3 | let
4 | nodeCfg = config.gytix.node;
5 | javaCfg = config.gytix.java;
6 | defaultEnvVarialbes = {
7 | XDG_DATA_HOME = mkDefault "$HOME/.local/share";
8 | XDG_CACHE_HOME = mkDefault "$HOME/.cache";
9 | XDG_CONFIG_HOME = mkDefault "$HOME/.config";
10 | };
11 | in
12 | {
13 | options = {
14 |
15 | gytix.java.additionalPackages = mkOption {
16 | description = ''
17 | Java packages to install. Typical values are pkgs.jdk or pkgs.jre. Example:
18 | ```
19 | gytix.java.additionalPackages = {
20 | inherit (pkgs) jdk11 jdk14 jdk15;
21 | };
22 | ```
23 | This snippet:
24 | 1. Generates environment variables `JAVA_HOME11` and `JAVA_HOME14`
25 | 2. Generates aliases `java11` and `java14`
26 | '';
27 | default = { };
28 | type = with types; attrsOf package;
29 | };
30 |
31 | gytix.node.additionalPackages = mkOption {
32 | description = ''
33 | Node packages to install. Typical values are pkgs.nodejs-10_x or pkgs.nodejs-14_x. Example:
34 | ```
35 | gytix.node.additionalPackages = {
36 | inherit (pkgs) nodejs-14_x;
37 | };
38 | ```
39 | This snippet:
40 | 1. Generates environment variables `JAVA_HOME11` and `JAVA_HOME14`
41 | 2. Generates aliases `java11` and `java14`
42 | '';
43 | default = { };
44 | type = with types; attrsOf package;
45 | };
46 | };
47 |
48 | config =
49 | let
50 | escapeDashes = it: replaceStrings [ "-" ] [ "_" ] it;
51 |
52 | javaPkgs = javaCfg.additionalPackages;
53 | javaAliases = mapAttrs'
54 | (name: value: nameValuePair "java_${name}" "${value.home}/bin/java")
55 | javaPkgs;
56 | javaTmpfiles =
57 | mapAttrsFlatten (name: value: "L+ /nix/java${name} - - - - ${value.home}")
58 | javaPkgs;
59 | javaEnvVariables = mapAttrs'
60 | (name: value:
61 | nameValuePair "JAVA_HOME_${toUpper (escapeDashes name)}" "${value.home}")
62 | javaPkgs;
63 |
64 | nodePkgs = nodeCfg.additionalPackages;
65 | nodeAliases =
66 | mapAttrs' (name: value: nameValuePair name "${value}/bin/node") nodePkgs;
67 | in
68 | {
69 | environment.variables = javaEnvVariables // defaultEnvVarialbes;
70 | environment.shellAliases = javaAliases // nodeAliases;
71 | systemd.tmpfiles.rules = javaTmpfiles;
72 |
73 | programs.npm.npmrc = mkIf config.programs.npm.enable (mkDefault ''
74 | prefix=''${XDG_DATA_HOME}/npm
75 | cache=''${XDG_CACHE_HOME}/npm
76 | init-module=''${XDG_CONFIG_HOME}/npm/config/npm-init.js
77 | init-license=MIT
78 | color=true
79 | '');
80 |
81 | environment.shellInit = mkIf config.programs.npm.enable ''
82 | export PATH=$PATH:$XDG_DATA_HOME/npm/bin
83 | '';
84 |
85 | };
86 | }
87 |
--------------------------------------------------------------------------------
/overlays/default.nix:
--------------------------------------------------------------------------------
1 | final: prev: {
2 | g-alacritty = prev.callPackage ./g-alacritty { };
3 | g-firefox = prev.callPackage ./g-firefox { };
4 | g-lf = prev.callPackage ./g-lf { };
5 | g-pistol = prev.callPackage ./g-pistol { };
6 | g-polybar = prev.callPackage ./g-polybar { };
7 | g-rofi = prev.callPackage ./g-rofi { };
8 | g-termite = prev.callPackage ./g-termite { };
9 | shell-config = prev.callPackage ./shell-config { };
10 | #zsh-forgit = prev.callPackage ./zsh-forgit { };
11 |
12 | discord-for-poor-people = with prev; makeDesktopItem {
13 | name = "Discord";
14 | desktopName = "Discord new";
15 | genericName = "All-in-one cross-platform voice and text chat for gamers";
16 | exec = "${chromium}/bin/chromium --app=\"https://discord.com/channels/@me\"";
17 | icon = "discord";
18 | type = "Application";
19 | categories = [ "Network" "InstantMessaging" ];
20 | terminal = false;
21 | mimeTypes = [ "x-scheme-handler/discord" ];
22 | };
23 |
24 | element-for-poor-people = with prev; makeDesktopItem {
25 | name = "Element";
26 | desktopName = "Element";
27 | genericName = "Secure and independent communication, connected via Matrix";
28 | exec = "${chromium}/bin/chromium --app=\"https://app.element.io/#/home\"";
29 | icon = "element";
30 | type = "Application";
31 | categories = [ "Network" "InstantMessaging" ];
32 | terminal = false;
33 | };
34 |
35 | yuescript = prev.stdenv.mkDerivation {
36 | pname = "yuescript";
37 | version = "0.5.0-1";
38 |
39 | installPhase = ''
40 | cp -R bin/release/ $out
41 |
42 | '';
43 |
44 | src = prev.fetchFromGitHub {
45 | owner = "pigpigyyy";
46 | repo = "Yuescript";
47 | rev = "6d290f08181a543778c75748b66c513bb8e33423";
48 | sha256 = "sha256-LLIXNkoDxe43IqghA42q6c/o5SWuI/n7A6qy7XxMn30=";
49 | };
50 |
51 | };
52 | }
53 |
--------------------------------------------------------------------------------
/overlays/dunst.conf:
--------------------------------------------------------------------------------
1 | [global]
2 | monitor = 0
3 | follow = mouse
4 | geometry = "320x5-15+15"
5 | indicate_hidden = yes
6 | shrink = no
7 | transparency = 0
8 | notification_height = 0
9 | separator_height = 2
10 | padding = 10
11 | horizontal_padding = 10
12 | frame_width = 1
13 | frame_color = "#232323"
14 | separator_color = frame
15 | sort = yes
16 | idle_threshold = 120
17 | font = Source Sans Pro 10
18 | line_height = 0
19 | markup = full
20 | format = "%s %p\n%b"
21 | alignment = left
22 | show_age_threshold = 60
23 | word_wrap = yes
24 | ellipsize = middle
25 | ignore_newline = no
26 | stack_duplicates = true
27 | hide_duplicate_count = false
28 | show_indicators = yes
29 | icon_position = left
30 | max_icon_size = 32
31 | icon_path = /usr/share/icons/Paper/16x16/status/:/usr/share/icons/Paper/16x16/devices/:/usr/share/icons/Paper/16x16/apps/
32 | sticky_history = yes
33 | history_length = 20
34 | always_run_script = true
35 | startup_notification = false
36 | verbosity = mesg
37 | corner_radius = 0
38 | force_xinerama = false
39 | mouse_left_click = close_current
40 | mouse_middle_click = do_action
41 | mouse_right_click = close_all
42 |
43 | [shortcuts]
44 | close = ctrl+space
45 | close_all = ctrl+shift+space
46 | history = ctrl+grave
47 | context = ctrl+shift+period
48 |
49 | [urgency_low]
50 | background = "#232323"
51 | foreground = "#a8a8a8"
52 | timeout = 10
53 |
54 | [urgency_normal]
55 | background = "#232323"
56 | foreground = "#a8a8a8"
57 | timeout = 10
58 |
59 | [urgency_critical]
60 | background = "#d64e4e"
61 | foreground = "#f0e0e0"
62 | frame_color = "#d64e4e"
63 | timeout = 0
64 | icon = /usr/share/icons/Papirus/16x16/status/package-purge.svg
65 |
66 |
--------------------------------------------------------------------------------
/overlays/g-alacritty/alacritty.toml:
--------------------------------------------------------------------------------
1 | [general]
2 | live_config_reload = true
3 |
4 | [colors]
5 | draw_bold_text_with_bright_colors = true
6 |
7 | [colors.bright]
8 | black = "#38252C"
9 | blue = "#289CD5"
10 | cyan = "#0A9B81"
11 | green = "#76B639"
12 | magenta = "#FF2491"
13 | red = "#FF0000"
14 | white = "#F8F8F8"
15 | yellow = "#E1A126"
16 |
17 | [colors.footer_bar]
18 | background = "#D81765"
19 | foreground = "#FFFFFF"
20 |
21 | [colors.normal]
22 | black = "#171717"
23 | blue = "#16B1FB"
24 | cyan = "#0FDCB6"
25 | green = "#97D01A"
26 | magenta = "#FF2491"
27 | red = "#D81765"
28 | white = "#EBEBEB"
29 | yellow = "#FFA800"
30 |
31 | [colors.primary]
32 | background = "#171717"
33 | foreground = "#F8F8F8"
34 |
35 | [colors.search.focused_match]
36 | background = "CellForeground"
37 | foreground = "CellBackground"
38 |
39 | [colors.search.matches]
40 | background = "#D81765"
41 | foreground = "#EBEBEB"
42 |
43 | [[keyboard.bindings]]
44 | chars = "\u0017"
45 | key = "Back"
46 | mods = "Control"
47 |
48 | [scrolling]
49 | history = 100000
50 |
--------------------------------------------------------------------------------
/overlays/g-alacritty/default.nix:
--------------------------------------------------------------------------------
1 | { pkgs, alacritty }:
2 | let
3 | wrapped = pkgs.writeShellScriptBin "alacritty" "${alacritty}/bin/alacritty --config-file ${./alacritty.toml} $@";
4 | in
5 | pkgs.symlinkJoin {
6 | name = "alacritty";
7 | paths = [
8 | wrapped
9 | alacritty
10 | ];
11 | }
12 |
--------------------------------------------------------------------------------
/overlays/g-firefox/default.nix:
--------------------------------------------------------------------------------
1 | { pkgs, lib, wrapFirefox, firefox-unwrapped, ... }:
2 | with lib;
3 | with builtins;
4 | let
5 | #https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig
6 | # ~/.mozilla/firefox/HASH_ID.default/prefs.js
7 | defaultPrefs = {
8 | "app.normandy.first_run" = false;
9 | "app.shield.optoutstudies.enabled" = false;
10 | "browser.aboutConfig.showWarning" = false;
11 | "browser.ctrlTab.recentlyUsedOrder" = false;
12 | "browser.download.viewableInternally.typeWasRegistered.svg" = true;
13 | "browser.download.viewableInternally.typeWasRegistered.webp" = true;
14 | "browser.download.viewableInternally.typeWasRegistered.xml" = true;
15 | "browser.fullscreen.autohide" = false;
16 | "browser.proton.enabled" = true;
17 | "browser.search.hiddenOneOffs" = "Google,Amazon.com,Bing,DuckDuckGo,Wikipedia (en)";
18 | "browser.shell.checkDefaultBrowser" = false;
19 | "browser.startup.page" = 3; #Resume the previous browser session
20 | "browser.tabs.closeWindowWithLastTab" = false;
21 | "browser.uidensity" = 1; # Compact
22 | "devtools.accessibility.enabled" = false;
23 | "devtools.cache.disabled" = true;
24 | "devtools.chrome.enabled" = true;
25 | "devtools.command-button-fission-prefs.enabled" = false;
26 | "devtools.command-button-measure.enabled" = true;
27 | "devtools.command-button-rulers.enabled" = true;
28 | "devtools.command-button-screenshot.enabled" = true;
29 | "devtools.debugger.prefs-schema-version" = 11;
30 | "devtools.editor.keymap" = "vim";
31 | "devtools.inspector.activeSidebar" = "ruleview";
32 | "devtools.inspector.three-pane-enabled" = false;
33 | "devtools.memory.enabled" = false;
34 | "devtools.netmonitor.columnsData" = "[{\"name\":\"status\",\"minWidth\":30,\"width\":5.79},{\"name\":\"method\",\"minWidth\":30,\"width\":5.79},{\"name\":\"domain\",\"minWidth\":30,\"width\":7.54},{\"name\":\"file\",\"minWidth\":30,\"width\":39.2},{\"name\":\"url\",\"minWidth\":30,\"width\":20},{\"name\":\"initiator\",\"minWidth\":30,\"width\":17.54},{\"name\":\"type\",\"minWidth\":30,\"width\":4.51},{\"name\":\"transferred\",\"minWidth\":30,\"width\":16.78},{\"name\":\"contentSize\",\"minWidth\":30,\"width\":29.21},{\"name\":\"waterfall\",\"minWidth\":150,\"width\":44.71},{\"name\":\"cookies\",\"minWidth\":30,\"width\":7.41},{\"name\":\"setCookies\",\"minWidth\":30,\"width\":7.41},{\"name\":\"remoteip\",\"minWidth\":30,\"width\":7.41},{\"name\":\"scheme\",\"minWidth\":30,\"width\":7.41},{\"name\":\"protocol\",\"minWidth\":30,\"width\":7.41}]";
35 | "devtools.netmonitor.filters" = "[\"xhr\"]";
36 | "devtools.netmonitor.visibleColumns" = "[\"status\",\"method\",\"file\",\"type\",\"waterfall\"]";
37 | "devtools.performance.enabled" = false;
38 | "devtools.screenshot.clipboard.enabled" = true;
39 | "devtools.styleeditor.enabled" = false;
40 | "devtools.theme" = "dark";
41 | "devtools.toolbox.host" = "right";
42 | "devtools.toolbox.previousHost" = "bottom";
43 | "devtools.toolbox.sidebar.width" = 1471;
44 | "devtools.toolbox.splitconsoleHeight" = 387;
45 | "devtools.toolsidebar-height.inspector" = 350;
46 | "devtools.toolsidebar-width.inspector" = 704;
47 | "devtools.toolsidebar-width.inspector.splitsidebar" = 704;
48 | "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
49 | "extensions.webcompat.enable_picture_in_picture_overrides" = true;
50 | "extensions.webcompat.enable_shims" = true;
51 | "extensions.webcompat.perform_injections" = true;
52 | "extensions.webcompat.perform_ua_overrides" = true;
53 | "gfx.webrender.all" = true;
54 | "gfx.webrender.enabled" = true;
55 | "media.ffmpeg.vaapi.enabled" = true;
56 | "network.allow-experiments" = false;
57 | "privacy.donottrackheader.enabled" = true;
58 | "signon.rememberSignons" = false;
59 | #"browser.startup.homepage" = "https://nixos.org";
60 | #"extensions.pocket.enabled" = false;
61 | #"extensions.update.enabled" = false;
62 | #"widget.wayland-dmabuf-vaapi.enabled" = true;
63 |
64 | "browser.newtabpage.enabled" = false;
65 | "browser.newtabpage.enhanced" = false;
66 | "browser.newtabpage.activity-stream.enabled" = false;
67 | "experiments.supported" = false;
68 | "experiments.enabled" = false;
69 |
70 | # Disable some not so useful functionality.
71 | "media.videocontrols.picture-in-picture.video-toggle.enabled" = false;
72 | "extensions.shield-recipe-client.enabled" = false;
73 | "dom.battery.enabled" = false;
74 | # Disable "beacon" asynchronous HTTP transfers (used for analytics)
75 | # https://developer.mozilla.org/en-US/docs/Web/API/navigator.sendBeacon
76 | "beacon.enabled" = false;
77 |
78 | # Disable pinging URIs specified in HTML ping= attributes
79 | # http://kb.mozillazine.org/Browser.send_pings
80 | "browser.send_pings" = false;
81 |
82 | # Disable gamepad API to prevent USB device enumeration
83 | # https://www.w3.org/TR/gamepad/
84 | # https://trac.torproject.org/projects/tor/ticket/13023
85 | "dom.gamepad.enabled" = false;
86 | # Disable health reports (basically more telemetry)
87 | # https://support.mozilla.org/en-US/kb/firefox-health-report-understand-your-browser-perf
88 | # https://gecko.readthedocs.org/en/latest/toolkit/components/telemetry/telemetry/preferences.html
89 | "datareporting.healthreport.uploadEnabled" = false;
90 | "datareporting.healthreport.service.enabled" = false;
91 | "datareporting.policy.dataSubmissionEnabled" = false;
92 | "browser.search.firstRunSkipsHomepage" = true;
93 |
94 | "extensions.formautofill.available" = "off";
95 | "browser.newtabpage.activity-stream.feeds.section.highlights" = false;
96 | "browser.newtabpage.activity-stream.feeds.snippets" = false;
97 | "browser.newtabpage.activity-stream.feeds.topsites" = false;
98 | "browser.toolbars.bookmarks.visibility" = "always";
99 | "browser.urlbar.shortcuts.bookmarks" = false;
100 | "browser.urlbar.shortcuts.history" = false;
101 | "browser.urlbar.shortcuts.tabs" = false;
102 | "findbar.highlightAll" = true;
103 |
104 | "browser.uiCustomization.state" = toJSON {
105 | "placements" = {
106 | "widget-overflow-fixed-list" = [ ];
107 | "nav-bar" = [
108 | "back-button"
109 | "forward-button"
110 | "stop-reload-button"
111 | "urlbar-container"
112 | "downloads-button"
113 | "library-button"
114 | "sidebar-button"
115 | "fxa-toolbar-menu-button"
116 | ];
117 | "toolbar-menubar" = [
118 | "menubar-items"
119 | ];
120 | "TabsToolbar" = [
121 | "tabbrowser-tabs"
122 | "new-tab-button"
123 | "alltabs-button"
124 | ];
125 | "PersonalToolbar" = [
126 | "personal-bookmarks"
127 | ];
128 | };
129 | "seen" = [
130 | "developer-button"
131 | ];
132 | "dirtyAreaCache" = [
133 | "nav-bar"
134 | "PersonalToolbar"
135 | "toolbar-menubar"
136 | "TabsToolbar"
137 | ];
138 | "currentVersion" = 16;
139 | "newElementCount" = 4;
140 | };
141 |
142 | };
143 |
144 | extensions = with pkgs.nur.repos.rycee.firefox-addons; [
145 | # audio-fingerprint-defender
146 | # bitwarden
147 | # browserpass
148 | # canvas-fingerprint-defender
149 | # certificate_pinner
150 | # dark-reader
151 | # darkreader
152 | # font-fingerprint-defender
153 | # foxyproxy-standard
154 | # https-everywhere
155 | # languagetool
156 | # lastpass-password-manager
157 | # link-cleaner
158 | # org-capture
159 | # privacy-badger
160 | # reddit-enhancement-suite
161 | # sidebery
162 | # stylus
163 | ublock-origin
164 | # unpaywall
165 | # user-agent-switcher
166 | # vim-vixen
167 | vimium
168 | # webgl-fingerprint-defender
169 | ];
170 |
171 | in
172 | wrapFirefox firefox-unwrapped {
173 |
174 | #nixExtensions = extensions;
175 | extraPolicies = {
176 | CaptivePortal = false;
177 | DisableFirefoxStudies = true;
178 | DisablePocket = true;
179 | DisableTelemetry = true;
180 | #EncryptedMediaExtensions.Enable = false;
181 | #SearchSuggestEnabled = false;
182 | #OfferToSaveLogins = false;
183 | #NetworkPrediction = false;
184 | #OverridePostUpdatePage = "";
185 | #FirefoxHome = {
186 | # Search = false;
187 | # Pocket = false;
188 | # Snippets = false;
189 | # Highlights = false;
190 | # TopSites = true;
191 | #};
192 | UserMessaging = {
193 | ExtensionRecommendations = false;
194 | SkipOnboarding = true;
195 | };
196 | #SupportMenu = {
197 | # Title = "navi's browser";
198 | # URL = "https://govanify.com";
199 | #};
200 | #SearchBar = "unified";
201 | #PictureInPicture.Enabled = false;
202 | #PasswordManagerEnabled = false;
203 | NoDefaultBookmarks = false;
204 | DontCheckDefaultBrowser = true;
205 | DisableSetDesktopBackground = true;
206 | # probably handled by nix extensions but oh well
207 | DisableSystemAddonUpdate = true;
208 | ExtensionUpdate = false;
209 | EnableTrackingProtection = {
210 | Value = true;
211 | Locked = true;
212 | Cryptomining = true;
213 | Fingerprinting = true;
214 | };
215 |
216 | DisableFeedbackCommands = true;
217 | SearchEngines.Default = "Google";
218 | #BlockAboutAddons = true;
219 | #DisableFormHistory = true;
220 | };
221 | extraPrefs = ''
222 | // Gytis
223 | ${concatStrings (mapAttrsToList
224 | (name: value: ''
225 | lockPref("${name}", ${builtins.toJSON value});
226 | '')
227 | defaultPrefs)}
228 | '';
229 |
230 | }
231 |
232 | # extensions = with [
233 |
--------------------------------------------------------------------------------
/overlays/g-lf/default.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, ... }:
2 | let
3 | image = pkgs.writeScript "image" ''
4 | #!/usr/bin/env bash
5 | readonly ID_PREVIEW="preview"
6 | case "$1" in
7 | "clear") declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") > "$FIFO_UEBERZUG" ;;
8 | "draw") declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" [x]="$3" [y]="$4" [max_width]="$5" [max_height]="$6" [path]="$2") > "$FIFO_UEBERZUG" ;;
9 | "*") echo "Unknown command: '$1', '$2'" ;;
10 | esac
11 | '';
12 |
13 | previewer = pkgs.writeScript "peviewer" ''
14 | #!/bin/sh
15 |
16 | # Calculate where the image should be placed on the screen.
17 | num=$(printf "%0.f\n" "`echo "$(tput cols) / 2" | bc`")
18 | numb=$(printf "%0.f\n" "`echo "$(tput cols) - $num - 1" | bc`")
19 | numc=$(printf "%0.f\n" "`echo "$(tput lines) - 2" | bc`")
20 |
21 | # Clear the last preview (if any) and print file information
22 | ${image} clear
23 | ${pkgs.pistol}/bin/pistol "$1"
24 |
25 | case "$1" in
26 | *.pdf)
27 | CACHE=$(mktemp /tmp/thumbcache.XXXXX)
28 | pdftoppm -png -f 1 -singlefile "$1" "$CACHE"
29 | ${image} draw "$CACHE.png" $num 1 $numb $numc
30 | ;;
31 | *.epub)
32 | CACHE=$(mktemp /tmp/thumbcache.XXXXX)
33 | epub-thumbnailer "$1" "$CACHE" 1024
34 | ${image} draw "$CACHE" $num 1 $numb $numc
35 | ;;
36 | *.bmp|*.jpg|*.jpeg|*.png|*.xpm)
37 | ${image} draw "$1" $num 1 $numb $numc
38 | ;;
39 | *.wav|*.mp3|*.flac|*.m4a|*.wma|*.ape|*.ac3|*.og[agx]|*.spx|*.opus|*.as[fx]|*.flac) exiftool "$1";;
40 | *.avi|*.mp4|*.wmv|*.dat|*.3gp|*.ogv|*.mkv|*.mpg|*.mpeg|*.vob|*.fl[icv]|*.m2v|*.mov|*.webm|*.ts|*.mts|*.m4v|*.r[am]|*.qt|*.divx)
41 | CACHE=$(mktemp /tmp/thumbcache.XXXXX)
42 | ffmpegthumbnailer -i "$1" -o "$CACHE" -s 0
43 | ${image} draw "$CACHE" $num 1 $numb $numc
44 | ;;
45 | esac
46 | '';
47 |
48 | lfrc = pkgs.writeTextDir "lf/lfrc" ''
49 | set shell sh
50 | set shellopts '-eu'
51 | set previewer ${previewer}
52 | set icons
53 | set scrolloff 10
54 |
55 | #map - $/etc/nixos/modules/lf/draw.sh $f
56 |
57 | cmd clear ''${{
58 | ${image} clear
59 | }}
60 |
61 | cmd open ''${{
62 | case $(file --mime-type $f -b) in
63 | text/*) $EDITOR $fx;;
64 | *) for f in $fx; do setsid $OPENER $f > /dev/null 2> /dev/null & done;;
65 | esac
66 | }}
67 |
68 | cmd delete ''${{
69 | set -f
70 | printf "$fx\n"
71 | printf "delete?[y/n]"
72 | read ans
73 | [ $ans = "y" ] && rm -rf $fx
74 | }}
75 |
76 | map delete
77 | map delete
78 | map delete
79 |
80 | cmd extract %atool -x "$f"
81 |
82 | cmd tar ''${{
83 | set -f
84 | mkdir $1
85 | cp -r $fx $1
86 | tar czf $1.tar.gz $1
87 | rm -rf $1
88 | }}
89 |
90 | cmd zip ''${{
91 | set -f
92 | mkdir $1
93 | cp -r $fx $1
94 | zip -r $1.zip $1
95 | rm -rf $1
96 | }}
97 |
98 | %{{
99 | w=$(tput cols)
100 | if [ $w -le 80 ]; then
101 | lf -remote "send $id set ratios 1:2"
102 | elif [ $w -le 160 ]; then
103 | lf -remote "send $id set ratios 1:2:3"
104 | fi
105 | }}
106 | '';
107 |
108 | wrapped = pkgs.writeScriptBin "lf" ''
109 | #!/usr/bin/env bash
110 | export FIFO_UEBERZUG="/tmp/lf-ueberzug-''${PPID}"
111 |
112 | function cleanup {
113 | rm "$FIFO_UEBERZUG" 2>/dev/null
114 | pkill -P $$
115 | }
116 |
117 | mkfifo "$FIFO_UEBERZUG"
118 | trap cleanup EXIT
119 | tail --follow "$FIFO_UEBERZUG" | ${pkgs.ueberzug}/bin/ueberzug layer --silent --parser bash &
120 |
121 | XDG_CONFIG_HOME=${lfrc} ${pkgs.lf}/bin/lf $@
122 | '';
123 |
124 | in
125 | pkgs.symlinkJoin {
126 | name = "lf";
127 | paths = [ wrapped pkgs.lf ];
128 | }
129 |
130 | # {
131 | # environment.systemPackages = with pkgs; [
132 | # atool
133 | # bat
134 | # bc
135 | # ffmpegthumbnailer
136 | # imagemagick
137 | # g-pistol
138 | # poppler
139 | # ueberzug
140 | # lf
141 | # zip
142 | ## pkgs.epub-thumbnailer
143 | # ];
144 | #}
145 |
--------------------------------------------------------------------------------
/overlays/g-lf/draw.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | clear_screen() {
4 | printf '\e[%sH\e[9999C\e[1J%b\e[1;%sr' \
5 | "$((LINES-2))" "${TMUX:+\e[2J}" "$max_items"
6 | }
7 |
8 | # Get a file's mime_type.
9 | mime_type=$(file -bi "$1")
10 |
11 | # File isn't an image file, give warning.
12 | if [[ $mime_type != image/* ]]; then
13 | lf -remote "send $id echoerr 'Not an image'"
14 | exit
15 | fi
16 |
17 | w3m_paths=(/usr/{local/,}{lib,libexec,lib64,libexec64}/w3m/w3mi*)
18 | read -r w3m _ < <(type -p w3mimgdisplay "${w3m_paths[@]}")
19 | read -r LINES COLUMNS < <(stty size)
20 |
21 | # Get terminal window size in pixels and set it to WIDTH and HEIGHT.
22 | export $(xdotool getactivewindow getwindowgeometry --shell)
23 |
24 | # Get the image size in pixels.
25 | read -r img_width img_height < <("$w3m" <<< "5;${CACHE:-$1}")
26 |
27 | ((img_width > WIDTH)) && {
28 | ((img_height=img_height*WIDTH/img_width))
29 | ((img_width=WIDTH))
30 | }
31 |
32 | ((img_height > HEIGHT)) && {
33 | ((img_width=img_width*HEIGHT/img_height))
34 | ((img_height=HEIGHT))
35 | }
36 |
37 | # Variable needed for centering image.
38 | HALF_HEIGHT=$(expr $HEIGHT / 2)
39 | HALF_WIDTH=$(expr $WIDTH / 2)
40 | HALF_IMG_HEIGHT=$(expr $img_height / 2)
41 | HALF_IMG_WIDTH=$(expr $img_width / 2)
42 | X_POS=$(expr $HALF_WIDTH - $HALF_IMG_WIDTH)
43 | Y_POS=$(expr $HALF_HEIGHT - $HALF_IMG_HEIGHT)
44 |
45 | clear_screen
46 | # Hide the cursor.
47 | printf '\e[?25l'
48 |
49 | # Display the image.
50 | printf '0;1;%s;%s;%s;%s;;;;;%s\n3;\n4\n' \
51 | ${X_POS:-0} \
52 | ${Y_POS:-0} \
53 | "$img_width" \
54 | "$img_height" \
55 | "${CACHE:-$1}" | "$w3m" &>/dev/null
56 |
57 | # Wait for user input.
58 | read -ern 1
59 |
60 | # Clear the image.
61 | printf '6;%s;%s;%s;%s\n3;' \
62 | "${X_POS:-0}" \
63 | "${Y_POS:-0}" \
64 | "$WIDTH" \
65 | "$HEIGHT" | "$w3m" &>/dev/null
66 |
67 | clear_screen
68 |
69 |
--------------------------------------------------------------------------------
/overlays/g-neovim/airline.vim:
--------------------------------------------------------------------------------
1 | "let g:airline#extensions#tabline#enabled = 1
2 | "let g:airline#extensions#tabline#fnamemod = ':t'
3 | "let g:airline_powerline_fonts = 1
4 |
5 | let g:airline#extensions#tabline#enabled = 1
6 | let g:airline#extensions#tabline#left_sep = ''
7 | let g:airline#extensions#tabline#left_alt_sep = ' '
8 | let g:airline#extensions#tabline#formatter = 'unique_tail'
9 | let g:airline#extensions#tabline#show_tab_count = 0
10 | let g:airline#extensions#tabline#show_tab_type = 0
11 | let g:airline#extensions#tabline#show_close_button = 0
12 | let g:airline#extensions#tabline#tab_nr_type = 0 " # of splits (default)
13 | "let g:airline_theme='zoe'
14 |
15 | let g:airline_left_sep = "\uE0B8 "
16 | let g:airline_right_sep = "\uE0BA "
17 | let g:airline_section_warning = ''
18 | let g:airline_section_error = ''
19 | let g:airline_section_z = airline#section#create_right(['%l/%L ☰ %c'])
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/overlays/g-neovim/coc.vim:
--------------------------------------------------------------------------------
1 | let g:webdevicons_enable = 1
2 | let g:WebDevIconsUnicodeDecorateFileNodes = 1
3 |
4 | " TextEdit might fail if hidden is not set.
5 | set hidden
6 |
7 | " Some servers have issues with backup files, see #649.
8 | set nobackup
9 | set nowritebackup
10 |
11 | " Give more space for displaying messages.
12 | set cmdheight=2
13 |
14 | " Don't pass messages to |ins-completion-menu|.
15 | set shortmess+=c
16 |
17 |
18 | " Use tab for trigger completion with characters ahead and navigate.
19 | inoremap
20 | \ pumvisible() ? "\" :
21 | \ check_back_space() ? "\" :
22 | \ coc#refresh()
23 | inoremap pumvisible() ? "\" : "\"
24 |
25 | function! s:check_back_space() abort
26 | let col = col('.') - 1
27 | return !col || getline('.')[col - 1] =~# '\s'
28 | endfunction
29 |
30 | " Use to trigger completion.
31 | inoremap coc#refresh()
32 |
33 | " Make auto-select the first completion item and notify coc.nvim to
34 | " format on enter, could be remapped by other vim plugin
35 | inoremap pumvisible() ? coc#_select_confirm()
36 | \: "\u\\=coc#on_enter()\"
37 |
38 | " Use `[g` and `]g` to navigate diagnostics
39 | " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
40 | nmap [g (coc-diagnostic-prev)
41 | nmap ]g (coc-diagnostic-next)
42 |
43 | " GoTo code navigation.
44 | nmap gd (coc-definition)
45 | nmap gy (coc-type-definition)
46 | nmap gi (coc-implementation)
47 | nmap gr (coc-references)
48 |
49 | " Use K to show documentation in preview window.
50 | nnoremap K :call show_documentation()
51 |
52 | function! s:show_documentation()
53 | if (index(['vim','help'], &filetype) >= 0)
54 | execute 'h '.expand('')
55 | elseif (coc#rpc#ready())
56 | call CocActionAsync('doHover')
57 | else
58 | execute '!' . &keywordprg . " " . expand('')
59 | endif
60 | endfunction
61 |
62 | " Highlight the symbol and its references when holding the cursor.
63 | autocmd CursorHold * silent call CocActionAsync('highlight')
64 |
65 | " Symbol renaming.
66 | nmap rn (coc-rename)
67 |
68 | " Formatting selected code.
69 | xmap f (coc-format-selected)
70 | nmap f (coc-format-selected)
71 |
72 | augroup mygroup
73 | autocmd!
74 | " Setup formatexpr specified filetype(s).
75 | autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
76 | " Update signature help on jump placeholder.
77 | autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
78 | augroup end
79 |
80 | " Applying codeAction to the selected region.
81 | " Example: `aap` for current paragraph
82 | xmap a (coc-codeaction-selected)
83 | nmap a (coc-codeaction-selected)
84 |
85 | " Remap keys for applying codeAction to the current buffer.
86 | nmap ac (coc-codeaction)
87 | " Apply AutoFix to problem on the current line.
88 | nmap qf (coc-fix-current)
89 |
90 | " Map function and class text objects
91 | " NOTE: Requires 'textDocument.documentSymbol' support from the language server.
92 | xmap if (coc-funcobj-i)
93 | omap if (coc-funcobj-i)
94 | xmap af (coc-funcobj-a)
95 | omap af (coc-funcobj-a)
96 | xmap ic (coc-classobj-i)
97 | omap ic (coc-classobj-i)
98 | xmap ac (coc-classobj-a)
99 | omap ac (coc-classobj-a)
100 |
101 | " Remap and for scroll float windows/popups.
102 | " Note coc#float#scroll works on neovim >= 0.4.0 or vim >= 8.2.0750
103 | nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\"
104 | nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\"
105 | inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\"
106 | inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\"
107 |
108 | " NeoVim-only mapping for visual mode scroll
109 | " Useful on signatureHelp after jump placeholder of snippet expansion
110 | if has('nvim')
111 | vnoremap coc#float#has_scroll() ? coc#float#nvim_scroll(1, 1) : "\"
112 | vnoremap coc#float#has_scroll() ? coc#float#nvim_scroll(0, 1) : "\"
113 | endif
114 |
115 | " Use CTRL-S for selections ranges.
116 | " Requires 'textDocument/selectionRange' support of language server.
117 | nmap (coc-range-select)
118 | xmap (coc-range-select)
119 |
120 | " Add `:Format` command to format current buffer.
121 | command! -nargs=0 Format :call CocAction('format')
122 |
123 | " Add `:Fold` command to fold current buffer.
124 | command! -nargs=? Fold :call CocAction('fold', )
125 |
126 | " Add `:OR` command for organize imports of the current buffer.
127 | command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
128 |
129 | " Add (Neo)Vim's native statusline support.
130 | " NOTE: Please see `:h coc-status` for integrations with external plugins that
131 | " provide custom statusline: lightline.vim, vim-airline.
132 | set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
133 |
134 | " Mappings for CoCList
135 | " Show all diagnostics.
136 | nnoremap a :CocList diagnostics
137 | " Manage extensions.
138 | nnoremap e :CocList extensions
139 | " Show commands.
140 | nnoremap c :CocList commands
141 | " Find symbol of current document.
142 | nnoremap o :CocList outline
143 | " Search workspace symbols.
144 | nnoremap s :CocList -I symbols
145 | " Do default action for next item.
146 | nnoremap j :CocNext
147 | " Do default action for previous item.
148 | nnoremap k :CocPrev
149 | " Resume latest coc list.
150 | nnoremap p :CocListResume
151 |
--------------------------------------------------------------------------------
/overlays/g-neovim/default.nix:
--------------------------------------------------------------------------------
1 | { stdenv
2 | , lib
3 | , vimPlugins
4 | , universal-ctags
5 | , neovim-unwrapped
6 | , wrapNeovim
7 | , enableAirline ? true
8 | , enableClap ? false
9 | , enableCoc ? true
10 | , enableNerdtree ? true
11 | , enableSignify ? true
12 | , enableTagbar ? true
13 | , highlightSearch ? true
14 | , preserveCursorLocation ? true
15 | , qualityOfLifeBindings ? true
16 | , trimSpacesOnWrite ? true
17 | , vimUtils
18 | , srcs
19 | }:
20 | let
21 | inherit (lib) optionals optional optionalString;
22 | vim-camelsnek = vimUtils.buildVimPluginFrom2Nix {
23 | pname = "vim-camelsnek";
24 | version = "master";
25 | src = srcs.vim-camelsnek;
26 | };
27 | in
28 | wrapNeovim neovim-unwrapped {
29 | viAlias = true;
30 | vimAlias = true;
31 | withNodeJs = true;
32 | withPython3 = true;
33 | withRuby = false;
34 |
35 | configure = {
36 |
37 | customRC = ''
38 | ${optionalString enableAirline (builtins.readFile ./airline.vim)}
39 | ${optionalString enableCoc (builtins.readFile ./coc.vim)}
40 | ${optionalString enableNerdtree (builtins.readFile ./nerdtree.vim)}
41 | ${optionalString enableSignify (builtins.readFile ./signify.vim)}
42 | ${optionalString highlightSearch (builtins.readFile ./highlightSearch.vim)}
43 | ${optionalString preserveCursorLocation (builtins.readFile ./preserveCursor.vim)}
44 | ${optionalString qualityOfLifeBindings (builtins.readFile ./qualityOfLifeBindings.vim)}
45 | ${optionalString trimSpacesOnWrite (builtins.readFile ./trimSpacesOnWrite.vim)}
46 |
47 | nmap c :CamelB
48 | highlight Pmenu guibg=#222222
49 | map
50 | au BufNewFile,BufRead /*.rasi setf css " Add rofi config file highlighting
51 | au FocusLost * stopinsert | wall! " Back to normal mode on focus lost
52 | let g:tagbar_ctags_bin = "${universal-ctags}/bin/ctags"
53 | '';
54 |
55 | packages.myVimPackage = with vimPlugins; {
56 |
57 | start = [
58 | vim-camelsnek
59 | vim-devicons
60 | vim-nix
61 | ]
62 | ++ optional enableClap vim-clap
63 | ++ optional enableNerdtree nerdtree
64 | ++ optional enableSignify vim-signify
65 | ++ optional enableTagbar tagbar
66 | ++ optionals enableAirline [ vim-airline vim-airline-themes ]
67 | ++ optionals enableCoc [
68 | #coc-actions
69 | #coc-cmake
70 | #coc-cssmodules
71 | #coc-xml
72 | #coc-css
73 | #coc-emmet
74 | #coc-eslint
75 | #coc-highlight
76 | #coc-html
77 | #coc-java
78 | #coc-json
79 | ##coc-prettier
80 | #coc-python
81 | #coc-rls
82 | #coc-snippets
83 | #coc-tslint-plugin
84 | #coc-tsserver
85 | #coc-vimlsp
86 | #coc-yaml
87 | #coc-yank
88 | ];
89 |
90 | opt = [ ];
91 | };
92 | };
93 | }
94 |
--------------------------------------------------------------------------------
/overlays/g-neovim/highlightSearch.vim:
--------------------------------------------------------------------------------
1 |
2 | " After highlighting search results, shows the search result
3 | " that is found at the cursor in a different color.
4 |
5 | nnoremap / :call HLNextSetTrigger()/
6 | nnoremap ? :call HLNextSetTrigger()?
7 | nnoremap n n:call HLNext()
8 | nnoremap N N:call HLNext()
9 |
10 | highlight default HLNext ctermfg=white ctermbg=darkred
11 |
12 | let g:HLNext_matchnum = 0
13 |
14 | function! HLNext ()
15 | call HLNextOff()
16 | let target_pat = '\c\%#'.@/
17 | let g:HLNext_matchnum = matchadd('HLNext', target_pat)
18 | endfunction
19 |
20 | function! HLNextOff ()
21 | if (g:HLNext_matchnum > 0)
22 | call matchdelete(g:HLNext_matchnum)
23 | let g:HLNext_matchnum = 0
24 | endif
25 | endfunction
26 |
27 | function! HLNextSetTrigger ()
28 | augroup HLNext
29 | autocmd!
30 | autocmd CursorMoved * :call HLNextMovedTrigger()
31 | augroup END
32 | endfunction
33 |
34 | function! HLNextMovedTrigger ()
35 | augroup HLNext
36 | autocmd!
37 | augroup END
38 | call HLNext()
39 | endfunction
40 |
41 |
--------------------------------------------------------------------------------
/overlays/g-neovim/nerdtree.vim:
--------------------------------------------------------------------------------
1 | let g:NERDTreeDirArrowExpandable = ' '
2 | let g:NERDTreeDirArrowCollapsible = ' '
3 |
--------------------------------------------------------------------------------
/overlays/g-neovim/preserveCursor.vim:
--------------------------------------------------------------------------------
1 |
2 | " Preserve cursor location
3 | " https://vim.fandom.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session
4 | set viminfo='10,\"100,:20,%,n~/.viminfo
5 | function! ResCur()
6 | if line("'\"") <= line("$")
7 | normal! g`"
8 | return 1
9 | endif
10 | endfunction
11 |
12 | if has("folding")
13 | function! UnfoldCur()
14 | if !&foldenable
15 | return
16 | endif
17 | let cl = line(".")
18 | if cl <= 1
19 | return
20 | endif
21 | let cf = foldlevel(cl)
22 | let uf = foldlevel(cl - 1)
23 | let min = (cf > uf ? uf : cf)
24 | if min
25 | execute "normal!" min . "zo"
26 | return 1
27 | endif
28 | endfunction
29 | endif
30 |
31 | augroup resCur
32 | autocmd!
33 | if has("folding")
34 | autocmd BufWinEnter * if ResCur() | call UnfoldCur() | endif
35 | else
36 | autocmd BufWinEnter * call ResCur()
37 | endif
38 | augroup END
39 |
--------------------------------------------------------------------------------
/overlays/g-neovim/qualityOfLifeBindings.vim:
--------------------------------------------------------------------------------
1 |
2 | " Common
3 | set mouse=a
4 | set nowrap
5 | set number
6 | set scrolloff=15
7 | set smartcase ignorecase hlsearch
8 | set splitbelow splitright
9 | set termguicolors
10 | set undofile
11 | set updatetime=100
12 | set visualbell
13 | set wildignore+=*/tmp/*,*.so,*.swp,*.pyc,*.db,*.sqlite,*.class,*/node_modules/*,*/.git/*
14 | set wildmode=longest,list " bash like completion
15 |
16 |
17 | set expandtab
18 | set shiftwidth=4
19 | set smartindent
20 | set softtabstop=4
21 | set tabstop=4
22 |
23 | if has("patch-8.1.1564")
24 | " Recently vim can merge signcolumn and number column into one
25 | set signcolumn=number
26 | else
27 | set signcolumn=yes
28 | endif
29 |
30 | " Clear highlight
31 | map / :noh
32 |
33 | " Ctrl + hjkl - in insert to move between characters
34 | inoremap
35 | inoremap
36 | inoremap
37 | inoremap
38 |
39 | " Ctrl + hjkl - in normal mode to move betwen splits,
40 | nmap h
41 | nmap j
42 | nmap k
43 | nmap l
44 |
45 | " q to quit, Q to record macro
46 | nnoremap Q q
47 | nnoremap q :q
48 |
49 | " Preserve visual highlighting when changing identation
50 | vnoremap < >gv
52 |
53 | " Make Y consistent with commands like D,C
54 | nmap Y y$
55 |
56 | " Ctrl+C/Ctrl+V to copy/paste to/from system clipboard
57 | nmap "+yy
58 | vmap "+y
59 | imap "+pa
60 |
61 | " Ctrl+S to save
62 | nmap :w
63 | imap :wa
64 |
65 | " Ctrl+Backspace to delete previous word. https://vi.stackexchange.com/questions/16139/s-bs-and-c-bs-mappings-not-working
66 | imap
67 |
68 | " Allow saving of files as sudo when I forgot to start vim using sudo.
69 | cmap w!! w !sudo tee > /dev/null %
70 |
--------------------------------------------------------------------------------
/overlays/g-neovim/signify.vim:
--------------------------------------------------------------------------------
1 |
2 | let g:signify_mapping_toggle_highlight = 'gh'
3 | let g:signify_sign_add = ''
4 | let g:signify_sign_change = ''
5 | let g:signify_sign_changedelete = g:signify_sign_change
6 | let g:signify_sign_delete = ''
7 | let g:signify_sign_delete_first_line = g:signify_sign_delete
8 | let g:signify_sign_show_count = 0
9 | let g:signify_vcs_list = [ 'git' ]
10 |
11 | highlight SignColumn guibg=none
12 | highlight SignifySignAdd ctermbg=green guibg=#76B639
13 | highlight SignifySignDelete ctermfg=black ctermbg=red guibg=#D81765
14 | highlight SignifySignChange ctermfg=black ctermbg=yellow guibg=#E1A126
15 | highlight SignifyLineAdd ctermbg=green guibg=#76B639
16 | highlight SignifyLineDelete ctermfg=black ctermbg=red guibg=#D81765
17 | highlight SignifyLineChange ctermfg=black ctermbg=yellow guibg=#E1A126
18 |
--------------------------------------------------------------------------------
/overlays/g-neovim/trimSpacesOnWrite.vim:
--------------------------------------------------------------------------------
1 |
2 | " Function to clean trailing Spaces on save
3 |
4 | function! CleanExtraSpaces() "Function to clean unwanted spaces
5 | let save_cursor = getpos(".")
6 | let old_query = getreg('/')
7 | silent! %s/\s\+$//e
8 | call setpos('.', save_cursor)
9 | call setreg('/', old_query)
10 | endfun
11 |
12 | autocmd BufWritePre * :call CleanExtraSpaces()
13 |
14 |
--------------------------------------------------------------------------------
/overlays/g-pistol/default.nix:
--------------------------------------------------------------------------------
1 | { pkgs
2 | , pistol
3 | , bat
4 | , mediainfo
5 | , batTheme ? "base16"
6 | }:
7 | let
8 | b = "${bat}/bin/bat --paging=never --plain --theme=${batTheme} --color=always";
9 | f = "%pistol-filename%";
10 | pistol-config = pkgs.writeText "pistol.conf" ''
11 | ^(video|image|audio)/* ${mediainfo}/bin/mediainfo ${f}
12 | application/csv column -s, -t ${f}
13 | application/json ${b} ${f}
14 | text/plain ${b} ${f}
15 |
16 | fpath .*.(kt|kts|properties)$ ${b} ${f}
17 | fpath .*.(pom|iml)$ ${b} --language xml ${f}
18 | fpath .*.(repositories|sha1)$ ${b} --language properties ${f}
19 | fpath .*.jmod jmod list ${f}
20 | fpath gradlew ${b} ${f}
21 |
22 | fpath .*.(7z)$ 7z l ${f}
23 | fpath .*.(iso)$ iso-info --no-header -l ${f}
24 | fpath .*.(o)$ nm ${f} | less
25 | fpath .*.(rar)$ unrar l ${f}
26 | fpath .*.(tar)$ tar tf ${f}
27 | fpath .*.(tar.bz2|tbz2)$ tar tjf ${f}
28 | fpath .*.(tar.txz|txz)$ xz --list ${f}
29 | fpath .*.(tgz|tar.gz)$ tar tzf ${f}
30 | fpath .*.(zip|jar|war|ear|oxt)$ unzip -l ${f}
31 | fpath .*.[1-8]$ man ${f} | col -b
32 | '';
33 | wrapped = pkgs.writeShellScriptBin "pistol" "${pistol}/bin/pistol --config ${pistol-config} $@";
34 | in
35 | pkgs.symlinkJoin {
36 | name = "pistol";
37 | paths = [
38 | wrapped
39 | pistol
40 | ];
41 | }
42 |
--------------------------------------------------------------------------------
/overlays/g-polybar/default.nix:
--------------------------------------------------------------------------------
1 | { pkgs, polybarFull }:
2 | let
3 | wrapped = pkgs.writeShellScriptBin "polybar" "${polybarFull}/bin/polybar -c ${./polybar.conf} main $@";
4 | in
5 | pkgs.symlinkJoin {
6 | name = "polybar";
7 | paths = [
8 | wrapped
9 | polybarFull
10 | ];
11 | }
12 |
--------------------------------------------------------------------------------
/overlays/g-polybar/polybar.conf:
--------------------------------------------------------------------------------
1 | ;-------------------------------------------------------------------------------
2 | ; V A R I A B L E S
3 | ;-------------------------------------------------------------------------------
4 |
5 | [colors]
6 | background = #131313
7 | background-alt = #333
8 |
9 | foreground = #b2b2b2
10 | foreground-alt = #ee3333
11 |
12 | trans = #DA292b2e
13 | white = #eee
14 | grey = #444444
15 | pink = #d75f87
16 | blue = #4f97d7
17 | purple = #875faf
18 | green = #20ad80
19 | red = #ee3333
20 |
21 | ;-------------------------------------------------------------------------------
22 | ; B A R S
23 | ;-------------------------------------------------------------------------------
24 |
25 | [bar/main]
26 | width = 100%
27 | height = 16
28 | radius = 1.0
29 | padding-left = 1
30 | fixed-center = true
31 |
32 | background = ${colors.trans}
33 | foreground = ${colors.foreground}
34 |
35 | font-0 = Roboto:pixelsize=9;2
36 | font-1 = "3270Medium Nerd Font:style=Medium:size=11;3"
37 | font-2 = Roboto:pixelsize=9:weight=bold;2
38 |
39 | modules-left = powermenu arrow0 i3 arrow
40 | modules-center = music
41 | modules-right = arrow8 xkeyboard arrow7 memory arrow6 cpu arrow7 battery arrow6 volume arrow7 date arrow6
42 |
43 | tray-position = right
44 | tray-background = ${colors.background}
45 | tray-padding = 8
46 |
47 |
48 | ;-------------------------------------------------------------------------------
49 | ; D E C O R A T I O N S
50 | ;-------------------------------------------------------------------------------
51 |
52 |
53 | [module/arrow]
54 | ; background to trans
55 | type = custom/text
56 | content = " "
57 | content-foreground = ${colors.background}
58 | content-background = ${colors.trans}
59 |
60 | [module/arrow0]
61 | ; background to trans
62 | type = custom/text
63 | content = " "
64 | content-foreground = ${colors.trans}
65 | content-background = ${colors.background}
66 |
67 | [module/arrow1]
68 | ; grey to Blue
69 | type = custom/text
70 | content = " "
71 | content-foreground = ${colors.blue}
72 | content-background = ${colors.grey}
73 |
74 | [module/arrow2]
75 | ; Blue to Purple
76 | type = custom/text
77 | content = " "
78 | content-foreground = ${colors.purple}
79 | content-background = ${colors.blue}
80 |
81 | [module/arrow3]
82 | ; Purple to pink
83 | type = custom/text
84 | content = " "
85 | content-foreground = ${colors.pink}
86 | content-background = ${colors.purple}
87 |
88 | [module/arrow4]
89 | ; pink to green
90 | type = custom/text
91 | content = " "
92 | content-foreground = ${colors.green}
93 | content-background = ${colors.pink}
94 |
95 | [module/arrow5]
96 | ; green to grey
97 | type = custom/text
98 | content = " "
99 | content-foreground = ${colors.grey}
100 | content-background = ${colors.green}
101 |
102 | [module/arrow6]
103 | ; grey to bg
104 | type = custom/text
105 | content = " "
106 | content-foreground = ${colors.background}
107 | content-background = ${colors.grey}
108 |
109 | [module/arrow7]
110 | ; bg to grey
111 | type = custom/text
112 | content = " "
113 | content-foreground = ${colors.grey}
114 | content-background = ${colors.background}
115 |
116 | [module/arrow8]
117 | ; grey to bg
118 | type = custom/text
119 | content = " "
120 | content-foreground = ${colors.background}
121 | content-background = ${colors.trans}
122 |
123 | ;-------------------------------------------------------------------------------
124 | ; M O D U L E S
125 | ;-------------------------------------------------------------------------------
126 |
127 | [module/xkeyboard]
128 | type = internal/xkeyboard
129 | blacklist-0 = num lock
130 |
131 | format-prefix = " KEY "
132 | format-prefix-foreground = ${colors.blue}
133 | format-prefix-background = ${colors.background}
134 |
135 | label-layout = %layout%
136 | label-layout-foreground = ${colors.blue}
137 | label-layout-background = ${colors.background}
138 |
139 |
140 | [module/i3]
141 | type = internal/i3
142 | format =
143 | index-sort = true
144 |
145 | label-mode-foreground = ${colors.pink}
146 | label-mode-background = ${colors.background}
147 |
148 | label-visible = " %name% "
149 | label-visible-foreground = ${colors.pink}
150 | label-visible-background = ${colors.background}
151 |
152 | label-focused = " %name% "
153 | label-focused-font = 3
154 | label-focused-foreground = ${colors.pink}
155 | label-focused-background = ${colors.background}
156 |
157 | label-urgent = " %name% "
158 | label-urgent-background = ${colors.background}
159 | label-urgent-foreground = ${colors.white}
160 |
161 | label-unfocused = " %name% "
162 | label-unfocused-foreground = ${colors.pink}
163 | label-unfocused-background = ${colors.background}
164 |
165 |
166 | [module/cpu]
167 | type = internal/cpu
168 | interval = 3
169 | format-prefix = " CPU "
170 | format-prefix-foreground = ${colors.purple}
171 | format-prefix-background = ${colors.background}
172 | label = %percentage%%
173 | label-foreground = ${colors.purple}
174 | label-background = ${colors.background}
175 |
176 |
177 | [module/memory]
178 | type = internal/memory
179 | interval = 3
180 | format-prefix = " RAM "
181 | format-prefix-foreground = ${colors.pink}
182 | format-prefix-background = ${colors.grey}
183 | label = %percentage_used%%
184 | label-foreground = ${colors.pink}
185 | label-background = ${colors.grey}
186 |
187 |
188 | [module/date]
189 | type = internal/date
190 | interval = 5
191 |
192 | date = " %Y-%m-%d"
193 | time= %H:%M
194 |
195 | label = %date% %time%
196 | label-foreground = ${colors.white}
197 | label-background = ${colors.grey}
198 |
199 |
200 | [module/volume]
201 | type = internal/alsa
202 |
203 | mapping = true
204 | format-volume =
205 | master-soundcard = default
206 | speaker-soundcard = default
207 | headphone-soundcard = default
208 |
209 | label-volume = %percentage%%
210 | label-volume-foreground = ${colors.blue}
211 | label-volume-background = ${colors.background}
212 | label-muted = " MUTED "
213 | label-muted-foreground = ${colors.blue}
214 | label-muted-background = ${colors.background}
215 |
216 | ramp-volume-0 = " VOL "
217 | ramp-volume-0-foreground = ${colors.blue}
218 | ramp-volume-0-background = ${colors.background}
219 | ramp-volume-1 = " VOL "
220 | ramp-volume-1-foreground = ${colors.blue}
221 | ramp-volume-1-background = ${colors.background}
222 | ramp-volume-2 = " VOL "
223 | ramp-volume-2-foreground = ${colors.blue}
224 | ramp-volume-2-background = ${colors.background}
225 | ramp-volume-3 = " VOL "
226 | ramp-volume-3-foreground = ${colors.blue}
227 | ramp-volume-3-background = ${colors.background}
228 |
229 |
230 | [module/battery]
231 | interval = 5
232 | type = internal/battery
233 | battery = BAT0
234 | adapter = AC
235 | full-at = 100
236 |
237 | format-charging =
238 | format-charging-foreground = ${colors.green}
239 | format-charging-background = ${colors.grey}
240 | format-discharging =
241 | format-discharging-foreground = ${colors.green}
242 | format-discharging-background = ${colors.grey}
243 | format-full =
244 | format-full-foreground = ${colors.green}
245 | format-full-background = ${colors.grey}
246 |
247 | label-charging = "CHR %percentage%%"
248 | label-discharging = "BAT %percentage%%"
249 | label-discharging-foreground = ${colors.green}
250 | label-full = "BAT %percentage%%"
251 |
252 | ramp-capacity-0 =
253 | ramp-capacity-0-foreground = ${colors.red}
254 | ramp-capacity-1 =
255 | ramp-capacity-1-foreground = ${colors.red}
256 | ramp-capacity-2 =
257 | ramp-capacity-3 =
258 | ramp-capacity-4 =
259 | animation-charging-0 =
260 | animation-charging-1 =
261 | animation-charging-2 =
262 | animation-charging-3 =
263 | animation-charging-4 =
264 | animation-charging-framerate = 750
265 |
266 |
267 | [module/powermenu]
268 | type = custom/menu
269 |
270 | label-open = ""
271 | label-open-padding = 2
272 | label-open-foreground = ${colors.white}
273 |
274 | label-close = ""
275 | label-close-padding-left = 3
276 | label-close-foreground = ${colors.white}
277 |
278 | label-separator = " "
279 |
280 | menu-0-0 = ""
281 | menu-0-0-foreground = ${colors.white}
282 | menu-0-0-exec = systemctl poweroff
283 |
284 | menu-0-1 = ""
285 | menu-0-1-foreground = ${colors.white}
286 | menu-0-1-exec = systemctl reboot
287 |
288 | menu-0-2 = " "
289 | menu-0-2-foreground = ${colors.white}
290 | menu-0-2-exec = systemctl suspend
291 |
292 | menu-0-3 = ""
293 | menu-0-3-foreground = ${colors.white}
294 | menu-0-3-exec = i3lock-fancy
295 |
296 | menu-0-4 = " "
297 | menu-0-4-foreground = ${colors.white}
298 | menu-0-4-exec = i3-msg exit
299 |
300 |
301 | [settings]
302 | screenchange-reload = true
303 |
304 |
305 | ; ############################################################
306 | ; Unused
307 | ; ############################################################
308 |
309 | [module/music]
310 | type = custom/script
311 | interval = 1
312 |
313 | label = %output:0:45:...%
314 | ;exec = ~/comfy_guration/scripts/polybar/poly_music.sh
315 |
316 |
317 |
318 |
--------------------------------------------------------------------------------
/overlays/g-rofi/default.nix:
--------------------------------------------------------------------------------
1 | { pkgs, rofi }:
2 |
3 | rofi.override { theme = ./rofi.rasi; }
4 |
--------------------------------------------------------------------------------
/overlays/g-rofi/rofi.rasi:
--------------------------------------------------------------------------------
1 |
2 | configuration {
3 | drun-display-format: "{icon} {name} [({generic})]";
4 | display-drun: "Apps";
5 | show-icons: true;
6 | hide-scrollbar: true;
7 | font: "Iosevka Nerd Font 12";
8 | fixed-num-lines: true;
9 | lines: 12;
10 | }
11 |
12 | * {
13 | background-color: #00000000;
14 | border-color: #2e343f;
15 | text-color: #8c90aa;
16 | spacing: 0;
17 | }
18 |
19 | window {
20 | background-color: #282C33F0;
21 | width: 50%;
22 | }
23 |
24 | overlay {
25 | background-color: magenta;
26 | }
27 |
28 | inputbar {
29 | padding: 8px;
30 | border: 0 0 1px 0;
31 | children: [prompt,entry];
32 | }
33 |
34 | prompt {
35 | padding: 0px 8px;
36 | border: 0 1px 0 0;
37 | }
38 |
39 | textbox {
40 | border: 0 0 1px 0;
41 | border-color: #282C33;
42 | padding: 8px 16px;
43 | }
44 |
45 | entry {
46 | padding: 0px 8px;
47 | }
48 |
49 | element {
50 | border: 0 0 1px 0;
51 | padding: 8px 16px;
52 | }
53 |
54 | element-icon {
55 | size: 1em;
56 | }
57 |
58 | element selected {
59 | background-color: #FFFFFF10;
60 | text-color: #9da0bb;
61 | }
62 |
--------------------------------------------------------------------------------
/overlays/g-termite/default.nix:
--------------------------------------------------------------------------------
1 | { termite }:
2 |
3 | termite.override { configFile = ./termite.conf; }
4 |
--------------------------------------------------------------------------------
/overlays/g-termite/termite.conf:
--------------------------------------------------------------------------------
1 |
2 | [options]
3 | allow_bold = true
4 | audible_bell = true
5 | browser = xdg-open
6 | clickable_url = true
7 | cursor_blink = system
8 | cursor_shape = block
9 | dynamic_title = true
10 | filter_unmatched_urls = true
11 | geometry = 480x280
12 | icon_name = terminal
13 | modify_other_keys = false
14 | mouse_autohide = false
15 | scroll_on_output = false
16 | scroll_on_keystroke = true
17 | scrollback_lines = 15000
18 | size_hints = false
19 | search_wrap = true
20 | urgent_on_bell = true
21 | highlight = #30343e
22 |
23 | [colors]
24 | background=#171717
25 | foreground=#F8F8F8
26 | # black
27 | color0=#171717
28 | color8=#38252C
29 | # red
30 | color1=#D81765
31 | color9=#FF0000
32 | # green
33 | color2=#97D01A
34 | color10=#76B639
35 | # yellow
36 | color3=#FFA800
37 | color11=#E1A126
38 | # blue
39 | color4=#16B1FB
40 | color12=#289CD5
41 | # magenta
42 | color5=#FF2491
43 | color13=#FF2491
44 | # cyan
45 | color6=#0FDCB6
46 | color14=#0A9B81
47 | # white
48 | color7=#EBEBEB
49 | color15=#F8F8F8
50 |
--------------------------------------------------------------------------------
/overlays/shell-config/default.nix:
--------------------------------------------------------------------------------
1 | { lib
2 | , system
3 | , writeShellScript
4 | , runCommandNoCC
5 | , fd
6 | , gh
7 | , pure-prompt
8 | , sshuttle
9 | , dockerAliasEnabled ? true
10 | , nixArgsEnabled ? true
11 | , nixCdEnabled ? true
12 | , prettyManPagesEnabled ? true
13 | , promptEnabled ? true
14 | , sshuttleEnabled ? true
15 | , zshPasteImprovementsEnabled ? true
16 | , exePathEnabled ? true
17 | , superSecretScriptsEnabled ? false
18 | , enableMemeScript ? true
19 | }:
20 |
21 | with lib;
22 | let
23 | meme = ''
24 | function meme(){
25 | cd $HOME/memes
26 | yt-dlp $@
27 | cd -
28 | }
29 | '';
30 | prettyManPages = ''
31 | export LESS_TERMCAP_mb=$(tput bold; tput setaf 2)
32 | export LESS_TERMCAP_md=$(tput bold; tput setaf 3)
33 | export LESS_TERMCAP_me=$(tput sgr0)
34 | export LESS_TERMCAP_so=$(tput bold; tput setaf 3; tput setab 4)
35 | export LESS_TERMCAP_se=$(tput rmso; tput sgr0)
36 | export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 2)
37 | export LESS_TERMCAP_ue=$(tput rmul; tput sgr0)
38 |
39 | export LESS_TERMCAP_mr=$(tput rev)
40 | export LESS_TERMCAP_mh=$(tput dim)
41 | export LESS_TERMCAP_ZN=$(tput ssubm)
42 | export LESS_TERMCAP_ZV=$(tput rsubm)
43 | export LESS_TERMCAP_ZO=$(tput ssupm)
44 | export LESS_TERMCAP_ZW=$(tput rsupm)
45 | '';
46 | vpn = ''
47 | function vpn() {
48 | ${sshuttle}/bin/sshuttle --dns -r $1 0/0 --disable-ipv6 --no-latency-control
49 | }
50 | '';
51 | nix-cd = ''
52 | function nix-cd() {
53 | cd $(nix eval --expr "(builtins.getFlake "flake:self").outputs.pkgs.${system}.nixpkgs.$1.outPath" --impure --raw)
54 | }
55 | '';
56 | exe-path = ''
57 | function exe-path() {
58 | readlink $(which $1)
59 | }
60 | '';
61 | docker = ''
62 | # Select a running docker container to stop
63 | function docker-stop() {
64 | local cid
65 | cid=$(docker ps | sed 1d | fzf -q "$1" | awk '{print $1}')
66 |
67 | [ -n "$cid" ] && docker stop "$cid"
68 | }
69 |
70 | # Select a docker container to remove
71 | function docker-rm() {
72 | local cid
73 | cid=$(docker ps -a | sed 1d | fzf -q "$1" | awk '{print $1}')
74 |
75 | [ -n "$cid" ] && docker rm "$cid"
76 | }
77 |
78 | # Select a container to attach onto with bash
79 | function docker-bash() {
80 | local cid
81 | cid=$(docker ps -a | sed 1d | fzf -q "$1" | awk '{print $1}')
82 |
83 | [ -n "$cid" ] && docker container exec -it "$cid" /bin/bash
84 | }
85 |
86 | docker-sh () {
87 | local cid
88 | cid=$(docker ps -a | sed 1d | fzf -q "$1" | awk '{print $1}')
89 |
90 | [ -n "$cid" ] && docker container exec -it "$cid" /bin/sh
91 | }
92 | '';
93 | zshPasteImprovements = ''
94 | pasteinit() {
95 | OLD_SELF_INSERT=''${''${(s.:.)widgets[self-insert]}[2,3]}
96 | zle -N self-insert url-quote-magic
97 | }
98 |
99 | pastefinish() {
100 | zle -N self-insert $OLD_SELF_INSERT
101 | }
102 |
103 | zstyle :bracketed-paste-magic paste-init pasteinit
104 | zstyle :bracketed-paste-magic paste-finish pastefinish
105 |
106 | bindkey -r ^V
107 | '';
108 | superSecretScripts = ''
109 | # For the record, as of writing this I am a proud, legal intelij user.
110 | # Its just that this might come in handy in the fugure ;)
111 | intellijResetEvaluationPeriod() {
112 | rm -rf ~/.config/JetBrains/IntelliJIdea*/eval
113 | sed -i -E 's///' ~/.config/JetBrains/IntelliJIdea*/options/other.xml
114 | rm -rf ~/.java/.userPrefs/jetbrains/idea
115 | }
116 | '';
117 | integrationGithub = runCommandNoCC "integrationGithub" { } ''
118 | ${lib.getExe gh} completion -s zsh > $out
119 | '';
120 | in
121 | writeShellScript "shellconfig.sh" ''
122 | if [ -n "''${commands[fzf-share]}" ]; then
123 | source "$(fzf-share)/key-bindings.zsh"
124 | source "$(fzf-share)/completion.zsh"
125 | fi
126 | source ${integrationGithub}
127 |
128 |
129 | ${optionalString dockerAliasEnabled docker}
130 | ${optionalString prettyManPagesEnabled prettyManPages}
131 | ${optionalString sshuttleEnabled vpn}
132 | ${optionalString nixArgsEnabled (builtins.readFile ./nix-args.sh)}
133 | ${optionalString nixCdEnabled nix-cd}
134 | ${optionalString zshPasteImprovementsEnabled zshPasteImprovements}
135 | ${optionalString exePathEnabled exe-path}
136 | ${optionalString superSecretScriptsEnabled superSecretScripts}
137 | ${optionalString enableMemeScript meme}
138 | ''
139 |
--------------------------------------------------------------------------------
/overlays/shell-config/nix-args.sh:
--------------------------------------------------------------------------------
1 |
2 | function nix-args(){
3 | nix eval -f '' --json $1.override 2> /dev/null | sed 's/\,"\w\+":\([,}]\)/\1/g' | jq .__functionArgs
4 | }
5 |
6 | _nix-args() {
7 | if [[ -z ${words[2]} ]]; then
8 | return
9 | fi
10 |
11 | read -d '' query << EOF
12 | {
13 | "from": 0,
14 | "size": 50,
15 | "sort": [
16 | "_score"
17 | ],
18 | "_source": [
19 | "package_attr_name"
20 | ],
21 | "query": {
22 | "bool": {
23 | "filter": [
24 | {
25 | "term": {
26 | "type": {
27 | "value": "package"
28 | }
29 | }
30 | }
31 | ],
32 | "must": [
33 | {
34 | "dis_max": {
35 | "tie_breaker": 0.7,
36 | "queries": [
37 | {
38 | "multi_match": {
39 | "type": "cross_fields",
40 | "query": "${words[2]}",
41 | "analyzer": "whitespace",
42 | "auto_generate_synonyms_phrase_query": false,
43 | "operator": "and",
44 | "fields": [
45 | "package_attr_name^9",
46 | "package_attr_name.edge^9",
47 | "package_pname^6",
48 | "package_pname.edge^6",
49 | "package_attr_name_query^4",
50 | "package_attr_name_query.edge^4"
51 | ]
52 | }
53 | }
54 | ]
55 | }
56 | }
57 | ]
58 | }
59 | }
60 | }
61 | EOF
62 |
63 | COMPREPLY=$(curl -s 'https://nixos-search-5886075189.us-east-1.bonsaisearch.net/latest-13-20.09/_search' \
64 | -H 'authorization: Basic ejNaRko2eTJtUjpkczhDRXZBTFBmOXB1aTdYRw==' \
65 | -H 'content-type: application/json' \
66 | --data-binary "$query" \
67 | --compressed \
68 | | noglob jq -r .hits.hits[]._source.package_attr_name)
69 |
70 |
71 | IFS=$'\n' array_of_lines=("${(@f)$(printf $COMPREPLY)}")
72 | compadd -d $array_of_lines
73 | }
74 |
75 | compdef _nix-args nix-args
76 |
--------------------------------------------------------------------------------
/overlays/shell-config/starship.toml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | [character]
5 | use_symbol_for_status = true
6 | success_symbol = "[❯](bold purple)"
7 | error_symbol = "[✗](bold red) "
8 |
9 | [directory]
10 | truncate_to_repo = false # truncates directory to root folder if in github repo
11 | style = "blue"
12 | read_only = ""
13 |
14 | [nix_shell]
15 | format = ' [$name]($style) '
16 |
17 | [username]
18 | format = "[$user]($style)"
19 |
20 | [hostname]
21 | ssh_only = true
22 |
23 | [git_branch]
24 | format = "[ $branch](#6a6a6a)"
25 |
26 | [git_status]
27 | format = " [$all_status](fg:#FFC0CB)[$ahead_behind](fg:cyan) "
28 | all_status = "$conflicted $stashed $deleted $modified $staged $untracked"
29 | staged = "•"
30 | modified = "~"
31 | untracked = "*"
32 | deleted = "x"
33 | stashed = ""
34 |
35 |
36 | [aws]
37 | symbol = " "
38 |
39 | [conda]
40 | symbol = " "
41 |
42 | [dart]
43 | symbol = " "
44 |
45 | [docker]
46 | symbol = " "
47 |
48 | [elixir]
49 | symbol = " "
50 |
51 | [elm]
52 | symbol = " "
53 |
54 | [golang]
55 | symbol = " "
56 |
57 | [haskell]
58 | symbol = " "
59 |
60 | [hg_branch]
61 | symbol = " "
62 |
63 | [java]
64 | symbol = " "
65 |
66 | [julia]
67 | symbol = " "
68 |
69 | [memory_usage]
70 | symbol = " "
71 |
72 | [nim]
73 | symbol = " "
74 |
75 | [nodejs]
76 | symbol = " "
77 |
78 | [package]
79 | symbol = " "
80 |
81 | [perl]
82 | symbol = " "
83 |
84 | [php]
85 | symbol = " "
86 |
87 | [python]
88 | symbol = " "
89 |
90 | [ruby]
91 | symbol = " "
92 |
93 | [rust]
94 | symbol = " "
95 |
96 | [swift]
97 | symbol = "ﯣ "
98 |
--------------------------------------------------------------------------------
/overlays/zsh-forgit/default.nix:
--------------------------------------------------------------------------------
1 | { stdenv, srcs, pkgs }:
2 |
3 | # To make use of this derivation, use
4 | # `programs.zsh.interactiveShellInit = "source ${pkgs.zsh-forgit}/share/zsh-forgit/forgit.plugin.zsh";
5 |
6 | stdenv.mkDerivation rec {
7 | pname = "forgit";
8 | version = "master";
9 |
10 | src = srcs.forgit-git;
11 |
12 | installPhase = ''
13 | install -D forgit.plugin.zsh --target-directory=$out/share/zsh-forgit
14 | '';
15 | }
16 |
--------------------------------------------------------------------------------
/setup-btrfs.sh:
--------------------------------------------------------------------------------
1 | export DRIVE=
2 | export BOOT_PARTITION="${DRIVE}p1"
3 | export ROOT_PARTITION="${DRIVE}p2"
4 |
5 | printf "label: gpt\n,550M,U\n,,L\n" | sfdisk /dev/$DRIVE
6 |
7 |
8 | mkfs.fat -F 32 /dev/$BOOT_PARTITION
9 | mkfs.btrfs /dev/$ROOT_PARTITION
10 |
11 | mkdir -p /mnt
12 | mount /dev/$ROOT_PARTITION /mnt
13 | btrfs subvolume create /mnt/root
14 | btrfs subvolume create /mnt/home
15 | btrfs subvolume create /mnt/nix
16 | umount /mnt
17 |
18 |
19 | mount -o compress=zstd,subvol=root /dev/$ROOT_PARTITION /mnt
20 | mkdir /mnt/{home,nix}
21 | mount -o compress=zstd,subvol=home /dev/$ROOT_PARTITION /mnt/home
22 | mount -o compress=zstd,noatime,subvol=nix /dev/$ROOT_PARTITION /mnt/nix
23 |
24 | mkdir /mnt/boot
25 | mount /dev/$BOOT_PARTITION /mnt/boot
26 |
27 |
28 | nixos-generate-config --root /mnt
29 |
--------------------------------------------------------------------------------
/setup-zfs.sh:
--------------------------------------------------------------------------------
1 |
2 | export DRIVE=nvme1n1
3 | export BOOT_PARTITION="${DRIVE}p1"
4 | export ROOT_PARTITION="${DRIVE}p2"
5 |
6 | printf "label: gpt\n,550M,U\n,,L\n" | sfdisk /dev/$DRIVE
7 |
8 | mkfs.vfat -n BOOT -F32 /dev/$BOOT_PARTITION
9 | parted /dev/$BOOT_PARTITION set 1 boot on
10 |
11 | zpool create -o autotrim=on -O compression=zstd -O acltype=posixacl -O xattr=sa -O atime=off -O mountpoint=legacy zroot $ROOT_PARTITION
12 |
13 | zfs create -o encryption=on -o keyformat=passphrase zroot/locker
14 | zfs create zroot/locker/home
15 | zfs create zroot/locker/nix
16 | zfs create zroot/locker/os
17 |
18 |
19 |
20 | mkdir -p /mnt/{home,boot,nix}
21 |
22 |
23 | mount -t zfs zroot/locker/os /mnt
24 | mount -t zfs zroot/locker/home /mnt/home
25 | mount -t zfs zroot/locker/nix /mnt/nix
26 | mount /dev/$BOOT_PARTITION /mnt/boot
27 |
28 |
29 | nixos-generate-config --root /mnt
30 |
--------------------------------------------------------------------------------
/suites.nix:
--------------------------------------------------------------------------------
1 | { utils }:
2 | let
3 | nixosModules = utils.lib.exportModules [
4 | ./modules/cachix.nix
5 | ./modules/clean-home.nix
6 | ./modules/nix-compose.nix
7 | ./modules/runtimes.nix
8 |
9 | ./config/aarch64Dev.nix
10 | ./config/base-desktop.nix
11 | ./config/cli-extras.nix
12 | ./config/cli.nix
13 | ./config/containers.nix
14 | ./config/dev.nix
15 | ./config/personal.nix
16 | ./config/sway.nix
17 | ./config/winapps.nix
18 | ./config/xorg.nix
19 | ];
20 | sharedModules = with nixosModules; [
21 | #cachix
22 | clean-home
23 | runtimes
24 | nix-compose
25 | personal
26 |
27 | #utils.nixosModules.saneFlakeDefaults
28 | {
29 | home-manager.useGlobalPkgs = true;
30 | home-manager.useUserPackages = true;
31 | }
32 | ];
33 | desktopModules = with nixosModules; [
34 | base-desktop
35 | cli
36 | cli-extras
37 | winapps
38 | cachix
39 | #./hosts/work/i3
40 | sway
41 | ({ pkgs, lib, config, ... }: {
42 | nix.generateRegistryFromInputs = true;
43 | nix.linkInputs = true;
44 | #nix.generateNixPathFromInputs = true;
45 | home-manager.users.gytis = import ./home-manager/sway.nix;
46 | #boot.kernelPackages = lib.mkForce pkgs.linuxKernel.packages.linux_5_15;
47 | boot.kernelPackages = lib.mkForce pkgs.linuxPackages_6_12;
48 | #boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
49 | hardware.bluetooth.enable = true;
50 | nix.extraOptions = ''
51 | http-connections = 50
52 | log-lines = 50
53 | warn-dirty = false
54 | http2 = true
55 | allow-import-from-derivation = true
56 | '';
57 | })
58 | ];
59 | in
60 | { inherit nixosModules sharedModules desktopModules; }
61 |
--------------------------------------------------------------------------------