refactor: apply nixfmt

This commit is contained in:
2025-06-04 00:39:56 +03:00
parent 93debfb780
commit af827c485b
10 changed files with 354 additions and 261 deletions

View File

@@ -2,28 +2,29 @@
description = "My homebrew NixOS configurations";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = github:nix-community/home-manager;
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = github:nix-community/nixvim;
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = github:nix-community/plasma-manager;
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nur.url = github:nix-community/NUR;
nethack.url = git+https://git.psf.lt/xezo360hye/nethack?shallow=1;
nur.url = "github:nix-community/NUR";
nethack.url = "git+https://git.psf.lt/xezo360hye/nethack?shallow=1";
};
outputs = {
outputs =
{
self,
nixpkgs,
home-manager,
@@ -32,12 +33,17 @@
plasma-manager,
nur,
...
} @ inputs:
}@inputs:
let
inherit (nixpkgs) lib;
username = "andrey";
hostnames = [ "tokishiko" "maidena" "noma" "tuxedo" ];
hostnames = [
"tokishiko"
"maidena"
"noma"
"tuxedo"
];
stateVersion = "24.05";
makeSystem = hostname: {
@@ -59,14 +65,25 @@
home-manager.useUserPackages = true;
home-manager.users.${username} = {
imports = [
imports =
[
./home/${hostname}.nix
./home/common.nix
] ++ (map
(module:
let hm = module.homeManagerModules;
in hm.${lib.head (lib.attrNames hm)})
[ nixvim nethack plasma-manager ]);
]
++ (map
(
module:
let
hm = module.homeManagerModules;
in
hm.${lib.head (lib.attrNames hm)}
)
[
nixvim
nethack
plasma-manager
]
);
home = {
username = username;
@@ -82,7 +99,8 @@
};
forEachHost = fn: lib.mergeAttrsList (map fn hostnames);
in {
in
{
nixosConfigurations = forEachHost makeSystem;
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree;

View File

@@ -11,13 +11,11 @@
fastfetch.enable = true;
btop.enable = true;
bash = {
enable = true;
historyControl = [ "ignoreboth" ];
};
git = {
enable = true;
userName = "xezo360hye";
@@ -26,8 +24,14 @@
extraConfig = {
credential.helper = "store";
init.defaultBranch = "master";
url."https://github.com/".insteadOf = [ "gh:" "github:" ];
url."https://git.psf.lt/".insteadOf = [ "psf:" "gitea:" ];
url."https://github.com/".insteadOf = [
"gh:"
"github:"
];
url."https://git.psf.lt/".insteadOf = [
"psf:"
"gitea:"
];
};
};
@@ -49,14 +53,17 @@
};
home = {
packages = with pkgs; let
packages =
with pkgs;
let
sent' = sent.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs ++ [ cairo ];
patches = [
./resources/patches/sent-pdf.diff
];
});
in [
in
[
texlive.combined.scheme-full
telegram-desktop
libreoffice-qt6

View File

@@ -3,7 +3,8 @@
programs.emacs = {
enable = true;
package = pkgs.emacs-gtk;
extraPackages = epkgs: with epkgs; [
extraPackages =
epkgs: with epkgs; [
doom
magit

View File

@@ -56,57 +56,95 @@
force = true;
default = "ddg";
engines = let
makeShortcuts = let
engines =
let
makeShortcuts =
let
prefix = "@";
in map (shortcut: prefix + shortcut);
in
map (shortcut: prefix + shortcut);
hideEngines = let
hideEngines =
let
hideEngine = engine: {
name = engine;
value = {
metaData.hidden = true;
};
};
in engines: lib.listToAttrs (map hideEngine engines);
in (hideEngines [ "google" "bing" "amazondotcom-us" "ebay" ]) //
{
in
engines: lib.listToAttrs (map hideEngine engines);
in
(hideEngines [
"google"
"bing"
"amazondotcom-us"
"ebay"
])
// {
"Arch Wiki" = {
urls = [{ template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; }];
urls = [ { template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; } ];
icon = "https://wiki.archlinux.org/favicon.ico";
definedAliases = makeShortcuts [ "archlinux" "aw" ];
definedAliases = makeShortcuts [
"archlinux"
"aw"
];
};
"Nix Packages" = {
urls = [{
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "channel"; value = "unstable"; }
{ name = "query"; value = "{searchTerms}"; }
{
name = "type";
value = "packages";
}
{
name = "channel";
value = "unstable";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = makeShortcuts [ "nixpkgs" "packages" "np" ];
definedAliases = makeShortcuts [
"nixpkgs"
"packages"
"np"
];
};
"NixOS Wiki" = {
urls = [{ template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; }];
urls = [ { template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ];
icon = "https://wiki.nixos.org/favicon.png";
definedAliases = makeShortcuts [ "nixos" "nw" ];
definedAliases = makeShortcuts [
"nixos"
"nw"
];
};
"MyNixOS" = {
urls = [{ template = "https://mynixos.com/search?q={searchTerms}"; }];
urls = [ { template = "https://mynixos.com/search?q={searchTerms}"; } ];
icon = "https://mynixos.com/favicon-light.svg";
definedAliases = makeShortcuts [ "mynixos" "mw" ];
definedAliases = makeShortcuts [
"mynixos"
"mw"
];
};
"RuTracker" = {
urls = [{ template = "https://rutracker.org/forum/tracker.php?nm={searchTerms}"; }];
urls = [ { template = "https://rutracker.org/forum/tracker.php?nm={searchTerms}"; } ];
icon = "https://rutracker.org/favicon.ico";
definedAliases = makeShortcuts [ "rutracker" "rt" ];
definedAliases = makeShortcuts [
"rutracker"
"rt"
];
};
};
};
@@ -126,7 +164,7 @@
EmailTracking = true;
Fingerprinting = true;
Exceptions = [];
Exceptions = [ ];
};
FirefoxHome = {

View File

@@ -5,7 +5,8 @@
lib,
...
}:
let genFlatList = f: n: builtins.concatLists (builtins.genList f n);
let
genFlatList = f: n: builtins.concatLists (builtins.genList f n);
in
{
programs.kitty = {
@@ -50,7 +51,8 @@ in
};
};
bind = [
bind =
[
"SUPER, Return, exec, kitty"
"SUPER SHIFT, Q, exit"
@@ -60,16 +62,17 @@ in
"ALT CTRL, left, workspace, -1"
"ALT CTRL, right, workspace, +1"
] ++ (
genFlatList
( x: let n = toString (x + 1);
]
++ (genFlatList (
x:
let
n = toString (x + 1);
in
[ "SUPER, ${n}, workspace, ${n}"
[
"SUPER, ${n}, workspace, ${n}"
"SUPER SHIFT, ${n}, movetoworkspace, ${n}"
]
)
9
);
) 9);
};
};
}

View File

@@ -199,17 +199,21 @@
"(mud|buckled|riding|snow|hiking|combat|jungle) boots" = "magenta";
" (Dragonbane|Fire Brand|Frost Brand|Ogresmasher|Trollsbane|Werebane)" = "lightgreen";
" (Demonbane|Excalibur|Grayswandir|Snickersnee|Sunsword)" = "lightgreen";
" (Orb of Detection|Sceptre of Might|Magic Mirror of Merlin|Mitre of Holiness|Tsurugi of Muramasa)" = "lightgreen";
" (Orb of Detection|Sceptre of Might|Magic Mirror of Merlin|Mitre of Holiness|Tsurugi of Muramasa)" =
"lightgreen";
" (Cleaver|Giantslayer|Magicbane|Mjollnir|Vorpal Blade)" = "lightgreen";
" (Heart of Ahriman|Staff of Aesculapius|Eyes of the Overworld|Platinum Yendorian Express Card|Orb of Fate|Eye of the Aethiopica)" = "lightgreen";
" (Heart of Ahriman|Staff of Aesculapius|Eyes of the Overworld|Platinum Yendorian Express Card|Orb of Fate|Eye of the Aethiopica)" =
"lightgreen";
" (Grimtooth|Orcrist|Sting|Stormbringer)" = "lightgreen";
" (Longbow of Diana|Master Key of Thievery)" = "lightgreen";
" (Bell of Opening|silver bell|Candelabrum of Invocation|candelabrum|Book of the Dead|papyrus spellbook)" = "magenta&bold";
" (Bell of Opening|silver bell|Candelabrum of Invocation|candelabrum|Book of the Dead|papyrus spellbook)" =
"magenta&bold";
" Amulet of Yendor named" = "magenta&bold";
" cursed.* bag .* holding" = "red&bold";
" cursed.* luck(stone)?($| )" = "red&bold";
" cursed.* unicorn horn" = "red&bold";
" cursed.* (Bell of Opening|silver bell|Candelabrum of Invocation|candelabrum|Book of the Dead|papyrus spellbook)" = "red&bold";
" cursed.* (Bell of Opening|silver bell|Candelabrum of Invocation|candelabrum|Book of the Dead|papyrus spellbook)" =
"red&bold";
"cursed tins? .* spinach|tins? .* spinach .* (cursed|C($| ))" = "red";
" load(stone)?($| )" = "red&underline";
" bag .* tricks" = "blue&underline";
@@ -218,8 +222,10 @@
" gold piece" = "yellow";
" valuable" = "brown";
" gems? .* hard" = "yellow";
" ([0-9]+|an?|gems? .*) (uncursed |cursed |blessed )?(dilithium|opal|garnet|jasper|agate|jet|obsidian|jade|citrine|chrysoberyl|amber|amethyst|fluorite|turquoise)(e?s)?( stones?| gems?| crystals?)?( named .*)?$" = "brown";
" ([0-9]+|an?|gems?.*) (uncursed |cursed |blessed )?(diamond|rub(y|ies)|jacinth|sapphire|black opal|emerald|topaz|aquamarine)(e?s)?( stones?| gems?)?( named .*)?$" = "yellow";
" ([0-9]+|an?|gems? .*) (uncursed |cursed |blessed )?(dilithium|opal|garnet|jasper|agate|jet|obsidian|jade|citrine|chrysoberyl|amber|amethyst|fluorite|turquoise)(e?s)?( stones?| gems?| crystals?)?( named .*)?$" =
"brown";
" ([0-9]+|an?|gems?.*) (uncursed |cursed |blessed )?(diamond|rub(y|ies)|jacinth|sapphire|black opal|emerald|topaz|aquamarine)(e?s)?( stones?| gems?)?( named .*)?$" =
"yellow";
" 0%" = "white";
" [1-9]%" = "cyan";
" [12][0-9]%" = "cyan";

View File

@@ -16,14 +16,16 @@
programs.plasma = {
enable = true;
input.touchpads = [{
input.touchpads = [
{
enable = true;
name = "SynPS/2 Synaptics TouchPad";
vendorId = "0002";
productId = "0007";
disableWhileTyping = false;
naturalScroll = true;
}];
}
];
kwin.edgeBarrier = 0;
workspace = {
@@ -40,7 +42,8 @@
floating = false;
height = 44;
widgets = let
widgets =
let
kickoff = {
kickoff.icon = "nix-snowflake-white";
};
@@ -87,7 +90,6 @@
}
];
window-rules = [
{
description = "Konsole";

View File

@@ -1,23 +1,27 @@
{ inputs, config, pkgs, lib, ... }:
let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
{
inputs,
config,
pkgs,
lib,
...
}:
let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in
{
# Bootloader
boot.loader.grub.enable = true;
boot.loader.grub.device = lib.mkDefault "/dev/sda";
# Networking
networking.networkmanager.enable = true;
services.openssh.enable = true;
services.tailscale.enable = true;
# l10n and i8n
time.timeZone = "Europe/Riga";
i18n.defaultLocale = "en_US.UTF-8";
# Editor
programs.neovim = {
enable = true;
@@ -26,13 +30,15 @@ in
defaultEditor = true;
};
# Nix
nixpkgs.config.allowUnfree = true;
nix = {
settings = {
trusted-users = [ "andrey" ];
experimental-features = [ "nix-command" "flakes" ];
experimental-features = [
"nix-command"
"flakes"
];
flake-registry = "";
nix-path = config.nix.nixPath;
};
@@ -42,19 +48,26 @@ in
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
# Users
users.mutableUsers = false;
users.users.andrey = {
isNormalUser = true;
initialHashedPassword = "$y$j9T$mGZT4otEkrc94e.Ile.P20$BoxfgxCiacs.tYoEp7S5AjcP.aMUBrsaCJYJkBot635";
extraGroups = [ "wheel" "cdrom" "networkmanager" "audio" "dialout" "scanner" "lp" "adbusers" ];
extraGroups = [
"wheel"
"cdrom"
"networkmanager"
"audio"
"dialout"
"scanner"
"lp"
"adbusers"
];
};
security.sudo.execWheelOnly = true;
security.sudo.wheelNeedsPassword = false;
# Printers and scanners
hardware.sane.enable = true;
services.printing.enable = true;
@@ -73,20 +86,24 @@ in
stats.enable = true;
};
# Programs
programs = {
git = {
enable = true;
config = {
init.defaultBranch = "master";
url."https://github.com/".insteadOf = [ "gh:" "github:" ];
url."https://git.psf.lt/".insteadOf = [ "psf:" "gitea:" ];
url."https://github.com/".insteadOf = [
"gh:"
"github:"
];
url."https://git.psf.lt/".insteadOf = [
"psf:"
"gitea:"
];
};
};
};
# Packages
environment.systemPackages = with pkgs; [
alsa-utils
@@ -97,13 +114,11 @@ in
unzip
];
hardware.bluetooth = {
enable = true;
settings.General.Enable = "Source,Sink,Media,Socket";
};
# Xorg
security.rtkit.enable = true;
services = {

View File

@@ -28,8 +28,11 @@
};
};
fonts.packages = lib.mkAfter (with pkgs; [
fonts.packages = lib.mkAfter (
with pkgs;
[
vistafonts
corefonts
]);
]
);
}