Reformat nix code with alejandra

This commit is contained in:
Jacob Hinkle 2022-09-08 12:27:21 -04:00
parent 3f7ad45ebe
commit a897038529
10 changed files with 244 additions and 217 deletions

View File

@ -24,15 +24,20 @@
};
};
outputs = inputs @ { self, nixpkgs, nixos-hardware, home-manager, sops-nix, ... }:
let
outputs = inputs @ {
self,
nixpkgs,
nixos-hardware,
home-manager,
sops-nix,
...
}: let
system = "x86_64-linux";
homeManagerConfFor = config: {...}: {
#nixpkgs.overlays = [ nur.overlay ];
imports = [config];
};
in {
nixosConfigurations = {
# Thinkpad T470 laptop
buck = nixpkgs.lib.nixosSystem {
@ -40,7 +45,8 @@
modules = [
nixos-hardware.nixosModules.lenovo-thinkpad-t470s
./machines/buck/configuration.nix
home-manager.nixosModules.home-manager {
home-manager.nixosModules.home-manager
{
home-manager.useUserPackages = true;
home-manager.users.jacob = homeManagerConfFor ./home/jacob.nix;
}
@ -54,7 +60,8 @@
nixos-hardware.nixosModules.common-pc-hdd
nixos-hardware.nixosModules.common-cpu-intel-cpu-only
./machines/pedro/configuration.nix
home-manager.nixosModules.home-manager {
home-manager.nixosModules.home-manager
{
home-manager.useUserPackages = true;
home-manager.users.jacob = homeManagerConfFor ./home/jacob.nix;
}

View File

@ -1,11 +1,11 @@
pkgs :
rec {
pkgs: rec {
menu = "${pkgs.dmenu}/bin/dmenu_run";
modifier = "Mod1";
terminal = "kitty";
keybindings = let
browser = "qutebrowser";
scrot2clip = pkgs.writeShellScript "scrot2clip"
scrot2clip =
pkgs.writeShellScript "scrot2clip"
"${pkgs.scrot}/bin/scrot -s - | ${pkgs.xclip}/bin/xclip -selection primary -i -t image/png";
in {
"${modifier}+Return" = "exec ${terminal} tmux new";
@ -54,31 +54,20 @@ rec {
"${modifier}+9" = "workspace number 9";
"${modifier}+0" = "workspace number 10";
"${modifier}+Shift+1" =
"move container to workspace number 1";
"${modifier}+Shift+2" =
"move container to workspace number 2";
"${modifier}+Shift+3" =
"move container to workspace number 3";
"${modifier}+Shift+4" =
"move container to workspace number 4";
"${modifier}+Shift+5" =
"move container to workspace number 5";
"${modifier}+Shift+6" =
"move container to workspace number 6";
"${modifier}+Shift+7" =
"move container to workspace number 7";
"${modifier}+Shift+8" =
"move container to workspace number 8";
"${modifier}+Shift+9" =
"move container to workspace number 9";
"${modifier}+Shift+0" =
"move container to workspace number 10";
"${modifier}+Shift+1" = "move container to workspace number 1";
"${modifier}+Shift+2" = "move container to workspace number 2";
"${modifier}+Shift+3" = "move container to workspace number 3";
"${modifier}+Shift+4" = "move container to workspace number 4";
"${modifier}+Shift+5" = "move container to workspace number 5";
"${modifier}+Shift+6" = "move container to workspace number 6";
"${modifier}+Shift+7" = "move container to workspace number 7";
"${modifier}+Shift+8" = "move container to workspace number 8";
"${modifier}+Shift+9" = "move container to workspace number 9";
"${modifier}+Shift+0" = "move container to workspace number 10";
"${modifier}+Shift+c" = "reload";
"${modifier}+Shift+r" = "restart";
"${modifier}+Shift+e" =
"exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
"${modifier}+Shift+e" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
"${modifier}+r" = "mode resize";
};

View File

@ -1,8 +1,12 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
imports = [
({lib, ...}: {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"zoom"
];
})
@ -58,8 +62,8 @@
stateVersion = "22.05";
};
accounts.email = {
accounts.gmail = {
accounts.email.accounts = {
gmail = {
address = "jacob.hinkle@gmail.com";
passwordCommand = "${pkgs.coreutils}/bin/cat /run/secrets/email/gmail/password";
flavor = "gmail.com";
@ -71,7 +75,7 @@
primary = true;
realName = "Jacob Hinkle";
};
accounts.jhink = {
jhink = {
address = "jacob.hinkle@jhink.org";
imap.host = "mail.privateemail.com";
smtp.host = "mail.privateemail.com";
@ -132,6 +136,7 @@
vim-nix
];
};
#notmuch.enable = true;
qutebrowser = import ./qutebrowser.nix;
rbw = {
enable = true;
@ -223,7 +228,8 @@
xmonad = {
enable = true;
enableContribAndExtras = true;
extraPackages = haskellPackages: with haskellPackages; [
extraPackages = haskellPackages:
with haskellPackages; [
#dbus
#List
#monad-logger

View File

@ -1,12 +1,14 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, sops, ... }:
{
imports =
[ # Include the results of the hardware scan.
config,
pkgs,
sops,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
];
@ -61,7 +63,6 @@
# Select internationalisation properties.
i18n.defaultLocale = "en_US.utf8";
# Allow unfree packages
nixpkgs.config.allowUnfree = true;

View File

@ -1,11 +1,15 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
@ -13,13 +17,13 @@
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/cc13728f-a446-49db-98fc-51db875bba20";
fileSystems."/" = {
device = "/dev/disk/by-uuid/cc13728f-a446-49db-98fc-51db875bba20";
fsType = "ext4";
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/164F-882B";
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/164F-882B";
fsType = "vfat";
};

View File

@ -1,9 +1,13 @@
# Edit this configuration file to define what should be installed on your system. Help is available in the configuration.nix(5) man page and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, options, sops, ... }:
{ imports =
[ # Include the results of the hardware scan.
{
config,
pkgs,
options,
sops,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration-zfs.nix
];
@ -36,7 +40,8 @@
};
# ZFS settings
initrd.availableKernelModules = [ "usbhid" "usb_storage" ]; initrd.supportedFilesystems = [ "zfs" ]; # boot from zfs supportedFilesystems = [ "zfs" ]; zfs.devNodes = "/dev/";
initrd.availableKernelModules = ["usbhid" "usb_storage"];
initrd.supportedFilesystems = ["zfs"]; # boot from zfs supportedFilesystems = [ "zfs" ]; zfs.devNodes = "/dev/";
};
# Set your time zone.
@ -63,21 +68,37 @@
};
firewall = {
allowedTCPPorts = [
8384 22000 # syncthing
8080 8443 6789 8880 8843 27117 # unifi controller: https://help.ui.com/hc/en-us/articles/218506997-UniFi-Network-Required-Ports-Reference
53 8088 # pihole
8384
22000 # syncthing
8080
8443
6789
8880
8843
27117 # unifi controller: https://help.ui.com/hc/en-us/articles/218506997-UniFi-Network-Required-Ports-Reference
53
8088 # pihole
#3000 # gitea
#8081 # vaultwarden
#8000 # paperless
80 443 # reverse proxy
80
443 # reverse proxy
];
allowedUDPPorts = [
22000 21027 # syncthing
3478 5514 10001 1900 123 # unifi
22000
21027 # syncthing
3478
5514
10001
1900
123 # unifi
53 # pihole
];
allowedUDPPortRanges = [
{ from = 5656; to = 5699; } # unifi
{
from = 5656;
to = 5699;
} # unifi
];
};
timeServers = ["192.168.88.1"] ++ options.networking.timeServers.default;
@ -93,7 +114,6 @@
hardware.bluetooth.enable = false;
services.blueman.enable = false;
# Enable CUPS to print documents.
services.printing.enable = false;
@ -234,4 +254,3 @@
nix.settings.experimental-features = ["nix-command" "flakes"];
}

View File

@ -1,11 +1,15 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
@ -18,83 +22,82 @@
# high-resolution display
hardware.video.hidpi.enable = lib.mkDefault true;
fileSystems."/" =
{ device = "none";
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
};
fileSystems."/boot" =
{
fileSystems."/boot" = {
device = "/dev/disk/by-partuuid/e7ebac1e-eb4c-4a7d-8893-49a95f6014d4";
fsType = "vfat";
};
fileSystems."/nix" =
{ device = "rpool/nixos/nix";
fileSystems."/nix" = {
device = "rpool/nixos/nix";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/etc" =
{ device = "rpool/nixos/etc";
fileSystems."/etc" = {
device = "rpool/nixos/etc";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/var" =
{ device = "rpool/nixos/var";
fileSystems."/var" = {
device = "rpool/nixos/var";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/var/lib" =
{ device = "rpool/nixos/var/lib";
fileSystems."/var/lib" = {
device = "rpool/nixos/var/lib";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/var/log" =
{ device = "rpool/nixos/var/log";
fileSystems."/var/log" = {
device = "rpool/nixos/var/log";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/var/spool" =
{ device = "rpool/nixos/var/spool";
fileSystems."/var/spool" = {
device = "rpool/nixos/var/spool";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/serverdata/pihole" =
{ device = "rpool/serverdata/pihole";
fileSystems."/serverdata/pihole" = {
device = "rpool/serverdata/pihole";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/serverdata/gitea" =
{ device = "rpool/serverdata/gitea";
fileSystems."/serverdata/gitea" = {
device = "rpool/serverdata/gitea";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/serverdata/home-assistant" =
{ device = "rpool/serverdata/home-assistant";
fileSystems."/serverdata/home-assistant" = {
device = "rpool/serverdata/home-assistant";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/home" =
{ device = "rpool/userdata/home";
fileSystems."/home" = {
device = "rpool/userdata/home";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/root" =
{ device = "rpool/userdata/home/root";
fileSystems."/root" = {
device = "rpool/userdata/home/root";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/home/jacob" =
{ device = "rpool/userdata/home/jacob";
fileSystems."/home/jacob" = {
device = "rpool/userdata/home/jacob";
fsType = "zfs";
options = ["zfsutil"];
};
@ -105,5 +108,4 @@
randomEncryption = true;
}
];
}

View File

@ -1,5 +1,4 @@
serverIP :
{
serverIP: {
image = "pihole/pihole:2022.07.1";
ports = [
"${serverIP}:53:53/tcp"