mirror of
https://git.adityakumar.xyz/nix-conf.git
synced 2024-11-09 15:39:44 +00:00
merge refactor
This commit is contained in:
commit
fef0eedc00
57 changed files with 2378 additions and 176 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1 @@
|
|||
hosts.nix
|
||||
hardware-configuration.nix
|
||||
|
|
|
@ -1,151 +0,0 @@
|
|||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
/etc/nixos/hardware-configuration.nix
|
||||
];
|
||||
|
||||
# Enable Bluetooth
|
||||
hardware.bluetooth.enable = true;
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||
|
||||
networking.hostName = "nixos"; # Define your hostname.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Asia/Kolkata";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_IN";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_IN";
|
||||
LC_IDENTIFICATION = "en_IN";
|
||||
LC_MEASUREMENT = "en_IN";
|
||||
LC_MONETARY = "en_IN";
|
||||
LC_NAME = "en_IN";
|
||||
LC_NUMERIC = "en_IN";
|
||||
LC_PAPER = "en_IN";
|
||||
LC_TELEPHONE = "en_IN";
|
||||
LC_TIME = "en_IN";
|
||||
};
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
|
||||
# Enable the KDE Plasma Desktop Environment.
|
||||
services.xserver.displayManager.sddm.enable = false;
|
||||
services.xserver.desktopManager.plasma5.enable = false;
|
||||
|
||||
# Enable GNOME desktop environment
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
|
||||
# Enable dconf
|
||||
programs.dconf.enable = true;
|
||||
|
||||
# Configure keymap in X11
|
||||
services.xserver = {
|
||||
layout = "us";
|
||||
xkbVariant = "";
|
||||
};
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = true;
|
||||
|
||||
# Enable sound with pipewire.
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
};
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
# services.xserver.libinput.enable = true;
|
||||
|
||||
programs.zsh.enable = true;
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.user = {
|
||||
isNormalUser = true;
|
||||
description = "user";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
packages = with pkgs; [
|
||||
firefox
|
||||
kate
|
||||
# thunderbird
|
||||
];
|
||||
};
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
wget
|
||||
git
|
||||
gnome.adwaita-icon-theme
|
||||
];
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
# programs.gnupg.agent = {
|
||||
# enable = true;
|
||||
# enableSSHSupport = true;
|
||||
# };
|
||||
|
||||
# List services that you want to enable:
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh.enable = true;
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
# Nix extra options
|
||||
nix.extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "22.11"; # Did you read the comment?
|
||||
|
||||
}
|
328
flake.lock
328
flake.lock
|
@ -1,12 +1,188 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"revCount": 57,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
|
||||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"nv",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1706830856,
|
||||
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709126324,
|
||||
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1701680307,
|
||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nv",
|
||||
"nixvim",
|
||||
"pre-commit-hooks",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1703887061,
|
||||
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1712645849,
|
||||
"narHash": "sha256-67v20E0gH7nvAaMsah2oRIocnxGO25fATUyzQHIywxQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "40a99619da804a78a0b166e5c6911108c059c3a8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "master",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nv",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1708988456,
|
||||
"narHash": "sha256-RCz7Xe64tN2zgWk+MVHkzg224znwqknJ1RnB7rVqUWw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "1d085ea4444d26aa52297758b333b449b2aa6fca",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nv",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709001452,
|
||||
"narHash": "sha256-FnZ54wkil54hKvr1irdKic1TE27lHQI9dKQmOJRrtlU=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "6c06334f0843c7300d1678726bb607ce526f6b36",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1688049487,
|
||||
"narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=",
|
||||
"lastModified": 1712439257,
|
||||
"narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9",
|
||||
"rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -16,9 +192,153 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1708984720,
|
||||
"narHash": "sha256-gJctErLbXx4QZBBbGp78PxtOOzsDaQ+yw1ylNQBuSUY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "13aff9b34cc32e59d35c62ac9356e4a41198a538",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixvim": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-parts": "flake-parts",
|
||||
"home-manager": "home-manager_2",
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709155917,
|
||||
"narHash": "sha256-S4yHqDKFmJpFQExP7bkOSw+RQaSr8pdOrfSFCOv3G70=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "be87309e0c1da19d99d969625300aaed36ff1b91",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nv": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixvim": "nixvim"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1712294440,
|
||||
"narHash": "sha256-+4CR4U2jjp1GyyXubfvZIREgnp0kR65v3efUZciwlEo=",
|
||||
"owner": "akr2002",
|
||||
"repo": "nv",
|
||||
"rev": "937e6141a0497b2da314d2206c6a865d078d1da6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "akr2002",
|
||||
"repo": "nv",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nyaa": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1711806425,
|
||||
"narHash": "sha256-ZEcFKE1QMvhNZUT/x2ymhw1aGh22LfaYnDaihgeNRhw=",
|
||||
"owner": "akr2002",
|
||||
"repo": "nyaa",
|
||||
"rev": "4fb0f5b06339d25966d8d48a70de7410e3e91021",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "akr2002",
|
||||
"repo": "nyaa",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-utils": "flake-utils_2",
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"nv",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-stable": [
|
||||
"nv",
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1708018599,
|
||||
"narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nv": "nv",
|
||||
"nyaa": "nyaa"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
38
flake.nix
38
flake.nix
|
@ -1,10 +1,38 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
#nixvim = {
|
||||
# url = "github:nix-community/nixvim";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
#};
|
||||
nv = {
|
||||
url = "github:akr2002/nv";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nyaa = {
|
||||
url = "github:akr2002/nyaa";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }: {
|
||||
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./configuration.nix ];
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
} @ inputs: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
nixosConfigurations.bridge = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs;};
|
||||
modules = [
|
||||
./hosts/default/configuration.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
72
hosts/default/configuration.nix
Normal file
72
hosts/default/configuration.nix
Normal file
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
../../modules/nixos/default.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
# Set your time zone.
|
||||
time.timeZone = "Asia/Kolkata";
|
||||
|
||||
# Debug infod
|
||||
services.nixseparatedebuginfod.enable = true;
|
||||
|
||||
nix.settings.trusted-users = ["root" "user"];
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.user = {
|
||||
isNormalUser = true;
|
||||
description = "user";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = ["networkmanager" "wheel" "libvirtd" "qemu" "qemu-kvm" "vo" "docker" "lxc" "incus-admin"];
|
||||
packages = with pkgs; [
|
||||
kate
|
||||
vim
|
||||
libvirt
|
||||
spice-gtk
|
||||
qemu
|
||||
qemu_kvm
|
||||
virt-viewer
|
||||
virt-manager
|
||||
OVMF
|
||||
dnsmasq
|
||||
networkmanagerapplet
|
||||
];
|
||||
};
|
||||
|
||||
users.users.root = {
|
||||
subUidRanges = [
|
||||
{
|
||||
count = 1000;
|
||||
startUid = 1000;
|
||||
}
|
||||
];
|
||||
subGidRanges = [
|
||||
{
|
||||
count = 1000;
|
||||
startGid = 1000;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
extraSpecialArgs = {inherit inputs;};
|
||||
users = {
|
||||
"user" = import ./home.nix;
|
||||
};
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "22.11"; # Did you read the comment?
|
||||
}
|
50
hosts/default/hardware-configuration.nix
Normal file
50
hosts/default/hardware-configuration.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "vmd" "ahci" "nvme" "usbhid" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{
|
||||
device = "/dev/disk/by-uuid/e45731e0-2052-4bfa-a0e8-8cc8f688ad89";
|
||||
# device = "/dev/disk/by-uuid/a09877ce-f520-429a-9f3b-57b073e4d662";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."luks-a09877ce-f520-429a-9f3b-57b073e4d662".device = "/dev/disk/by-uuid/a09877ce-f520-429a-9f3b-57b073e4d662";
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/5E03-9FED";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[
|
||||
{ device = "/dev/disk/by-uuid/29f26db6-b544-4744-b6d8-74ed071b2baf";}
|
||||
# { device = "/dev/disk/by-uuid/3b571a97-616b-4dd7-9abb-d1e0491d178a";}
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.br-07ff78b90602.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.docker0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.veth8ab8363.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.vetha05d8b1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.virbr0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
|
@ -1,12 +1,20 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home.username = "user";
|
||||
home.homeDirectory = "/home/user";
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
imports = [
|
||||
# inputs.nixvim.homeManagerModules.nixvim
|
||||
../../modules/home-manager
|
||||
];
|
||||
|
||||
# This value determines the Home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
# when a new Home Manager release introduces backwards
|
||||
|
@ -17,9 +25,7 @@
|
|||
# release notes.
|
||||
home.stateVersion = "22.11"; # Please read the comment before changing.
|
||||
|
||||
# Allow non-free packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.config.joypixels.acceptLicense = true;
|
||||
# Manage session variables
|
||||
|
||||
# Manage session variables
|
||||
home.sessionVariables = {
|
||||
|
@ -45,6 +51,7 @@
|
|||
# (pkgs.writeShellScriptBin "my-hello" ''
|
||||
# echo "Hello, ${config.home.username}!"
|
||||
# '')
|
||||
<<<<<<< HEAD:home.nix
|
||||
xsel wget neofetch htop oh-my-zsh git chromium kitty plasma5Packages.qtstyleplugin-kvantum kdeconnect
|
||||
bat gnome.gnome-tweaks microsoft-edge vivaldi vivaldi-ffmpeg-codecs x264 gnome.gnome-terminal
|
||||
joypixels rustc cargo unzip
|
||||
|
@ -74,19 +81,26 @@
|
|||
defaultEditor = true;
|
||||
};
|
||||
|
||||
=======
|
||||
];
|
||||
|
||||
>>>>>>> refactor:hosts/default/home.nix
|
||||
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
||||
# plain files is through 'home.file'.
|
||||
home.file = {
|
||||
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
||||
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
||||
# # symlink to the Nix store copy.
|
||||
# ".screenrc".source = dotfiles/screenrc;
|
||||
#home.file = {
|
||||
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
||||
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
||||
# # symlink to the Nix store copy.
|
||||
# ".screenrc".source = dotfiles/screenrc;
|
||||
|
||||
# # You can also set the file content immediately.
|
||||
# ".gradle/gradle.properties".text = ''
|
||||
# org.gradle.console=verbose
|
||||
# org.gradle.daemon.idletimeout=3600000
|
||||
# '';
|
||||
# # You can also set the file content immediately.
|
||||
# ".gradle/gradle.properties".text = ''
|
||||
# org.gradle.console=verbose
|
||||
# org.gradle.daemon.idletimeout=3600000
|
||||
# '';
|
||||
#};
|
||||
home.file = {
|
||||
".config/hypr".source = ../../modules/nixos/hyprland/config/hypr;
|
||||
};
|
||||
|
||||
# You can also manage environment variables but you will have to manually
|
19
modules/home-manager/bash/default.nix
Normal file
19
modules/home-manager/bash/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
bash.enable = lib.mkEnableOption "enable bash";
|
||||
};
|
||||
config = lib.mkIf config.bash.enable {
|
||||
programs.bash = {
|
||||
enable = false;
|
||||
bashrcExtra = ''
|
||||
. ~/.bashrc
|
||||
eval "$(direnv hook bash)"
|
||||
eval "$(starship init bash)"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
17
modules/home-manager/bat/default.nix
Normal file
17
modules/home-manager/bat/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
bat.enable = lib.mkEnableOption "enable bat";
|
||||
};
|
||||
config = lib.mkIf config.bat.enable {
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
config = {
|
||||
theme = "ansi";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
8
modules/home-manager/browsers/default.nix
Normal file
8
modules/home-manager/browsers/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
chromium
|
||||
microsoft-edge
|
||||
vivaldi
|
||||
vivaldi-ffmpeg-codecs
|
||||
];
|
||||
}
|
6
modules/home-manager/communication/default.nix
Normal file
6
modules/home-manager/communication/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
dino
|
||||
tdesktop
|
||||
];
|
||||
}
|
34
modules/home-manager/default.nix
Normal file
34
modules/home-manager/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{lib, ...}: {
|
||||
imports = [
|
||||
./bash
|
||||
./bat
|
||||
./browsers
|
||||
./communication
|
||||
./devel
|
||||
./fonts
|
||||
./gnome-utils
|
||||
./kde-utils
|
||||
./kitty
|
||||
./media
|
||||
./neovim
|
||||
./office
|
||||
./session-vars
|
||||
./tmux
|
||||
./utils
|
||||
./vscode
|
||||
./zsh
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
services.mpris-proxy.enable = true;
|
||||
|
||||
bash.enable = lib.mkDefault true;
|
||||
bat.enable = lib.mkDefault true;
|
||||
gnome-utils.enable = lib.mkDefault false;
|
||||
kde-utils.enable = lib.mkDefault true;
|
||||
kitty.enable = lib.mkDefault true;
|
||||
neovim.enable = lib.mkDefault true;
|
||||
tmux.enable = lib.mkDefault true;
|
||||
vscode.enable = lib.mkDefault true;
|
||||
zsh.enable = lib.mkDefault true;
|
||||
}
|
6
modules/home-manager/devel/default.nix
Normal file
6
modules/home-manager/devel/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
cargo
|
||||
rustc
|
||||
];
|
||||
}
|
7
modules/home-manager/fonts/default.nix
Normal file
7
modules/home-manager/fonts/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{pkgs, ...}: {
|
||||
nixpkgs.config.joypixels.acceptLicense = true;
|
||||
home.packages = with pkgs; [
|
||||
jetbrains-mono
|
||||
joypixels
|
||||
];
|
||||
}
|
16
modules/home-manager/gnome-utils/default.nix
Normal file
16
modules/home-manager/gnome-utils/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
gnome-utils.enable = lib.mkEnableOption "enable gnome-utils";
|
||||
};
|
||||
config = lib.mkIf config.gnome-utils.enable {
|
||||
home.packages = with pkgs; [
|
||||
gnome.gnome-tweaks
|
||||
gnome-extension-manager
|
||||
];
|
||||
};
|
||||
}
|
21
modules/home-manager/kde-utils/default.nix
Normal file
21
modules/home-manager/kde-utils/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
kde-utils.enable = lib.mkEnableOption "enable kde-utils";
|
||||
};
|
||||
config = lib.mkIf config.kde-utils.enable {
|
||||
home.packages = with pkgs; [
|
||||
kdeconnect
|
||||
libsForQt5.kwallet
|
||||
libsForQt5.kwallet-pam
|
||||
libsForQt5.kwalletmanager
|
||||
libsForQt5.ksshaskpass
|
||||
plasma5Packages.qtstyleplugin-kvantum
|
||||
yakuake
|
||||
];
|
||||
};
|
||||
}
|
63
modules/home-manager/kitty/default.nix
Normal file
63
modules/home-manager/kitty/default.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
kitty.enable = lib.mkEnableOption "enable kitty";
|
||||
};
|
||||
config = lib.mkIf config.kitty.enable {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
keybindings = {
|
||||
# Create a new window splitting the space used by the existing one so that
|
||||
# the two windows are placed one above the other
|
||||
"f5" = "launch --location=hsplit";
|
||||
|
||||
# Create a new window splitting the space used by the existing one so that
|
||||
# the two windows are placed side by side
|
||||
"f6" = "launch --location=vsplit";
|
||||
|
||||
# Create a new window splitting the space used by the existing one so that
|
||||
# the two windows aew placed side by side if the existing window is wide or
|
||||
# one above the other if the existing window is tall
|
||||
"f4" = "launch --location=split";
|
||||
|
||||
# Rotate the current split, changing its split axis from vertical to
|
||||
# horizontal or vice versa
|
||||
"f7" = "layout_action rotate";
|
||||
|
||||
# Move the active window in the indicated direction
|
||||
"shift+up" = "move_window up";
|
||||
"shift+left" = "move_window left";
|
||||
"shift+right" = "move_window right";
|
||||
"shift+down" = "move_window down";
|
||||
|
||||
# Move the window to the indicated screen edge
|
||||
"ctrl+shift+up" = "layout_action move_to_screen_edge top";
|
||||
"ctrl+shift+left" = "layout_action move_to_screen_edge left";
|
||||
"ctrl+shift+right" = "layout_action move_to_screen_edge right";
|
||||
"ctrl+shift+down" = "layout_action move_to_screen_edge bottom";
|
||||
|
||||
# Switch focus to the neighboring window in the indicated direction
|
||||
"ctrl+left" = "neighboring_window left";
|
||||
"ctrl+right" = "neighboring_window right";
|
||||
"ctrl+up" = "neighboring_window up";
|
||||
"ctrl+down" = "neighboring_window down";
|
||||
};
|
||||
extraConfig = "include ~/.config/kitty/current-theme.conf
|
||||
font_family JetBrainsMono Nerd Font
|
||||
bold_font JetBrainsMono NF Bold
|
||||
italic_font JetBrainsMono NF Italic
|
||||
bold_italic_font JetBrainsMono NF Bold Italic
|
||||
wayland_titlebar_color system
|
||||
hide_window_decorations no
|
||||
linux_display_server x11
|
||||
enabled_layouts splits
|
||||
confirm_os_window_close 0
|
||||
";
|
||||
};
|
||||
home.packages = with pkgs; [kitty-themes];
|
||||
};
|
||||
}
|
6
modules/home-manager/media/default.nix
Normal file
6
modules/home-manager/media/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
x264
|
||||
mpv
|
||||
];
|
||||
}
|
54
modules/home-manager/neovim/default.nix
Normal file
54
modules/home-manager/neovim/default.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
neovim.enable = lib.mkEnableOption "enable neovim";
|
||||
};
|
||||
config = lib.mkIf config.neovim.enable {
|
||||
programs.neovim = {
|
||||
enable = false;
|
||||
defaultEditor = true;
|
||||
# coc.enable = true;
|
||||
# extraLuaConfig = ''
|
||||
# for _, source in ipairs {
|
||||
# "astronvim.bootstrap",
|
||||
# "astronvim.options",
|
||||
# "astronvim.lazy",
|
||||
# "astronvim.autocmds",
|
||||
# "astronvim.mappings",
|
||||
# } do
|
||||
# local status_ok, fault = pcall(require, source)
|
||||
# if not status_ok then vim.api.nvim_err_writeln("Failed to load " .. source .. "\n\n" .. fault
|
||||
# ) end
|
||||
# end
|
||||
#
|
||||
# if astronvim.default_colorscheme then
|
||||
# if not pcall(vim.cmd.colorscheme, astronvim.default_colorscheme) then
|
||||
# requrie("astronvim.utils").notify(
|
||||
# "Error setting up colorscheme: " .. astronvim.default_colorscheme,
|
||||
# vim.log.levels.ERROR
|
||||
# )
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# require("astronvim.utils").conditional_func(astronvim.user_opts("polish", nil, false), true)
|
||||
# '';
|
||||
#
|
||||
# plugins = (with pkgs.vimPlugins; [
|
||||
# rust-vim
|
||||
# rust-tools-nvim
|
||||
# coc-rust-analyzer
|
||||
# nvim-treesitter-parsers.rust
|
||||
# nvim-treesitter-parsers.cpp
|
||||
# nvim-treesitter-parsers.c
|
||||
# nvim-treesitter-parsers.latex
|
||||
# coc-rls
|
||||
# coc-clangd
|
||||
# clangd_extensions-nvim
|
||||
# vim-clang-format
|
||||
# ]);
|
||||
};
|
||||
};
|
||||
}
|
9
modules/home-manager/office/default.nix
Normal file
9
modules/home-manager/office/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
foliate
|
||||
libreoffice-fresh
|
||||
nextcloud-client
|
||||
obsidian
|
||||
zathura
|
||||
];
|
||||
}
|
14
modules/home-manager/session-vars/default.nix
Normal file
14
modules/home-manager/session-vars/default.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
_: {
|
||||
home.sessionVariables = {
|
||||
# default editor
|
||||
EDITOR = "nvim";
|
||||
NIXPKGS_ALLOW_UNFREE = 1;
|
||||
|
||||
# sshaskpass
|
||||
SSH_ASKPASS = "/home/user/.nix-profile/bin/ksshaskpass";
|
||||
SSH_ASKPASS_REQUIRE = "prefer";
|
||||
|
||||
# Store git credentials in KDE Wallet
|
||||
GIT_ASKPASS = "/home/user/.nix-profile/bin/ksshaskpass";
|
||||
};
|
||||
}
|
31
modules/home-manager/tmux/default.nix
Normal file
31
modules/home-manager/tmux/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
tmux.enable = lib.mkEnableOption "enable tmux";
|
||||
};
|
||||
config = lib.mkIf config.tmux.enable {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
mouse = true;
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
better-mouse-mode
|
||||
#dracula
|
||||
#gruvbox
|
||||
#nord
|
||||
#onedark-theme
|
||||
#power-theme
|
||||
resurrect
|
||||
#tmux-colors-solarized
|
||||
tmux-fzf
|
||||
];
|
||||
extraConfig = ''
|
||||
set-option -g mouse on
|
||||
set -g default-terminal "screen-256color"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
30
modules/home-manager/utils/default.nix
Normal file
30
modules/home-manager/utils/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
aria2
|
||||
bitwarden
|
||||
cachix
|
||||
direnv
|
||||
duf
|
||||
git
|
||||
git-lfs
|
||||
htop
|
||||
filelight
|
||||
neofetch
|
||||
nix-direnv
|
||||
ocs-url
|
||||
p7zip
|
||||
ranger
|
||||
ripgrep
|
||||
starship
|
||||
unzip
|
||||
wget
|
||||
xsel
|
||||
yt-dlp
|
||||
inputs.nv.packages.x86_64-linux.default
|
||||
inputs.nyaa.packages.x86_64-linux.default
|
||||
];
|
||||
}
|
30
modules/home-manager/vscode/default.nix
Normal file
30
modules/home-manager/vscode/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
vscode.enable = lib.mkEnableOption "enable vscode";
|
||||
};
|
||||
config = lib.mkIf config.vscode.enable {
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
arrterian.nix-env-selector
|
||||
mkhl.direnv
|
||||
jnoortheen.nix-ide
|
||||
|
||||
xaver.clang-format
|
||||
llvm-vs-code-extensions.vscode-clangd
|
||||
vadimcn.vscode-lldb
|
||||
# ms-vscode.cpptools
|
||||
colejcummins.llvm-syntax-highlighting
|
||||
|
||||
rust-lang.rust-analyzer
|
||||
|
||||
waderyan.gitblame
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
29
modules/home-manager/zsh/default.nix
Normal file
29
modules/home-manager/zsh/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
zsh.enable = lib.mkEnableOption "enable zsh";
|
||||
};
|
||||
config = lib.mkIf config.zsh.enable {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
# enableBashCompletion = true;
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
theme = "ys";
|
||||
plugins = ["git" "colored-man-pages" "extract" "sudo"];
|
||||
};
|
||||
initExtra = ''
|
||||
eval "$(direnv hook zsh)"
|
||||
eval "$(starship init zsh)"
|
||||
alias vv=nvim
|
||||
alias yt-dlp-1080="yt-dlp -f 'bestvideo[height<=1080]+bestaudio/best[height<=1080]'"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
20
modules/nixos/bluetooth/default.nix
Normal file
20
modules/nixos/bluetooth/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
bluetooth.enable = lib.mkEnableOption "enable bluetooth";
|
||||
};
|
||||
config = lib.mkIf config.bluetooth.enable {
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
settings = {
|
||||
General = {
|
||||
Experimental = "true";
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
12
modules/nixos/bootloader/default.nix
Normal file
12
modules/nixos/bootloader/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
_: {
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot";
|
||||
};
|
||||
};
|
||||
supportedFilesystems = ["ntfs"];
|
||||
};
|
||||
}
|
57
modules/nixos/default.nix
Normal file
57
modules/nixos/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{lib, ...}: {
|
||||
imports = [
|
||||
./bluetooth
|
||||
./bootloader
|
||||
./display-manager
|
||||
./editor
|
||||
./environment
|
||||
./filesystem
|
||||
./fonts
|
||||
./hardware
|
||||
./hyprland
|
||||
./kernel
|
||||
./locale
|
||||
./networking
|
||||
./packages
|
||||
./sound
|
||||
./ssh
|
||||
./virtualization
|
||||
];
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "daily";
|
||||
options = "--delete-older-than 15d";
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
services = {
|
||||
gvfs.enable = true;
|
||||
printing.enable = true;
|
||||
upower.enable = true;
|
||||
uptimed.enable = true;
|
||||
};
|
||||
|
||||
programs = {
|
||||
dconf.enable = true;
|
||||
zsh.enable = true;
|
||||
};
|
||||
|
||||
# enable modules
|
||||
bluetooth.enable = lib.mkDefault true;
|
||||
display-manager.enable = lib.mkDefault true;
|
||||
editor.enable = lib.mkDefault true;
|
||||
hardware.enable = lib.mkDefault true;
|
||||
hyprland.enable = lib.mkDefault true;
|
||||
networking.enable = lib.mkDefault true;
|
||||
audio.enable = lib.mkDefault true;
|
||||
ssh.enable = lib.mkDefault true;
|
||||
virtualization.enable = lib.mkDefault true;
|
||||
}
|
64
modules/nixos/display-manager/default.nix
Normal file
64
modules/nixos/display-manager/default.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
display-manager.enable = lib.mkEnableOption "enable display-manager";
|
||||
};
|
||||
config = lib.mkIf config.display-manager.enable {
|
||||
services = {
|
||||
xserver = {
|
||||
enable = true;
|
||||
displayManager = {
|
||||
sddm.enable = true;
|
||||
gdm.enable = false;
|
||||
};
|
||||
desktopManager = {
|
||||
#plasma6.enable = true;
|
||||
gnome.enable = false;
|
||||
};
|
||||
xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
};
|
||||
};
|
||||
desktopManager.plasma6.enable = true;
|
||||
#wayland.enable = true;
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
dunst
|
||||
grim
|
||||
gnomeExtensions.autohide-battery
|
||||
gnomeExtensions.aylurs-widgets
|
||||
gnomeExtensions.bluetooth-battery
|
||||
gnomeExtensions.clipboard-indicator
|
||||
gnomeExtensions.hide-activities-button
|
||||
gnomeExtensions.hide-top-bar
|
||||
gnomeExtensions.ideapad-controls
|
||||
gnomeExtensions.lock-keys
|
||||
gnomeExtensions.maximize-to-empty-workspace
|
||||
gnomeExtensions.media-controls
|
||||
gnomeExtensions.openweather
|
||||
gnomeExtensions.system-monitor-next
|
||||
gnomeExtensions.wireless-hid
|
||||
kdePackages.ksystemstats
|
||||
libsForQt5.bismuth
|
||||
libnotify
|
||||
pamixer
|
||||
plasma5Packages.bismuth
|
||||
rofi-wayland
|
||||
swww
|
||||
(
|
||||
waybar.overrideAttrs (oldAttrs: {
|
||||
mesonFlags = oldAttrs.mesonFlags ++ ["-Dexperimental=true"];
|
||||
})
|
||||
)
|
||||
wl-clipboard
|
||||
virtiofsd
|
||||
];
|
||||
xdg.portal.enable = true;
|
||||
programs.xwayland.enable = true;
|
||||
};
|
||||
}
|
13
modules/nixos/editor/default.nix
Normal file
13
modules/nixos/editor/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {editor.enable = lib.mkEnableOption "enable editor";};
|
||||
config = lib.mkIf config.editor.enable {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
};
|
||||
}
|
10
modules/nixos/environment/default.nix
Normal file
10
modules/nixos/environment/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
_: {
|
||||
environment = {
|
||||
homeBinInPath = true; # Include ~/bin/ in $PATH
|
||||
localBinInPath = true; # Include ~/.local/bin in $PATH
|
||||
sessionVariables = {
|
||||
# tell electron apps to use wayland
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
};
|
||||
}
|
10
modules/nixos/filesystem/default.nix
Normal file
10
modules/nixos/filesystem/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
_: {
|
||||
fileSystems."/".options = ["noatime" "nodiratime" "discard"];
|
||||
# Enable swap on luks
|
||||
boot.initrd.luks.devices."luks-3b571a97-616b-4dd7-9abb-d1e0491d178a".device = "/dev/disk/by-uuid/3b571a97-616b-4dd7-9abb-d1e0491d178a";
|
||||
boot.initrd.luks.devices."luks-3b571a97-616b-4dd7-9abb-d1e0491d178a".allowDiscards = true;
|
||||
|
||||
# Allow discard on /
|
||||
boot.initrd.luks.devices."luks-a09877ce-f520-429a-9f3b-57b073e4d662".device = "/dev/disk/by-uuid/a09877ce-f520-429a-9f3b-57b073e4d662";
|
||||
boot.initrd.luks.devices."luks-a09877ce-f520-429a-9f3b-57b073e4d662".allowDiscards = true;
|
||||
}
|
7
modules/nixos/fonts/default.nix
Normal file
7
modules/nixos/fonts/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{pkgs, ...}: {
|
||||
fonts.packages = with pkgs; [
|
||||
source-han-serif
|
||||
noto-fonts-emoji
|
||||
noto-fonts-cjk
|
||||
];
|
||||
}
|
22
modules/nixos/hardware/default.nix
Normal file
22
modules/nixos/hardware/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
hardware.enable = lib.mkEnableOption "enable hardware options";
|
||||
};
|
||||
config = lib.mkIf config.hardware.enable {
|
||||
hardware = {
|
||||
#firmware = with pkgs; [firmwareLinuxNonfree];
|
||||
opengl = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [vaapiIntel vaapiVdpau libvdpau-va-gl intel-media-driver];
|
||||
};
|
||||
};
|
||||
nixpkgs.config.packageOverrides = pkgs: {
|
||||
vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
|
||||
};
|
||||
};
|
||||
}
|
23
modules/nixos/hyprland/config/hypr/hypridle.conf
Normal file
23
modules/nixos/hyprland/config/hypr/hypridle.conf
Normal file
|
@ -0,0 +1,23 @@
|
|||
$lock_cmd = pidof hyprlock || hyprlock
|
||||
$suspend_cmd = systemctl suspend || loginctl suspend
|
||||
|
||||
general {
|
||||
lock_cmd = $lock_cmd
|
||||
before_sleep_cmd = $lock_cmd
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 180 # 3mins
|
||||
on-timeout = $lock_cmd
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 240 # 4mins
|
||||
on-timeout = hyprctl dispatch dpms off
|
||||
on-resume = hyprctl dispatch dpms on
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 540 # 9mins
|
||||
on-timeout = $suspend_cmd
|
||||
}
|
5
modules/nixos/hyprland/config/hypr/hyprland.conf
Normal file
5
modules/nixos/hyprland/config/hypr/hyprland.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
source=./hyprland/env.conf
|
||||
source=./hyprland/general.conf
|
||||
source=./hyprland/colors.conf
|
||||
source=./hyprland/keybinds.conf
|
||||
exec-once=bash ~/.config/hypr/start.sh
|
34
modules/nixos/hyprland/config/hypr/hyprland/colors.conf
Normal file
34
modules/nixos/hyprland/config/hypr/hyprland/colors.conf
Normal file
|
@ -0,0 +1,34 @@
|
|||
$SLURP_COMMAND="$(slurp -d -c f8daeeBB -b 55405044 -s 00000000)"
|
||||
|
||||
general {
|
||||
col.active_border = rgba(eae0e445)
|
||||
col.inactive_border = rgba(9a8d9533)
|
||||
}
|
||||
|
||||
misc {
|
||||
background_color = rgba(1f1a1dFF)
|
||||
}
|
||||
|
||||
plugin {
|
||||
hyprbars {
|
||||
# Honestly idk if it works like css, but well, why not
|
||||
bar_text_font = Rubik, Geist, AR One Sans, Reddit Sans, Inter, Roboto, Ubuntu, Noto Sans, sans-serif
|
||||
bar_height = 30
|
||||
bar_padding = 10
|
||||
bar_button_padding = 5
|
||||
bar_precedence_over_border = true
|
||||
bar_part_of_window = true
|
||||
|
||||
bar_color = rgba(120F11FF)
|
||||
col.text = rgba(eae0e4FF)
|
||||
|
||||
|
||||
# example buttons (R -> L)
|
||||
# hyprbars-button = color, size, on-click
|
||||
hyprbars-button = rgb(eae0e4), 13, , hyprctl dispatch killactive
|
||||
hyprbars-button = rgb(eae0e4), 13, , hyprctl dispatch fullscreen 1
|
||||
hyprbars-button = rgb(eae0e4), 13, , hyprctl dispatch movetoworkspacesilent special
|
||||
}
|
||||
}
|
||||
|
||||
windowrulev2 = bordercolor rgba(ffabf1AA) rgba(ffabf177),pinned:1
|
19
modules/nixos/hyprland/config/hypr/hyprland/env.conf
Normal file
19
modules/nixos/hyprland/config/hypr/hyprland/env.conf
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Input method
|
||||
# See https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland
|
||||
env = QT_IM_MODULE, fcitx
|
||||
env = XMODIFIERS, @im=fcitx
|
||||
# env = GTK_IM_MODULE, wayland # Crashes electron apps in xwayland
|
||||
# env = GTK_IM_MODULE, fcitx # My Gtk apps no longer require this to work with fcitx5 hmm
|
||||
env = SDL_IM_MODULE, fcitx
|
||||
env = GLFW_IM_MODULE, ibus
|
||||
env = INPUT_METHOD, fcitx
|
||||
|
||||
# Themes
|
||||
env = QT_QPA_PLATFORM, wayland
|
||||
env = QT_QPA_PLATFORMTHEME, qt5ct
|
||||
# env = QT_STYLE_OVERRIDE,kvantum
|
||||
env = WLR_NO_HARDWARE_CURSORS, 1
|
||||
env = XCURSOR_SIZE, 24
|
||||
|
||||
# Screen tearing
|
||||
# env = WLR_DRM_NO_ATOMIC, 1
|
143
modules/nixos/hyprland/config/hypr/hyprland/general.conf
Normal file
143
modules/nixos/hyprland/config/hypr/hyprland/general.conf
Normal file
|
@ -0,0 +1,143 @@
|
|||
# General config taken from https://github.com/end-4/dots-hyprland
|
||||
# MONITOR CONFIG
|
||||
monitor=,preferred,auto,1
|
||||
|
||||
# HDMI port: mirror display. To see device name, use `hyprctl monitors`
|
||||
# monitor=HDMI-A-1,1920x1080@60,1920x0,1,mirror,eDP-1
|
||||
|
||||
input {
|
||||
# Keyboard: Add a layout and uncomment kb_options for Win+Space switching shortcut
|
||||
kb_layout = us
|
||||
# kb_options = grp:win_space_toggle
|
||||
numlock_by_default = false
|
||||
repeat_delay = 250
|
||||
repeat_rate = 35
|
||||
|
||||
touchpad {
|
||||
natural_scroll = no
|
||||
disable_while_typing = true
|
||||
clickfinger_behavior = true
|
||||
scroll_factor = 0.5
|
||||
}
|
||||
|
||||
sensitivity = 1.4 # [-1.0, 1.0]
|
||||
special_fallthrough = true
|
||||
follow_mouse = 1
|
||||
}
|
||||
|
||||
binds {
|
||||
# focus_window_on_workspace_c# For Auto-run stuff see execs.confhange = true
|
||||
scroll_event_delay = 0
|
||||
}
|
||||
|
||||
gestures {
|
||||
workspace_swipe = true
|
||||
workspace_swipe_distance = 700
|
||||
workspace_swipe_fingers = 3
|
||||
workspace_swipe_cancel_ratio = 0.2
|
||||
workspace_swipe_min_speed_to_force = 5
|
||||
workspace_swipe_direction_lock = true
|
||||
workspace_swipe_direction_lock_threshold = 10
|
||||
workspace_swipe_create_new = true
|
||||
}
|
||||
|
||||
general {
|
||||
# Gaps and border
|
||||
gaps_in = 4
|
||||
gaps_out = 5
|
||||
gaps_workspaces = 50
|
||||
border_size = 1
|
||||
|
||||
# Fallback colors
|
||||
col.active_border = rgba(0DB7D4FF)
|
||||
col.inactive_border = rgba(31313600)
|
||||
|
||||
resize_on_border = true
|
||||
no_focus_fallback = true
|
||||
layout = dwindle
|
||||
|
||||
allow_tearing = false
|
||||
}
|
||||
|
||||
dwindle {
|
||||
preserve_split = true
|
||||
# no_gaps_when_only = 1
|
||||
smart_split = false
|
||||
smart_resizing = false
|
||||
}
|
||||
|
||||
decoration {
|
||||
rounding = 20
|
||||
|
||||
blur {
|
||||
enabled = true
|
||||
xray = true
|
||||
special = false
|
||||
new_optimizations = true
|
||||
size = 7
|
||||
passes = 4
|
||||
brightness = 1
|
||||
noise = 0.01
|
||||
contrast = 1
|
||||
}
|
||||
# Shadow
|
||||
drop_shadow = false
|
||||
shadow_ignore_window = true
|
||||
shadow_range = 20
|
||||
shadow_offset = 0 2
|
||||
shadow_render_power = 2
|
||||
col.shadow = rgba(0000001A)
|
||||
|
||||
# Shader
|
||||
# screen_shader = ~/.config/hypr/shaders/nothing.frag
|
||||
# screen_shader = ~/.config/hypr/shaders/vibrance.frag
|
||||
|
||||
# Dim
|
||||
dim_inactive = false
|
||||
dim_strength = 0.1
|
||||
dim_special = 0
|
||||
}
|
||||
|
||||
animations {
|
||||
enabled = true
|
||||
# Animation curves
|
||||
|
||||
bezier = linear, 0, 0, 1, 1
|
||||
bezier = md3_standard, 0.2, 0, 0, 1
|
||||
bezier = md3_decel, 0.05, 0.7, 0.1, 1
|
||||
bezier = md3_accel, 0.3, 0, 0.8, 0.15
|
||||
bezier = overshot, 0.05, 0.9, 0.1, 1.1
|
||||
bezier = crazyshot, 0.1, 1.5, 0.76, 0.92
|
||||
bezier = hyprnostretch, 0.05, 0.9, 0.1, 1.0
|
||||
bezier = fluent_decel, 0.1, 1, 0, 1
|
||||
bezier = easeInOutCirc, 0.85, 0, 0.15, 1
|
||||
bezier = easeOutCirc, 0, 0.55, 0.45, 1
|
||||
bezier = easeOutExpo, 0.16, 1, 0.3, 1
|
||||
bezier = softAcDecel, 0.26, 0.26, 0.15, 1
|
||||
# Animation configs
|
||||
animation = windows, 1, 3, md3_decel, popin 60%
|
||||
animation = border, 1, 10, default
|
||||
animation = fade, 1, 2.5, md3_decel
|
||||
# animation = workspaces, 1, 3.5, md3_decel, slide
|
||||
animation = workspaces, 1, 7, fluent_decel, slide
|
||||
# animation = workspaces, 1, 2.5, softAcDecel, slide
|
||||
# animation = workspaces, 1, 7, fluent_decel, slidefade 15%
|
||||
# animation = specialWorkspace, 1, 3, md3_decel, slidefadevert 15%
|
||||
animation = specialWorkspace, 1, 3, md3_decel, slidevert
|
||||
}
|
||||
|
||||
misc {
|
||||
vfr = 1
|
||||
vrr = 1
|
||||
# layers_hog_mouse_focus = true
|
||||
focus_on_activate = true
|
||||
animate_manual_resizes = false
|
||||
animate_mouse_windowdragging = false
|
||||
enable_swallow = false
|
||||
swallow_regex = (foot|kitty|allacritty|Alacritty)
|
||||
|
||||
disable_hyprland_logo = true
|
||||
force_default_wallpaper = 0
|
||||
new_window_takes_over_fullscreen = 2
|
||||
}
|
||||
|
95
modules/nixos/hyprland/config/hypr/hyprland/keybinds.conf
Normal file
95
modules/nixos/hyprland/config/hypr/hyprland/keybinds.conf
Normal file
|
@ -0,0 +1,95 @@
|
|||
$MainMod = Super
|
||||
|
||||
### Audio keybinds ###
|
||||
# Mute
|
||||
bindl = , XF86AudioMute, exec, pamixer -m
|
||||
|
||||
# Raise volume by 2%
|
||||
bindle = , XF86AudioRaiseVolume, exec, pamixer -i 2
|
||||
|
||||
# Lower volume by 2%
|
||||
bindle = , XF86AudioLowerVolume, exec, pamixer -d 2
|
||||
|
||||
|
||||
### Applications ###
|
||||
|
||||
$browser = chromium
|
||||
$filemanager = dolphin
|
||||
$menu = rofi -show drun -show-icons
|
||||
$terminal1 = kitty
|
||||
$terminal2 = konsole
|
||||
|
||||
bind = $MainMod, Return, exec, $terminal1
|
||||
bind = $MainMod+Shift, Return, exec $terminal2
|
||||
bind = $MainMod, E, exec, $filemanager
|
||||
bind = $MainMod, R, exec, $menu
|
||||
bind = $MainMod, B, exec, $browser
|
||||
|
||||
|
||||
### Window Manager Actions ###
|
||||
bind = $MainMod, Q, killactive
|
||||
bind = $MainMod+Shift, Q, exec, hyprctl kill
|
||||
bind = $MainMod, F, togglefloating
|
||||
|
||||
# Swap windows
|
||||
bind = $MainMod+Shift, left, movewindow, l
|
||||
bind = $MainMod+Shift, right, movewindow, r
|
||||
bind = $MainMod+Shift, up, movewindow, u
|
||||
bind = $MainMod+Shift, down, movewindow, d
|
||||
bind = $MainMod, P, pin
|
||||
|
||||
# Move focus
|
||||
bind = $MainMod, left, movefocus, l
|
||||
bind = $MainMod, right, movefocus, r
|
||||
bind = $MainMod, up, movefocus, u
|
||||
bind = $MainMod, down, movefocus, d
|
||||
bind = $MainMod, BracketLeft, movefocus, l
|
||||
bind = $MainMod, BracketRight, movefocus, r
|
||||
|
||||
# Window split ratio
|
||||
binde = $MainMod, Minus, splitratio, -0.1
|
||||
binde = $MainMod, Equal, splitratio, 0.1
|
||||
binde = $MainMod, Semicolon, splitratio, -0.1
|
||||
binde = $MainMod, Apostrophe, splitratio, 0.1
|
||||
|
||||
# Switch workspace
|
||||
bind = $MainMod, 1, workspace, 1
|
||||
bind = $MainMod, 2, workspace, 2
|
||||
bind = $MainMod, 3, workspace, 3
|
||||
bind = $MainMod, 4, workspace, 4
|
||||
bind = $MainMod, 5, workspace, 5
|
||||
bind = $MainMod, 6, workspace, 6
|
||||
bind = $MainMod, 7, workspace, 7
|
||||
bind = $MainMod, 8, workspace, 8
|
||||
bind = $MainMod, 9, workspace, 9
|
||||
bind = $MainMod, 10, workspace, 10
|
||||
|
||||
# Move active window to a workspace
|
||||
bind = $MainMod Shift, 1, movetoworkspace, 1
|
||||
bind = $MainMod Shift, 2, movetoworkspace, 2
|
||||
bind = $MainMod Shift, 3, movetoworkspace, 3
|
||||
bind = $MainMod Shift, 4, movetoworkspace, 4
|
||||
bind = $MainMod Shift, 5, movetoworkspace, 5
|
||||
bind = $MainMod Shift, 6, movetoworkspace, 6
|
||||
bind = $MainMod Shift, 7, movetoworkspace, 7
|
||||
bind = $MainMod Shift, 8, movetoworkspace, 8
|
||||
bind = $MainMod Shift, 9, movetoworkspace, 9
|
||||
bind = $MainMod Shift, 10, movetoworkspace, 10
|
||||
|
||||
# Example special workspace
|
||||
bind = $MainMod, S, togglespecialworkspace, magic
|
||||
bind = $MainMod Shift, S, movetoworkspace, special:magic
|
||||
|
||||
# Scroll through existing workspaces
|
||||
bind = $MainMod, mouse_down, workspace, e+1
|
||||
bind = $MainMod, mouse_up, workspace, e-1
|
||||
|
||||
# Move and resize window with kb+mouse
|
||||
bindm = $MainMod, mouse:272, movewindow # LMB
|
||||
bindm = $MainMod, mouse:273, resizeWindow # RMB
|
||||
|
||||
### Lock Screen ###
|
||||
bind = $MainMod, L, exec, loginctl lock-session
|
||||
bind = $MainMod+Shift, L, exec, sleep 0.1 && systemctl suspend
|
||||
|
||||
|
97
modules/nixos/hyprland/config/hypr/hyprlock.conf
Normal file
97
modules/nixos/hyprland/config/hypr/hyprlock.conf
Normal file
|
@ -0,0 +1,97 @@
|
|||
$text_color = rgba(E2E2E2FF)
|
||||
$entry_background_color = rgba(13131311)
|
||||
$entry_border_color = rgba(91919155)
|
||||
$entry_color = rgba(C6C6C6FF)
|
||||
$font_family = Gabarito
|
||||
$font_family_clock = Gabarito
|
||||
$font_material_symbols = Material Symbols Rounded
|
||||
|
||||
background {
|
||||
color = rgba(13131377)
|
||||
# path = {{ SWWW_WALL }}
|
||||
path = screenshot
|
||||
blur_size = 5
|
||||
blur_passes = 4
|
||||
}
|
||||
input-field {
|
||||
monitor =
|
||||
size = 250, 50
|
||||
outline_thickness = 2
|
||||
dots_size = 0.1
|
||||
dots_spacing = 0.3
|
||||
outer_color = $entry_border_color
|
||||
inner_color = $entry_background_color
|
||||
font_color = $entry_color
|
||||
# fade_on_empty = true
|
||||
|
||||
position = 0, 20
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
label { # Clock
|
||||
monitor =
|
||||
text = $TIME
|
||||
shadow_passes = 1
|
||||
shadow_boost = 0.5
|
||||
color = $text_color
|
||||
font_size = 65
|
||||
font_family = $font_family_clock
|
||||
|
||||
position = 0, 300
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
label { # Greeting
|
||||
monitor =
|
||||
text = hi $USER !!!
|
||||
shadow_passes = 1
|
||||
shadow_boost = 0.5
|
||||
color = $text_color
|
||||
font_size = 20
|
||||
font_family = $font_family
|
||||
|
||||
position = 0, 240
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
label { # lock icon
|
||||
monitor =
|
||||
text = lock
|
||||
shadow_passes = 1
|
||||
shadow_boost = 0.5
|
||||
color = $text_color
|
||||
font_size = 21
|
||||
font_family = $font_material_symbols
|
||||
|
||||
position = 0, 65
|
||||
halign = center
|
||||
valign = bottom
|
||||
}
|
||||
label { # "locked" text
|
||||
monitor =
|
||||
text = locked
|
||||
shadow_passes = 1
|
||||
shadow_boost = 0.5
|
||||
color = $text_color
|
||||
font_size = 14
|
||||
font_family = $font_family
|
||||
|
||||
position = 0, 50
|
||||
halign = center
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
label { # Status
|
||||
monitor =
|
||||
text = cmd[update:5000] ~/.config/hypr/hyprlock/status.sh
|
||||
shadow_passes = 1
|
||||
shadow_boost = 0.5
|
||||
color = $text_color
|
||||
font_size = 14
|
||||
font_family = $font_family
|
||||
|
||||
position = 30, -30
|
||||
halign = left
|
||||
valign = top
|
||||
}
|
29
modules/nixos/hyprland/config/hypr/hyprlock/status.sh
Normal file
29
modules/nixos/hyprland/config/hypr/hyprlock/status.sh
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
############ Variables ############
|
||||
enable_battery=false
|
||||
battery_charging=false
|
||||
|
||||
####### Check availability ########
|
||||
for battery in /sys/class/power_supply/*BAT*; do
|
||||
if [[ -f "$battery/uevent" ]]; then
|
||||
enable_battery=true
|
||||
if [[ $(cat /sys/class/power_supply/*/status | head -1) == "Charging" ]]; then
|
||||
battery_charging=true
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
############# Output #############
|
||||
if [[ $enable_battery == true ]]; then
|
||||
if [[ $battery_charging == true ]]; then
|
||||
echo -n "(+) "
|
||||
fi
|
||||
echo -n "$(cat /sys/class/power_supply/*/capacity | head -1)"%
|
||||
if [[ $battery_charging == false ]]; then
|
||||
echo -n " remaining"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ''
|
|
@ -0,0 +1,26 @@
|
|||
// Taken from https://github.com/end-4/dots-hyprland/tree/main/.config/hypr/shaders
|
||||
|
||||
// vim: set ft=glsl:
|
||||
|
||||
precision highp float;
|
||||
varying highp vec2 v_texcoord;
|
||||
uniform highp sampler2D tex;
|
||||
|
||||
#define STRENGTH 0.0027
|
||||
|
||||
void main() {
|
||||
vec2 center = vec2(0.5, 0.5);
|
||||
vec2 offset = (v_texcoord - center) * STRENGTH;
|
||||
|
||||
float rSquared = dot(offset, offset);
|
||||
float distortion = 1.0 + 1.0 * rSquared;
|
||||
vec2 distortedOffset = offset * distortion;
|
||||
|
||||
vec2 redOffset = vec2(distortedOffset.x, distortedOffset.y);
|
||||
vec2 blueOffset = vec2(distortedOffset.x, distortedOffset.y);
|
||||
|
||||
vec4 redColor = texture2D(tex, v_texcoord + redOffset);
|
||||
vec4 blueColor = texture2D(tex, v_texcoord + blueOffset);
|
||||
|
||||
gl_FragColor = vec4(redColor.r, texture2D(tex, v_texcoord).g, blueColor.b, 1.0);
|
||||
}
|
511
modules/nixos/hyprland/config/hypr/shaders/crt.frag
Normal file
511
modules/nixos/hyprland/config/hypr/shaders/crt.frag
Normal file
|
@ -0,0 +1,511 @@
|
|||
#version 100
|
||||
precision highp float;
|
||||
varying highp vec2 v_texcoord;
|
||||
varying highp vec3 v_pos;
|
||||
uniform highp sampler2D tex;
|
||||
uniform lowp float time;
|
||||
|
||||
#define BORDER_COLOR vec4(vec3(0.0, 0.0, 0.0), 1.0) // black border
|
||||
#define BORDER_RADIUS 1.0 // larger vignette radius
|
||||
#define BORDER_SIZE 0.01 // small border size
|
||||
#define CHROMATIC_ABERRATION_STRENGTH 0.00
|
||||
#define DENOISE_INTENSITY 0.0001 //
|
||||
#define DISTORTION_AMOUNT 0.00 // moderate distortion amount
|
||||
#define HDR_BLOOM 0.75 // bloom intensity
|
||||
#define HDR_BRIGHTNESS 0.011 // brightness
|
||||
#define HDR_CONTRAST 0.011 // contrast
|
||||
#define HDR_SATURATION 1.0// saturation
|
||||
#define LENS_DISTORTION_AMOUNT 0.0
|
||||
#define NOISE_THRESHOLD 0.0001
|
||||
#define PHOSPHOR_BLUR_AMOUNT 0.77 // Amount of blur for phosphor glow
|
||||
#define PHOSPHOR_GLOW_AMOUNT 0.77 // Amount of phosphor glow
|
||||
#define SAMPLING_RADIUS 0.0001
|
||||
#define SCANLINE_FREQUENCY 540.0
|
||||
#define SCANLINE_THICKNESS 0.0507
|
||||
#define SCANLINE_TIME time * 471.24
|
||||
#define SHARPNESS 0.25
|
||||
#define SUPERSAMPLING_SAMPLES 16.0
|
||||
#define VIGNETTE_RADIUS 0.0 // larger vignette radius
|
||||
#define PI 3.14159265359
|
||||
#define TWOPI 6.28318530718
|
||||
|
||||
vec2 applyBarrelDistortion(vec2 coord, float amt) {
|
||||
vec2 p = coord.xy / vec2(1.0);
|
||||
vec2 v = p * 2.0 - vec2(1.0);
|
||||
float r = dot(v, v);
|
||||
float k = 1.0 + pow(r, 2.0) * pow(amt, 2.0);
|
||||
vec2 result = v * k;
|
||||
return vec2(0.5, 0.5) + 0.5 * result.xy;
|
||||
}
|
||||
|
||||
vec4 applyColorCorrection(vec4 color) {
|
||||
color.rgb *= vec3(1.0, 0.79, 0.89);
|
||||
return vec4(color.rgb, 1.0);
|
||||
}
|
||||
|
||||
vec4 applyBorder(vec2 tc, vec4 color, float borderSize, vec4 borderColor) {
|
||||
float dist_x = min(tc.x, 1.0 - tc.x);
|
||||
float dist_y = min(tc.y, 1.0 - tc.y);
|
||||
float dist = min(dist_x, dist_y) * -1.0;
|
||||
float border = smoothstep(borderSize, 0.0, dist);
|
||||
border += smoothstep(borderSize, 0.0, dist);
|
||||
return mix(color, borderColor, border);
|
||||
}
|
||||
|
||||
vec4 applyFakeHDR(vec4 color, float brightness, float contrast, float saturation, float bloom) {
|
||||
color.rgb = (color.rgb - vec3(0.5)) * exp2(brightness) + vec3(0.5);
|
||||
vec3 crtfactor = vec3(1.05, 0.92, 1.0);
|
||||
color.rgb = pow(color.rgb, crtfactor);
|
||||
// // NTSC
|
||||
// vec3 lumCoeff = vec3(0.2125, 0.7154, 0.0721);
|
||||
|
||||
// // BT.709
|
||||
// vec3 lumCoeff = vec3(0.299, 0.587, 0.114);
|
||||
|
||||
// BT.2020
|
||||
vec3 lumCoeff = vec3(0.2627, 0.6780, 0.0593);
|
||||
|
||||
// // Warm NTSC
|
||||
// vec3 lumCoeff = vec3(0.2125, 0.7010, 0.0865);
|
||||
|
||||
float luminance = dot(color.rgb, lumCoeff);
|
||||
luminance = pow(luminance, 2.2);
|
||||
color.rgb = mix(vec3(luminance), color.rgb, saturation);
|
||||
color.rgb = mix(color.rgb, vec3(1.0), pow(max(0.0, luminance - 1.0 + bloom), 4.0));
|
||||
return color;
|
||||
}
|
||||
|
||||
vec4 applyVignette(vec4 color) {
|
||||
vec2 center = vec2(0.5, 0.5); // center of screen
|
||||
float radius = VIGNETTE_RADIUS; // radius of vignette effect
|
||||
float softness = 1.0; // softness of vignette effect
|
||||
float intensity = 0.7; // intensity of vignette effect
|
||||
vec2 offset = v_texcoord - center; // offset from center of screen
|
||||
float distance = length(offset); // distance from center of screen
|
||||
float alpha = smoothstep(radius, radius - radius * softness, distance) * intensity; // calculate alpha value for vignette effect
|
||||
return mix(vec4(0.0, 0.0, 0.0, alpha), color, alpha); // mix black with color using calculated alpha value
|
||||
}
|
||||
|
||||
vec4 applyPhosphorGlow(vec2 tc, vec4 color, sampler2D tex) {
|
||||
// Calculate average color value of the texture
|
||||
vec4 texelColor = color;
|
||||
float averageColor = (texelColor.r + texelColor.g + texelColor.b) / 3.0;
|
||||
|
||||
// Determine brightness-dependent color factor
|
||||
float factor = mix(
|
||||
mix(0.09,
|
||||
mix(0.005, 0.0075, (averageColor - 0.1) / 0.1),
|
||||
step(0.01, averageColor)), 0.0005,
|
||||
step(0.02, averageColor));
|
||||
// Apply phosphor glow effect
|
||||
vec4 sum = vec4(0.0);
|
||||
vec4 pixels[9];
|
||||
pixels[0] = texture2D(tex, tc - vec2(0.001, 0.001));
|
||||
pixels[1] = texture2D(tex, tc - vec2(0.001, 0.0));
|
||||
pixels[2] = texture2D(tex, tc - vec2(0.001, -0.001));
|
||||
pixels[3] = texture2D(tex, tc - vec2(0.0, 0.001));
|
||||
pixels[4] = texture2D(tex, tc);
|
||||
pixels[5] = texture2D(tex, tc + vec2(0.001, 0.001));
|
||||
pixels[6] = texture2D(tex, tc + vec2(0.001, 0.0));
|
||||
pixels[7] = texture2D(tex, tc + vec2(0.001, -0.001));
|
||||
pixels[8] = texture2D(tex, tc + vec2(0.0, 0.001));
|
||||
|
||||
// Perform operations on input pixels in parallel
|
||||
sum = pixels[0]
|
||||
+ pixels[1]
|
||||
+ pixels[2]
|
||||
+ pixels[3]
|
||||
+ pixels[4]
|
||||
+ pixels[5]
|
||||
+ pixels[6]
|
||||
+ pixels[7]
|
||||
+ pixels[8];
|
||||
sum /= 9.0;
|
||||
sum += texture2D(tex, tc - vec2(0.01, 0.01)) * 0.001;
|
||||
sum += texture2D(tex, tc - vec2(0.0, 0.01)) * 0.001;
|
||||
sum += texture2D(tex, tc - vec2(-0.01, 0.01)) * 0.001;
|
||||
sum += texture2D(tex, tc - vec2(0.01, 0.0)) * 0.001;
|
||||
sum += color * PHOSPHOR_BLUR_AMOUNT;
|
||||
sum += texture2D(tex, tc - vec2(-0.01, 0.0)) * 0.001;
|
||||
sum += texture2D(tex, tc - vec2(0.01, -0.01)) * 0.001;
|
||||
sum += texture2D(tex, tc - vec2(0.0, -0.01)) * 0.001;
|
||||
sum += texture2D(tex, tc - vec2(-0.01, -0.01)) * 0.001;
|
||||
sum *= PHOSPHOR_GLOW_AMOUNT;
|
||||
|
||||
// Initialize sum_sum_factor to zero
|
||||
vec4 sum_sum_factor = vec4(0.0);
|
||||
// Compute sum_j for i = -1
|
||||
vec4 sum_j = vec4(0.0);
|
||||
sum_j += texture2D(tex, tc + vec2(-1, -1) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(0, -1) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(1, -1) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(-1, 0) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(0, 0) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(1, 0) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(-1, 1) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(0, 1) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(1, 1) * 0.01);
|
||||
sum_sum_factor += sum_j * vec4(0.011);
|
||||
|
||||
// Compute sum_j for i = 0
|
||||
sum_j = vec4(0.0);
|
||||
sum_j += texture2D(tex, tc + vec2(-1, 0) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(0, 0) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(1, 0) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(-1, 1) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(0, 1) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(1, 1) * 0.01);
|
||||
sum_sum_factor += sum_j * vec4(0.011);
|
||||
|
||||
// Compute sum_j for i = 1
|
||||
sum_j = vec4(0.0);
|
||||
sum_j += texture2D(tex, tc + vec2(-1, 0) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(0, 1) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(1, 0) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(-1, 1) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(0, 1) * 0.01);
|
||||
sum_j += texture2D(tex, tc + vec2(1, 1) * 0.01);
|
||||
sum_sum_factor += sum_j * vec4(0.011);
|
||||
color += mix(sum_sum_factor * sum_sum_factor * vec4(factor), sum, 0.5);
|
||||
return color;
|
||||
}
|
||||
|
||||
vec4 applyAdaptiveSharpen(vec2 tc, vec4 color, sampler2D tex) {
|
||||
vec4 color_tl = texture2D(tex, tc + vec2(-1.0, -1.0) * 0.5 / 2160.0);
|
||||
vec4 color_tr = texture2D(tex, tc + vec2(1.0, -1.0) * 0.5 / 2160.0);
|
||||
vec4 color_bl = texture2D(tex, tc + vec2(-1.0, 1.0) * 0.5 / 2160.0);
|
||||
vec4 color_br = texture2D(tex, tc + vec2(1.0, 1.0) * 0.5 / 2160.0);
|
||||
float sharpness = SHARPNESS;
|
||||
vec3 color_no_alpha = color.rgb;
|
||||
vec3 color_tl_no_alpha = color_tl.rgb;
|
||||
vec3 color_tr_no_alpha = color_tr.rgb;
|
||||
vec3 color_bl_no_alpha = color_bl.rgb;
|
||||
vec3 color_br_no_alpha = color_br.rgb;
|
||||
float delta = (dot(color_no_alpha, vec3(0.333333)) + dot(color_tl_no_alpha, vec3(0.333333)) + dot(color_tr_no_alpha, vec3(0.333333)) + dot(color_bl_no_alpha, vec3(0.333333)) + dot(color_br_no_alpha, vec3(0.333333))) * 0.2 - dot(color_no_alpha, vec3(0.333333));
|
||||
vec3 sharp_color_no_alpha = color_no_alpha + min(vec3(0.0), vec3(delta * sharpness));
|
||||
vec4 sharp_color = vec4(sharp_color_no_alpha, color.a);
|
||||
return sharp_color;
|
||||
}
|
||||
|
||||
vec4 applyScanlines(vec2 tc, vec4 color) {
|
||||
float scanline = (cos(tc.y * SCANLINE_FREQUENCY + SCANLINE_TIME) *
|
||||
sin(tc.y * SCANLINE_FREQUENCY + SCANLINE_TIME)) * SCANLINE_THICKNESS;
|
||||
float alpha = clamp(1.0 - abs(scanline), 0.0, 1.0);
|
||||
return vec4(color.rgb * alpha, color.a);
|
||||
}
|
||||
|
||||
vec4 applyChromaticAberration(vec2 uv, vec4 color) {
|
||||
vec2 center = vec2(0.5, 0.5); // center of the screen
|
||||
vec2 offset = (uv - center) * CHROMATIC_ABERRATION_STRENGTH; // calculate the offset from the center
|
||||
|
||||
// apply lens distortion
|
||||
float rSquared = dot(offset, offset);
|
||||
float distortion = 1.0 + LENS_DISTORTION_AMOUNT * rSquared;
|
||||
vec2 distortedOffset = offset * distortion;
|
||||
|
||||
// apply chromatic aberration
|
||||
vec2 redOffset = vec2(distortedOffset.x * 1.00, distortedOffset.y * 1.00);
|
||||
vec2 blueOffset = vec2(distortedOffset.x * 1.00, distortedOffset.y * 1.00);
|
||||
|
||||
vec4 redColor = texture2D(tex, uv + redOffset);
|
||||
vec4 blueColor = texture2D(tex, uv + blueOffset);
|
||||
|
||||
vec4 result = vec4(redColor.r, color.g, blueColor.b, color.a);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
vec4 reduceGlare(vec4 color) {
|
||||
// Calculate the intensity of the color by taking the average of the RGB components
|
||||
float intensity = (color.r + color.g + color.b) / 3.0;
|
||||
// Set the maximum intensity that can be considered for glare
|
||||
float maxIntensity = 0.98;
|
||||
// Use smoothstep to create a smooth transition from no glare to full glare
|
||||
// based on the intensity of the color and the maximum intensity
|
||||
float glareIntensity = smoothstep(maxIntensity - 0.02, maxIntensity, intensity);
|
||||
// Set the amount of glare to apply to the color
|
||||
float glareAmount = 0.02;
|
||||
// Mix the original color with the reduced color that has glare applied to it
|
||||
vec3 reducedColor = mix(color.rgb, vec3(glareIntensity), glareAmount);
|
||||
// Return the reduced color with the original alpha value
|
||||
return vec4(reducedColor, color.a);
|
||||
}
|
||||
|
||||
// Apply a fake HDR effect to the input color.
|
||||
// Parameters:
|
||||
// - inputColor: the color to apply the effect to.
|
||||
// - brightness: the brightness of the image. Should be a value between 0 and 1.
|
||||
// - contrast: the contrast of the image. Should be a value between 0 and 1.
|
||||
// - saturation: the saturation of the image. Should be a value between 0 and 2.
|
||||
// - bloom: the intensity of the bloom effect. Should be a value between 0 and 1.
|
||||
vec4 applyFakeHDREffect(vec4 inputColor, float brightness, float contrast, float saturation, float bloom) {
|
||||
const float minBrightness = 0.0;
|
||||
const float maxBrightness = 1.0;
|
||||
const float minContrast = 0.0;
|
||||
const float maxContrast = 1.0;
|
||||
const float minSaturation = 0.0;
|
||||
const float maxSaturation = 2.0;
|
||||
const float minBloom = 0.0;
|
||||
const float maxBloom = 1.0;
|
||||
|
||||
// Check input parameters for validity
|
||||
if (brightness < minBrightness || brightness > maxBrightness) {
|
||||
return vec4(0.0, 0.0, 0.0, 1.0); // Return black with alpha of 1.0 to indicate error
|
||||
}
|
||||
if (contrast < minContrast || contrast > maxContrast) {
|
||||
return vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
if (saturation < minSaturation || saturation > maxSaturation) {
|
||||
return vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
if (bloom < minBloom || bloom > maxBloom) {
|
||||
return vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
// Apply brightness and contrast
|
||||
vec3 color = inputColor.rgb;
|
||||
color = (color - vec3(0.5)) * exp2(brightness * 10.0) + vec3(0.5);
|
||||
color = mix(vec3(0.5), color, pow(contrast * 4.0 + 1.0, 2.0));
|
||||
|
||||
// // NTSC
|
||||
// vec3 lumCoeff = vec3(0.2125, 0.7154, 0.0721);
|
||||
|
||||
// // BT.709
|
||||
// vec3 lumCoeff = vec3(0.299, 0.587, 0.114);
|
||||
|
||||
// // BT.2020
|
||||
// vec3 lumCoeff = vec3(0.2627, 0.6780, 0.0593);
|
||||
|
||||
// Warm NTSC
|
||||
vec3 lumCoeff = vec3(0.2125, 0.7010, 0.0865);
|
||||
|
||||
// Apply saturation
|
||||
float luminance = dot(color, lumCoeff);
|
||||
vec3 grey = vec3(luminance);
|
||||
color = mix(grey, color, saturation);
|
||||
|
||||
// Apply bloom effect
|
||||
float threshold = 1.0 - bloom;
|
||||
vec3 bloomColor = max(color - threshold, vec3(0.0));
|
||||
bloomColor = pow(bloomColor, vec3(2.0));
|
||||
bloomColor = mix(vec3(0.0), bloomColor, pow(min(luminance, threshold), 4.0));
|
||||
color += bloomColor;
|
||||
|
||||
return vec4(color, inputColor.a);
|
||||
}
|
||||
|
||||
vec4 bilateralFilter(sampler2D tex, vec2 uv, vec4 color, float sampleRadius, float noiseThreshold, float intensity) {
|
||||
vec4 filteredColor = vec4(0.0);
|
||||
float totalWeight = 0.0;
|
||||
|
||||
// Top-left pixel
|
||||
vec4 sample = texture2D(tex, uv + vec2(-1.0, -1.0));
|
||||
float dist = length(vec2(-1.0, -1.0));
|
||||
float colorDist = length(sample - color);
|
||||
float weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius));
|
||||
filteredColor += sample * weight;
|
||||
totalWeight += weight;
|
||||
|
||||
// Top pixel
|
||||
sample = texture2D(tex, uv + vec2(0.0, -1.0));
|
||||
dist = length(vec2(0.0, -1.0));
|
||||
colorDist = length(sample - color);
|
||||
weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius));
|
||||
filteredColor += sample * weight;
|
||||
totalWeight += weight;
|
||||
|
||||
// Top-right pixel
|
||||
sample = texture2D(tex, uv + vec2(1.0, -1.0));
|
||||
dist = length(vec2(1.0, -1.0));
|
||||
colorDist = length(sample - color);
|
||||
weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius));
|
||||
filteredColor += sample * weight;
|
||||
totalWeight += weight;
|
||||
|
||||
// Left pixel
|
||||
sample = texture2D(tex, uv + vec2(-1.0, 0.0));
|
||||
dist = length(vec2(-1.0, 0.0));
|
||||
colorDist = length(sample - color);
|
||||
weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius));
|
||||
filteredColor += sample * weight;
|
||||
totalWeight += weight;
|
||||
|
||||
// Center pixel
|
||||
sample = texture2D(tex, uv);
|
||||
dist = 0.0;
|
||||
colorDist = length(sample - color);
|
||||
weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius));
|
||||
filteredColor += sample * weight;
|
||||
totalWeight += weight;
|
||||
|
||||
// Right pixel
|
||||
sample = texture2D(tex, uv + vec2(1.0, 0.0));
|
||||
dist = length(vec2(1.0, 0.0));
|
||||
colorDist = length(sample - color);
|
||||
weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius));
|
||||
filteredColor += sample * weight;
|
||||
totalWeight += weight;
|
||||
|
||||
// Bottom-left pixel
|
||||
sample = texture2D(tex, uv + vec2(-1.0, 1.0));
|
||||
dist = length(vec2(-1.0, 1.0));
|
||||
colorDist = length(sample - color);
|
||||
weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius));
|
||||
filteredColor += sample * weight;
|
||||
totalWeight += weight;
|
||||
|
||||
// Bottom pixel
|
||||
sample = texture2D(tex, uv + vec2(0.0, sampleRadius));
|
||||
dist = length(vec2(0.0, sampleRadius));
|
||||
colorDist = length(sample - color);
|
||||
weight = exp(-0.5 * (dist * dist + colorDist * colorDist * intensity) / (sampleRadius * sampleRadius));
|
||||
filteredColor += sample * weight;
|
||||
totalWeight += weight;
|
||||
|
||||
filteredColor /= totalWeight;
|
||||
return mix(color, filteredColor, step(noiseThreshold, length(filteredColor - color)));
|
||||
}
|
||||
|
||||
vec4 supersample(sampler2D tex, vec2 uv, float sampleRadius, float noiseThreshold, float intensity) {
|
||||
float radiusSq = sampleRadius * sampleRadius;
|
||||
vec2 poissonDisk;
|
||||
vec4 color = vec4(0.0);
|
||||
|
||||
float r1_0 = sqrt(0.0 / 16.0);
|
||||
float r2_0 = fract(1.0 / 3.0);
|
||||
float theta_0 = TWOPI * r2_0;
|
||||
poissonDisk = vec2(r1_0 * cos(theta_0), r1_0 * sin(theta_0));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_1 = sqrt(1.0 / 16.0);
|
||||
float r2_1 = fract(2.0 / 3.0);
|
||||
float theta_1 = TWOPI * r2_1;
|
||||
poissonDisk = vec2(r1_1 * cos(theta_1), r1_1 * sin(theta_1));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_2 = sqrt(2.0 / 16.0);
|
||||
float r2_2 = fract(3.0 / 3.0);
|
||||
float theta_2 = TWOPI * r2_2;
|
||||
poissonDisk = vec2(r1_2 * cos(theta_2), r1_2 * sin(theta_2));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_3 = sqrt(3.0 / 16.0);
|
||||
float r2_3 = fract(4.0 / 3.0);
|
||||
float theta_3 = TWOPI * r2_3;
|
||||
poissonDisk = vec2(r1_3 * cos(theta_3), r1_3 * sin(theta_3));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_4 = sqrt(4.0 / 16.0);
|
||||
float r2_4 = fract(5.0 / 3.0);
|
||||
float theta_4 = TWOPI * r2_4;
|
||||
poissonDisk = vec2(r1_4 * cos(theta_4), r1_4 * sin(theta_4));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_5 = sqrt(5.0 / 16.0);
|
||||
float r2_5 = fract(6.0 / 3.0);
|
||||
float theta_5 = TWOPI * r2_5;
|
||||
poissonDisk = vec2(r1_5 * cos(theta_5), r1_5 * sin(theta_5));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_6 = sqrt(6.0 / 16.0);
|
||||
float r2_6 = fract(7.0 / 3.0);
|
||||
float theta_6 = TWOPI * r2_6;
|
||||
poissonDisk = vec2(r1_6 * cos(theta_6), r1_6 * sin(theta_6));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_7 = sqrt(7.0 / 16.0);
|
||||
float r2_7 = fract(8.0 / 3.0);
|
||||
float theta_7 = TWOPI * r2_7;
|
||||
poissonDisk = vec2(r1_7 * cos(theta_7), r1_7 * sin(theta_7));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_8 = sqrt(8.0 / 16.0);
|
||||
float r2_8 = fract(9.0 / 3.0);
|
||||
float theta_8 = TWOPI * r2_8;
|
||||
poissonDisk = vec2(r1_8 * cos(theta_8), r1_8 * sin(theta_8));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_9 = sqrt(9.0 / 16.0);
|
||||
float r2_9 = fract(10.0 / 3.0);
|
||||
float theta_9 = TWOPI * r2_9;
|
||||
poissonDisk = vec2(r1_9 * cos(theta_9), r1_9 * sin(theta_9));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_10 = sqrt(10.0 / 16.0);
|
||||
float r2_10 = fract(11.0 / 3.0);
|
||||
float theta_10 = TWOPI * r2_10;
|
||||
poissonDisk = vec2(r1_10 * cos(theta_10), r1_10 * sin(theta_10));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_11 = sqrt(11.0 / 16.0);
|
||||
float r2_11 = fract(12.0 / 3.0);
|
||||
float theta_11 = TWOPI * r2_11;
|
||||
poissonDisk = vec2(r1_11 * cos(theta_11), r1_11 * sin(theta_11));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_12 = sqrt(12.0 / 16.0);
|
||||
float r2_12 = fract(13.0 / 3.0);
|
||||
float theta_12 = TWOPI * r2_12;
|
||||
poissonDisk = vec2(r1_12 * cos(theta_12), r1_12 * sin(theta_12));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_13 = sqrt(13.0 / 16.0);
|
||||
float r2_13 = fract(14.0 / 3.0);
|
||||
float theta_13 = TWOPI * r2_13;
|
||||
poissonDisk = vec2(r1_13 * cos(theta_13), r1_13 * sin(theta_13));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_14 = sqrt(14.0 / 16.0);
|
||||
float r2_14 = fract(15.0 / 3.0);
|
||||
float theta_14 = TWOPI * r2_14;
|
||||
poissonDisk = vec2(r1_14 * cos(theta_14), r1_14 * sin(theta_14));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
float r1_15 = sqrt(15.0 / 16.0);
|
||||
float r2_15 = fract(16.0 / 3.0);
|
||||
float theta_15 = TWOPI * r2_15;
|
||||
poissonDisk = vec2(r1_15 * cos(theta_15), r1_15 * sin(theta_15));
|
||||
color += texture2D(tex, uv + poissonDisk * sampleRadius);
|
||||
|
||||
return bilateralFilter(tex, uv, color, sampleRadius, noiseThreshold, intensity);
|
||||
}
|
||||
void main() {
|
||||
vec2 tc_no_dist = v_texcoord;
|
||||
|
||||
vec2 tc = applyBarrelDistortion(tc_no_dist, DISTORTION_AMOUNT);
|
||||
|
||||
// [-1, 1]
|
||||
vec2 tc_no_dist_symmetric = tc_no_dist * 2.0 - 1.0;
|
||||
|
||||
// [0,1]
|
||||
vec2 tc_no_dist_normalized = (tc_no_dist_symmetric + 1.0) / 2.0;
|
||||
|
||||
// vec4 color = texture2D(tex, tc);
|
||||
vec4 color = supersample(tex, tc, SAMPLING_RADIUS, NOISE_THRESHOLD, DENOISE_INTENSITY);
|
||||
|
||||
color = applyAdaptiveSharpen(tc, color, tex);
|
||||
|
||||
color = applyPhosphorGlow(tc, color, tex);
|
||||
|
||||
color = reduceGlare(color);
|
||||
|
||||
color = mix(applyFakeHDREffect(color, HDR_BRIGHTNESS, HDR_CONTRAST, HDR_SATURATION, HDR_BLOOM), color, 0.5);
|
||||
|
||||
color = applyColorCorrection(color);
|
||||
|
||||
color /= SUPERSAMPLING_SAMPLES;
|
||||
|
||||
color = mix(applyChromaticAberration(tc, color), color, 0.25);
|
||||
|
||||
color = mix(color, applyVignette(color), 0.37);
|
||||
|
||||
color = applyBorder(tc_no_dist_normalized, color, 1.0 - BORDER_SIZE * BORDER_RADIUS, BORDER_COLOR);
|
||||
|
||||
color = mix(applyBorder(tc, color, BORDER_SIZE, BORDER_COLOR), color, 0.05);
|
||||
|
||||
color = applyScanlines(tc, color);
|
||||
|
||||
gl_FragColor = color;
|
||||
gl_FragColor.a = 1.0;
|
||||
}
|
||||
|
42
modules/nixos/hyprland/config/hypr/shaders/drugs.frag
Normal file
42
modules/nixos/hyprland/config/hypr/shaders/drugs.frag
Normal file
|
@ -0,0 +1,42 @@
|
|||
|
||||
precision highp float;
|
||||
varying vec2 v_texcoord;
|
||||
uniform sampler2D tex;
|
||||
uniform float time;
|
||||
|
||||
void warpco(inout vec2 tc) {
|
||||
tc -= 0.5;
|
||||
tc *= length(tc) * 2.0;
|
||||
tc += 0.5;
|
||||
}
|
||||
|
||||
float rand1d(float seed) {
|
||||
return sin(seed*1454.0);
|
||||
}
|
||||
|
||||
float rand2d(vec2 co)
|
||||
{
|
||||
return fract(sin(dot(co.xy, vec2(12.9898,78.233))) * 43758.5453);
|
||||
}
|
||||
|
||||
vec3 rgb(in vec2 tc, float freq, float amp, inout vec4 centre) {
|
||||
vec2 off = vec2(1.0/800.0, 0.0) * sin(tc.t * freq + time) * amp;
|
||||
vec2 off2 = vec2(1.0/800.0, 0.0) * sin(tc.t * freq - time * 1.5) * amp;
|
||||
centre = texture2D(tex, tc);
|
||||
return vec3(texture2D(tex, tc-off).r, centre.g, texture2D(tex, tc+off2).b);
|
||||
}
|
||||
|
||||
void main() {
|
||||
// vec2 px = 1.0 / textureSize(tex, 0).st;
|
||||
vec2 tc = v_texcoord;
|
||||
warpco(tc);
|
||||
tc = mix(v_texcoord, tc, sin(time * 2.0)*0.07);
|
||||
tc.x += rand2d(floor(tc * 20.0 + floor(time * 2.5))) * 0.01;
|
||||
tc.x += rand1d(floor(tc.x * 40.0)) * 0.005 * rand1d(time * 0.001);
|
||||
tc.y += sin(tc.x + time) * 0.02;
|
||||
vec4 centre;
|
||||
vec3 bent = rgb(tc, 100.0, 5.0, centre);
|
||||
vec3 col = mix(centre.rgb, bent, sin(time));
|
||||
gl_FragColor = vec4(col, centre.a);
|
||||
// gl_FragColor = vec4(texture2D(tex, v_texcoord));
|
||||
}
|
21
modules/nixos/hyprland/config/hypr/shaders/extradark.frag
Normal file
21
modules/nixos/hyprland/config/hypr/shaders/extradark.frag
Normal file
|
@ -0,0 +1,21 @@
|
|||
// vim: set ft=glsl:
|
||||
// blue light filter shader
|
||||
// values from https://reshade.me/forum/shader-discussion/3673-blue-light-filter-similar-to-f-lux
|
||||
|
||||
precision mediump float;
|
||||
varying vec2 v_texcoord;
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main() {
|
||||
|
||||
vec4 pixColor = texture2D(tex, v_texcoord);
|
||||
|
||||
// red
|
||||
pixColor[0] *= 0.7;
|
||||
// green
|
||||
pixColor[1] *= 0.6;
|
||||
// blue
|
||||
pixColor[2] *= 0.5;
|
||||
|
||||
gl_FragColor = pixColor;
|
||||
}
|
21
modules/nixos/hyprland/config/hypr/shaders/invert.frag
Normal file
21
modules/nixos/hyprland/config/hypr/shaders/invert.frag
Normal file
|
@ -0,0 +1,21 @@
|
|||
// vim: set ft=glsl:
|
||||
// blue light filter shader
|
||||
// values from https://reshade.me/forum/shader-discussion/3673-blue-light-filter-similar-to-f-lux
|
||||
|
||||
precision mediump float;
|
||||
varying vec2 v_texcoord;
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main() {
|
||||
|
||||
vec4 pixColor = texture2D(tex, v_texcoord);
|
||||
|
||||
// red
|
||||
pixColor[0] *= 0.7;
|
||||
// green
|
||||
pixColor[1] *= 0.6;
|
||||
// blue
|
||||
pixColor[2] *= 0.5;
|
||||
|
||||
gl_FragColor = pixColor;
|
||||
}
|
41
modules/nixos/hyprland/config/hypr/shaders/solarized.frag
Normal file
41
modules/nixos/hyprland/config/hypr/shaders/solarized.frag
Normal file
|
@ -0,0 +1,41 @@
|
|||
// -*- mode:c -*-
|
||||
precision lowp float;
|
||||
varying vec2 v_texcoord;
|
||||
uniform sampler2D tex;
|
||||
|
||||
float distanceSquared(vec3 pixColor, vec3 solarizedColor) {
|
||||
vec3 distanceVector = pixColor - solarizedColor;
|
||||
return dot(distanceVector, distanceVector);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec3 solarized[16];
|
||||
solarized[0] = vec3(0.,0.169,0.212);
|
||||
solarized[1] = vec3(0.027,0.212,0.259);
|
||||
solarized[2] = vec3(0.345,0.431,0.459);
|
||||
solarized[3] = vec3(0.396,0.482,0.514);
|
||||
solarized[4] = vec3(0.514,0.58,0.588);
|
||||
solarized[5] = vec3(0.576,0.631,0.631);
|
||||
solarized[6] = vec3(0.933,0.91,0.835);
|
||||
solarized[7] = vec3(0.992,0.965,0.89);
|
||||
solarized[8] = vec3(0.71,0.537,0.);
|
||||
solarized[9] = vec3(0.796,0.294,0.086);
|
||||
solarized[10] = vec3(0.863,0.196,0.184);
|
||||
solarized[11] = vec3(0.827,0.212,0.51);
|
||||
solarized[12] = vec3(0.424,0.443,0.769);
|
||||
solarized[13] = vec3(0.149,0.545,0.824);
|
||||
solarized[14] = vec3(0.165,0.631,0.596);
|
||||
solarized[15] = vec3(0.522,0.6,0.);
|
||||
|
||||
vec3 pixColor = vec3(texture2D(tex, v_texcoord));
|
||||
int closest = 0;
|
||||
float closestDistanceSquared = distanceSquared(pixColor, solarized[0]);
|
||||
for (int i = 1; i < 15; i++) {
|
||||
float newDistanceSquared = distanceSquared(pixColor, solarized[i]);
|
||||
if (newDistanceSquared < closestDistanceSquared) {
|
||||
closest = i;
|
||||
closestDistanceSquared = newDistanceSquared;
|
||||
}
|
||||
}
|
||||
gl_FragColor = vec4(solarized[closest], 1.);
|
||||
}
|
9
modules/nixos/hyprland/config/hypr/start.sh
Executable file
9
modules/nixos/hyprland/config/hypr/start.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
swww init &
|
||||
swww img /home/user/Pictures/1611244530792.jpg &
|
||||
|
||||
# pkgs.networkmanagerapplet
|
||||
nm-applet --indicator &
|
||||
|
||||
waybar &
|
15
modules/nixos/hyprland/default.nix
Normal file
15
modules/nixos/hyprland/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
hyprland.enable = lib.mkEnableOption "enable hyprland";
|
||||
};
|
||||
config = lib.mkIf config.hyprland.enable {
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
15
modules/nixos/kernel/default.nix
Normal file
15
modules/nixos/kernel/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{pkgs, ...}: {
|
||||
boot = {
|
||||
kernelModules = ["kvm-intel" "snd-hda-intel" "i8042" "nf_nat_ftp"];
|
||||
extraModprobeConfig = ''
|
||||
options snd-hda-intel model=alc255-acer,dell-headset-multi
|
||||
options i8042 nopnp=1
|
||||
'';
|
||||
kernelParams = ["allow-discards"];
|
||||
kernel.sysctl = {
|
||||
"net.ipv4.conf.all.forwarding" = true;
|
||||
"net.ipv4.conf.default.forwarding" = true;
|
||||
};
|
||||
};
|
||||
hardware.firmware = with pkgs; [firmwareLinuxNonfree];
|
||||
}
|
17
modules/nixos/locale/default.nix
Normal file
17
modules/nixos/locale/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
_: {
|
||||
i18n = {
|
||||
defaultLocale = "en_IN";
|
||||
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_IN";
|
||||
LC_IDENTIFICATION = "en_IN";
|
||||
LC_MEASUREMENT = "en_IN";
|
||||
LC_MONETARY = "en_IN";
|
||||
LC_NAME = "en_IN";
|
||||
LC_NUMERIC = "en_IN";
|
||||
LC_PAPER = "en_IN";
|
||||
LC_TELEPHONE = "en_IN";
|
||||
LC_TIME = "en_IN";
|
||||
};
|
||||
};
|
||||
}
|
32
modules/nixos/networking/default.nix
Normal file
32
modules/nixos/networking/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
networking.enable = lib.mkEnableOption "enable networking";
|
||||
};
|
||||
config = lib.mkIf config.networking.enable {
|
||||
networking = {
|
||||
hostName = "bridge";
|
||||
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
unmanaged = ["virbr0" "docker0"];
|
||||
};
|
||||
|
||||
nftables.enable = true;
|
||||
|
||||
firewall = {
|
||||
allowedTCPPorts = [80 443];
|
||||
trustedInterfaces = ["incusbr0" "virbr0"];
|
||||
};
|
||||
|
||||
extraHosts = ''
|
||||
185.199.108.133 raw.githubusercontent.com
|
||||
'';
|
||||
nameservers = ["1.1.1.1" "9.9.9.9"];
|
||||
bridges = {incusbr0.interfaces = [];};
|
||||
};
|
||||
};
|
||||
}
|
7
modules/nixos/packages/default.nix
Normal file
7
modules/nixos/packages/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
wget
|
||||
git
|
||||
];
|
||||
}
|
20
modules/nixos/sound/default.nix
Normal file
20
modules/nixos/sound/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
audio.enable = lib.mkEnableOption "enable sound";
|
||||
};
|
||||
config = lib.mkIf config.audio.enable {
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
12
modules/nixos/ssh/default.nix
Normal file
12
modules/nixos/ssh/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
ssh.enable = lib.mkEnableOption "enable ssh";
|
||||
};
|
||||
config = lib.mkIf config.ssh.enable {
|
||||
services.openssh.enable = true;
|
||||
};
|
||||
}
|
21
modules/nixos/virtualization/default.nix
Normal file
21
modules/nixos/virtualization/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
virtualization.enable = lib.mkEnableOption "enable virtualization";
|
||||
};
|
||||
config = lib.mkIf config.virtualization.enable {
|
||||
virtualisation = {
|
||||
docker.enable = true;
|
||||
incus.enable = true;
|
||||
libvirtd.enable = true;
|
||||
lxc = {
|
||||
enable = true;
|
||||
lxcfs.enable = true;
|
||||
};
|
||||
waydroid.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue