1
0
forked from extern/nix-config

treewide: Switch from alejandra to nixpkgs-fmt

Neither nixfmt nor alejandra support the "standard" way to syntax
highlight multi-line strings in Nix, so nixpkgs-fmt is the only viable
solution.
This commit is contained in:
Donovan Glover 2023-06-11 09:33:54 -04:00
parent 09f2ce62de
commit 43a07cc8d9
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
35 changed files with 247 additions and 230 deletions

View File

@ -1,6 +1,7 @@
let
VARIABLES = import ../src/variables.nix;
in {
in
{
containers.rar = {
privateNetwork = true;
@ -11,51 +12,51 @@ in {
};
};
config = {
pkgs,
lib,
...
}: {
programs = {
fish.enable = true;
neovim.enable = true;
starship.enable = true;
};
users = {
defaultUserShell = pkgs.fish;
mutableUsers = false;
allowNoPasswordLogin = true;
users.user = {
isNormalUser = true;
home = "/home/user";
};
};
environment = {
shells = with pkgs; [fish];
variables = {
TERM = "xterm-kitty";
config =
{ pkgs
, lib
, ...
}: {
programs = {
fish.enable = true;
neovim.enable = true;
starship.enable = true;
};
defaultPackages = [];
};
users = {
defaultUserShell = pkgs.fish;
mutableUsers = false;
allowNoPasswordLogin = true;
environment.systemPackages = with pkgs; [
kitty
rar
unrar
];
users.user = {
isNormalUser = true;
home = "/home/user";
};
};
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"rar"
"unrar"
environment = {
shells = with pkgs; [ fish ];
variables = {
TERM = "xterm-kitty";
};
defaultPackages = [ ];
};
environment.systemPackages = with pkgs; [
kitty
rar
unrar
];
system.stateVersion = VARIABLES.stateVersion;
};
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"rar"
"unrar"
];
system.stateVersion = VARIABLES.stateVersion;
};
};
}

View File

@ -1,7 +1,9 @@
{config, ...}: let
{ config, ... }:
let
VARIABLES = import ../src/variables.nix;
hostCfg = config;
in {
in
{
containers.wine = {
privateNetwork = true;
@ -23,64 +25,64 @@ in {
};
};
config = {
pkgs,
lib,
...
}: {
programs = {
fish.enable = true;
neovim.enable = true;
starship.enable = true;
};
users = {
defaultUserShell = pkgs.fish;
mutableUsers = false;
allowNoPasswordLogin = true;
users.user = {
isNormalUser = true;
home = "/home/user";
};
};
environment = {
shells = with pkgs; [fish];
variables = {
TERM = "xterm-kitty";
config =
{ pkgs
, lib
, ...
}: {
programs = {
fish.enable = true;
neovim.enable = true;
starship.enable = true;
};
defaultPackages = [];
users = {
defaultUserShell = pkgs.fish;
mutableUsers = false;
allowNoPasswordLogin = true;
users.user = {
isNormalUser = true;
home = "/home/user";
};
};
environment = {
shells = with pkgs; [ fish ];
variables = {
TERM = "xterm-kitty";
};
defaultPackages = [ ];
};
environment.systemPackages = with pkgs; [
kitty
wine-staging
winetricks
];
environment.sessionVariables = {
WAYLAND_DISPLAY = "wayland-1";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
SDL_VIDEODRIVER = "wayland";
CLUTTER_BACKEND = "wayland";
MOZ_ENABLE_WAYLAND = "1";
XDG_RUNTIME_DIR = "/run/user/1000";
DISPLAY = ":0";
};
services.xserver.enable = true;
hardware.opengl = {
enable = true;
extraPackages = hostCfg.hardware.opengl.extraPackages;
driSupport32Bit = true;
};
system.stateVersion = VARIABLES.stateVersion;
};
environment.systemPackages = with pkgs; [
kitty
wine-staging
winetricks
];
environment.sessionVariables = {
WAYLAND_DISPLAY = "wayland-1";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
SDL_VIDEODRIVER = "wayland";
CLUTTER_BACKEND = "wayland";
MOZ_ENABLE_WAYLAND = "1";
XDG_RUNTIME_DIR = "/run/user/1000";
DISPLAY = ":0";
};
services.xserver.enable = true;
hardware.opengl = {
enable = true;
extraPackages = hostCfg.hardware.opengl.extraPackages;
driSupport32Bit = true;
};
system.stateVersion = VARIABLES.stateVersion;
};
};
}

View File

@ -1,30 +1,32 @@
{
outputs = {
self,
nixpkgs,
home-manager,
hyprland,
stylix,
nix-gaming,
crystal-flake,
...
} @ attrs: let
VARIABLES = import ./src/variables.nix;
in {
formatter."${VARIABLES.system}" = nixpkgs.legacyPackages."${VARIABLES.system}".alejandra;
outputs =
{ self
, nixpkgs
, home-manager
, hyprland
, stylix
, nix-gaming
, crystal-flake
, ...
} @ attrs:
let
VARIABLES = import ./src/variables.nix;
in
{
formatter."${VARIABLES.system}" = nixpkgs.legacyPackages."${VARIABLES.system}".alejandra;
nixosConfigurations."${VARIABLES.hostname}" = nixpkgs.lib.nixosSystem {
system = VARIABLES.system;
specialArgs = attrs;
modules = [
home-manager.nixosModules.home-manager
hyprland.nixosModules.default
stylix.nixosModules.stylix
nix-gaming.nixosModules.pipewireLowLatency
./src/main.nix
];
nixosConfigurations."${VARIABLES.hostname}" = nixpkgs.lib.nixosSystem {
system = VARIABLES.system;
specialArgs = attrs;
modules = [
home-manager.nixosModules.home-manager
hyprland.nixosModules.default
stylix.nixosModules.stylix
nix-gaming.nixosModules.pipewireLowLatency
./src/main.nix
];
};
};
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

View File

@ -1,17 +1,16 @@
{
config,
lib,
modulesPath,
...
{ config
, lib
, modulesPath
, ...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
@ -25,7 +24,7 @@
fsType = "vfat";
};
swapDevices = [];
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;

View File

@ -1,7 +1,7 @@
{pkgs, ...}: {
{ pkgs, ... }: {
services.interception-tools = {
enable = true;
plugins = [pkgs.interception-tools-plugins.dual-function-keys];
plugins = [ pkgs.interception-tools-plugins.dual-function-keys ];
udevmonConfig = ''
- JOB: "${pkgs.interception-tools}/bin/intercept -g $DEVNODE | ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c /etc/dual-function-keys.yaml | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE"
DEVICE:

View File

@ -1,5 +1,5 @@
{pkgs, ...}: {
environment.systemPackages = [pkgs.libnotify];
{ pkgs, ... }: {
environment.systemPackages = [ pkgs.libnotify ];
home-manager.sharedModules = [
{

View File

@ -1,6 +1,6 @@
{pkgs, ...}: {
{ pkgs, ... }: {
i18n.inputMethod.enabled = "fcitx5";
i18n.inputMethod.fcitx5.addons = [pkgs.fcitx5-mozc];
i18n.inputMethod.fcitx5.addons = [ pkgs.fcitx5-mozc ];
home-manager.sharedModules = [
{

View File

@ -5,8 +5,8 @@
enable = true;
keybindings = {
next_img = ["k" "Right"];
prev_img = ["j" "Left"];
next_img = [ "k" "Right" ];
prev_img = [ "j" "Left" ];
quit = "q";
toggle_fullscreen = "f";
@ -25,8 +25,8 @@
jump_back = "L";
scroll_left = "b";
scroll_right = "n";
scroll_up = ["u" "Up"];
scroll_down = ["d" "Down"];
scroll_up = [ "u" "Up" ];
scroll_down = [ "d" "Down" ];
zoom_default = "o";
zoom_fill = "p";
toggle_auto_zoom = "m";

View File

@ -1,8 +1,10 @@
{pkgs, ...}: let
{ pkgs, ... }:
let
VARIABLES = import ../../src/variables.nix;
in {
in
{
users.defaultUserShell = pkgs.fish;
environment.shells = [pkgs.fish];
environment.shells = [ pkgs.fish ];
programs.fish = {
enable = true;

View File

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [
@ -13,12 +13,12 @@
];
fontconfig = {
defaultFonts = {
serif = ["Noto Serif CJK JP" "Noto Serif"];
sansSerif = ["Noto Sans CJK JP" "Noto Sans"];
monospace = ["Noto Mono CJK JP" "Noto Mono"];
serif = [ "Noto Serif CJK JP" "Noto Serif" ];
sansSerif = [ "Noto Sans CJK JP" "Noto Sans" ];
monospace = [ "Noto Mono CJK JP" "Noto Mono" ];
};
allowBitmaps = false;
hinting = {style = "hintfull";};
hinting = { style = "hintfull"; };
};
};
}

View File

@ -1,7 +1,9 @@
{pkgs, ...}: let
{ pkgs, ... }:
let
VARIABLES = import ../../src/variables.nix;
in {
environment.systemPackages = with pkgs; [tig git];
in
{
environment.systemPackages = with pkgs; [ tig git ];
home-manager.sharedModules = [
{

View File

@ -1,6 +1,8 @@
{pkgs, ...}: let
{ pkgs, ... }:
let
VARIABLES = import ../../src/variables.nix;
in {
in
{
programs.hyprland.enable = true;
services.udisks2 = {
enable = true;
@ -14,7 +16,7 @@ in {
services.xserver = {
enable = true;
displayManager.lightdm.enable = false;
excludePackages = [pkgs.xterm];
excludePackages = [ pkgs.xterm ];
};
home-manager.sharedModules = [

View File

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
joshuto
];

View File

@ -1,6 +1,7 @@
let
VARIABLES = import ../../src/variables.nix;
in {
in
{
home-manager.sharedModules = [
{
programs.kitty = {

View File

@ -1,6 +1,7 @@
let
VARIABLES = import ../../src/variables.nix;
in {
in
{
home-manager.sharedModules = [
{
xdg.mimeApps = {

View File

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
home-manager.sharedModules = [
{
programs.mpv = {

View File

@ -1,6 +1,8 @@
{pkgs, ...}: let
{ pkgs, ... }:
let
VARIABLES = import ../../src/variables.nix;
in {
in
{
home-manager.sharedModules = [
{
services.mpd = {
@ -24,7 +26,7 @@ in {
}
{
key = "h";
command = ["previous_column" "jump_to_parent_directory"];
command = [ "previous_column" "jump_to_parent_directory" ];
}
{
key = "j";
@ -36,23 +38,23 @@ in {
}
{
key = "l";
command = ["next_column" "enter_directory" "play_item"];
command = [ "next_column" "enter_directory" "play_item" ];
}
{
key = "H";
command = ["select_item" "scroll_down"];
command = [ "select_item" "scroll_down" ];
}
{
key = "J";
command = ["move_sort_order_down" "move_selected_items_down"];
command = [ "move_sort_order_down" "move_selected_items_down" ];
}
{
key = "K";
command = ["move_sort_order_up" "move_selected_items_up"];
command = [ "move_sort_order_up" "move_selected_items_up" ];
}
{
key = "L";
command = ["select_item" "scroll_up"];
command = [ "select_item" "scroll_up" ];
}
{
key = "'";
@ -149,5 +151,5 @@ in {
}
];
environment.systemPackages = with pkgs; [mpc-cli];
environment.systemPackages = with pkgs; [ mpc-cli ];
}

View File

@ -1,4 +1,5 @@
{pkgs, ...}: let
{ pkgs, ... }:
let
vim-nix-rummik = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "vim-nix";
version = "0def8020f152a51c011a707680780dac61a8989a";
@ -9,7 +10,8 @@
sha256 = "sha256-Q+Jx6/MgeE2hsd/a6FqfXpAOaRcNymZW6t75hYCcH4E=";
};
};
in {
in
{
programs.neovim.enable = true;
home-manager.sharedModules = [

View File

@ -1,5 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }: {
services.ratbagd.enable = true;
environment.systemPackages = [pkgs.piper];
environment.systemPackages = [ pkgs.piper ];
}

View File

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
services.pipewire = {
enable = true;

View File

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
home-manager.sharedModules = [
{
programs.qutebrowser = {
@ -30,12 +30,12 @@
fileselect = {
handler = "external";
folder.command = ["kitty" "-e" "joshuto" "--output-file" "{}"];
multiple_files.command = ["kitty" "-e" "joshuto" "--output-file" "{}"];
single_file.command = ["kitty" "-e" "joshuto" "--output-file" "{}"];
folder.command = [ "kitty" "-e" "joshuto" "--output-file" "{}" ];
multiple_files.command = [ "kitty" "-e" "joshuto" "--output-file" "{}" ];
single_file.command = [ "kitty" "-e" "joshuto" "--output-file" "{}" ];
};
editor.command = ["kitty" "-e" "nvim" "{}"];
editor.command = [ "kitty" "-e" "nvim" "{}" ];
};
keyBindings = {

View File

@ -1,4 +1,4 @@
{lib, ...}: {
{ lib, ... }: {
home-manager.sharedModules = [
{
programs.rofi = {

View File

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
stylix.image = ./wallpaper.png;
stylix.polarity = "dark";
stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/monokai.yaml";

View File

@ -1,5 +1,5 @@
{pkgs, ...}: {
security.pam.services.swaylock = {};
{ pkgs, ... }: {
security.pam.services.swaylock = { };
home-manager.sharedModules = [
{

View File

@ -1,11 +1,11 @@
{pkgs, ...}: {
{ pkgs, ... }: {
programs.thunar.enable = true;
services.tumbler.enable = true; # Thumbnail support
environment.systemPackages = with pkgs; [
xfce.exo # Open with kitty support
glib
(pkgs.callPackage ../../packages/go-thumbnailer {})
(pkgs.callPackage ../../packages/go-thumbnailer { })
];
services.gvfs.enable = true; # Trash support

View File

@ -1,7 +1,6 @@
{
lib,
hyprland,
...
{ lib
, hyprland
, ...
}: {
home-manager.sharedModules = [
{
@ -16,8 +15,8 @@
width = 45;
spacing = 8;
modules-left = ["wlr/workspaces" "custom/new-workspace"];
modules-right = ["tray" "wireplumber" "backlight" "battery" "clock"];
modules-left = [ "wlr/workspaces" "custom/new-workspace" ];
modules-right = [ "tray" "wireplumber" "backlight" "battery" "clock" ];
tray = {
icon-size = 24;
@ -46,13 +45,13 @@
format = "{icon}";
tooltip-format = "{volume}% {node_name}";
format-muted = "";
format-icons = ["" ""];
format-icons = [ "" "" ];
};
battery = {
"format" = "{icon}";
"tooltip-format" = "{capacity}% {timeTo}";
"format-icons" = ["" "" "" "" ""];
"format-icons" = [ "" "" "" "" "" ];
};
clock = {
@ -73,7 +72,7 @@
backlight = {
"format" = "{icon}";
"format-icons" = ["" ""];
"format-icons" = [ "" "" ];
};
"custom/new-workspace" = {

View File

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
waycorner
];

View File

@ -1,6 +1,7 @@
let
VARIABLES = import ../../src/variables.nix;
in {
in
{
home-manager.sharedModules = [
{
xdg.userDirs = {

View File

@ -2,7 +2,7 @@
nixpkgs.overlays = [
(final: prev: {
alejandra = prev.alejandra.overrideAttrs (old: {
patches = (old.patches or []) ++ [./remove-ads.patch];
patches = (old.patches or [ ]) ++ [ ./remove-ads.patch ];
});
})
];

View File

@ -1,4 +1,4 @@
{lib, ...}: {
{ lib, ... }: {
nixpkgs.overlays = [
(final: prev: {
joshuto = prev.joshuto.overrideAttrs (oldAttrs: rec {

View File

@ -2,7 +2,7 @@
nixpkgs.overlays = [
(final: prev: {
kitty = prev.kitty.overrideAttrs (old: {
patches = (old.patches or []) ++ [./fix-duplicate-lines.patch];
patches = (old.patches or [ ]) ++ [ ./fix-duplicate-lines.patch ];
});
})
];

View File

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
nixpkgs.overlays = [
(final: prev: {
rofi-unwrapped = prev.rofi-unwrapped.overrideAttrs (oldAttrs: rec {
@ -12,8 +12,8 @@
sha256 = "sha256-8IfHpaVFGeWqyw+tLjNtg+aWwAHhSA5PuXJYjpoht2E=";
};
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [pkgs.wayland-scanner];
buildInputs = oldAttrs.buildInputs ++ [pkgs.wayland pkgs.wayland-protocols];
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ pkgs.wayland-scanner ];
buildInputs = oldAttrs.buildInputs ++ [ pkgs.wayland pkgs.wayland-protocols ];
});
})
];

View File

@ -1,9 +1,9 @@
{
lib,
buildGoModule,
fetchFromGitHub,
pkg-config,
vips,
{ lib
, buildGoModule
, fetchFromGitHub
, pkg-config
, vips
,
}:
buildGoModule rec {
pname = "go-thumbnailer";
@ -35,6 +35,6 @@ buildGoModule rec {
description = "A cover thumbnailer written in Go for performance and reliability";
homepage = "https://github.com/donovanglover/go-thumbnailer";
license = licenses.mit;
maintainers = with maintainers; [donovanglover];
maintainers = with maintainers; [ donovanglover ];
};
}

View File

@ -1,15 +1,16 @@
{
pkgs,
lib,
hypr-contrib,
nix-gaming,
crystal-flake,
nixpkgs-hyprland-autoname-workspaces,
nixpkgs-srb2,
...
}: let
{ pkgs
, lib
, hypr-contrib
, nix-gaming
, crystal-flake
, nixpkgs-hyprland-autoname-workspaces
, nixpkgs-srb2
, ...
}:
let
VARIABLES = import ./variables.nix;
in {
in
{
imports = [
"${VARIABLES.hostHardwareConfiguration}"
../overlays
@ -24,7 +25,7 @@ in {
# nix
nix.package = pkgs.nixFlakes;
nix.settings.experimental-features = ["nix-command" "flakes" "repl-flake"];
nix.settings.experimental-features = [ "nix-command" "flakes" "repl-flake" ];
nix.settings.auto-optimise-store = true;
hardware.opengl.driSupport32Bit = true;
@ -205,7 +206,7 @@ in {
NODE_OPTIONS = "--max_old_space_size=16384";
};
environment.defaultPackages = [];
environment.defaultPackages = [ ];
system.stateVersion = VARIABLES.stateVersion;
# home-manager
@ -278,7 +279,7 @@ in {
isNormalUser = true;
uid = 1000;
password = "user";
extraGroups = ["wheel" "networkmanager"];
extraGroups = [ "wheel" "networkmanager" ];
};
};
@ -300,7 +301,7 @@ in {
wifi.macAddress = "random";
ethernet.macAddress = "random";
unmanaged = ["interface-name:ve-*"];
unmanaged = [ "interface-name:ve-*" ];
};
useHostResolvConf = true;
@ -318,7 +319,7 @@ in {
restrictNetwork = true;
};
virtualisation.qemu.options = ["-device virtio-vga-gl" "-display sdl,gl=on,show-cursor=off" "-full-screen"];
virtualisation.qemu.options = [ "-device virtio-vga-gl" "-display sdl,gl=on,show-cursor=off" "-full-screen" ];
environment.sessionVariables = {
WLR_NO_HARDWARE_CURSORS = "1";
@ -331,12 +332,12 @@ in {
enableExcludeWrapper = false;
};
networking.firewall.allowedTCPPorts = [11918];
networking.firewall.allowedTCPPorts = [ 11918 ];
networking = {
nat = {
enable = true;
internalInterfaces = ["ve-+"];
internalInterfaces = [ "ve-+" ];
externalInterface = "wg-mullvad";
forwardPorts = [
@ -360,7 +361,7 @@ in {
programs.htop = {
enable = true;
package = pkgs."htop-vim";
settings = {tree_view = 1;};
settings = { tree_view = 1; };
};
services.greetd = {

View File

@ -5,7 +5,7 @@
hostHardwareConfiguration = ../hosts/laptop.nix;
stateVersion = "22.11";
defaultLocale = "ja_JP.UTF-8";
supportedLocales = ["ja_JP.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8"];
supportedLocales = [ "ja_JP.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8" ];
username = "user";
defaultBrowser = "librewolf";
}