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 done
deadnix -qe $STAGED deadnix -qe $STAGED
alejandra -q $STAGED nixfmt -q $STAGED
git add $STAGED git add $STAGED

112
flake.lock generated
View file

@ -59,11 +59,11 @@
"flake-compat_2": { "flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1673956053, "lastModified": 1650374568,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra", "owner": "edolstra",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -88,6 +88,37 @@
"type": "github" "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": { "lowdown-src": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -139,24 +170,50 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"lowdown-src": "lowdown-src", "lowdown-src": "lowdown-src",
"nixpkgs": "nixpkgs", "nixpkgs": [
"unstable"
],
"nixpkgs-regression": "nixpkgs-regression" "nixpkgs-regression": "nixpkgs-regression"
}, },
"locked": { "locked": {
"lastModified": 1694007573, "lastModified": 1694067117,
"narHash": "sha256-DThtWWrG8JHzG6oS/JA/0mOVRj7IxHNdVnXk291wJRs=", "narHash": "sha256-fstL4alQM8QpsunEtaErpURwQ0yoTh19YdjobsN2ids=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nix", "repo": "nix",
"rev": "3a62651bd663a849a568bf69017d0f3b1addd564", "rev": "2da46530d0bb4faf8ca0605f8fdffca7bd5baa73",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "3a62651bd663a849a568bf69017d0f3b1addd564", "ref": "2.17-maintenance",
"repo": "nix", "repo": "nix",
"type": "github" "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": { "nixlib": {
"locked": { "locked": {
"lastModified": 1693701915, "lastModified": 1693701915,
@ -193,22 +250,6 @@
"type": "github" "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": { "nixpkgs-regression": {
"locked": { "locked": {
"lastModified": 1643052045, "lastModified": 1643052045,
@ -226,6 +267,22 @@
} }
}, },
"nixpkgs-stable": { "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": { "locked": {
"lastModified": 1694908564, "lastModified": 1694908564,
"narHash": "sha256-ducA98AuWWJu5oUElIzN24Q22WlO8bOfixGzBgzYdVc=", "narHash": "sha256-ducA98AuWWJu5oUElIzN24Q22WlO8bOfixGzBgzYdVc=",
@ -243,7 +300,7 @@
}, },
"nvim-flake": { "nvim-flake": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_3",
"neovim-src": "neovim-src", "neovim-src": "neovim-src",
"nixpkgs": [ "nixpkgs": [
"unstable" "unstable"
@ -269,6 +326,7 @@
"fetch-rs": "fetch-rs", "fetch-rs": "fetch-rs",
"master": "master", "master": "master",
"nix": "nix", "nix": "nix",
"nixfmt": "nixfmt",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nvim-flake": "nvim-flake", "nvim-flake": "nvim-flake",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
@ -283,7 +341,7 @@
"nixpkgs": [ "nixpkgs": [
"unstable" "unstable"
], ],
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1695284550, "lastModified": 1695284550,
@ -301,7 +359,7 @@
}, },
"spicetify-nix": { "spicetify-nix": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_4",
"nixpkgs": [ "nixpkgs": [
"unstable" "unstable"
] ]

View file

@ -5,7 +5,10 @@
unstable.url = "github:NixOS/nixpkgs?ref=nixos-unstable"; unstable.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
stable.url = "github:NixOS/nixpkgs?ref=nixos-23.05"; 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 = { nixos-generators = {
url = "github:nix-community/nixos-generators"; url = "github:nix-community/nixos-generators";
@ -19,6 +22,10 @@
url = "github:nix-community/disko"; url = "github:nix-community/disko";
inputs.nixpkgs.follows = "unstable"; inputs.nixpkgs.follows = "unstable";
}; };
nixfmt = {
url = "github:piegamesde/nixfmt?ref=rfc101-style";
inputs.nixpkgs.follows = "unstable";
};
spicetify-nix = { spicetify-nix = {
url = "github:Gerg-L/spicetify-nix"; url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "unstable"; inputs.nixpkgs.follows = "unstable";
@ -69,7 +76,23 @@
"game-laptop" "game-laptop"
"moms-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 { devShells.${system}.default = pkgs.mkShell {
packages = [ packages = [

View file

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

View file

@ -1,4 +1,4 @@
{nvim-flake, ...}: { {nvim-flake, nixfmt, ...}: {
pkgs, pkgs,
config, config,
... ...
@ -43,7 +43,14 @@
nix.settings.system-features = ["kvm" "big-parallel" "nixos-test" "benchmark"]; nix.settings.system-features = ["kvm" "big-parallel" "nixos-test" "benchmark"];
environment = { environment = {
systemPackages = builtins.attrValues { systemPackages = let
fmt = pkgs.nixfmt.overrideAttrs {
version = "0.6.0-${nixfmt.shortRev}";
src = nixfmt;
};
in
builtins.attrValues {
inherit inherit
(pkgs) (pkgs)
bitwarden # store stuff bitwarden # store stuff
@ -53,22 +60,39 @@
librewolf # best browser librewolf # best browser
vlc # play stuff vlc # play stuff
ripgrep ripgrep
fd
jq
xautoclick xautoclick
prismlauncher prismlauncher
deadnix deadnix
statix statix
alejandra
nix-index nix-index
element-desktop element-desktop
webcord webcord
; ;
inherit (nvim-flake.packages.${pkgs.system}) neovim; inherit (nvim-flake.packages.${pkgs.system}) neovim;
lint = pkgs.writeShellScriptBin "lint" '' inherit fmt;
deadnix -e "''${1:-.}" lint = pkgs.writeShellApplication {
statix fix -- "''${1:-.}" name = "lint";
alejandra "''${1:-.}" 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 = { etc = {
"jdks/17".source = "${pkgs.openjdk17}/bin"; "jdks/17".source = "${pkgs.openjdk17}/bin";
"jdks/8".source = "${pkgs.openjdk8}/bin"; "jdks/8".source = "${pkgs.openjdk8}/bin";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -61,9 +61,10 @@ in {
pkgs.brightnessctl #brightness control for laptop pkgs.brightnessctl #brightness control for laptop
pkgs.playerctl #music control pkgs.playerctl #music control
pkgs.xclip 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; max-jobs = 0;
substituters = [ substituters = [
"ssh-ng://nix-ssh@gerg-desktop" "ssh-ng://nix-ssh@gerg-desktop"
"https://cache.nixos.org/"
]; ];
trusted-public-keys = [ trusted-public-keys = [
"gerg-desktop:6p1+h6jQnb1MOt3ra3PlQpfgEEF4zRrQWiEuAqcjBj8=" "gerg-desktop:6p1+h6jQnb1MOt3ra3PlQpfgEEF4zRrQWiEuAqcjBj8="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
]; ];
}; };
distributedBuilds = true; distributedBuilds = true;

View file

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

View file

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

View file

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

View file

@ -55,7 +55,7 @@ in {
platformTheme = "gtk2"; platformTheme = "gtk2";
}; };
services.xserver.displayManager.sessionCommands = '' services.xserver.displayManager.sessionCommands = ''
xrdb -load /etc/xdg/Xresources ${lib.getExe' pkgs.xorg.xrdb "xrdb"} -load /etc/xdg/Xresources
''; '';
fonts = { fonts = {
packages = [pkgs.overpass]; 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, lib,
stdenv, runCommandNoCC,
makeBinaryWrapper,
fetchurl, fetchurl,
bash,
jre, jre,
}: }: let
stdenv.mkDerivation (finalAttrs: {
pname = "papermc"; pname = "papermc";
version = "1.20.1.83"; version = "1.20.1.83";
in
runCommandNoCC "papermc" {
inherit pname version;
jar = let src = let
mcVersion = lib.versions.pad 3 finalAttrs.version; mcVersion = lib.versions.pad 3 version;
buildNum = builtins.elemAt (lib.versions.splitVersion finalAttrs.version) 3; buildNum = builtins.elemAt (lib.versions.splitVersion version) 3;
in in
fetchurl { fetchurl {
url = "https://papermc.io/api/v2/projects/paper/versions/${mcVersion}/builds/${buildNum}/downloads/paper-${mcVersion}-${buildNum}.jar"; 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; nativeBuildInputs = [makeBinaryWrapper];
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
'';
meta = { meta = {
description = "High-performance Minecraft Server"; description = "High-performance Minecraft Server";
@ -42,4 +31,10 @@ stdenv.mkDerivation (finalAttrs: {
maintainers = with lib.maintainers; [aaronjanse neonfuz]; maintainers = with lib.maintainers; [aaronjanse neonfuz];
mainProgram = "minecraft-server"; 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 "$@"
''