Format code with alejandra

This commit is contained in:
2022-04-23 17:52:45 +01:00
parent 0d56231235
commit d90883e404
27 changed files with 743 additions and 677 deletions

View File

@@ -11,8 +11,12 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { nixpkgs, home-manager, i3utils, ... }@inputs: outputs = {
let nixpkgs,
home-manager,
i3utils,
...
} @ inputs: let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
@@ -21,7 +25,11 @@
lib = nixpkgs.lib; lib = nixpkgs.lib;
hostSystem = { hostname, headless }: lib.nixosSystem { hostSystem = {
hostname,
headless,
}:
lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
@@ -32,20 +40,34 @@
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
users = import ./users; users = import ./users;
extraSpecialArgs = {inherit hostname; inherit headless;}; extraSpecialArgs = {
inherit hostname;
inherit headless;
};
}; };
} }
]; ];
specialArgs = {inherit inputs;}; specialArgs = {inherit inputs;};
}; };
in { in {
nixosConfigurations = { nixosConfigurations = {
dingbox = hostSystem { hostname = "dingbox"; headless = false; }; dingbox = hostSystem {
miniding = hostSystem { hostname = "miniding"; headless = false; }; hostname = "dingbox";
pingbox = hostSystem { hostname = "pingbox"; headless = false; }; headless = false;
dingserver = hostSystem { hostname = "dingserver"; headless = true; }; };
miniding = hostSystem {
hostname = "miniding";
headless = false;
};
pingbox = hostSystem {
hostname = "pingbox";
headless = false;
};
dingserver = hostSystem {
hostname = "dingserver";
headless = true;
};
}; };
}; };
} }

View File

@@ -1,6 +1,9 @@
{ config, pkgs, lib, ...}:
{ {
config,
pkgs,
lib,
...
}: {
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.systemd-boot.enable = lib.mkDefault true; boot.loader.systemd-boot.enable = lib.mkDefault true;

View File

@@ -1,6 +1,9 @@
{ config, pkgs, inputs, ...}:
{ {
config,
pkgs,
inputs,
...
}: {
security.pam.services.gdm.enableGnomeKeyring = true; security.pam.services.gdm.enableGnomeKeyring = true;
# Enable the X11 windowing system. # Enable the X11 windowing system.
hardware.opengl.driSupport32Bit = true; hardware.opengl.driSupport32Bit = true;
@@ -9,7 +12,6 @@
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
programs.nm-applet.enable = true; programs.nm-applet.enable = true;
services = { services = {
gnome.gnome-keyring.enable = true; gnome.gnome-keyring.enable = true;
@@ -46,4 +48,3 @@
}; };
}; };
} }

View File

@@ -1,19 +1,19 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{ {
imports = config,
[ # Include the results of the hardware scan. pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../common ../common
../common/graphical ../common/graphical
]; ];
services.xserver = { services.xserver = {
dpi = 144; dpi = 144;
videoDrivers = ["nvidia"]; videoDrivers = ["nvidia"];
screenSection = '' screenSection = ''
@@ -21,7 +21,6 @@
Option "AllowIndirectGLXProtocol" "off" Option "AllowIndirectGLXProtocol" "off"
Option "TripleBuffer" "on" Option "TripleBuffer" "on"
''; '';
}; };
hardware.nvidia.modesetting.enable = true; hardware.nvidia.modesetting.enable = true;
@@ -38,4 +37,3 @@
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.05"; # Did you read the comment? system.stateVersion = "21.05"; # Did you read the comment?
} }

View File

@@ -1,11 +1,15 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/installer/scan/not-detected.nix") lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
@@ -13,13 +17,13 @@
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = []; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/1c0e1988-4420-4485-bf16-ffb8ec854c69"; device = "/dev/disk/by-uuid/1c0e1988-4420-4485-bf16-ffb8ec854c69";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/F5EA-A9CB"; device = "/dev/disk/by-uuid/F5EA-A9CB";
fsType = "vfat"; fsType = "vfat";
}; };

View File

@@ -1,12 +1,13 @@
{ pkgs, lib, ... }:
{ {
pkgs,
lib,
...
}: {
networking.firewall.allowedTCPPorts = [80 8448 443]; networking.firewall.allowedTCPPorts = [80 8448 443];
services.caddy = { services.caddy = {
enable = true; enable = true;
virtualHosts = { virtualHosts = {
"matrix.broccoli.town" = { "matrix.broccoli.town" = {
extraConfig = '' extraConfig = ''
reverse_proxy /_matrix/* http://localhost:8008 reverse_proxy /_matrix/* http://localhost:8008
@@ -37,7 +38,8 @@
X-Content-Type-Options "nosniff" X-Content-Type-Options "nosniff"
X-Robots-Tag "noindex, noarchive, nofollow" X-Robots-Tag "noindex, noarchive, nofollow"
} }
root * ${pkgs.element-web.override { root * ${
pkgs.element-web.override {
conf = { conf = {
default_server_config."m.homeserver" = { default_server_config."m.homeserver" = {
"base_url" = "https://broccoli.town"; "base_url" = "https://broccoli.town";
@@ -57,7 +59,6 @@
file_server file_server
''; '';
}; };
}; };
}; };
} }

View File

@@ -1,8 +1,11 @@
{ config, pkgs, lib, ... }:
{ {
imports = config,
[ # Include the results of the hardware scan. pkgs,
lib,
...
}: {
imports = [
# Include the results of the hardware scan.
../common ../common
./hardware-configuration.nix ./hardware-configuration.nix
./caddy.nix ./caddy.nix
@@ -29,6 +32,4 @@
]; ];
system.stateVersion = "21.11"; # Did you read the comment? system.stateVersion = "21.11"; # Did you read the comment?
} }

View File

@@ -1,11 +1,15 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/profiles/qemu-guest.nix") lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
@@ -13,8 +17,8 @@
boot.kernelModules = []; boot.kernelModules = [];
boot.extraModulePackages = []; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/f91229ad-de6b-49ad-8858-e49fea85e8a1"; device = "/dev/disk/by-uuid/f91229ad-de6b-49ad-8858-e49fea85e8a1";
fsType = "ext4"; fsType = "ext4";
}; };

View File

@@ -1,6 +1,9 @@
{ config, pkgs, lib, ... }:
{ {
config,
pkgs,
lib,
...
}: {
services.grafana = { services.grafana = {
enable = true; enable = true;
}; };
@@ -14,9 +17,11 @@
{ {
job_name = "synapse"; job_name = "synapse";
metrics_path = "/_synapse/metrics"; metrics_path = "/_synapse/metrics";
static_configs = [{ static_configs = [
{
targets = ["localhost:9000"]; targets = ["localhost:9000"];
}]; }
];
} }
]; ];
}; };

View File

@@ -1,5 +1,9 @@
{ config, pkgs, lib, ... }: {
let config,
pkgs,
lib,
...
}: let
fqdn = "matrix.broccoli.town"; fqdn = "matrix.broccoli.town";
in { in {
services.matrix-synapse = { services.matrix-synapse = {

View File

@@ -1,5 +1,9 @@
{ config, pkgs, lib, ... }:
{ {
config,
pkgs,
lib,
...
}: {
services.syncthing = { services.syncthing = {
enable = true; enable = true;
}; };

View File

@@ -1,12 +1,13 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{ {
imports = config,
[ # Include the results of the hardware scan. pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../common ../common
../common/graphical ../common/graphical
@@ -30,4 +31,3 @@
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.05"; # Did you read the comment? system.stateVersion = "21.05"; # Did you read the comment?
} }

View File

@@ -1,11 +1,15 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/installer/scan/not-detected.nix") lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod"];
@@ -13,16 +17,15 @@
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = []; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/6a362ee7-854b-4a5b-8989-e65af01b9b99"; device = "/dev/disk/by-uuid/6a362ee7-854b-4a5b-8989-e65af01b9b99";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/C103-FFC1"; device = "/dev/disk/by-uuid/C103-FFC1";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = []; swapDevices = [];
} }

View File

@@ -1,12 +1,13 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{ {
imports = config,
[ # Include the results of the hardware scan. pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../common ../common
../common/graphical ../common/graphical
@@ -55,6 +56,4 @@
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.05"; # Did you read the comment? system.stateVersion = "21.05"; # Did you read the comment?
} }

View File

@@ -1,11 +1,15 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/installer/scan/not-detected.nix") lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"];
@@ -13,13 +17,13 @@
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = []; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/3d0e0831-a08a-4d97-ad5b-d07448346dee"; device = "/dev/disk/by-uuid/3d0e0831-a08a-4d97-ad5b-d07448346dee";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/C4F1-BE4C"; device = "/dev/disk/by-uuid/C4F1-BE4C";
fsType = "vfat"; fsType = "vfat";
}; };

View File

@@ -1,9 +1,11 @@
{ config, lib, pkgs, ...}: {
config,
let lib,
pkgs,
...
}: let
mod = "Mod4"; mod = "Mod4";
in { in {
home.file = { home.file = {
"bin/scripts/goup" = { "bin/scripts/goup" = {
source = ./goup; source = ./goup;
@@ -171,8 +173,14 @@ in {
modifier = mod; modifier = mod;
startup = [ startup = [
{ command = "$HOME/bin/scripts/flower"; always = true; } {
{ command = "feh --bg-fill $HOME/wallpapers/wallpaper.jpg"; always = false; } command = "$HOME/bin/scripts/flower";
always = true;
}
{
command = "feh --bg-fill $HOME/wallpapers/wallpaper.jpg";
always = false;
}
]; ];
terminal = "kitty"; terminal = "kitty";
@@ -181,11 +189,16 @@ in {
border = lib.mkDefault 2; border = lib.mkDefault 2;
titlebar = false; titlebar = false;
commands = [ commands = [
{ command = "move position center #2116 46"; criteria = { class = "jetbrains-toolbox"; }; } {
{ command = "move scratchpad"; criteria = { instance = "spotify"; }; } command = "move position center #2116 46";
criteria = {class = "jetbrains-toolbox";};
}
{
command = "move scratchpad";
criteria = {instance = "spotify";};
}
]; ];
}; };
}; };
}; };
}; };

View File

@@ -1,6 +1,8 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
programs.i3status-rust = { programs.i3status-rust = {
enable = true; enable = true;
bars = { bars = {

View File

@@ -1,6 +1,4 @@
{pkgs, ...}: {pkgs, ...}: {
{
services.polybar = { services.polybar = {
enable = true; enable = true;
@@ -14,7 +12,5 @@
''; '';
config = ./config; config = ./config;
}; };
} }

View File

@@ -1,6 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.rofi = { programs.rofi = {
enable = true; enable = true;
theme = ./colour.rasi; theme = ./colour.rasi;

View File

@@ -1,6 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.alacritty = { programs.alacritty = {
enable = false; enable = false;
settings = { settings = {

View File

@@ -1,5 +1,4 @@
{...}: {...}: {
{
home.file.".config/helix" = { home.file.".config/helix" = {
source = ./config; source = ./config;
recursive = true; recursive = true;

View File

@@ -1,6 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.kitty = { programs.kitty = {
enable = true; enable = true;
font = { font = {

View File

@@ -1,12 +1,11 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.neovim = { programs.neovim = {
enable = true; enable = true;
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
(nvim-treesitter.withPlugins ( (nvim-treesitter.withPlugins (
plugins: with plugins; [ plugins:
with plugins; [
#tree-sitter-nix #tree-sitter-nix
tree-sitter-go tree-sitter-go
tree-sitter-c tree-sitter-c

View File

@@ -1,5 +1,11 @@
{ pkgs, lib, fetchurl, hostname, headless, ... }: {
let pkgs,
lib,
fetchurl,
hostname,
headless,
...
}: let
cliPackages = with pkgs; [ cliPackages = with pkgs; [
aerc aerc
entr entr
@@ -9,7 +15,8 @@ let
oh-my-zsh oh-my-zsh
( (
let let
my-python-packages = python-packages: with python-packages; [ my-python-packages = python-packages:
with python-packages; [
tkinter tkinter
requests requests
]; ];
@@ -38,20 +45,16 @@ let
spotify spotify
xclip xclip
]; ];
in in {
{ imports =
imports = [ [
./configs/system ./configs/system
]
] ++ lib.optionals (!headless) [ ++ lib.optionals (!headless) [
./configs/desktop ./configs/desktop
]
] ++ lib.optionals (builtins.pathExists ./host-specific/${hostname}) [ ++ lib.optionals (builtins.pathExists ./host-specific/${hostname}) [
./host-specific/${hostname} ./host-specific/${hostname}
]; ];
home = { home = {
@@ -88,7 +91,6 @@ in
}; };
programs = { programs = {
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
home-manager.enable = true; home-manager.enable = true;
@@ -152,5 +154,4 @@ in
inactiveInterval = 60; inactiveInterval = 60;
}; };
}; };
} }

View File

@@ -1,6 +1,9 @@
{ config, lib, pkgs, ...}:
{ {
config,
lib,
pkgs,
...
}: {
home.file = { home.file = {
"wallpapers" = { "wallpapers" = {
source = ./wallpapers; source = ./wallpapers;

View File

@@ -1,6 +1,9 @@
{ config, lib, pkgs, ...}:
{ {
config,
lib,
pkgs,
...
}: {
services.picom = { services.picom = {
enable = true; enable = true;
vSync = true; vSync = true;

View File

@@ -1,6 +1,9 @@
{ config, lib, pkgs, ...}:
{ {
config,
lib,
pkgs,
...
}: {
home = { home = {
file = { file = {
"wallpapers" = { "wallpapers" = {