1 Commits

Author SHA1 Message Date
2b597ff20a WIP 2024-07-23 20:46:41 -07:00
10 changed files with 74 additions and 1800 deletions

1674
flake.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,31 +3,28 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
shelvacu.url = "git+https://git.uninsane.org/shelvacu/nix-stuff";
}; };
outputs = { self, nixpkgs, ... }@inputs: outputs = { self, nixpkgs, ... }@inputs:
let let
secrets = builtins.fromJSON (builtins.readFile ./secrets.json); secrets = builtins.fromJSON (builtins.readFile ./secrets.json);
in in {
{ nixosModules = {
nixosModules = { common = import ./modules/common.nix;
common = import ./modules/common.nix; server = import ./modules/server.nix;
prompt = import ./modules/prompt.nix; };
server = import ./modules/server.nix;
};
nixosConfigurations = { nixosConfigurations = {
marauder = nixpkgs.lib.nixosSystem { marauder = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ ./hosts/marauder ]; modules = [ ./hosts/marauder ];
specialArgs = { inherit self inputs secrets; }; specialArgs = { inherit self inputs secrets; };
}; };
monolith = nixpkgs.lib.nixosSystem { monolith = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ ./hosts/monolith ]; modules = [ ./hosts/monolith ];
specialArgs = { inherit self inputs secrets; }; specialArgs = { inherit self inputs secrets; };
};
}; };
}; };
};
} }

View File

@@ -20,7 +20,7 @@
script = "notify-send -u critical \"Backup to B2 failed\" \"$(journalctl -u restic-backups-b2 -n 5 -o cat)\""; script = "notify-send -u critical \"Backup to B2 failed\" \"$(journalctl -u restic-backups-b2 -n 5 -o cat)\"";
}; };
restic-backups-b2 = { restic-backups-b2 = {
onFailure = [ "notify-backup-b2-failed.service" ]; onFailure = ["notify-backup-b2-failed.service"];
}; };
}; };
@@ -39,9 +39,14 @@
repository = "b2:marauder-backup"; repository = "b2:marauder-backup";
passwordFile = "/etc/restic-password"; passwordFile = "/etc/restic-password";
paths = [ paths = [
"${config.users.users.nettika.home}/Desktop"
"${config.users.users.nettika.home}/Documents" "${config.users.users.nettika.home}/Documents"
"${config.users.users.nettika.home}/Artwork" "${config.users.users.nettika.home}/Music"
"${config.users.users.nettika.home}/Pictures"
"${config.users.users.nettika.home}/Projects" "${config.users.users.nettika.home}/Projects"
"${config.users.users.nettika.home}/Public"
"${config.users.users.nettika.home}/Templates"
"${config.users.users.nettika.home}/Videos"
]; ];
pruneOpts = [ pruneOpts = [
"--keep-daily 7" "--keep-daily 7"

View File

@@ -1,10 +1,8 @@
{ self, pkgs, inputs, ... }: { self, pkgs, inputs, secrets, ... }:
{ {
imports = [ imports = [
self.nixosModules.common self.nixosModules.common
self.nixosModules.prompt
./backup.nix ./backup.nix
./dev.nix
]; ];
networking.hostName = "marauder"; networking.hostName = "marauder";
@@ -36,7 +34,7 @@
"sd_mod" "sd_mod"
]; ];
}; };
kernelModules = [ "kvm-amd" ]; kernelModules = ["kvm-amd"];
kernelParams = [ "amd_pstate=active" ]; kernelParams = [ "amd_pstate=active" ];
}; };
@@ -46,7 +44,7 @@
opengl = { opengl = {
enable = true; enable = true;
driSupport32Bit = true; driSupport32Bit = true;
extraPackages = [ pkgs.vaapiVdpau ]; extraPackages = [pkgs.vaapiVdpau];
}; };
nvidia.prime = { nvidia.prime = {
offload = { offload = {
@@ -58,36 +56,41 @@
}; };
}; };
environment = { environment.systemPackages = with pkgs; [
systemPackages = [ # Chat clients
inputs.shelvacu.packages.x86_64-linux.sm64coopdx discord
] ++ (with pkgs; [ element-desktop
# Chat clients telegram-desktop
discord
slack
element-desktop
telegram-desktop
# Browsers # Browsers
firefox firefox
filezilla
# Art and 3D # Coding
inkscape vscode
gimp
krita
openscad-unstable
bambu-studio
# Multimedia # Art and 3D
vlc inkscape
ffmpeg openscad-unstable
(callPackage ./ffcheck.nix { }) bambu-studio
# Misc # Multimedia
obsidian vlc
(callPackage ./romraider.nix { })
]); # Productivity
obsidian
];
programs.bash = {
promptInit = ''
PS1="\[\e]0;\u@\h: \w\a\]" # window title
PS1+="\n"
PS1+="\$(printf \"%*s\" \$((\$COLUMNS + 9)) \"\[\e[1;33m\]\$(git branch --show-current 2>/dev/null)\")" # git branch
PS1+="\[\e[1G\]" # move cursor to beginning of line
PS1+="💜" # prompt symbol
PS1+="\[\033[1;$((UID ? 32 : 31))m\]" # prompt color
PS1+="[\u@\h:\w]\\$"
PS1+="\[\033[0m\] " # reset color
'';
}; };
programs.steam = { programs.steam = {
@@ -98,7 +101,7 @@
services.xserver = { services.xserver = {
enable = true; enable = true;
videoDrivers = [ "nvidia" ]; videoDrivers = ["nvidia"];
desktopManager = { desktopManager = {
cinnamon.enable = true; cinnamon.enable = true;
xterm.enable = false; xterm.enable = false;
@@ -117,14 +120,8 @@
enable = true; enable = true;
}; };
services.mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn; # Include GUI
};
promptEmoji = "💜";
time.timeZone = "America/Los_Angeles"; time.timeZone = "America/Los_Angeles";
system.stateVersion = "24.05"; system.stateVersion = "24.05";
} }

View File

@@ -1,20 +0,0 @@
{ pkgs, ... }:
{
environment.variables = {
VISUAL = "code --wait";
};
environment.systemPackages = with pkgs; [
vscode
kotlin
rustup
pyenv
gcc
nixd
nixpkgs-fmt
];
programs.direnv = {
enable = true;
};
}

View File

@@ -1,3 +0,0 @@
{ writeShellScriptBin, ffmpeg }: writeShellScriptBin "ffcheck" ''
${ffmpeg}/bin/ffmpeg -v error -stats -hide_banner -i "$1" -c copy -f null -
''

View File

@@ -1,24 +0,0 @@
{ stdenv, fetchFromGitHub, ant, jdk11, makeWrapper, jre }: stdenv.mkDerivation {
pname = "romraider";
version = "1.0.0";
src = fetchFromGitHub {
owner = "Romraider";
repo = "Romraider";
rev = "1.0.0-DEC01-2023";
hash = "sha256-KCG6D/+yupGahzPtZk1l9FK826MHZKdTuWoTCLC0ngY=";
};
JRE_DIR = jdk11;
nativeBuildInputs = [ ant jdk11 makeWrapper ];
buildPhase = "ant build-linux";
installPhase = ''
mkdir -p $out/{bin,share/java}
install build/linux/lib/RomRaider.jar $out/share/java/romraider.jar
makeWrapper ${jdk11}/bin/java $out/bin/romraider \
--add-flags "-jar $out/share/java/romraider.jar"
'';
}

View File

@@ -1,8 +1,7 @@
{ self, ... }: { self, pkgs, secrets, ... }:
{ {
imports = [ imports = [
self.nixosModules.common self.nixosModules.common
self.nixosModules.prompt
self.nixosModules.server self.nixosModules.server
./dns.nix ./dns.nix
]; ];
@@ -10,6 +9,7 @@
networking = { networking = {
hostName = "monolith"; hostName = "monolith";
hostId = "44551c32"; hostId = "44551c32";
firewall.allowedTCPPorts = [ 80 ];
}; };
fileSystems = { fileSystems = {
@@ -38,7 +38,11 @@
supportedFilesystems = [ "zfs" ]; supportedFilesystems = [ "zfs" ];
}; };
promptEmoji = "🏰"; services.static-web-server = {
enable = true;
listen = "[::]:80";
root = "/srv/www";
};
time.timeZone = "America/Los_Angeles"; time.timeZone = "America/Los_Angeles";

View File

@@ -4,8 +4,6 @@
nix.settings = { nix.settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
substituters = [ "https://nixcache.shelvacu.com" ];
trusted-public-keys = [ "nixcache.shelvacu.com:73u5ZGBpPRoVZfgNJQKYYBt9K9Io/jPwgUfuOLsJbsM=" ];
trusted-users = [ "@wheel" ]; trusted-users = [ "@wheel" ];
}; };
@@ -16,10 +14,6 @@
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
environment.variables = {
EDITOR = "nano";
};
programs.git = { programs.git = {
enable = true; enable = true;
lfs.enable = true; lfs.enable = true;

View File

@@ -1,10 +0,0 @@
{ lib, config, ... }:
{
options.promptEmoji = lib.mkOption {
type = lib.types.str;
};
config.programs.bash.promptInit = ''
PS1="\[\e]0;\u@\h: \w\a\]\n${config.promptEmoji} \[\033[1;$((UID ? 32 : 31))m\]\w \\$\[\033[0m\] "
'';
}