This commit is contained in:
2025-08-29 15:25:40 +02:00
parent 26440bfeee
commit f3821f0dfa
201 changed files with 2461 additions and 1546 deletions

View File

@@ -1,23 +1,37 @@
{ {
description = "cnix nix"; description = "cnix nix";
outputs = inputs: outputs =
inputs.flake-parts.lib.mkFlake {inherit inputs;} { inputs:
systems = ["x86_64-linux" "aarch64-linux"]; inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
];
imports = [ imports = [
./users ./users
./hosts ./hosts
./modules ./modules
./pkgs
./fmt-hooks.nix ./fmt-hooks.nix
]; ];
perSystem = {pkgs, ...}: { perSystem =
devShells = import ./nix/shell { { config, pkgs, ... }:
inherit pkgs inputs; {
devShells.default = pkgs.mkShell {
packages = [
pkgs.git
config.packages.repl
];
name = "dots";
env.DIRENV_LOG_FORMAT = "";
shellHook = ''
${config.pre-commit.installationScript}
'';
};
}; };
formatter = pkgs.alejandra;
};
}; };
inputs = { inputs = {

View File

@@ -1,4 +1,5 @@
{inputs, ...}: { { inputs, ... }:
{
imports = [ imports = [
inputs.git-hooks.flakeModule inputs.git-hooks.flakeModule
inputs.treefmt-nix.flakeModule inputs.treefmt-nix.flakeModule
@@ -6,7 +7,7 @@
perSystem = { perSystem = {
pre-commit.settings = { pre-commit.settings = {
excludes = ["flake.lock"]; excludes = [ "flake.lock" ];
hooks.treefmt.enable = true; hooks.treefmt.enable = true;
}; };

View File

@@ -3,9 +3,11 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in { in
{
users.users.cnst = { users.users.cnst = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.fish; shell = pkgs.fish;

View File

@@ -6,8 +6,9 @@
lib, lib,
modulesPath, modulesPath,
... ...
}: { }:
imports = [(modulesPath + "/installer/scan/not-detected.nix")]; {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = { boot = {
initrd = { initrd = {
availableKernelModules = [ availableKernelModules = [
@@ -18,11 +19,11 @@
"usb_storage" "usb_storage"
"sd_mod" "sd_mod"
]; ];
kernelModules = ["amdgpu"]; kernelModules = [ "amdgpu" ];
}; };
kernelModules = ["kvm-amd"]; kernelModules = [ "kvm-amd" ];
extraModulePackages = []; extraModulePackages = [ ];
}; };
fileSystems."/" = { fileSystems."/" = {
@@ -30,12 +31,16 @@
fsType = "ext4"; fsType = "ext4";
}; };
boot.initrd.luks.devices."luks-e75ac560-748f-4071-bbe7-479678400be3".device = "/dev/disk/by-uuid/e75ac560-748f-4071-bbe7-479678400be3"; boot.initrd.luks.devices."luks-e75ac560-748f-4071-bbe7-479678400be3".device =
"/dev/disk/by-uuid/e75ac560-748f-4071-bbe7-479678400be3";
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/7E84-D168"; device = "/dev/disk/by-uuid/7E84-D168";
fsType = "vfat"; fsType = "vfat";
options = ["fmask=0022" "dmask=0022"]; options = [
"fmask=0022"
"dmask=0022"
];
}; };
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View File

@@ -3,7 +3,7 @@
boot = { boot = {
kernel = { kernel = {
variant = "latest"; variant = "latest";
hardware = ["amd"]; hardware = [ "amd" ];
}; };
loader = { loader = {
default = { default = {
@@ -20,7 +20,7 @@
}; };
graphics = { graphics = {
enable = true; enable = true;
vendors = ["amd"]; vendors = [ "amd" ];
}; };
logitech = { logitech = {
enable = false; enable = false;
@@ -29,7 +29,11 @@
enable = true; enable = true;
interfaces = { interfaces = {
"wlp6s0" = { "wlp6s0" = {
allowedTCPPorts = [22 80 443]; allowedTCPPorts = [
22
80
443
];
}; };
}; };
}; };

View File

@@ -4,97 +4,112 @@
homeImports, homeImports,
self, self,
... ...
}: { }:
flake.nixosConfigurations = let {
# custom paths flake.nixosConfigurations =
userConfig = "${self}/home"; let
systemConfig = "${self}/system"; # custom paths
hostConfig = "${self}/hosts"; userConfig = "${self}/home";
systemConfig = "${self}/system";
hostConfig = "${self}/hosts";
cnstConfig = "${self}/users/cnst"; cnstConfig = "${self}/users/cnst";
toothpickConfig = "${self}/users/toothpick"; toothpickConfig = "${self}/users/toothpick";
umodPath = "${self}/modules/home"; umodPath = "${self}/modules/home";
smodPath = "${self}/modules/system"; smodPath = "${self}/modules/system";
# shorten paths # shorten paths
inherit (inputs.nixpkgs.lib) nixosSystem; inherit (inputs.nixpkgs.lib) nixosSystem;
# get these into the module system # get these into the module system
specialArgs = {inherit inputs self userConfig systemConfig hostConfig cnstConfig toothpickConfig umodPath smodPath;}; specialArgs = {
in { inherit
kima = nixosSystem { inputs
inherit specialArgs; self
modules = [ userConfig
./kima systemConfig
"${self}/nix" hostConfig
{ cnstConfig
home-manager = { toothpickConfig
users.cnst.imports = homeImports."cnst@kima"; umodPath
extraSpecialArgs = specialArgs; smodPath
}; ;
} };
self.nixosModules.nixos in
self.nixosModules.settings {
inputs.chaotic.nixosModules.default kima = nixosSystem {
inputs.agenix.nixosModules.default inherit specialArgs;
]; modules = [
./kima
"${self}/nix"
{
home-manager = {
users.cnst.imports = homeImports."cnst@kima";
extraSpecialArgs = specialArgs;
};
}
self.nixosModules.nixos
self.nixosModules.settings
inputs.chaotic.nixosModules.default
inputs.agenix.nixosModules.default
];
};
bunk = nixosSystem {
inherit specialArgs;
modules = [
./bunk
"${self}/nix"
{
home-manager = {
users.cnst.imports = homeImports."cnst@bunk";
extraSpecialArgs = specialArgs;
};
}
self.nixosModules.nixos
self.nixosModules.settings
inputs.chaotic.nixosModules.default
inputs.agenix.nixosModules.default
];
};
sobotka = nixosSystem {
inherit specialArgs;
modules = [
./sobotka
"${self}/nix"
self.nixosModules.nixos
self.nixosModules.settings
self.nixosModules.server
inputs.agenix.nixosModules.default
];
};
ziggy = nixosSystem {
inherit specialArgs;
modules = [
./ziggy
"${self}/nix"
self.nixosModules.nixos
self.nixosModules.settings
self.nixosModules.server
inputs.agenix.nixosModules.default
];
};
toothpc = nixosSystem {
inherit specialArgs;
modules = [
./toothpc
"${self}/nix"
{
home-manager = {
users.toothpick.imports = homeImports."toothpick@toothpc";
extraSpecialArgs = specialArgs;
};
}
self.nixosModules.nixos
self.nixosModules.settings
inputs.chaotic.nixosModules.default
inputs.agenix.nixosModules.default
];
};
}; };
bunk = nixosSystem {
inherit specialArgs;
modules = [
./bunk
"${self}/nix"
{
home-manager = {
users.cnst.imports = homeImports."cnst@bunk";
extraSpecialArgs = specialArgs;
};
}
self.nixosModules.nixos
self.nixosModules.settings
inputs.chaotic.nixosModules.default
inputs.agenix.nixosModules.default
];
};
sobotka = nixosSystem {
inherit specialArgs;
modules = [
./sobotka
"${self}/nix"
self.nixosModules.nixos
self.nixosModules.settings
self.nixosModules.server
inputs.agenix.nixosModules.default
];
};
ziggy = nixosSystem {
inherit specialArgs;
modules = [
./ziggy
"${self}/nix"
self.nixosModules.nixos
self.nixosModules.settings
self.nixosModules.server
inputs.agenix.nixosModules.default
];
};
toothpc = nixosSystem {
inherit specialArgs;
modules = [
./toothpc
"${self}/nix"
{
home-manager = {
users.toothpick.imports = homeImports."toothpick@toothpc";
extraSpecialArgs = specialArgs;
};
}
self.nixosModules.nixos
self.nixosModules.settings
inputs.chaotic.nixosModules.default
inputs.agenix.nixosModules.default
];
};
};
} }

View File

@@ -3,9 +3,11 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in { in
{
users.users.cnst = { users.users.cnst = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.fish; shell = pkgs.fish;

View File

@@ -7,20 +7,31 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; boot.initrd.availableKernelModules = [
boot.initrd.kernelModules = ["amdgpu"]; "nvme"
boot.kernelModules = ["kvm-amd" "i2c-dev"]; "xhci_pci"
boot.extraModulePackages = []; "ahci"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [
"kvm-amd"
"i2c-dev"
];
boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/90eafb57-0f89-4c2a-b417-4e0f2fba5f47"; device = "/dev/disk/by-uuid/90eafb57-0f89-4c2a-b417-4e0f2fba5f47";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=root"]; options = [ "subvol=root" ];
}; };
boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/36144799-13f2-4166-9bfe-b29c3df435ab"; boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/36144799-13f2-4166-9bfe-b29c3df435ab";
@@ -28,35 +39,38 @@
fileSystems."/home" = { fileSystems."/home" = {
device = "/dev/disk/by-uuid/90eafb57-0f89-4c2a-b417-4e0f2fba5f47"; device = "/dev/disk/by-uuid/90eafb57-0f89-4c2a-b417-4e0f2fba5f47";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=home"]; options = [ "subvol=home" ];
}; };
fileSystems."/nix" = { fileSystems."/nix" = {
device = "/dev/disk/by-uuid/90eafb57-0f89-4c2a-b417-4e0f2fba5f47"; device = "/dev/disk/by-uuid/90eafb57-0f89-4c2a-b417-4e0f2fba5f47";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=nix"]; options = [ "subvol=nix" ];
}; };
fileSystems."/persist" = { fileSystems."/persist" = {
device = "/dev/disk/by-uuid/90eafb57-0f89-4c2a-b417-4e0f2fba5f47"; device = "/dev/disk/by-uuid/90eafb57-0f89-4c2a-b417-4e0f2fba5f47";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=persist"]; options = [ "subvol=persist" ];
}; };
fileSystems."/var/log" = { fileSystems."/var/log" = {
device = "/dev/disk/by-uuid/90eafb57-0f89-4c2a-b417-4e0f2fba5f47"; device = "/dev/disk/by-uuid/90eafb57-0f89-4c2a-b417-4e0f2fba5f47";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=log"]; options = [ "subvol=log" ];
neededForBoot = true; neededForBoot = true;
}; };
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/1D4A-3121"; device = "/dev/disk/by-uuid/1D4A-3121";
fsType = "vfat"; fsType = "vfat";
options = ["fmask=0022" "dmask=0022"]; options = [
"fmask=0022"
"dmask=0022"
];
}; };
swapDevices = [{device = "/dev/disk/by-uuid/91e16a5f-6a1c-4c7d-aa61-5823068fdaf0";}]; swapDevices = [ { device = "/dev/disk/by-uuid/91e16a5f-6a1c-4c7d-aa61-5823068fdaf0"; } ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -3,8 +3,8 @@
boot = { boot = {
kernel = { kernel = {
variant = "latest"; variant = "latest";
hardware = ["amd"]; hardware = [ "amd" ];
extraKernelParams = ["amdgpu.dcdebugmask=0x10"]; extraKernelParams = [ "amdgpu.dcdebugmask=0x10" ];
}; };
loader = { loader = {
default = { default = {
@@ -21,7 +21,7 @@
}; };
graphics = { graphics = {
enable = true; enable = true;
vendors = ["amd"]; vendors = [ "amd" ];
}; };
logitech = { logitech = {
enable = true; enable = true;
@@ -30,7 +30,11 @@
enable = true; enable = true;
interfaces = { interfaces = {
"eno1" = { "eno1" = {
allowedTCPPorts = [22 80 443]; allowedTCPPorts = [
22
80
443
];
}; };
}; };
}; };

View File

@@ -3,9 +3,11 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in { in
{
users.users.cnst = { users.users.cnst = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.fish; shell = pkgs.fish;
@@ -49,7 +51,8 @@ in {
./server.nix ./server.nix
]; ];
boot.initrd.luks.devices."luks-47b35d4b-467a-4637-a5f9-45177da62897".device = "/dev/disk/by-uuid/47b35d4b-467a-4637-a5f9-45177da62897"; boot.initrd.luks.devices."luks-47b35d4b-467a-4637-a5f9-45177da62897".device =
"/dev/disk/by-uuid/47b35d4b-467a-4637-a5f9-45177da62897";
networking = { networking = {
hostName = "sobotka"; hostName = "sobotka";

View File

@@ -7,31 +7,43 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = [
boot.initrd.kernelModules = ["amdgpu"]; "nvme"
boot.kernelModules = []; "xhci_pci"
boot.extraModulePackages = []; "ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/a0a3595f-e61c-475c-8f4e-bfbb05582c20"; device = "/dev/disk/by-uuid/a0a3595f-e61c-475c-8f4e-bfbb05582c20";
fsType = "ext4"; fsType = "ext4";
}; };
boot.initrd.luks.devices."luks-4f289fde-55ed-4b05-a6ee-d396db2a887b".device = "/dev/disk/by-uuid/4f289fde-55ed-4b05-a6ee-d396db2a887b"; boot.initrd.luks.devices."luks-4f289fde-55ed-4b05-a6ee-d396db2a887b".device =
"/dev/disk/by-uuid/4f289fde-55ed-4b05-a6ee-d396db2a887b";
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/E03E-5458"; device = "/dev/disk/by-uuid/E03E-5458";
fsType = "vfat"; fsType = "vfat";
options = ["fmask=0077" "dmask=0077"]; options = [
"fmask=0077"
"dmask=0077"
];
}; };
swapDevices = [ swapDevices = [
{device = "/dev/disk/by-uuid/704e09db-c7dd-462b-9560-47bbf845905d";} { device = "/dev/disk/by-uuid/704e09db-c7dd-462b-9560-47bbf845905d"; }
]; ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View File

@@ -3,8 +3,8 @@
boot = { boot = {
kernel = { kernel = {
variant = "latest"; variant = "latest";
hardware = ["amd"]; hardware = [ "amd" ];
extraKernelParams = []; extraKernelParams = [ ];
}; };
loader = { loader = {
default = { default = {
@@ -21,7 +21,10 @@
}; };
graphics = { graphics = {
enable = true; enable = true;
vendors = ["intel" "amd"]; vendors = [
"intel"
"amd"
];
}; };
logitech = { logitech = {
enable = false; enable = false;
@@ -30,8 +33,16 @@
enable = true; enable = true;
interfaces = { interfaces = {
"enp6s0" = { "enp6s0" = {
allowedTCPPorts = [22 80 443 8090]; allowedTCPPorts = [
allowedUDPPorts = [58846 6881]; 22
80
443
8090
];
allowedUDPPorts = [
58846
6881
];
}; };
}; };
}; };

View File

@@ -1,4 +1,5 @@
{config, ...}: { { config, ... }:
{
server = { server = {
enable = true; enable = true;
email = "adam@cnst.dev"; email = "adam@cnst.dev";

View File

@@ -3,9 +3,11 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in { in
{
users.users.toothpick = { users.users.toothpick = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.zsh; shell = pkgs.zsh;

View File

@@ -7,8 +7,9 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
imports = [(modulesPath + "/installer/scan/not-detected.nix")]; {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = { boot = {
initrd = { initrd = {
@@ -20,14 +21,14 @@
"usb_storage" "usb_storage"
"sd_mod" "sd_mod"
]; ];
kernelModules = []; kernelModules = [ ];
}; };
kernelModules = []; kernelModules = [ ];
kernelParams = [ kernelParams = [
"intel_pstate=active" "intel_pstate=active"
"nvidia_drm.modeset=1" "nvidia_drm.modeset=1"
]; ];
extraModulePackages = []; extraModulePackages = [ ];
}; };
fileSystems."/" = { fileSystems."/" = {
@@ -35,15 +36,19 @@
fsType = "ext4"; fsType = "ext4";
}; };
boot.initrd.luks.devices."luks-81dcb5e4-7adb-44ee-99df-69e366f8b735".device = "/dev/disk/by-uuid/81dcb5e4-7adb-44ee-99df-69e366f8b735"; boot.initrd.luks.devices."luks-81dcb5e4-7adb-44ee-99df-69e366f8b735".device =
"/dev/disk/by-uuid/81dcb5e4-7adb-44ee-99df-69e366f8b735";
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/CA19-5F2A"; device = "/dev/disk/by-uuid/CA19-5F2A";
fsType = "vfat"; fsType = "vfat";
options = ["fmask=0022" "dmask=0022"]; options = [
"fmask=0022"
"dmask=0022"
];
}; };
swapDevices = []; swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -3,7 +3,7 @@
boot = { boot = {
kernel = { kernel = {
variant = "latest"; variant = "latest";
hardware = ["nvidia"]; hardware = [ "nvidia" ];
}; };
loader = { loader = {
default = { default = {
@@ -20,7 +20,7 @@
}; };
graphics = { graphics = {
enable = true; enable = true;
vendors = ["nvidia"]; vendors = [ "nvidia" ];
nvidia = { nvidia = {
package = "latest"; package = "latest";
open = true; open = true;
@@ -33,7 +33,11 @@
enable = true; enable = true;
interfaces = { interfaces = {
"enp4s0" = { "enp4s0" = {
allowedTCPPorts = [22 80 443]; allowedTCPPorts = [
22
80
443
];
}; };
}; };
}; };
@@ -189,7 +193,7 @@
enable = true; enable = true;
}; };
xserver = { xserver = {
videoDrivers = ["nvidia"]; videoDrivers = [ "nvidia" ];
xkbLayout = "se"; xkbLayout = "se";
}; };
zram = { zram = {

View File

@@ -3,9 +3,11 @@
config, config,
pkgs, pkgs,
... ...
}: let }:
let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in { in
{
users.users.cnst = { users.users.cnst = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.fish; shell = pkgs.fish;

View File

@@ -7,22 +7,23 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["usbhid"]; boot.initrd.availableKernelModules = [ "usbhid" ];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [ ];
boot.kernelModules = []; boot.kernelModules = [ ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = [{device = "/swapfile";}]; swapDevices = [ { device = "/swapfile"; } ];
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
} }

View File

@@ -3,8 +3,8 @@
boot = { boot = {
kernel = { kernel = {
variant = "latest"; variant = "latest";
hardware = []; hardware = [ ];
extraKernelParams = []; extraKernelParams = [ ];
}; };
loader = { loader = {
default = { default = {
@@ -21,7 +21,7 @@
}; };
graphics = { graphics = {
enable = false; enable = false;
vendors = []; vendors = [ ];
}; };
logitech = { logitech = {
enable = false; enable = false;
@@ -30,8 +30,16 @@
enable = true; enable = true;
interfaces = { interfaces = {
"enu1u1" = { "enu1u1" = {
allowedTCPPorts = [22 80 443 8090]; allowedTCPPorts = [
allowedUDPPorts = [58846 6881]; 22
80
443
8090
];
allowedUDPPorts = [
58846
6881
];
}; };
}; };
}; };

View File

@@ -1,4 +1,5 @@
{config, ...}: { { config, ... }:
{
server = { server = {
enable = true; enable = true;
email = "adam@cnst.dev"; email = "adam@cnst.dev";

58
lib/repl/default.nix Normal file
View File

@@ -0,0 +1,58 @@
# yanked from @fufexan
{
flakePath ? null,
hostnamePath ? "/etc/hostname",
registryPath ? /etc/nix/registry.json,
}:
let
inherit (builtins)
getFlake
head
match
currentSystem
readFile
pathExists
filter
fromJSON
;
selfFlake =
if pathExists registryPath then
filter (it: it.from.id == "self") (fromJSON (readFile registryPath)).flakes
else
[ ];
flakePath' = toString (
if flakePath != null then
flakePath
else if selfFlake != [ ] then
(head selfFlake).to.path
else
"/etc/nixos"
);
flake = if pathExists flakePath' then getFlake flakePath' else { };
hostname =
if pathExists hostnamePath then head (match "([a-zA-Z0-9\\-]+)\n" (readFile hostnamePath)) else "";
nixpkgsFromInputsPath = flake.inputs.nixpkgs.outPath or "";
nixpkgs =
flake.pkgs.${currentSystem}.nixpkgs
or (if nixpkgsFromInputsPath != "" then import nixpkgsFromInputsPath { } else { });
nixpkgsOutput = removeAttrs (nixpkgs // nixpkgs.lib or { }) [
"options"
"config"
];
in
{
inherit flake;
}
// flake
// builtins
// (flake.nixosConfigurations or { })
// flake.nixosConfigurations.${hostname} or { }
// nixpkgsOutput
// {
getFlake = path: getFlake (toString path);
}

View File

@@ -4,10 +4,12 @@
osConfig, osConfig,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.aerc; cfg = config.home.programs.aerc;
in { in
{
options = { options = {
home.programs.aerc.enable = mkEnableOption "Enables aerc"; home.programs.aerc.enable = mkEnableOption "Enables aerc";
}; };

View File

@@ -4,11 +4,13 @@
pkgs, pkgs,
inputs, inputs,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.ags; cfg = config.home.programs.ags;
in { in
imports = [inputs.ags.homeManagerModules.default]; {
imports = [ inputs.ags.homeManagerModules.default ];
options = { options = {
home.programs.ags.enable = mkEnableOption "Enables ags"; home.programs.ags.enable = mkEnableOption "Enables ags";
}; };

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.alacritty; cfg = config.home.programs.alacritty;
in { in
{
options = { options = {
home.programs.alacritty.enable = mkEnableOption "Enables firefox"; home.programs.alacritty.enable = mkEnableOption "Enables firefox";
}; };

View File

@@ -3,10 +3,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.anyrun; cfg = config.home.programs.anyrun;
in { in
{
imports = [ imports = [
inputs.anyrun.homeManagerModules.default inputs.anyrun.homeManagerModules.default
]; ];

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.bash; cfg = config.home.programs.bash;
in { in
{
options = { options = {
home.programs.bash.enable = mkEnableOption "Enables bash"; home.programs.bash.enable = mkEnableOption "Enables bash";
}; };

View File

@@ -3,10 +3,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.chromium; cfg = config.home.programs.chromium;
in { in
{
options = { options = {
home.programs.chromium.enable = mkEnableOption "Enables chromium"; home.programs.chromium.enable = mkEnableOption "Enables chromium";
}; };

View File

@@ -3,8 +3,14 @@
config, config,
lib, lib,
... ...
}: let }:
inherit (lib) mkIf mkOption mkEnableOption types; let
inherit (lib)
mkIf
mkOption
mkEnableOption
types
;
# Workaround for https://github.com/GooseMod/OpenAsar/issues/202 # Workaround for https://github.com/GooseMod/OpenAsar/issues/202
# Needlessly complicated, but it's dynamic! :D # Needlessly complicated, but it's dynamic! :D
variantMapping = { variantMapping = {
@@ -18,24 +24,32 @@
}; };
canary = { canary = {
dir = "discordcanary"; dir = "discordcanary";
package = pkgs.discord-canary.override {withOpenASAR = true;}; package = pkgs.discord-canary.override { withOpenASAR = true; };
}; };
vesktop = { vesktop = {
dir = "vesktop"; dir = "vesktop";
package = pkgs.vesktop; package = pkgs.vesktop;
}; };
}; };
getVariantConfig = variant: getVariantConfig =
if builtins.hasAttr variant variantMapping variant:
then variantMapping.${variant} if builtins.hasAttr variant variantMapping then
else throw "Unknown package variant: ${variant}"; variantMapping.${variant}
else
throw "Unknown package variant: ${variant}";
cfg = config.home.programs.discord; cfg = config.home.programs.discord;
in { in
{
options = { options = {
home.programs.discord = { home.programs.discord = {
enable = mkEnableOption "Enables discord"; enable = mkEnableOption "Enables discord";
variant = mkOption { variant = mkOption {
type = types.enum ["stable" "ptb" "canary" "vesktop"]; type = types.enum [
"stable"
"ptb"
"canary"
"vesktop"
];
default = "stable"; default = "stable";
description = "Preferred package version to use"; description = "Preferred package version to use";
}; };
@@ -44,13 +58,11 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
home = { home = {
sessionVariables.DISCORD_USER_DATA_DIR = "$HOME/.config/${(getVariantConfig cfg.variant).dir}"; sessionVariables.DISCORD_USER_DATA_DIR = "$HOME/.config/${(getVariantConfig cfg.variant).dir}";
packages = [(getVariantConfig cfg.variant).package]; packages = [ (getVariantConfig cfg.variant).package ];
}; };
xdg.configFile = mkIf (cfg.variant == "vesktop") { xdg.configFile = mkIf (cfg.variant == "vesktop") {
"vesktop/themes/base16.css".text = "vesktop/themes/base16.css".text =
/* # css
css
*/
'' ''
/** /**
* @name Material Gruvbox * @name Material Gruvbox

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.eza; cfg = config.home.programs.eza;
in { in
{
options = { options = {
home.programs.eza.enable = mkEnableOption "Enables eza"; home.programs.eza.enable = mkEnableOption "Enables eza";
}; };

View File

@@ -4,10 +4,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.firefox; cfg = config.home.programs.firefox;
in { in
{
imports = [ imports = [
# inputs.nur.hmModules.nur # inputs.nur.hmModules.nur
]; ];
@@ -24,9 +26,12 @@ in {
force = true; force = true;
default = "ddg"; default = "ddg";
privateDefault = "ddg"; privateDefault = "ddg";
order = ["ddg" "google"]; order = [
"ddg"
"google"
];
}; };
bookmarks = {}; bookmarks = { };
# extensions = with config.nur.repos.rycee.firefox-addons; [ # extensions = with config.nur.repos.rycee.firefox-addons; [
# ublock-origin # ublock-origin
# sponsorblock # sponsorblock

View File

@@ -3,12 +3,14 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (pkgs) eza bat; inherit (pkgs) eza bat;
cfg = config.home.programs.fish; cfg = config.home.programs.fish;
in { in
{
options = { options = {
home.programs.fish.enable = mkEnableOption "Enables fish home configuration"; home.programs.fish.enable = mkEnableOption "Enables fish home configuration";
}; };
@@ -59,17 +61,13 @@ in {
up-or-search = lib.readFile ./up-or-search.fish; up-or-search = lib.readFile ./up-or-search.fish;
# Check stuff in PATH # Check stuff in PATH
nix-inspect = nix-inspect =
/* # fish
fish
*/
'' ''
set -s PATH | grep "PATH\[.*/nix/store" | cut -d '|' -f2 | grep -v -e "-man" -e "-terminfo" | perl -pe 's:^/nix/store/\w{32}-([^/]*)/bin$:\1:' | sort | uniq set -s PATH | grep "PATH\[.*/nix/store" | cut -d '|' -f2 | grep -v -e "-man" -e "-terminfo" | perl -pe 's:^/nix/store/\w{32}-([^/]*)/bin$:\1:' | sort | uniq
''; '';
}; };
interactiveShellInit = interactiveShellInit =
/* # fish
fish
*/
'' ''
# Open command buffer in vim when alt+e is pressed # Open command buffer in vim when alt+e is pressed
bind \ee edit_command_buffer bind \ee edit_command_buffer

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.floorp; cfg = config.home.programs.floorp;
in { in
{
options = { options = {
home.programs.floorp.enable = mkEnableOption "Enables floorp browser"; home.programs.floorp.enable = mkEnableOption "Enables floorp browser";
}; };

View File

@@ -3,10 +3,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.foot; cfg = config.home.programs.foot;
in { in
{
options = { options = {
home.programs.foot.enable = mkEnableOption "Enables foot programs"; home.programs.foot.enable = mkEnableOption "Enables foot programs";
}; };

View File

@@ -4,11 +4,13 @@
pkgs, pkgs,
osConfig, osConfig,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption mkMerge; inherit (lib) mkIf mkEnableOption mkMerge;
cfg = config.home.programs.fuzzel; cfg = config.home.programs.fuzzel;
host = osConfig.networking.hostName; host = osConfig.networking.hostName;
in { in
{
options = { options = {
home.programs.fuzzel.enable = mkEnableOption "Enables fuzzel"; home.programs.fuzzel.enable = mkEnableOption "Enables fuzzel";
}; };

View File

@@ -4,11 +4,18 @@
osConfig, osConfig,
pkgs, pkgs,
... ...
}: let }:
inherit (lib) mkIf mkEnableOption mkMerge getExe; let
inherit (lib)
mkIf
mkEnableOption
mkMerge
getExe
;
cfg = config.home.programs.ghostty; cfg = config.home.programs.ghostty;
host = osConfig.networking.hostName; host = osConfig.networking.hostName;
in { in
{
options = { options = {
home.programs.ghostty.enable = mkEnableOption "Enables ghostty"; home.programs.ghostty.enable = mkEnableOption "Enables ghostty";
}; };

View File

@@ -4,15 +4,17 @@
lib, lib,
osConfig, osConfig,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.git; cfg = config.home.programs.git;
in { in
{
options = { options = {
home.programs.git.enable = mkEnableOption "Enables git"; home.programs.git.enable = mkEnableOption "Enables git";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = [pkgs.gh]; home.packages = [ pkgs.gh ];
programs.git = { programs.git = {
enable = true; enable = true;
userName = osConfig.settings.accounts.username; userName = osConfig.settings.accounts.username;
@@ -31,7 +33,8 @@ in {
}; };
gpg = { gpg = {
# format = lib.mkDefault "ssh"; # format = lib.mkDefault "ssh";
ssh.allowedSignersFile = config.home.homeDirectory + "/" + config.xdg.configFile."git/allowed_signers".target; ssh.allowedSignersFile =
config.home.homeDirectory + "/" + config.xdg.configFile."git/allowed_signers".target;
}; };
commit = { commit = {
verbose = true; verbose = true;

View File

@@ -4,10 +4,12 @@
lib, lib,
config, config,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.helix; cfg = config.home.programs.helix;
in { in
{
imports = [ imports = [
./languages.nix ./languages.nix
./gruvbox.nix ./gruvbox.nix
@@ -46,7 +48,12 @@ in {
display-messages = true; display-messages = true;
display-inlay-hints = true; display-inlay-hints = true;
}; };
gutters = ["diagnostics" "line-numbers" "spacer" "diff"]; gutters = [
"diagnostics"
"line-numbers"
"spacer"
"diff"
];
statusline = { statusline = {
separator = "/"; separator = "/";
left = [ left = [
@@ -57,7 +64,7 @@ in {
"spinner" "spinner"
"diagnostics" "diagnostics"
]; ];
center = ["file-name"]; center = [ "file-name" ];
right = [ right = [
"file-encoding" "file-encoding"
"file-line-ending" "file-line-ending"
@@ -78,62 +85,103 @@ in {
}; };
}; };
keys = let keys =
spaceMode = { let
space = "file_picker"; spaceMode = {
n = "global_search"; space = "file_picker";
f = ":format"; n = "global_search";
c = "toggle_comments"; f = ":format";
t = { c = "toggle_comments";
d = "goto_type_definition"; t = {
i = "goto_implementation"; d = "goto_type_definition";
r = "goto_reference"; i = "goto_implementation";
t = "goto_definition"; r = "goto_reference";
w = "trim_selections"; t = "goto_definition";
w = "trim_selections";
};
x = ":buffer-close";
w = ":w";
q = ":q";
y = "yank";
p = "paste_after";
P = "paste_before";
R = "replace_with_yanked";
}; };
x = ":buffer-close"; in
w = ":w"; {
q = ":q"; normal = {
y = "yank"; d = {
p = "paste_after"; d = [
P = "paste_before"; "extend_to_line_bounds"
R = "replace_with_yanked"; "yank_main_selection_to_clipboard"
}; "delete_selection"
in { ];
normal = { s = [ "surround_delete" ];
d = { };
d = ["extend_to_line_bounds" "yank_main_selection_to_clipboard" "delete_selection"]; x = "delete_selection";
s = ["surround_delete"]; y = {
y = [
"extend_to_line_bounds"
"yank_main_selection_to_clipboard"
"normal_mode"
"collapse_selection"
];
d = ":yank-diagnostic";
};
Y = [
"extend_to_line_end"
"yank_main_selection_to_clipboard"
"collapse_selection"
];
P = [
"paste_clipboard_before"
"collapse_selection"
];
p = [
"paste_clipboard_after"
"collapse_selection"
];
C-a = "select_all";
del = "delete_selection";
space = spaceMode;
}; };
x = "delete_selection"; insert = {
y = { C-v = "paste_clipboard_after";
y = ["extend_to_line_bounds" "yank_main_selection_to_clipboard" "normal_mode" "collapse_selection"]; C-c = "yank_to_clipboard";
d = ":yank-diagnostic"; C-x = "completion";
del = "delete_selection";
esc = [
"collapse_selection"
"normal_mode"
];
};
select = {
space = spaceMode;
d = [
"yank_main_selection_to_clipboard"
"delete_selection"
];
x = [
"yank_main_selection_to_clipboard"
"delete_selection"
];
y = [
"yank_main_selection_to_clipboard"
"normal_mode"
"flip_selections"
"collapse_selection"
];
Y = [
"extend_to_line_bounds"
"yank_main_selection_to_clipboard"
"goto_line_start"
"collapse_selection"
"normal_mode"
];
p = [ "replace_selections_with_clipboard" ];
P = [ "paste_clipboard_before" ];
}; };
Y = ["extend_to_line_end" "yank_main_selection_to_clipboard" "collapse_selection"];
P = ["paste_clipboard_before" "collapse_selection"];
p = ["paste_clipboard_after" "collapse_selection"];
C-a = "select_all";
del = "delete_selection";
space = spaceMode;
}; };
insert = {
C-v = "paste_clipboard_after";
C-c = "yank_to_clipboard";
C-x = "completion";
del = "delete_selection";
esc = ["collapse_selection" "normal_mode"];
};
select = {
space = spaceMode;
d = ["yank_main_selection_to_clipboard" "delete_selection"];
x = ["yank_main_selection_to_clipboard" "delete_selection"];
y = ["yank_main_selection_to_clipboard" "normal_mode" "flip_selections" "collapse_selection"];
Y = ["extend_to_line_bounds" "yank_main_selection_to_clipboard" "goto_line_start" "collapse_selection" "normal_mode"];
p = ["replace_selections_with_clipboard"];
P = ["paste_clipboard_before"];
};
};
}; };
}; };
}; };

View File

@@ -1,201 +1,225 @@
{ {
programs.helix.themes = { programs.helix.themes = {
gruvbox_custom = let gruvbox_custom =
bg0 = "#32302f"; let
bg1 = "#3c3836"; bg0 = "#32302f";
bg2 = "#3c3836"; bg1 = "#3c3836";
bg3 = "#504945"; bg2 = "#3c3836";
bg4 = "#504945"; bg3 = "#504945";
fg0 = "#d4be98"; bg4 = "#504945";
red = "#ea6962"; fg0 = "#d4be98";
orange = "#e78a4e"; red = "#ea6962";
yellow = "#d8a657"; orange = "#e78a4e";
bg_visual_yellow = "#574833"; yellow = "#d8a657";
green = "#a9b665"; bg_visual_yellow = "#574833";
aqua = "#89b482"; green = "#a9b665";
blue = "#7daea3"; aqua = "#89b482";
purple = "#d3869b"; blue = "#7daea3";
grey0 = "#7c6f64"; purple = "#d3869b";
grey2 = "#a89984"; grey0 = "#7c6f64";
in { grey2 = "#a89984";
"type" = yellow; in
"constant" = purple; {
"constant.numeric" = purple; "type" = yellow;
"constant.character.escape" = orange; "constant" = purple;
"string" = green; "constant.numeric" = purple;
"string.regexp" = blue; "constant.character.escape" = orange;
"comment" = grey0; "string" = green;
"variable" = fg0; "string.regexp" = blue;
"variable.builtin" = blue; "comment" = grey0;
"variable.parameter" = fg0; "variable" = fg0;
"variable.other.member" = fg0; "variable.builtin" = blue;
"label" = aqua; "variable.parameter" = fg0;
"punctuation" = grey2; "variable.other.member" = fg0;
"punctuation.delimiter" = grey2; "label" = aqua;
"punctuation.bracket" = fg0; "punctuation" = grey2;
"keyword" = red; "punctuation.delimiter" = grey2;
"keyword.directive" = aqua; "punctuation.bracket" = fg0;
"operator" = orange; "keyword" = red;
"function" = green; "keyword.directive" = aqua;
"function.builtin" = blue; "operator" = orange;
"function.macro" = aqua; "function" = green;
"tag" = yellow; "function.builtin" = blue;
"namespace" = aqua; "function.macro" = aqua;
"attribute" = aqua; "tag" = yellow;
"constructor" = yellow; "namespace" = aqua;
"module" = blue; "attribute" = aqua;
"special" = orange; "constructor" = yellow;
"markup.heading.marker" = grey2; "module" = blue;
"markup.heading.1" = { "special" = orange;
fg = red; "markup.heading.marker" = grey2;
modifiers = ["bold"]; "markup.heading.1" = {
}; fg = red;
"markup.heading.2" = { modifiers = [ "bold" ];
fg = orange; };
modifiers = ["bold"]; "markup.heading.2" = {
}; fg = orange;
"markup.heading.3" = { modifiers = [ "bold" ];
fg = yellow; };
modifiers = ["bold"]; "markup.heading.3" = {
}; fg = yellow;
"markup.heading.4" = { modifiers = [ "bold" ];
fg = green; };
modifiers = ["bold"]; "markup.heading.4" = {
}; fg = green;
"markup.heading.5" = { modifiers = [ "bold" ];
fg = blue; };
modifiers = ["bold"]; "markup.heading.5" = {
}; fg = blue;
"markup.heading.6" = { modifiers = [ "bold" ];
fg = fg0; };
modifiers = ["bold"]; "markup.heading.6" = {
}; fg = fg0;
"markup.list" = red; modifiers = [ "bold" ];
"markup.bold" = {modifiers = ["bold"];}; };
"markup.italic" = {modifiers = ["italic"];}; "markup.list" = red;
"markup.link.url" = { "markup.bold" = {
fg = blue; modifiers = [ "bold" ];
modifiers = ["underlined"]; };
}; "markup.italic" = {
"markup.link.text" = purple; modifiers = [ "italic" ];
"markup.quote" = grey2; };
"markup.raw" = green; "markup.link.url" = {
fg = blue;
modifiers = [ "underlined" ];
};
"markup.link.text" = purple;
"markup.quote" = grey2;
"markup.raw" = green;
"diff.plus" = green; "diff.plus" = green;
"diff.delta" = orange; "diff.delta" = orange;
"diff.minus" = red; "diff.minus" = red;
"ui.background" = {bg = bg0;}; "ui.background" = {
"ui.background.separator" = grey0; bg = bg0;
"ui.cursor" = { };
fg = bg0; "ui.background.separator" = grey0;
bg = fg0; "ui.cursor" = {
}; fg = bg0;
"ui.cursor.match" = { bg = fg0;
fg = orange; };
bg = bg_visual_yellow; "ui.cursor.match" = {
}; fg = orange;
"ui.cursor.insert" = { bg = bg_visual_yellow;
fg = bg0; };
bg = grey2; "ui.cursor.insert" = {
}; fg = bg0;
"ui.cursor.select" = { bg = grey2;
fg = bg0; };
bg = blue; "ui.cursor.select" = {
}; fg = bg0;
"ui.cursorline.primary" = {bg = bg1;}; bg = blue;
"ui.cursorline.secondary" = {bg = bg1;}; };
"ui.selection" = {bg = bg3;}; "ui.cursorline.primary" = {
"ui.linenr" = grey0; bg = bg1;
"ui.linenr.selected" = fg0; };
"ui.statusline" = { "ui.cursorline.secondary" = {
fg = fg0; bg = bg1;
bg = bg3; };
}; "ui.selection" = {
"ui.statusline.inactive" = { bg = bg3;
fg = grey0; };
bg = bg1; "ui.linenr" = grey0;
}; "ui.linenr.selected" = fg0;
"ui.statusline.normal" = { "ui.statusline" = {
fg = bg0; fg = fg0;
bg = fg0; bg = bg3;
modifiers = ["bold"]; };
}; "ui.statusline.inactive" = {
"ui.statusline.insert" = { fg = grey0;
fg = bg0; bg = bg1;
bg = yellow; };
modifiers = ["bold"]; "ui.statusline.normal" = {
}; fg = bg0;
"ui.statusline.select" = { bg = fg0;
fg = bg0; modifiers = [ "bold" ];
bg = blue; };
modifiers = ["bold"]; "ui.statusline.insert" = {
}; fg = bg0;
"ui.bufferline" = { bg = yellow;
fg = grey0; modifiers = [ "bold" ];
bg = bg1; };
}; "ui.statusline.select" = {
"ui.bufferline.active" = { fg = bg0;
fg = fg0; bg = blue;
bg = bg3; modifiers = [ "bold" ];
modifiers = ["bold"]; };
}; "ui.bufferline" = {
"ui.popup" = { fg = grey0;
fg = grey2; bg = bg1;
bg = bg2; };
}; "ui.bufferline.active" = {
"ui.window" = { fg = fg0;
fg = grey0; bg = bg3;
bg = bg0; modifiers = [ "bold" ];
}; };
"ui.help" = { "ui.popup" = {
fg = fg0; fg = grey2;
bg = bg2; bg = bg2;
}; };
"ui.text" = fg0; "ui.window" = {
"ui.text.focus" = fg0; fg = grey0;
"ui.menu" = { bg = bg0;
fg = fg0; };
bg = bg3; "ui.help" = {
}; fg = fg0;
"ui.menu.selected" = { bg = bg2;
fg = bg0; };
bg = blue; "ui.text" = fg0;
modifiers = ["bold"]; "ui.text.focus" = fg0;
}; "ui.menu" = {
"ui.virtual.whitespace" = {fg = bg4;}; fg = fg0;
"ui.virtual.indent-guide" = {fg = bg4;}; bg = bg3;
"ui.virtual.ruler" = {bg = bg3;}; };
"ui.menu.selected" = {
fg = bg0;
bg = blue;
modifiers = [ "bold" ];
};
"ui.virtual.whitespace" = {
fg = bg4;
};
"ui.virtual.indent-guide" = {
fg = bg4;
};
"ui.virtual.ruler" = {
bg = bg3;
};
"hint" = blue; "hint" = blue;
"info" = aqua; "info" = aqua;
"warning" = yellow; "warning" = yellow;
"error" = red; "error" = red;
"diagnostic" = {underline = {style = "curl";};}; "diagnostic" = {
"diagnostic.hint" = { underline = {
underline = { style = "curl";
color = blue; };
style = "dotted"; };
"diagnostic.hint" = {
underline = {
color = blue;
style = "dotted";
};
};
"diagnostic.info" = {
underline = {
color = aqua;
style = "dotted";
};
};
"diagnostic.warning" = {
underline = {
color = yellow;
style = "curl";
};
};
"diagnostic.error" = {
underline = {
color = red;
style = "curl";
};
}; };
}; };
"diagnostic.info" = {
underline = {
color = aqua;
style = "dotted";
};
};
"diagnostic.warning" = {
underline = {
color = yellow;
style = "curl";
};
};
"diagnostic.error" = {
underline = {
color = red;
style = "curl";
};
};
};
}; };
} }

View File

@@ -2,31 +2,48 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
programs.helix.languages = { programs.helix.languages = {
language = let language =
deno = lang: { let
command = lib.getExe pkgs.deno; deno = lang: {
args = ["fmt" "-" "--ext" lang]; command = lib.getExe pkgs.deno;
}; args = [
"fmt"
"-"
"--ext"
lang
];
};
prettier = lang: { prettier = lang: {
command = "prettier"; command = "prettier";
args = ["--parser" lang]; args = [
}; "--parser"
prettierLangs = map (e: { lang
name = e; ];
formatter = prettier e; };
}); prettierLangs = map (e: {
langs = ["css" "scss" "html"]; name = e;
in formatter = prettier e;
});
langs = [
"css"
"scss"
"html"
];
in
[ [
{ {
name = "bash"; name = "bash";
auto-format = true; auto-format = true;
formatter = { formatter = {
command = lib.getExe pkgs.shfmt; command = lib.getExe pkgs.shfmt;
args = ["-i" "2"]; args = [
"-i"
"2"
];
}; };
} }
{ {
@@ -36,7 +53,17 @@
{ {
name = "clojure"; name = "clojure";
injection-regex = "(clojure|clj|edn|boot|yuck)"; injection-regex = "(clojure|clj|edn|boot|yuck)";
file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"]; file-types = [
"clj"
"cljs"
"cljc"
"clje"
"cljr"
"cljx"
"edn"
"boot"
"yuck"
];
} }
# { # {
# name = "cmake"; # name = "cmake";
@@ -50,7 +77,7 @@
{ {
name = "lua"; name = "lua";
auto-format = true; auto-format = true;
language-servers = ["lua-language-server"]; language-servers = [ "lua-language-server" ];
formatter = { formatter = {
command = lib.getExe pkgs.stylua; command = lib.getExe pkgs.stylua;
}; };
@@ -66,7 +93,7 @@
} }
{ {
name = "common-lisp"; name = "common-lisp";
file-types = ["kbd"]; file-types = [ "kbd" ];
auto-format = true; auto-format = true;
} }
{ {
@@ -77,10 +104,10 @@
{ {
name = "nix"; name = "nix";
auto-format = true; auto-format = true;
language-servers = ["nil"]; language-servers = [ "nil" ];
formatter = { formatter = {
command = "${pkgs.nixfmt}/bin/nixfmt"; command = "${pkgs.nixfmt}/bin/nixfmt";
args = ["-q"]; args = [ "-q" ];
}; };
} }
# { # {
@@ -94,7 +121,7 @@
{ {
name = "qml"; name = "qml";
auto-format = true; auto-format = true;
language-servers = ["qmlls"]; language-servers = [ "qmlls" ];
} }
# { # {
# name = "typescript"; # name = "typescript";
@@ -112,13 +139,13 @@
{ {
name = "css"; name = "css";
auto-format = true; auto-format = true;
language-servers = ["vscode-css-language-server"]; language-servers = [ "vscode-css-language-server" ];
} }
{ {
name = "rust"; name = "rust";
auto-format = true; auto-format = true;
file-types = ["rs"]; file-types = [ "rs" ];
language-servers = ["rust-analyzer"]; language-servers = [ "rust-analyzer" ];
formatter = { formatter = {
command = lib.getExe pkgs.rustfmt; command = lib.getExe pkgs.rustfmt;
}; };
@@ -129,17 +156,17 @@
language-server = { language-server = {
phpactor = { phpactor = {
command = lib.getExe pkgs.phpactor; command = lib.getExe pkgs.phpactor;
args = ["language-server"]; args = [ "language-server" ];
}; };
bash-language-server = { bash-language-server = {
command = lib.getExe pkgs.bash-language-server; command = lib.getExe pkgs.bash-language-server;
args = ["start"]; args = [ "start" ];
}; };
clangd = { clangd = {
command = "${pkgs.clang-tools}/bin/clangd"; command = "${pkgs.clang-tools}/bin/clangd";
clangd.fallbackFlags = ["-std=c++2b"]; clangd.fallbackFlags = [ "-std=c++2b" ];
}; };
# cmake-language-server = { # cmake-language-server = {
@@ -152,7 +179,7 @@
deno-lsp = { deno-lsp = {
command = lib.getExe pkgs.deno; command = lib.getExe pkgs.deno;
args = ["lsp"]; args = [ "lsp" ];
environment.NO_COLOR = "1"; environment.NO_COLOR = "1";
config.deno = { config.deno = {
enable = true; enable = true;
@@ -160,7 +187,9 @@
unstable = true; unstable = true;
suggest = { suggest = {
completeFunctionCalls = false; completeFunctionCalls = false;
imports = {hosts."https://deno.land" = true;}; imports = {
hosts."https://deno.land" = true;
};
}; };
inlayHints = { inlayHints = {
enumMemberValues.enabled = true; enumMemberValues.enabled = true;
@@ -180,7 +209,7 @@
qmlls = { qmlls = {
command = "${pkgs.qt6.qtdeclarative}/bin/qmlls"; command = "${pkgs.qt6.qtdeclarative}/bin/qmlls";
args = ["-E"]; args = [ "-E" ];
}; };
# pyright = { # pyright = {
@@ -197,36 +226,38 @@
typescript-language-server = { typescript-language-server = {
command = lib.getExe pkgs.nodePackages.typescript-language-server; command = lib.getExe pkgs.nodePackages.typescript-language-server;
args = ["--stdio"]; args = [ "--stdio" ];
config = let config =
inlayHints = { let
includeInlayEnumMemberValueHints = true; inlayHints = {
includeInlayFunctionLikeReturnTypeHints = true; includeInlayEnumMemberValueHints = true;
includeInlayFunctionParameterTypeHints = true; includeInlayFunctionLikeReturnTypeHints = true;
includeInlayParameterNameHints = "all"; includeInlayFunctionParameterTypeHints = true;
includeInlayParameterNameHintsWhenArgumentMatchesName = true; includeInlayParameterNameHints = "all";
includeInlayPropertyDeclarationTypeHints = true; includeInlayParameterNameHintsWhenArgumentMatchesName = true;
includeInlayVariableTypeHints = true; includeInlayPropertyDeclarationTypeHints = true;
}; includeInlayVariableTypeHints = true;
in { };
typescript-language-server.source = { in
addMissingImports.ts = true; {
fixAll.ts = true; typescript-language-server.source = {
organizeImports.ts = true; addMissingImports.ts = true;
removeUnusedImports.ts = true; fixAll.ts = true;
sortImports.ts = true; organizeImports.ts = true;
}; removeUnusedImports.ts = true;
sortImports.ts = true;
};
typescript = {inherit inlayHints;}; typescript = { inherit inlayHints; };
javascript = {inherit inlayHints;}; javascript = { inherit inlayHints; };
hostInfo = "helix"; hostInfo = "helix";
}; };
}; };
vscode-css-language-server = { vscode-css-language-server = {
command = "${pkgs.vscode-langservers-extracted}/bin/vscode-css-language-server"; command = "${pkgs.vscode-langservers-extracted}/bin/vscode-css-language-server";
args = ["--stdio"]; args = [ "--stdio" ];
config = { config = {
provideFormatter = true; provideFormatter = true;
css.validate.enable = true; css.validate.enable = true;

View File

@@ -5,13 +5,15 @@
lib, lib,
osConfig, osConfig,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.hyprlock; cfg = config.home.programs.hyprlock;
hyprlockFlake = inputs.hyprlock.packages.${pkgs.system}.hyprlock; hyprlockFlake = inputs.hyprlock.packages.${pkgs.system}.hyprlock;
# hyprlockPkg = pkgs.hyprlock; # hyprlockPkg = pkgs.hyprlock;
in { in
{
options = { options = {
home.programs.hyprlock.enable = mkEnableOption "Enables hyprlock"; home.programs.hyprlock.enable = mkEnableOption "Enables hyprlock";
}; };

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.jujutsu; cfg = config.home.programs.jujutsu;
in { in
{
options = { options = {
home.programs.jujutsu.enable = mkEnableOption "Enables jujutsu"; home.programs.jujutsu.enable = mkEnableOption "Enables jujutsu";
}; };
@@ -25,13 +27,15 @@ in {
]; ];
pager = "less -FRX"; pager = "less -FRX";
}; };
signing = let signing =
gitCfg = config.programs.git.extraConfig; let
in { gitCfg = config.programs.git.extraConfig;
backend = "ssh"; in
sign-all = true; {
key = gitCfg.signing.key; backend = "ssh";
}; sign-all = true;
key = gitCfg.signing.key;
};
templates = { templates = {
draft_commit_description = '' draft_commit_description = ''
concat( concat(

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.kitty; cfg = config.home.programs.kitty;
in { in
{
options = { options = {
home.programs.kitty.enable = mkEnableOption "Enables kitty programs"; home.programs.kitty.enable = mkEnableOption "Enables kitty programs";
}; };

View File

@@ -3,10 +3,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.lutris; cfg = config.home.programs.lutris;
in { in
{
options = { options = {
home.programs.lutris.enable = mkEnableOption "Enables lutris"; home.programs.lutris.enable = mkEnableOption "Enables lutris";
}; };

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.mangohud; cfg = config.home.programs.mangohud;
in { in
{
options = { options = {
home.programs.mangohud.enable = mkEnableOption "Enables mangohud"; home.programs.mangohud.enable = mkEnableOption "Enables mangohud";
}; };

View File

@@ -3,18 +3,20 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.mpv; cfg = config.home.programs.mpv;
in { in
{
options = { options = {
home.programs.mpv.enable = mkEnableOption "Enables mpv"; home.programs.mpv.enable = mkEnableOption "Enables mpv";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.mpv = { programs.mpv = {
enable = true; enable = true;
defaultProfiles = ["gpu-hq"]; defaultProfiles = [ "gpu-hq" ];
scripts = [pkgs.mpvScripts.mpris]; scripts = [ pkgs.mpvScripts.mpris ];
}; };
}; };
} }

View File

@@ -3,10 +3,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.neovim; cfg = config.home.programs.neovim;
in { in
{
imports = [ imports = [
./plugins ./plugins
./lsp.nix ./lsp.nix
@@ -22,9 +24,7 @@ in {
programs.neovim = { programs.neovim = {
enable = true; enable = true;
extraLuaConfig = extraLuaConfig =
/* # lua
lua
*/
'' ''
-- Use system clipboard -- Use system clipboard
vim.opt.clipboard = "unnamedplus" vim.opt.clipboard = "unnamedplus"

View File

@@ -2,9 +2,7 @@
config = { config = {
programs.neovim = { programs.neovim = {
extraLuaConfig = extraLuaConfig =
/* # lua
lua
*/
'' ''
-- Key mappings for various commands and navigation -- Key mappings for various commands and navigation
vim.api.nvim_set_keymap("n", "<C-j>", "<C-e>", { noremap = true }) vim.api.nvim_set_keymap("n", "<C-j>", "<C-e>", { noremap = true })

View File

@@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
# LSP and completions for injected langs # LSP and completions for injected langs
otter-nvim otter-nvim
@@ -8,9 +9,7 @@
plugin = nvim-lspconfig; plugin = nvim-lspconfig;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
@@ -56,9 +55,7 @@
plugin = ltex_extra-nvim; plugin = ltex_extra-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
local ltex_extra = require("ltex_extra") local ltex_extra = require("ltex_extra")
add_lsp(lspconfig.ltex, { add_lsp(lspconfig.ltex, {
@@ -84,9 +81,7 @@
plugin = cmp-git; plugin = cmp-git;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("cmp_git").setup({}) require("cmp_git").setup({})
''; '';
@@ -97,9 +92,7 @@
plugin = nvim-cmp; plugin = nvim-cmp;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
local cmp = require("cmp") local cmp = require("cmp")

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = alpha-nvim; plugin = alpha-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
local alpha = require("alpha") local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard") local dashboard = require("alpha.themes.dashboard")

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = nvim-autopairs; plugin = nvim-autopairs;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("nvim-autopairs").setup({}) require("nvim-autopairs").setup({})
''; '';

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = nvim-bqf; plugin = nvim-bqf;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("bqf").setup({}) require("bqf").setup({})
''; '';

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = bufferline-nvim; plugin = bufferline-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("bufferline").setup({}) require("bufferline").setup({})
''; '';

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = nvim-colorizer-lua; plugin = nvim-colorizer-lua;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("colorizer").setup({}) require("colorizer").setup({})
''; '';

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = comment-nvim; plugin = comment-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("Comment").setup({ require("Comment").setup({
opleader = { opleader = {

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = conform-nvim; plugin = conform-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("conform").setup({ require("conform").setup({
default_format_opts = { default_format_opts = {

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = copilot-lua; plugin = copilot-lua;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("copilot").setup({ require("copilot").setup({
panel = { panel = {

View File

@@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
vim-illuminate vim-illuminate
]; ];

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = fidget-nvim; plugin = fidget-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("fidget").setup({ require("fidget").setup({
progress = { progress = {

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = vim-fugitive; plugin = vim-fugitive;
type = "viml"; type = "viml";
config = config =
/* # vim
vim
*/
'' ''
nmap <space>G :Git<CR> nmap <space>G :Git<CR>
''; '';

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = gitsigns-nvim; plugin = gitsigns-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("gitsigns").setup({ require("gitsigns").setup({
signs = { signs = {

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = lualine-nvim; plugin = lualine-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("lualine").setup({ require("lualine").setup({
options = { options = {

View File

@@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim = { programs.neovim = {
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
none-ls-nvim none-ls-nvim
@@ -6,9 +7,7 @@
nvim-treesitter.withAllGrammars nvim-treesitter.withAllGrammars
]; ];
extraConfig = extraConfig =
/* # lua
lua
*/
'' ''
-- Require necessary plugins -- Require necessary plugins
require("plenary") require("plenary")

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = oil-nvim; plugin = oil-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("oil").setup({ require("oil").setup({
buf_options = { buf_options = {

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = plenary-nvim; plugin = plenary-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("plenary").setup({}) require("plenary").setup({})
''; '';

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = range-highlight-nvim; plugin = range-highlight-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("range-highlight").setup({}) require("range-highlight").setup({})
''; '';

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = nvim-treesitter.withAllGrammars; plugin = nvim-treesitter.withAllGrammars;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
highlight = { highlight = {

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = nvim-web-devicons; plugin = nvim-web-devicons;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("nvim-web-devicons").setup({}) require("nvim-web-devicons").setup({})
''; '';

View File

@@ -1,12 +1,11 @@
{pkgs, ...}: { { pkgs, ... }:
{
programs.neovim.plugins = with pkgs.vimPlugins; [ programs.neovim.plugins = with pkgs.vimPlugins; [
{ {
plugin = which-key-nvim; plugin = which-key-nvim;
type = "lua"; type = "lua";
config = config =
/* # lua
lua
*/
'' ''
require("which-key").setup({}) require("which-key").setup({})
''; '';

View File

@@ -3,21 +3,22 @@
config, config,
lib, lib,
... ...
}: { }:
{
programs.neovim = { programs.neovim = {
extraConfig = extraConfig =
lib.mkAfter # vim lib.mkAfter # vim
''
function! SetCustomKeywords()
syn match Todo /TODO/
syn match Done /DONE/
syn match Start /START/
syn match End /END/
endfunction
autocmd Syntax * call SetCustomKeywords() ''
''; function! SetCustomKeywords()
syn match Todo /TODO/
syn match Done /DONE/
syn match Start /START/
syn match End /END/
endfunction
autocmd Syntax * call SetCustomKeywords()
'';
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
rust-vim rust-vim
dart-vim-plugin dart-vim-plugin
@@ -34,15 +35,11 @@
{ {
plugin = vimtex; plugin = vimtex;
config = let config =
viewMethod = let
if config.programs.zathura.enable viewMethod = if config.programs.zathura.enable then "zathura" else "general";
then "zathura" in
else "general"; # vim
in
/*
vim
*/
'' ''
let g:vimtex_view_method = '${viewMethod}' let g:vimtex_view_method = '${viewMethod}'
"Don't open automatically "Don't open automatically

View File

@@ -5,10 +5,12 @@
pkgs, pkgs,
inputs, inputs,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.nvf; cfg = config.home.programs.nvf;
in { in
{
options = { options = {
home.programs.nvf.enable = mkEnableOption "Enables nvf (neovim)"; home.programs.nvf.enable = mkEnableOption "Enables nvf (neovim)";
}; };

View File

@@ -3,10 +3,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.nwg-bar; cfg = config.home.programs.nwg-bar;
in { in
{
options = { options = {
home.programs.nwg-bar.enable = mkEnableOption "Enables nwg-bar"; home.programs.nwg-bar.enable = mkEnableOption "Enables nwg-bar";
}; };

View File

@@ -3,10 +3,18 @@
config, config,
lib, lib,
... ...
}: let }:
inherit (lib) mkIf mkEnableOption mkOption types mkMerge; let
inherit (lib)
mkIf
mkEnableOption
mkOption
types
mkMerge
;
cfg = config.home.programs.pkgs; cfg = config.home.programs.pkgs;
in { in
{
options = { options = {
home.programs.pkgs = { home.programs.pkgs = {
enable = mkEnableOption "Enables miscellaneous utility apps"; enable = mkEnableOption "Enables miscellaneous utility apps";
@@ -41,14 +49,15 @@ in {
programs = { programs = {
btop = { btop = {
enable = true; enable = true;
package = pkgs.btop.override {rocmSupport = true;}; package = pkgs.btop.override { rocmSupport = true; };
settings = { settings = {
color_theme = "gruvbox_material_dark"; color_theme = "gruvbox_material_dark";
}; };
}; };
}; };
home.packages = with pkgs; home.packages =
with pkgs;
mkMerge [ mkMerge [
[ [
cmatrix cmatrix
@@ -98,13 +107,13 @@ in {
]) ])
(mkIf cfg.laptop.enable [ (mkIf cfg.laptop.enable [
]) ])
(mkIf cfg.server.enable [ (mkIf cfg.server.enable [
]) ])
(mkIf cfg.dev.enable [ (mkIf cfg.dev.enable [
]) ])
]; ];
}; };
} }

View File

@@ -3,10 +3,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.rofi; cfg = config.home.programs.rofi;
in { in
{
options = { options = {
home.programs.rofi.enable = mkEnableOption "Enables firefox"; home.programs.rofi.enable = mkEnableOption "Enables firefox";
}; };

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.ssh; cfg = config.home.programs.ssh;
in { in
{
options = { options = {
home.programs.ssh.enable = mkEnableOption "Enables ssh"; home.programs.ssh.enable = mkEnableOption "Enables ssh";
}; };

View File

@@ -4,12 +4,20 @@
lib, lib,
config, config,
... ...
}: let }:
inherit (lib) mkIf mkEnableOption concatStringsSep head filter getExe; let
inherit (lib)
mkIf
mkEnableOption
concatStringsSep
head
filter
getExe
;
cfg = config.home.programs.steam; cfg = config.home.programs.steam;
steam-with-pkgs = pkgs.steam.override { steam-with-pkgs = pkgs.steam.override {
extraPkgs = pkgs: extraPkgs =
with pkgs; [ pkgs: with pkgs; [
xorg.libXcursor xorg.libXcursor
xorg.libXi xorg.libXi
xorg.libXinerama xorg.libXinerama
@@ -25,32 +33,34 @@
}; };
monitor = head (filter (m: m.primary) config.monitors); monitor = head (filter (m: m.primary) config.monitors);
steam-session = let steam-session =
gamescope = concatStringsSep " " [ let
(getExe pkgs.gamescope) gamescope = concatStringsSep " " [
"--output-width ${toString monitor.width}" (getExe pkgs.gamescope)
"--output-height ${toString monitor.height}" "--output-width ${toString monitor.width}"
"--framerate-limit ${toString monitor.refreshRate}" "--output-height ${toString monitor.height}"
"--prefer-output ${monitor.name}" "--framerate-limit ${toString monitor.refreshRate}"
# "--adaptive-sync" "--prefer-output ${monitor.name}"
"--expose-wayland" # "--adaptive-sync"
"--hdr-enabled" "--expose-wayland"
"--steam" "--hdr-enabled"
]; "--steam"
steam = concatStringsSep " " [ ];
"steam" steam = concatStringsSep " " [
"steam://open/bigpicture" "steam"
]; "steam://open/bigpicture"
in ];
in
pkgs.writeTextDir "share/wayland-sessions/steam-sesson.desktop" # ini pkgs.writeTextDir "share/wayland-sessions/steam-sesson.desktop" # ini
'' ''
[Desktop Entry] [Desktop Entry]
Name=Steam Session Name=Steam Session
Exec=${gamescope} -- ${steam} Exec=${gamescope} -- ${steam}
Type=Application Type=Application
''; '';
in { in
{
options = { options = {
home.programs.steam.enable = mkEnableOption "Enables steam"; home.programs.steam.enable = mkEnableOption "Enables steam";
}; };

View File

@@ -4,10 +4,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.tuirun; cfg = config.home.programs.tuirun;
in { in
{
imports = [ imports = [
inputs.tuirun.homeManagerModules.default inputs.tuirun.homeManagerModules.default
]; ];

View File

@@ -3,10 +3,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.vscode; cfg = config.home.programs.vscode;
in { in
{
options = { options = {
home.programs.vscode.enable = mkEnableOption "Enables vscode"; home.programs.vscode.enable = mkEnableOption "Enables vscode";
}; };

View File

@@ -3,19 +3,21 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.waybar; cfg = config.home.programs.waybar;
# uwsm = lib.getExe pkgs.uwsm; # uwsm = lib.getExe pkgs.uwsm;
waybar = lib.getExe pkgs.waybar; waybar = lib.getExe pkgs.waybar;
waybarAssets = pkgs.runCommand "waybar-config-assets" {} '' waybarAssets = pkgs.runCommand "waybar-config-assets" { } ''
mkdir -p $out/assets mkdir -p $out/assets
cp ${./assets/button.svg} $out/assets/button.svg cp ${./assets/button.svg} $out/assets/button.svg
cp ${./config/style.css} $out/style.css cp ${./config/style.css} $out/style.css
cp ${./config/config.jsonc} $out/config.jsonc cp ${./config/config.jsonc} $out/config.jsonc
''; '';
in { in
{
options = { options = {
home.programs.waybar.enable = mkEnableOption "Enables waybar"; home.programs.waybar.enable = mkEnableOption "Enables waybar";
}; };
@@ -23,7 +25,7 @@ in {
systemd.user.services.waybar = { systemd.user.services.waybar = {
Unit = { Unit = {
Description = "Highly customizable Wayland bar for Sway and Wlroots based compositors."; Description = "Highly customizable Wayland bar for Sway and Wlroots based compositors.";
After = ["graphical-session.target"]; After = [ "graphical-session.target" ];
}; };
Service = { Service = {
Type = "exec"; Type = "exec";
@@ -32,7 +34,7 @@ in {
Slice = "app-graphical.slice"; Slice = "app-graphical.slice";
}; };
Install = { Install = {
WantedBy = ["graphical-session.target"]; WantedBy = [ "graphical-session.target" ];
}; };
}; };
}; };

View File

@@ -4,13 +4,15 @@
lib, lib,
inputs, inputs,
... ...
}: let }:
let
enable_wayland = "true"; enable_wayland = "true";
# weztermPkg = pkgs.wezterm; # weztermPkg = pkgs.wezterm;
weztermFlake = inputs.wezterm.packages.${pkgs.system}.default; weztermFlake = inputs.wezterm.packages.${pkgs.system}.default;
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.wezterm; cfg = config.home.programs.wezterm;
in { in
{
options = { options = {
home.programs.wezterm.enable = mkEnableOption "Enables wezterm programs"; home.programs.wezterm.enable = mkEnableOption "Enables wezterm programs";
}; };
@@ -19,9 +21,7 @@ in {
enable = true; enable = true;
package = weztermFlake; package = weztermFlake;
extraConfig = extraConfig =
/* # lua
lua
*/
'' ''
local wezterm = require 'wezterm' local wezterm = require 'wezterm'

View File

@@ -3,10 +3,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.yazi; cfg = config.home.programs.yazi;
in { in
{
imports = [ imports = [
./theme ./theme
]; ];
@@ -25,7 +27,11 @@ in {
settings = { settings = {
manager = { manager = {
layout = [1 4 3]; layout = [
1
4
3
];
sort_by = "alphabetical"; sort_by = "alphabetical";
sort_sensitive = true; sort_sensitive = true;
sort_reverse = false; sort_reverse = false;

View File

@@ -1,8 +1,14 @@
{ {
programs.yazi.theme.help = { programs.yazi.theme.help = {
on = {fg = "#fe8019";}; on = {
exec = {fg = "#83a598";}; fg = "#fe8019";
desc = {fg = "#928374";}; };
exec = {
fg = "#83a598";
};
desc = {
fg = "#928374";
};
hovered = { hovered = {
bg = "#504945"; bg = "#504945";
bold = true; bold = true;

View File

@@ -1,8 +1,12 @@
{ {
programs.yazi.theme.input = { programs.yazi.theme.input = {
border = {fg = "#bdae93";}; border = {
title = {}; fg = "#bdae93";
value = {}; };
selected = {reversed = true;}; title = { };
value = { };
selected = {
reversed = true;
};
}; };
} }

View File

@@ -1,13 +1,17 @@
{ {
programs.yazi.theme.manager = { programs.yazi.theme.manager = {
cwd = {fg = "#83a598";}; cwd = {
fg = "#83a598";
};
# Hovered # Hovered
hovered = { hovered = {
fg = "#282828"; fg = "#282828";
bg = "#83a598"; bg = "#83a598";
}; };
preview_hovered = {underline = true;}; preview_hovered = {
underline = true;
};
# Find # Find
find_keyword = { find_keyword = {
@@ -47,11 +51,23 @@
# Border; # Border;
border_symbol = ""; border_symbol = "";
border_style = {fg = "#665c54";}; border_style = {
fg = "#665c54";
};
# Offset; # Offset;
folder_offset = [1 0 1 0]; folder_offset = [
preview_offset = [1 1 1 1]; 1
0
1
0
];
preview_offset = [
1
1
1
1
];
# Highlighting; # Highlighting;
syntect_theme = ""; syntect_theme = "";

View File

@@ -1,7 +1,11 @@
{ {
programs.yazi.theme.select = { programs.yazi.theme.select = {
border = {fg = "#504945";}; border = {
active = {fg = "#fe8019";}; fg = "#504945";
inactive = {}; };
active = {
fg = "#fe8019";
};
inactive = { };
}; };
} }

View File

@@ -39,10 +39,20 @@
}; };
# Permissions; # Permissions;
permissions_t = {fg = "#504945";}; permissions_t = {
permissions_r = {fg = "#b8bb26";}; fg = "#504945";
permissions_w = {fg = "#fb4934";}; };
permissions_x = {fg = "#b8bb26";}; permissions_r = {
permissions_s = {fg = "#665c54";}; fg = "#b8bb26";
};
permissions_w = {
fg = "#fb4934";
};
permissions_x = {
fg = "#b8bb26";
};
permissions_s = {
fg = "#665c54";
};
}; };
} }

View File

@@ -1,7 +1,11 @@
{ {
programs.yazi.theme.tasks = { programs.yazi.theme.tasks = {
border = {fg = "#504945";}; border = {
title = {}; fg = "#504945";
hovered = {underline = true;}; };
title = { };
hovered = {
underline = true;
};
}; };
} }

View File

@@ -1,10 +1,20 @@
{ {
programs.yazi.theme.which = { programs.yazi.theme.which = {
mask = {bg = "#3c3836";}; mask = {
cand = {fg = "#83a598";}; bg = "#3c3836";
rest = {fg = "#928374";}; };
desc = {fg = "#fe8019";}; cand = {
fg = "#83a598";
};
rest = {
fg = "#928374";
};
desc = {
fg = "#fe8019";
};
separator = " "; separator = " ";
separator_style = {fg = "#504945";}; separator_style = {
fg = "#504945";
};
}; };
} }

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.zathura; cfg = config.home.programs.zathura;
in { in
{
options = { options = {
home.programs.zathura.enable = mkEnableOption "Enables zathura"; home.programs.zathura.enable = mkEnableOption "Enables zathura";
}; };

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.zed-editor; cfg = config.home.programs.zed-editor;
in { in
{
options = { options = {
home.programs.zed-editor.enable = mkEnableOption "Enables zed-editor"; home.programs.zed-editor.enable = mkEnableOption "Enables zed-editor";
}; };

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.zellij; cfg = config.home.programs.zellij;
in { in
{
options = { options = {
home.programs.zellij.enable = mkEnableOption "Enables zellij"; home.programs.zellij.enable = mkEnableOption "Enables zellij";
}; };

View File

@@ -4,10 +4,12 @@
lib, lib,
inputs, inputs,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.zen; cfg = config.home.programs.zen;
in { in
{
options = { options = {
home.programs.zen.enable = mkEnableOption "Enables zen browser"; home.programs.zen.enable = mkEnableOption "Enables zen browser";
}; };

View File

@@ -3,12 +3,14 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (pkgs) eza bat; inherit (pkgs) eza bat;
cfg = config.home.programs.zsh; cfg = config.home.programs.zsh;
in { in
{
options = { options = {
home.programs.zsh.enable = mkEnableOption "Enables zsh home configuration"; home.programs.zsh.enable = mkEnableOption "Enables zsh home configuration";
}; };

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.services.blueman-applet; cfg = config.home.services.blueman-applet;
in { in
{
options = { options = {
home.services.blueman-applet.enable = mkEnableOption "Enables blueman-applet"; home.services.blueman-applet.enable = mkEnableOption "Enables blueman-applet";
}; };

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.services.copyq; cfg = config.home.services.copyq;
in { in
{
options = { options = {
home.services.copyq.enable = mkEnableOption "Enables copyq"; home.services.copyq.enable = mkEnableOption "Enables copyq";
}; };

View File

@@ -2,10 +2,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) types mkOption; inherit (lib) types mkOption;
cfg = config.home.services.dconf; cfg = config.home.services.dconf;
in { in
{
options = { options = {
home.services.dconf.settings.color-scheme = mkOption { home.services.dconf.settings.color-scheme = mkOption {
type = types.str; type = types.str;

View File

@@ -3,10 +3,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.services.dunst; cfg = config.home.services.dunst;
in { in
{
options = { options = {
home.services.dunst.enable = mkEnableOption "Enables dunst"; home.services.dunst.enable = mkEnableOption "Enables dunst";
}; };

View File

@@ -3,10 +3,12 @@
lib, lib,
pkgs, pkgs,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.services.gpg; cfg = config.home.services.gpg;
in { in
{
options = { options = {
home.services.gpg.enable = mkEnableOption "Enables gpg"; home.services.gpg.enable = mkEnableOption "Enables gpg";
}; };

View File

@@ -3,10 +3,12 @@
config, config,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.services.gtk; cfg = config.home.services.gtk;
in { in
{
options = { options = {
home.services.gtk.enable = mkEnableOption "Enables miscellaneous GTK elements"; home.services.gtk.enable = mkEnableOption "Enables miscellaneous GTK elements";
}; };

View File

@@ -3,10 +3,12 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }:
let
inherit (lib) types mkOption mkIf; inherit (lib) types mkOption mkIf;
cfg = config.home.userd.gtk; cfg = config.home.userd.gtk;
in { in
{
options = { options = {
home.userd.gtk.enable = mkOption { home.userd.gtk.enable = mkOption {
type = types.bool; type = types.bool;
@@ -60,7 +62,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
home = { home = {
packages = [pkgs.glib]; packages = [ pkgs.glib ];
pointerCursor = { pointerCursor = {
package = cfg.cursorTheme.package; package = cfg.cursorTheme.package;

View File

@@ -4,13 +4,15 @@
pkgs, pkgs,
inputs, inputs,
... ...
}: let }:
let
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
cfg = config.home.services.hypridle; cfg = config.home.services.hypridle;
hypridleFlake = inputs.hypridle.packages.${pkgs.system}.hypridle; hypridleFlake = inputs.hypridle.packages.${pkgs.system}.hypridle;
# hypridlePkg = pkgs.hypridle; # hypridlePkg = pkgs.hypridle;
in { in
{
options = { options = {
home.services.hypridle.enable = mkEnableOption "Enables hypridle"; home.services.hypridle.enable = mkEnableOption "Enables hypridle";
}; };

Some files were not shown because too many files have changed in this diff Show More