formatted the code with alejandra

This commit is contained in:
2024-03-03 02:11:14 +05:30
parent 0528e06873
commit ef89207879
34 changed files with 1035 additions and 976 deletions

View File

@ -16,26 +16,29 @@
nur.url = "github:nix-community/nur";
};
outputs = { self, nixpkgs, home-manager, ... } @ inputs:
let
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
];
username = "tux";
in
{
in {
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Custom packages and modifications, exported as overlays
overlays = import ./overlays { inherit inputs; };
overlays = import ./overlays {inherit inputs;};
# NixOS configuration entrypoint
# 'nixos-rebuild switch --flake .#your-hostname'
nixosConfigurations = {
canopus = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs username; };
specialArgs = {inherit inputs outputs username;};
modules = [
./hosts/canopus
@ -47,7 +50,7 @@
home-manager.nixosModules.home-manager
{
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs outputs username; };
home-manager.extraSpecialArgs = {inherit inputs outputs username;};
home-manager.users.${username} = {
imports = [
./modules/home-manager
@ -61,7 +64,7 @@
};
controller = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs username; };
specialArgs = {inherit inputs outputs username;};
modules = [
./hosts/controller
./modules/nixos/headscale.nix
@ -69,7 +72,7 @@
home-manager.nixosModules.home-manager
{
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs outputs username; };
home-manager.extraSpecialArgs = {inherit inputs outputs username;};
home-manager.users.${username} = {
imports = [
./modules/home-manager
@ -81,14 +84,14 @@
};
wsl = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs username; };
specialArgs = {inherit inputs outputs username;};
modules = [
./hosts/wsl
home-manager.nixosModules.home-manager
{
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs outputs username; };
home-manager.extraSpecialArgs = {inherit inputs outputs username;};
home-manager.users.${username} = {
imports = [
./modules/home-manager
@ -105,7 +108,7 @@
homeConfigurations = {
"${username}@canopus" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs username; };
extraSpecialArgs = {inherit inputs outputs username;};
modules = [
./modules/home-manager
];

View File

@ -1,4 +1,12 @@
{ inputs, outputs, lib, config, pkgs, username, ... }: {
{
inputs,
outputs,
lib,
config,
pkgs,
username,
...
}: {
imports = [
inputs.nixos-hardware.nixosModules.asus-zephyrus-ga503
./hardware-configuration.nix
@ -46,19 +54,25 @@
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [ 80 443 3000 6666 ];
allowedTCPPorts = [80 443 3000 6666 8081];
allowedTCPPortRanges = [
{ from = 1714; to = 1764; }
{
from = 1714;
to = 1764;
}
];
allowedUDPPortRanges = [
{ from = 1714; to = 1764; }
{
from = 1714;
to = 1764;
}
];
};
};
boot = {
kernelPackages = pkgs.linuxPackages_zen;
supportedFilesystems = [ "ntfs" ];
supportedFilesystems = ["ntfs"];
initrd.systemd.enable = true;
loader = {
@ -89,9 +103,9 @@
user = {
services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
wantedBy = ["graphical-session.target"];
wants = ["graphical-session.target"];
after = ["graphical-session.target"];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
@ -108,7 +122,7 @@
zsh.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [ thunar-archive-plugin thunar-volman ];
plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman];
};
nix-ld.enable = true;
nm-applet.enable = true;
@ -119,7 +133,7 @@
users.${username} = {
initialPassword = "${username}";
isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" "storage" ];
extraGroups = ["networkmanager" "wheel" "storage"];
openssh.authorizedKeys.keys = [
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL+OzPUe2ECPC929DqpkM39tl/vdNAXfsRnmrGfR+X3D 0xtux@pm.me''
];
@ -215,7 +229,7 @@
ollama.enable = true;
};
fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" ]; }) ];
fonts.packages = with pkgs; [(nerdfonts.override {fonts = ["FiraCode" "JetBrainsMono"];})];
system.stateVersion = "23.11";
}

View File

@ -1,15 +1,21 @@
# 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, ... }: {
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/e79e5cdf-4197-4f44-96c7-3ab9ba9878bb";
@ -21,7 +27,7 @@
fsType = "vfat";
};
swapDevices = [ ];
swapDevices = [];
# 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

View File

@ -1,6 +1,12 @@
{ config, outputs, lib, pkgs, inputs, username, ... }:
{
config,
outputs,
lib,
pkgs,
inputs,
username,
...
}: {
imports = [
./hardware-configuration.nix
];
@ -64,17 +70,17 @@
users.${username} = {
initialPassword = "${username}";
isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" "storage" ];
extraGroups = ["networkmanager" "wheel" "storage"];
openssh.authorizedKeys.keys = [
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL+OzPUe2ECPC929DqpkM39tl/vdNAXfsRnmrGfR+X3D 0xtux@pm.me''
];
};
};
environment.systemPackages = with pkgs;[
environment.systemPackages = with pkgs; [
];
fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" ]; }) ];
fonts.packages = with pkgs; [(nerdfonts.override {fonts = ["FiraCode" "JetBrainsMono"];})];
system.stateVersion = "23.11";
}

View File

@ -1,32 +1,33 @@
# 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 =
[
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
fileSystems."/" =
{
fileSystems."/" = {
device = "/dev/disk/by-uuid/b5a9a9f6-be72-4520-b2ac-439d0479a34b";
fsType = "ext4";
};
fileSystems."/efi" =
{
fileSystems."/efi" = {
device = "systemd-1";
fsType = "autofs";
};
swapDevices = [ ];
swapDevices = [];
# 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

View File

@ -1,6 +1,11 @@
{ config, lib, pkgs, inputs, username, ... }:
{
config,
lib,
pkgs,
inputs,
username,
...
}: {
imports = [
inputs.nixos-wsl.nixosModules.wsl
];
@ -32,16 +37,16 @@
users.${username} = {
initialPassword = "${username}";
isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" "storage" ];
extraGroups = ["networkmanager" "wheel" "storage"];
openssh.authorizedKeys.keys = [
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL+OzPUe2ECPC929DqpkM39tl/vdNAXfsRnmrGfR+X3D 0xtux@pm.me''
];
};
};
environment.systemPackages = with pkgs;[ ];
environment.systemPackages = with pkgs; [];
fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" ]; }) ];
fonts.packages = with pkgs; [(nerdfonts.override {fonts = ["FiraCode" "JetBrainsMono"];})];
system.stateVersion = "23.11";
}

View File

@ -1,4 +1,4 @@
{ ... }: {
{...}: {
programs.alacritty = {
enable = true;

View File

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
# services.barrier.client.enable = true;
home.packages = with pkgs; [

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.rbw = {
enable = true;
settings = {

View File

@ -1,4 +1,12 @@
{ inputs, outputs, lib, config, pkgs, username, ... }: {
{
inputs,
outputs,
lib,
config,
pkgs,
username,
...
}: {
imports = [
./picom
./shell

View File

@ -1,4 +1,9 @@
{ pkgs, inputs, username, ... }: {
{
pkgs,
inputs,
username,
...
}: {
programs.firefox = {
enable = true;

View File

@ -1,4 +1,4 @@
{ ... }: {
{...}: {
programs.git = {
enable = true;
userName = "0xTux";

View File

@ -1,5 +1,8 @@
{ lib, pkgs, ... }: {
{
lib,
pkgs,
...
}: {
programs = {
waybar = {
enable = true;
@ -9,8 +12,7 @@
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
settings =
let
settings = let
# Notify
notifycmd = "notify-send -h string:x-canonical-private-synchronous:hypr-cfg -u low";
@ -33,8 +35,7 @@
group_border_locked_active_col = "rgba(90ceaaff) rgba(ecd3a0ff) 45deg";
group_border_locked_inactive_col = "rgba(86aaeccc) rgba(93cee9cc) 45deg";
groupbar_text_color = "0xFFf1fcf9";
in
{
in {
#-- General
general = {
border_size = hypr_border_size;
@ -162,18 +163,15 @@
};
#-- Window Rules
windowrule = [ ];
windowrule = [];
#-- Keybindings
bind =
let
bind = let
terminal = "alacritty";
browser = "firefox";
filemanager = "thunar";
editor = "geany";
in
[
in [
# groups
"SUPER, G, togglegroup"
"SUPER, G, exec, ${notifycmd} 'Toggled Group Mode'"

View File

@ -1,4 +1,4 @@
{ ... }: {
{...}: {
services.kdeconnect = {
enable = true;
indicator = true;

View File

@ -1,5 +1,8 @@
{ inputs, pkgs, ... }: {
{
inputs,
pkgs,
...
}: {
# fix nvchad
# xdg.configFile."nvim" = {
# source = "${pkgs.nvchad}";

View File

@ -1,4 +1,8 @@
{ config, pkgs, ... }: {
{
config,
pkgs,
...
}: {
services.picom = {
enable = true;
package = pkgs.picom-next;
@ -8,7 +12,7 @@
fade = true;
fadeDelta = 10;
fadeSteps = [ 0.05 0.05 ];
fadeSteps = [0.05 0.05];
fadeExclude = [
"window_type *= 'menu'"
];

View File

@ -1,9 +1,7 @@
{ config, ... }: {
programs.rofi =
{
{config, ...}: {
programs.rofi = {
enable = true;
extraConfig =
{
extraConfig = {
terminal = "alacritty";
modes = "combi,keys";
@ -40,11 +38,9 @@
cycle = false;
fixed-num-lines = false;
};
theme =
let
theme = let
inherit (config.lib.formats.rasi) mkLiteral;
in
{
in {
"*" = {
font = "JetBrains Mono 11";

View File

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs = {
bat.enable = true;
zsh = {
@ -16,7 +16,7 @@
lazygit.enable = true;
zoxide = {
enable = true;
options = [ "--cmd cd" ];
options = ["--cmd cd"];
};
ripgrep.enable = true;
btop = {

View File

@ -1,4 +1,4 @@
{ ... }: {
{...}: {
programs.starship = {
enable = true;
settings = {

View File

@ -1,8 +1,7 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.tmux = {
enable = true;
plugins = with pkgs;[
plugins = with pkgs; [
{
plugin = tmuxPlugins.gruvbox;
extraConfig = "set -g @tmux-gruvbox 'dark'";
@ -42,5 +41,4 @@
";
};
}

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.vscode = {
enable = true;
package = pkgs.vscodium;
@ -39,7 +38,7 @@
"terminal.integrated.fontFamily" = "FiraCode NF, FiraCode Nerd Font , FiraCode";
};
extensions = with pkgs.vscode-extensions;[
extensions = with pkgs.vscode-extensions; [
wakatime.vscode-wakatime
ms-dotnettools.csharp
naumovs.color-highlight

View File

@ -1,5 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs = {
waybar = {
enable = true;
@ -41,10 +40,10 @@
"active-only" = false;
"on-click" = "activate";
"persistent-workspaces" = {
"1" = [ ];
"2" = [ ];
"3" = [ ];
"4" = [ ];
"1" = [];
"2" = [];
"3" = [];
"4" = [];
};
};
@ -69,7 +68,7 @@
"format-charging" = " {capacity}%";
"format-plugged" = " {capacity}%";
"format-alt" = "{time} {icon}";
"format-icons" = [ "󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ];
"format-icons" = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
};
"bluetooth" = {
@ -78,7 +77,7 @@
"format-connected" = " {num_connections}";
"format-connected-battery" = "{icon} {num_connections}";
# "format-connected-battery"= "{icon} {device_alias}-{device_battery_percentage}%";
"format-icons" = [ "󰥇" "󰤾" "󰤿" "󰥀" "󰥁" "󰥂" "󰥃" "󰥄" "󰥅" "󰥆" "󰥈" ];
"format-icons" = ["󰥇" "󰤾" "󰤿" "󰥀" "󰥁" "󰥂" "󰥃" "󰥄" "󰥅" "󰥆" "󰥈"];
# "format-device-preference"= [ "device1"; "device2" ]; // preference list deciding the displayed device If this config option is not defined or none of the devices in the list are connected; it will fall back to showing the last connected device.
"tooltip-format" = "{controller_alias}\n{num_connections} connected";
"tooltip-format-connected" = "{controller_alias}\n{num_connections} connected\n\n{device_enumerate}";
@ -107,7 +106,7 @@
"interval" = 10;
"format" = "󰍛 {usage}%";
"format-alt" = "{icon0}{icon1}{icon2}{icon3}";
"format-icons" = [ "" "" "" "" "" "" "" "" ];
"format-icons" = ["" "" "" "" "" "" "" ""];
};
"tray" = {
@ -156,11 +155,9 @@
"interval" = "once";
"tooltip" = false;
};
};
};
style =
let
style = let
bar_bg = "rgba(23, 28, 34, 0.95)";
main_bg = "#101419";
main_fg = "#93cee9";
@ -170,8 +167,7 @@
wb_hvr_bg = "#90ceaa";
wb_hvr_fg = "#1f2328";
in
''
in ''
* {
border: none;
border-radius: 0px;
@ -339,5 +335,4 @@
'';
};
};
}

View File

@ -1,4 +1,4 @@
{ ... }: {
{...}: {
programs.wezterm = {
enable = true;

View File

@ -1,4 +1,11 @@
{ inputs, outputs, lib, pkgs, username, ... }: {
{
inputs,
outputs,
lib,
pkgs,
username,
...
}: {
services = {
xserver = {
enable = true;
@ -34,7 +41,7 @@
programs.dconf.enable = true;
environment.systemPackages = with pkgs;[
environment.systemPackages = with pkgs; [
lua53Packages.lua
wezterm
acpi

View File

@ -1,3 +1,3 @@
{ ... }: {
{...}: {
programs.hyprland.enable = true;
}

View File

@ -1,5 +1,9 @@
{ config, lib, pkgs, ... }: {
{
config,
lib,
pkgs,
...
}: {
security = {
acme = {
defaults.email = "0xtux@pm.me";
@ -56,6 +60,6 @@
};
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
environment.systemPackages = with pkgs;[ headscale ];
networking.firewall.allowedTCPPorts = [80 443];
environment.systemPackages = with pkgs; [headscale];
}

View File

@ -1,4 +1,4 @@
{ ... }: {
{...}: {
programs.steam = {
enable = true;
};

View File

@ -1,7 +1,7 @@
{ username, ... }: {
{username, ...}: {
virtualisation = {
docker.enable = true;
};
users.users.${username}.extraGroups = [ "docker" ];
users.users.${username}.extraGroups = ["docker"];
}

View File

@ -1,9 +1,13 @@
{ pkgs, username, ... }: {
{
pkgs,
username,
...
}: {
virtualisation = {
libvirtd.enable = true;
};
users.users.${username}.extraGroups = [ "libvirtd" ];
users.users.${username}.extraGroups = ["libvirtd"];
environment.systemPackages = with pkgs; [
virt-manager

View File

@ -1,4 +1,4 @@
{ ... }: {
{...}: {
virtualisation = {
waydroid.enable = true;
};

View File

@ -1,5 +1,5 @@
{ inputs, ... }: {
additions = final: _prev: import ../pkgs { pkgs = final; };
{inputs, ...}: {
additions = final: _prev: import ../pkgs {pkgs = final;};
modifications = final: prev: {
#vscode = prev.vscode.overrideAttrs (oldAttrs: rec {
@ -11,7 +11,7 @@
# buildInputs = oldAttrs.buildInputs;
#});
awesome = inputs.nixpkgs-f2k.packages.${prev.system}.awesome-git.override { lua = prev.lua53Packages.lua; };
awesome = inputs.nixpkgs-f2k.packages.${prev.system}.awesome-git.override {lua = prev.lua53Packages.lua;};
};
# When applied, the unstable nixpkgs set (declared in the flake inputs) will

View File

@ -1,9 +1,11 @@
{ lib, stdenv, pkgs }:
let
{
lib,
stdenv,
pkgs,
}: let
user = ./user;
in
stdenv.mkDerivation {
stdenv.mkDerivation {
pname = "astronvim";
version = "3.44.1";
@ -27,4 +29,4 @@ stdenv.mkDerivation {
platforms = platforms.all;
license = licenses.gpl3;
};
}
}

View File

@ -1,4 +1,4 @@
{ pkgs, ... }: {
nvchad = pkgs.callPackage ./nvchad { };
astronvim = pkgs.callPackage ./astronvim { };
{pkgs, ...}: {
nvchad = pkgs.callPackage ./nvchad {};
astronvim = pkgs.callPackage ./astronvim {};
}

View File

@ -1,9 +1,11 @@
{ stdenv, lib, fetchFromGitHub }:
let
{
stdenv,
lib,
fetchFromGitHub,
}: let
custom = ./custom;
in
stdenv.mkDerivation {
stdenv.mkDerivation {
pname = "nvchad";
version = "2.0.0";
@ -27,4 +29,4 @@ stdenv.mkDerivation {
platforms = platforms.all;
license = licenses.gpl3;
};
}
}