pre-format

This commit is contained in:
Gerg-L 2023-09-23 17:35:09 -04:00
parent 3ad599c6aa
commit de7683556e
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
21 changed files with 462 additions and 403 deletions

View file

@ -11,6 +11,6 @@ for i in $STAGED; do
done
deadnix -qe $STAGED
alejandra -q $STAGED
nixfmt -q $STAGED
git add $STAGED

112
flake.lock generated
View file

@ -59,11 +59,11 @@
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
@ -88,6 +88,37 @@
"type": "github"
}
},
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"lowdown-src": {
"flake": false,
"locked": {
@ -139,24 +170,50 @@
"inputs": {
"flake-compat": "flake-compat",
"lowdown-src": "lowdown-src",
"nixpkgs": "nixpkgs",
"nixpkgs": [
"unstable"
],
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1694007573,
"narHash": "sha256-DThtWWrG8JHzG6oS/JA/0mOVRj7IxHNdVnXk291wJRs=",
"lastModified": 1694067117,
"narHash": "sha256-fstL4alQM8QpsunEtaErpURwQ0yoTh19YdjobsN2ids=",
"owner": "NixOS",
"repo": "nix",
"rev": "3a62651bd663a849a568bf69017d0f3b1addd564",
"rev": "2da46530d0bb4faf8ca0605f8fdffca7bd5baa73",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "3a62651bd663a849a568bf69017d0f3b1addd564",
"ref": "2.17-maintenance",
"repo": "nix",
"type": "github"
}
},
"nixfmt": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils",
"nixpkgs": [
"unstable"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1689712241,
"narHash": "sha256-SJlTDNBYBJVl8HrHPT8kWKqVxa7MNSosLI07svHG1A8=",
"owner": "piegamesde",
"repo": "nixfmt",
"rev": "a93dcf7e9e19b4308d6cdb50da829839bf88817a",
"type": "github"
},
"original": {
"owner": "piegamesde",
"ref": "rfc101-style",
"repo": "nixfmt",
"type": "github"
}
},
"nixlib": {
"locked": {
"lastModified": 1693701915,
@ -193,22 +250,6 @@
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1670461440,
"narHash": "sha256-jy1LB8HOMKGJEGXgzFRLDU1CBGL0/LlkolgnqIsF0D8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "04a75b2eecc0acf6239acf9dd04485ff8d14f425",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.11-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
@ -226,6 +267,22 @@
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1672580127,
"narHash": "sha256-3lW3xZslREhJogoOkjeZtlBtvFMyxHku7I/9IVehhT8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0874168639713f547c05947c76124f78441ea46c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1694908564,
"narHash": "sha256-ducA98AuWWJu5oUElIzN24Q22WlO8bOfixGzBgzYdVc=",
@ -243,7 +300,7 @@
},
"nvim-flake": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-compat": "flake-compat_3",
"neovim-src": "neovim-src",
"nixpkgs": [
"unstable"
@ -269,6 +326,7 @@
"fetch-rs": "fetch-rs",
"master": "master",
"nix": "nix",
"nixfmt": "nixfmt",
"nixos-generators": "nixos-generators",
"nvim-flake": "nvim-flake",
"sops-nix": "sops-nix",
@ -283,7 +341,7 @@
"nixpkgs": [
"unstable"
],
"nixpkgs-stable": "nixpkgs-stable"
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1695284550,
@ -301,7 +359,7 @@
},
"spicetify-nix": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-compat": "flake-compat_4",
"nixpkgs": [
"unstable"
]

View file

@ -5,7 +5,10 @@
unstable.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
stable.url = "github:NixOS/nixpkgs?ref=nixos-23.05";
nix.url = "github:NixOS/nix?ref=3a62651bd663a849a568bf69017d0f3b1addd564";
nix = {
url = "github:NixOS/nix?ref=2.17-maintenance";
inputs.nixpkgs.follows = "unstable";
};
nixos-generators = {
url = "github:nix-community/nixos-generators";
@ -19,6 +22,10 @@
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "unstable";
};
nixfmt = {
url = "github:piegamesde/nixfmt?ref=rfc101-style";
inputs.nixpkgs.follows = "unstable";
};
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "unstable";
@ -69,7 +76,23 @@
"game-laptop"
"moms-laptop"
];
formatter.${system} = pkgs.alejandra;
formatter.${system} = pkgs.writeShellApplication {
name = "lint";
runtimeInputs = [
(pkgs.nixfmt.overrideAttrs {
version = "0.6.0-${inputs.nixfmt.shortRev}";
src = inputs.nixfmt;
})
pkgs.deadnix
pkgs.statix
pkgs.fd
];
text = ''
fd '.*\.nix' . -x statix fix -- {} \;
fd '.*\.nix' . -X deadnix -e -- {} \; -X nixfmt {} \;
'';
};
devShells.${system}.default = pkgs.mkShell {
packages = [

View file

@ -1,28 +1,27 @@
{disko, ...}: _: {
{disko, ...}: {lib, ...}: {
imports = [disko.nixosModules.disko];
disko.devices = {
disk = {
"0E" = let
baseDevice = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N0E";
disko.devices.disk = lib.genAttrs ["0E" "22"] (name: let
fullName = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N${name}";
in {
type = "disk";
device = baseDevice;
device = fullName;
content = {
type = "gpt";
partitions = {
BOOT = {
device = "${baseDevice}-part1";
device = "${fullName}-part1";
type = "EF00";
start = "0";
end = "4G";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/efi0E";
mountpoint = "/efi${name}";
};
};
swap = {
device = "${baseDevice}-part2";
device = "${fullName}-part2";
start = "5G";
end = "21G";
content = {
@ -31,7 +30,7 @@
};
};
zfsroot = {
device = "${baseDevice}-part3";
device = "${fullName}-part3";
start = "21G";
end = "100%";
content = {
@ -41,49 +40,9 @@
};
};
};
};
"22" = let
baseDevice = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N22";
in {
type = "disk";
device = baseDevice;
content = {
type = "gpt";
partitions = {
BOOT = {
device = "${baseDevice}-part1";
type = "EF00";
start = "0";
end = "4G";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/efi22";
};
};
swap = {
device = "${baseDevice}-part2";
start = "5G";
end = "21G";
content = {
type = "swap";
randomEncryption = true;
};
};
zfsroot = {
device = "${baseDevice}-part3";
start = "21G";
end = "100%";
content = {
type = "zfs";
pool = "rpool";
};
};
};
};
};
};
zpool = {
});
disko.devices.zpool = {
rpool = {
type = "zpool";
mode = "mirror";
@ -137,6 +96,5 @@
};
};
};
};
_file = ./disko.nix;
}

View file

@ -1,4 +1,4 @@
{nvim-flake, ...}: {
{nvim-flake, nixfmt, ...}: {
pkgs,
config,
...
@ -43,32 +43,56 @@
nix.settings.system-features = ["kvm" "big-parallel" "nixos-test" "benchmark"];
environment = {
systemPackages = builtins.attrValues {
systemPackages = let
fmt = pkgs.nixfmt.overrideAttrs {
version = "0.6.0-${nixfmt.shortRev}";
src = nixfmt;
};
in
builtins.attrValues {
inherit
(pkgs)
bitwarden #store stuff
qbittorrent #steal stuff
pavucontrol #gui volume control
pcmanfm #file manager
librewolf #best browser
vlc #play stuff
bitwarden # store stuff
qbittorrent # steal stuff
pavucontrol # gui volume control
pcmanfm # file manager
librewolf # best browser
vlc # play stuff
ripgrep
fd
jq
xautoclick
prismlauncher
deadnix
statix
alejandra
nix-index
element-desktop
webcord
;
inherit (nvim-flake.packages.${pkgs.system}) neovim;
lint = pkgs.writeShellScriptBin "lint" ''
deadnix -e "''${1:-.}"
statix fix -- "''${1:-.}"
alejandra "''${1:-.}"
inherit fmt;
lint = pkgs.writeShellApplication {
name = "lint";
runtimeInputs = [
fmt
pkgs.deadnix
pkgs.statix
pkgs.fd
];
text = ''
if [ -z "''${1:-""}" ]; then
fd '.*\.nix' . -x statix fix -- {} \;
fd '.*\.nix' . -X deadnix -e -- {} \; -X nixfmt {} \;
else
statix fix -- "$1"
deadnix -e "$1"
nixfmt "$1"
fi
'';
};
};
etc = {
"jdks/17".source = "${pkgs.openjdk17}/bin";
"jdks/8".source = "${pkgs.openjdk8}/bin";

View file

@ -7,7 +7,6 @@
config = lib.mkIf false {
networking.firewall.allowedTCPPorts = [25565];
system.stateVersion = "unstable";
users.users.minecraft = {
description = "Minecraft server service user";
home = "/persist/minecraft";
@ -64,7 +63,7 @@
serviceConfig = {
Restart = "always";
User = "minecraft";
WorkingDirectory = "/minecraft";
WorkingDirectory = "/persist/minecraft";
StandardInput = "socket";
StandardOutput = "journal";

View file

@ -16,6 +16,7 @@ _: {
enableBrokenCiphersForSSE = false;
database.createLocally = true;
config = {
overwriteProtocol = "https";
dbtype = "pgsql";
adminpassFile = config.sops.secrets.nextcloud.path;
adminuser = "admin-root";

View file

@ -1,16 +1,18 @@
{spicetify-nix, ...}: {pkgs, ...}: let
spicePkgs = spicetify-nix.legacyPackages.${pkgs.system};
ex = spicePkgs.extensions;
in {
imports = [spicetify-nix.nixosModules.default];
local.allowedUnfree = ["spotify"];
programs.spicetify = {
enable = true;
enabledExtensions = [
ex.adblock
ex.hidePodcasts
ex.shuffle
];
enabledExtensions = builtins.attrValues {
inherit
(spicePkgs.extensions)
adblock
hidePodcasts
shuffle
;
};
theme = spicePkgs.themes.Comfy;
colorScheme = "custom";
customColorScheme = {

View file

@ -37,6 +37,16 @@ let
echo >> $out
'';
###END OF TAKEN PART
cfg_monitors = pkgs.writeShellApplication {
name = "cfg_monitors";
runtimeInputs = [pkgs.xorg.xrandr pkgs.xorg.xset pkgs.gawk pkgs.gnugrep];
text = ''
xrandr --output DP-0 --auto --mode 3440x1440 --rate 120 --primary --pos 0x0
xrandr --output "$(xrandr | grep -e 'HDMI.* connected.*'| awk '{ print$1 }')" --auto --mode 1920x1080 --rate 144 --set TearFree on --pos 3440x360
xset -dpms
'';
};
in {
environment.etc = {
"Xorg/1_mon.conf".source = pkgs.runCommand "1_mon.conf" {} (
@ -103,6 +113,7 @@ in {
systemPackages = [
pkgs.virt-manager
pkgs.dmidecode
cfg_monitors
];
shellAliases = {
vm-start = "virsh start Windows";
@ -110,29 +121,33 @@ in {
};
};
programs.dconf.enable = true;
users.users.gerg.extraGroups = ["kvm" "libvirtd"];
services.xserver.displayManager.xserverArgs = lib.mkAfter ["-config /etc/Xorg/active.conf"];
services.xserver.displayManager.sessionCommands = lib.mkBefore ''
if ! [ -e "/etc/Xorg/ONE_MONITOR" ] ; then
xrandr --output DP-0 --auto --mode 3440x1440 --rate 120 --primary --pos 0x0
xrandr --output "$(xrandr | grep -e 'HDMI.* connected.*'| awk '{ print$1 }')" --auto --mode 1920x1080 --rate 144 --set TearFree on --pos 3440x360
xset -dpms
${lib.getExe cfg_monitors}
fi
'';
systemd.tmpfiles.rules = let
qemuHook = pkgs.writeShellScript "qemu-hook" ''
qemuHook = pkgs.writeShellApplication {
name = "qemu-hook";
runtimeInputs = [pkgs.libvirt pkgs.systemd pkgs.kmod];
text = ''
GUEST_NAME="$1"
OPERATION="$2"
SUB_OPERATION="$3"
if [ "$GUEST_NAME" == "Windows" ]; then
if [ "$OPERATION" == "prepare" ]; then
systemctl stop display-manager.service
modprobe -r -a nvidia_uvm nvidia_drm nvidia nvidia_modeset
${pkgs.libvirt}/bin/virsh nodedev-detach pci_0000_01_00_0
${pkgs.libvirt}/bin/virsh nodedev-detach pci_0000_01_00_1
virsh nodedev-detach pci_0000_01_00_0
virsh nodedev-detach pci_0000_01_00_1
systemctl set-property --runtime -- user.slice AllowedCPUs=8-15,24-31
systemctl set-property --runtime -- system.slice AllowedCPUs=8-15,24-31
systemctl set-property --runtime -- init.scope AllowedCPUs=8-15,24-31
@ -145,8 +160,8 @@ in {
systemctl set-property --runtime -- user.slice AllowedCPUs=0-31
systemctl set-property --runtime -- system.slice AllowedCPUs=0-31
systemctl set-property --runtime -- init.scope AllowedCPUs=0-31
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_0
${pkgs.libvirt}/bin/virsh nodedev-reattach pci_0000_01_00_1
virsh nodedev-reattach pci_0000_01_00_0
virsh nodedev-reattach pci_0000_01_00_1
modprobe -a nvidia_uvm nvidia_drm nvidia nvidia_modeset
ln -fs /etc/Xorg/2_mon.conf /etc/Xorg/active.conf
rm /etc/Xorg/ONE_MONITOR
@ -154,9 +169,10 @@ in {
fi
fi
'';
};
in [
"L /etc/Xorg/active.conf - - - - /etc/Xorg/2_mon.conf"
"C /var/lib/libvirt/hooks/qemu - - - - ${qemuHook}"
"C /var/lib/libvirt/hooks/qemu - - - - ${lib.getExe qemuHook}"
"C /var/lib/libvirt/qemu/Windows.xml - - - - ${./Windows.xml}"
];
_file = ./vfio.nix;

View file

@ -23,7 +23,7 @@
defaultSession = "none+dwm";
};
windowManager.session =
lib.singleton
[
{
name = "dwm";
start = ''
@ -43,7 +43,8 @@
dont_stop &
waitPID=$!
'';
};
}
];
};
environment.systemPackages = builtins.attrValues {
inherit

View file

@ -61,9 +61,10 @@ in {
pkgs.brightnessctl #brightness control for laptop
pkgs.playerctl #music control
pkgs.xclip
pkgs.coreutils
];
services.xserver.displayManager.sessionCommands = "${pkgs.sxhkd}/bin/sxhkd -c ${configFile} &";
services.xserver.displayManager.sessionCommands = ''
${lib.getExe' pkgs.sxhkd "sxhkd"} -c ${configFile} &
'';
}
)
];

87
modules/boot.nix Normal file
View file

@ -0,0 +1,87 @@
{self, ...}: {
lib,
pkgs,
config,
...
}: {
options.local.bootConfig.disable = lib.mkEnableOption "";
config = lib.mkIf (!config.local.bootConfig.disable) {
environment.etc = {
"issue" = {
text = "[?12l[?25h";
mode = "0444";
};
};
boot = {
blacklistedKernelModules = ["pcspkr"];
kernelParams = lib.mkAfter [
"acpi_call"
"pti=auto"
"randomize_kstack_offset=on"
"vsyscall=none"
"slab_nomerge"
"module.sig_enforce=1"
"lockdown=confidentiality"
"page_poison=1"
"page_alloc.shuffle=1"
"sysrq_always_enabled=0"
"idle=nomwait"
"rootflags=noatime"
"iommu=pt"
"usbcore.autosuspend=-1"
"noresume"
"acpi_backlight=native"
"logo.nologo"
"fbcon=nodefer"
"bgrt_disable"
"systemd.show_status=false"
"rd.udev.log_level=3"
"vt.global_cursor_default=0"
"quiet"
"splash"
];
consoleLogLevel = 3;
initrd = {
verbose = false;
systemd.enable = true;
};
plymouth = {
enable = lib.mkDefault true;
theme = "breeze";
logo = "${self.packages.${pkgs.system}.images}/logo.png";
};
loader = {
grub = {
configurationLimit = 10;
extraConfig = ''
GRUB_TIMEOUT_STYLE=hidden
'';
};
systemd-boot = {
configurationLimit = 10;
enable = lib.mkDefault true;
consoleMode = "max";
editor = false;
};
efi.canTouchEfiVariables = lib.mkDefault true;
timeout = 0;
};
};
systemd.services.efibootmgr = {
reloadIfChanged = false;
restartIfChanged = false;
stopIfChanged = false;
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
path = [pkgs.efibootmgr];
wantedBy = ["default.target"];
script = ''
efibootmgr -t 0
'';
};
};
_file = ./misc.nix;
}

View file

@ -1,88 +0,0 @@
{self, ...}: {
lib,
pkgs,
config,
...
}: {
options.local.bootConfig.disable = lib.mkEnableOption "";
config =
lib.mkIf (!config.local.bootConfig.disable)
{
environment.etc = {
"issue" = {
text = "[?12l[?25h";
mode = "0444";
};
};
boot = {
blacklistedKernelModules = ["pcspkr"];
kernelParams = [
"acpi_call"
"pti=auto"
"randomize_kstack_offset=on"
"vsyscall=none"
"slab_nomerge"
"module.sig_enforce=1"
"lockdown=confidentiality"
"page_poison=1"
"page_alloc.shuffle=1"
"sysrq_always_enabled=0"
"idle=nomwait"
"rootflags=noatime"
"iommu=pt"
"usbcore.autosuspend=-1"
"noresume"
"acpi_backlight=native"
"logo.nologo"
"fbcon=nodefer"
"bgrt_disable"
"quiet"
"systemd.show_status=false"
"rd.udev.log_level=3"
"vt.global_cursor_default=0"
];
consoleLogLevel = 3;
initrd = {
verbose = false;
systemd.enable = true;
};
plymouth = {
enable = lib.mkDefault true;
theme = "breeze";
logo = "${self.packages.${pkgs.system}.images}/logo.png";
};
loader = {
grub = {
configurationLimit = 10;
extraConfig = ''
GRUB_TIMEOUT_STYLE=hidden
'';
};
systemd-boot = {
configurationLimit = 10;
enable = lib.mkDefault true;
consoleMode = "max";
editor = false;
};
efi.canTouchEfiVariables = lib.mkDefault true;
timeout = 0;
};
};
systemd.services.efibootmgr = {
reloadIfChanged = false;
restartIfChanged = false;
stopIfChanged = false;
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
path = [pkgs.efibootmgr];
wantedBy = ["default.target"];
script = ''
efibootmgr -t 0
'';
};
};
_file = ./misc.nix;
}

View file

@ -18,11 +18,9 @@ _: {
max-jobs = 0;
substituters = [
"ssh-ng://nix-ssh@gerg-desktop"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"gerg-desktop:6p1+h6jQnb1MOt3ra3PlQpfgEEF4zRrQWiEuAqcjBj8="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
};
distributedBuilds = true;

View file

@ -1,11 +1,7 @@
_: {lib, ...}: {
options = {
local.keys = lib.mkOption {
default = {};
};
};
config = {
local.keys = {
options.local.keys = lib.mkOption {};
config.local.keys = {
gerg_gerg-phone = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDU6BnoHIgMLgZVGuvi03J9l5Z1yP1P5Q8QPyjRHyi77";
gerg_gerg-windows = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILpYY2uw0OH1Re+3BkYFlxn0O/D8ryqByJB/ljefooNc";
root_moms-laptop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIq9YTf4jlVCKBKn44m4yJvj94C7pTOyaa4VjZFohNqD";
@ -14,6 +10,5 @@ _: {lib, ...}: {
gerg-desktop_fingerprint = "BQxvBOWsTw1gdNDR0KzrSRmbVhDrJdG05vYXkVmw8yA";
gerg_gerg-desktop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJWbwkFJmRBgyWyWU+w3ksZ+KuFw9uXJN3PwqqE7Z/i8";
};
};
_file = ./keys.nix;
}

View file

@ -18,17 +18,17 @@ _: {
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.local.allowedUnfree;
};
};
programs.git.enable = true;
environment.defaultPackages = lib.mkForce (builtins.attrValues {
inherit
(pkgs)
alsa-utils #volume control
bottom #view tasks
efibootmgr #efi editor
nix-output-monitor #nom nom nom nom;
nix-tree #view packages
pciutils #lspci
xclip #commandline clipboard access
;
});
@ -43,14 +43,17 @@ _: {
KbdInteractiveAuthentication = false;
};
};
i18n.defaultLocale = "en_US.UTF-8";
#time settings
time.timeZone = "America/New_York";
# For`info` command.
# For `info` command.
documentation.info.enable = false;
# NixOS manual and such.
documentation.nixos.enable = false;
# Useless with flakes (without configuring)
programs.command-not-found.enable = false;
};
_file = ./misc.nix;

View file

@ -1,4 +1,8 @@
{fetch-rs, ...}: {
{
fetch-rs,
self,
...
}: {
pkgs,
config,
lib,
@ -72,16 +76,9 @@
syntaxHighlighting.enable = true;
histSize = 10000;
histFile = "$HOME/.cache/zsh_history";
interactiveShellInit = let
fzf-tab = pkgs.fetchFromGitHub {
owner = "Aloxaf";
repo = "fzf-tab";
rev = "c2b4aa5ad2532cca91f23908ac7f00efb7ff09c9";
hash = "sha256-gvZp8P3quOtcy1Xtt1LAW1cfZ/zCtnAmnWqcwrKel6w=";
};
in ''
interactiveShellInit = ''
### fzf-tab ###
source ${fzf-tab}/fzf-tab.plugin.zsh
source ${self.packages.${pkgs.system}.fzf-tab}/fzf-tab.plugin.zsh
### pager ###
man () {
PROGRAM="''${@[-1]}"

View file

@ -55,7 +55,7 @@ in {
platformTheme = "gtk2";
};
services.xserver.displayManager.sessionCommands = ''
xrdb -load /etc/xdg/Xresources
${lib.getExe' pkgs.xorg.xrdb "xrdb"} -load /etc/xdg/Xresources
'';
fonts = {
packages = [pkgs.overpass];

7
packages/fzf-tab.nix Normal file
View file

@ -0,0 +1,7 @@
{fetchFromGitHub}:
fetchFromGitHub {
owner = "Aloxaf";
repo = "fzf-tab";
rev = "c2b4aa5ad2532cca91f23908ac7f00efb7ff09c9";
hash = "sha256-gvZp8P3quOtcy1Xtt1LAW1cfZ/zCtnAmnWqcwrKel6w=";
}

View file

@ -1,37 +1,26 @@
{
lib,
stdenv,
runCommandNoCC,
makeBinaryWrapper,
fetchurl,
bash,
jre,
}:
stdenv.mkDerivation (finalAttrs: {
}: let
pname = "papermc";
version = "1.20.1.83";
in
runCommandNoCC "papermc" {
inherit pname version;
jar = let
mcVersion = lib.versions.pad 3 finalAttrs.version;
buildNum = builtins.elemAt (lib.versions.splitVersion finalAttrs.version) 3;
src = let
mcVersion = lib.versions.pad 3 version;
buildNum = builtins.elemAt (lib.versions.splitVersion version) 3;
in
fetchurl {
url = "https://papermc.io/api/v2/projects/paper/versions/${mcVersion}/builds/${buildNum}/downloads/paper-${mcVersion}-${buildNum}.jar";
sha256 = "sha256-HQpc3MOXa1wkXqgm9ciQj04FUIyuupnYiu+2RZ/sXE4=";
hash = "sha256-HQpc3MOXa1wkXqgm9ciQj04FUIyuupnYiu+2RZ/sXE4=";
};
preferLocalBuild = true;
dontUnpack = true;
dontConfigure = true;
buildPhase = ''
cat > minecraft-server << EOF
#!${bash}/bin/sh
exec ${jre}/bin/java \$@ -jar $out/share/papermc/papermc.jar nogui
'';
installPhase = ''
install -Dm444 ${finalAttrs.jar} $out/share/papermc/papermc.jar
install -Dm555 -t $out/bin minecraft-server
'';
nativeBuildInputs = [makeBinaryWrapper];
meta = {
description = "High-performance Minecraft Server";
@ -42,4 +31,10 @@ stdenv.mkDerivation (finalAttrs: {
maintainers = with lib.maintainers; [aaronjanse neonfuz];
mainProgram = "minecraft-server";
};
})
}
''
install -D $src $out/share/papermc/papermc.jar
makeWrapper ${lib.getExe jre} "$out/bin/minecraft-server" \
--append-flags "-jar $out/share/papermc/papermc.jar nogui"
''

View file

@ -1,18 +0,0 @@
{
stdenv,
writeShellScriptBin,
fetchzip,
glibc,
}: let
src = fetchzip {
url = "https://github.com/trexminer/T-Rex/releases/download/0.26.8/t-rex-0.26.8-linux.tar.gz";
sha256 = "sha256-qM/YIMqcntVYD8zJGCORQgIn1h4J4CDobyXwcdK3li8=";
stripRoot = false;
};
in
writeShellScriptBin "t-rex"
''
LD_LIBRARY_PATH=${stdenv.cc.cc.lib}/lib/:${glibc}/lib/:/run/opengl-driver/lib/
exec ${glibc}/lib64/ld-linux-x86-64.so.2 \
${src}/t-rex --no-watchdog "$@"
''