Skip to content

Commit

Permalink
Ran formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
addisonbeck committed Oct 24, 2024
1 parent fe9467f commit 77e32a6
Show file tree
Hide file tree
Showing 7 changed files with 471 additions and 430 deletions.
34 changes: 22 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# dotnet test test/Core.Test/Core.Test.csproj -v quiet --nologo
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

nixpkgs-forked.url = "github:addisonbeck/nixpkgs";

Expand Down Expand Up @@ -66,11 +66,14 @@
# };
minecraft = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs outputs nixpkgs;
pkgs-forked = import inputs.nixpkgs-forked { system = "x86_64-linux" ; config.allowUnfree = true; };
};
modules = [ ./system/minecraft.nix ];
specialArgs = {
inherit inputs outputs nixpkgs;
pkgs-forked = import inputs.nixpkgs-forked {
system = "x86_64-linux";
config.allowUnfree = true;
};
};
modules = [./system/minecraft.nix];
};
};
darwinConfigurations = {
Expand All @@ -80,24 +83,31 @@
bw = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {
inherit inputs outputs nixpkgs;
pkgs-forked = import inputs.nixpkgs-forked { system = "aarch64-darwin" ; config.allowUnfree = true; };
};
inherit inputs outputs nixpkgs;
pkgs-forked = import inputs.nixpkgs-forked {
system = "aarch64-darwin";
config.allowUnfree = true;
};
};
modules = [./system/bw.nix];
};
air = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {
inherit inputs outputs nixpkgs;
pkgs-forked = import inputs.nixpkgs-forked { system = "aarch64-darwin" ; config.allowUnfree = true; };
};
inherit inputs outputs nixpkgs;
pkgs-forked = import inputs.nixpkgs-forked {
system = "aarch64-darwin";
config.allowUnfree = true;
};
};
modules = [./system/air.nix];
};
};
devShells = forAllSystemTypes (system: let
pkgs = import nixpkgs {inherit system;};
in {
default = pkgs.mkShell {
inputsFrom = with self.devShells.${system}; [formatting];
packages = [
agenix.packages.${system}.default
#nix-darwin.packages.${system}.default
Expand Down
126 changes: 66 additions & 60 deletions system/minecraft.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{inputs, modulesPath, pkgs, ...}: {
{
inputs,
modulesPath,
pkgs,
...
}: {
imports = [
(modulesPath + "/virtualisation/digital-ocean-config.nix")
inputs.home-manager.nixosModules.home-manager
Expand All @@ -11,76 +16,77 @@
./with/user/root.nix
./with/user/steve.nix
{
security.sudo = {
enable = true;
extraRules = [{
commands = [
{
command = "ALL";
options = [ "NOPASSWD" ];
}
];
groups = [ "wheel" ];
}];
};
security.sudo = {
enable = true;
extraRules = [
{
commands = [
{
command = "ALL";
options = ["NOPASSWD"];
}
];
groups = ["wheel"];
}
];
};
}
inputs.nix-minecraft.nixosModules.minecraft-servers
{
services.minecraft-servers = {
enable = true;
eula = true;
# managementSystem.tmux = {
# enable = true;
# socketPath = name: "/home/steve/sessions/${name}.sock";
# };
# dataDir = "/home/steve/servers/";
# user = "steve";
# group = "steve";
servers.bonesfamily = {

jvmOpts = ''-Xmx6G -Xms6G -XX:+UseG1GC -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M'';
enable = true;
enableReload = false;
package = inputs.nix-minecraft.legacyPackages.x86_64-linux.fabricServers.fabric-1_21_1;
openFirewall = true;
autoStart = true;
serverProperties = {
default-player-permission-level = "visitor";
motd = "Bones bones bones";
difficulty = "easy";
gamemode = "survival";
};
services.minecraft-servers = {
enable = true;
eula = true;
# managementSystem.tmux = {
# enable = true;
# socketPath = name: "/home/steve/sessions/${name}.sock";
# };
# dataDir = "/home/steve/servers/";
# user = "steve";
# group = "steve";
servers.bonesfamily = {
jvmOpts = ''-Xmx6G -Xms6G -XX:+UseG1GC -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M'';
enable = true;
enableReload = false;
package = inputs.nix-minecraft.legacyPackages.x86_64-linux.fabricServers.fabric-1_21_1;
openFirewall = true;
autoStart = true;
serverProperties = {
default-player-permission-level = "visitor";
motd = "Bones bones bones";
difficulty = "easy";
gamemode = "survival";
};
files = {
"config/Geyser-Fabric/config.yml".value = {
remote."auth-type" = "floodgate";
};
};
symlinks = {
mods = pkgs.linkFarmFromDrvs "mods" (builtins.attrValues {
FabricAPI = pkgs.fetchurl {
url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/iFnYBUfS/fabric-api-0.106.0%2B1.21.1.jar";
hash = "sha256-sUONHcxgqL+bZv17oWWaJCSiUZxwh/pYrQ6+l9edWKg=";
};
Geyser = pkgs.fetchurl {
url = "https://cdn.modrinth.com/data/wKkoqHrH/versions/LrOHtTFt/geyser-fabric-Geyser-Fabric-2.4.3-b689.jar";
sha512 = "sha512-Sw4SX3nFYMblGSsgpVMOJxA7qiRfWPg6SU896Thmseb4hfg/jOkPkDd6jD/TvDfDiyCXIg9cPF725aFkfHvq/Q==";
};
Floodgate = pkgs.fetchurl {
url = "https://cdn.modrinth.com/data/bWrNNfkb/versions/wPa1pHZJ/Floodgate-Fabric-2.2.4-b36.jar";
hash = "sha256-ifzWrdZ4KJoQpFspdhmOQ+FJtwVMaGtfy4XQOcewV0Y=";
};
});
};
};
};
symlinks = {
mods = pkgs.linkFarmFromDrvs "mods" (builtins.attrValues {
FabricAPI = pkgs.fetchurl {
url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/iFnYBUfS/fabric-api-0.106.0%2B1.21.1.jar";
hash = "sha256-sUONHcxgqL+bZv17oWWaJCSiUZxwh/pYrQ6+l9edWKg=";
};
Geyser = pkgs.fetchurl {
url = "https://cdn.modrinth.com/data/wKkoqHrH/versions/LrOHtTFt/geyser-fabric-Geyser-Fabric-2.4.3-b689.jar";
sha512 = "sha512-Sw4SX3nFYMblGSsgpVMOJxA7qiRfWPg6SU896Thmseb4hfg/jOkPkDd6jD/TvDfDiyCXIg9cPF725aFkfHvq/Q==";
};
Floodgate = pkgs.fetchurl {
url = "https://cdn.modrinth.com/data/bWrNNfkb/versions/wPa1pHZJ/Floodgate-Fabric-2.2.4-b36.jar";
hash = "sha256-ifzWrdZ4KJoQpFspdhmOQ+FJtwVMaGtfy4XQOcewV0Y=";
};
});
};
};
};
}
];
nixpkgs.overlays = [inputs.nix-minecraft.overlay];

networking = {
firewall = {
enable = true;
allowedUDPPorts = [ 19132 ];
};
};
firewall = {
enable = true;
allowedUDPPorts = [19132];
};
};
}
2 changes: 1 addition & 1 deletion system/with/nix-darwin.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{...}: {
nix = {
linux-builder.enable = true;
settings.trusted-users = [ "@admin" ];
settings.trusted-users = ["@admin"];
};
}
10 changes: 5 additions & 5 deletions system/with/user/steve.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
pkgs,
...
}: let
authorizedKeys = pkgs.writeText "authorized_keys" ''
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJJSLY/c9uffjNA0T8o8CjrAI7DdvxNyp0SNBeLjQ4pH me@bw
'';
authorizedKeys = pkgs.writeText "authorized_keys" ''
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJJSLY/c9uffjNA0T8o8CjrAI7DdvxNyp0SNBeLjQ4pH me@bw
'';
in {
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowBroken = true;
Expand All @@ -17,8 +17,8 @@ in {
shell = pkgs.bash;
isNormalUser = true;
group = "steve";
extraGroups = [ "wheel" "minecraft" ];
openssh.authorizedKeys.keyFiles = [ "${authorizedKeys}" ];
extraGroups = ["wheel" "minecraft"];
openssh.authorizedKeys.keyFiles = ["${authorizedKeys}"];
};
home-manager.users.steve = {
imports = [
Expand Down
2 changes: 1 addition & 1 deletion system/with/user/with/program/minecraft.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{pkgs-forked, ...}: {
home.packages = [ pkgs-forked.modrinth-app ];
home.packages = [pkgs-forked.modrinth-app];
}
26 changes: 26 additions & 0 deletions system/with/user/with/program/newsboat.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
{...}: {
programs.newsboat.enable = true;
programs.newsboat.autoReload = true;
programs.newsboat.browser = "open";
programs.newsboat.extraConfig = ''
show-read-feeds yes
bind-key j down feedlist
bind-key k up feedlist
bind-key j next articlelist
bind-key k prev articlelist
bind-key J next-feed articlelist
bind-key K prev-feed articlelist
bind-key j down article
bind-key k up article
unbind-key C feedlist
confirm-exit no
'';
programs.newsboat.urls = [
{
title = "HN";
url = "https://news.ycombinator.com/rss";
tags = ["hn"];
}
{url = "https://lukesmith.xyz/rss.xml";}
{url = "https://www.hanselman.com/blog/";}
];
}
Loading

0 comments on commit 77e32a6

Please sign in to comment.