complete refactor of packages and options

This commit is contained in:
stitchy 2024-03-27 03:47:54 +00:00
parent 16fb30026c
commit a2f3b33514
Signed by: stitchy
SSH key fingerprint: SHA256:yz2SoxdnY67tfY5Jzb0f2v8f5W3o/IF359kbcquWip8
12 changed files with 328 additions and 297 deletions

View file

@ -1,73 +0,0 @@
{ config, pkgs, lib, ... }:
{
imports =
[
./packages/default.nix
];
# Use the systemd-boot EFI boot loader.
boot.kernelPackages = pkgs.linuxPackages_zen;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
security.sudo.wheelNeedsPassword=false;
security.rtkit.enable = true;
programs.zsh.enable = true;
# Virtualization because I need mah vr back
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
defaultEditor = true;
configure = {
customRC = builtins.readFile ./config/nvim/init.vim;
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
nvim-lspconfig
nvim-cmp
cmp-nvim-lsp
luasnip
cmp_luasnip
tokyonight-nvim
vim-lsp-cxx-highlight
typst-vim
];
};
};
};
boot.kernel.sysctl."kernel.sched_rt_runtime_us" = -1;
users.mutableUsers = false;
users.users = {
root.initialHashedPassword = "!";
};
networking.firewall = {
enable = true;
# if packets are still dropped, they will show up in dmesg
logReversePathDrops = true;
# wireguard trips rpfilter up
extraCommands = ''
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 47111 -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 47111 -j RETURN
'';
extraStopCommands = ''
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 47111 -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 47111 -j RETURN || true
'';
# Open ports in the firewall.
allowedTCPPorts = [ 22000 ];
allowedUDPPorts = [ 22000 ];
};
}

View file

@ -5,8 +5,6 @@
outputs = inputs@{ outputs = inputs@{
nixpkgs, nixpkgs,
home-manager, home-manager,
hyprland,
eww,
osu-nixos, osu-nixos,
... ...
} : { } : {
@ -17,7 +15,7 @@
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
./configuration.nix ./packages/default.nix
./hosts/malachite/default.nix ./hosts/malachite/default.nix
./users/stitchynyan/default.nix ./users/stitchynyan/default.nix
@ -35,7 +33,7 @@
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
./configuration.nix ./packages/default.nix
./hosts/lappy/default.nix ./hosts/lappy/default.nix
./users/stitchynyan/default.nix ./users/stitchynyan/default.nix
@ -53,7 +51,7 @@
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
./configuration.nix ./packages/default.nix
./hosts/gemini/default.nix ./hosts/gemini/default.nix
./users/nyadmin/default.nix ./users/nyadmin/default.nix
@ -70,17 +68,17 @@
}; };
inputs = { inputs = {
mobile-nixos = {
url = "github:nixos/mobile-nixos";
flake = false;
};
nixpkgs = { nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable"; url = "github:NixOS/nixpkgs/nixos-unstable";
}; };
home-manager = { home-manager = {
url = "github:nix-community/home-manager/master"; url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
hyprland.url = "github:hyprwm/Hyprland";
eww.url = "github:elkowar/eww";
osu-nixos.url = "github:Asqiir/osu-nixos"; osu-nixos.url = "github:Asqiir/osu-nixos";
}; };
} }

View file

@ -1,9 +1,55 @@
{config, pkg, home-manager, ...}: { config, lib, pkgs, ... }:
let
# This is a placeholder
in
{ {
options = {};
imports = [ ../packages/default.nix ];
config = {
hardware = {
bluetooth.enable = lib.mkDefault false;
steam-hardware.enable = lib.mkDefault false;
};
boot = {
kernelPackages = lib.mkDefault pkgs.linuxPackages_zen;
loader = {
efi.canTouchEfiVariables = lib.mkDefault true;
systemd-boot.enable = lib.mkDefault true;
};
};
security.sudo.wheelNeedsPassword = false;
security.rtkit.enable = true;
services.xserver.displayManager.lightdm.enable = false;
# Wireguard stuff, to-do make better
networking.firewall = {
enable = true;
# if packets are still dropped, they will show up in dmesg
logReversePathDrops = true;
# wireguard trips rpfilter up
extraCommands = ''
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 47111 -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 47111 -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
'';
extraStopCommands = ''
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 47111 -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 47111 -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
'';
# Open ports in the firewall.
allowedTCPPorts = [ 22000 ];
allowedUDPPorts = [ 22000 ];
};
environment.etc.hosts.mode = "0644";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
};
} }

View file

@ -6,8 +6,9 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [
./hardware-configuration.nix ./hardware-configuration.nix
../default.nix
]; ];
networking.hostName = "gemini"; networking.hostName = "gemini";

View file

@ -1,13 +1,17 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
../default.nix
]; ];
stitchyconf = {
artPkgs.enable = true;
};
system.nixos.tags = [ "Nya_Beginnings" ]; system.nixos.tags = [ "Nya_Beginnings" ];
services.logind.powerKey = "ignore"; services.logind.powerKey = "ignore";
@ -41,6 +45,8 @@
"i915.enable_guc=7" "i915.enable_guc=7"
]; ];
virtualisation.libvirtd.enable = true;
hardware.bluetooth.enable = true;
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
driSupport = true; driSupport = true;
@ -76,8 +82,7 @@
STOP_CHARGE_THRESH_BAT0 = 90; # 80 and above it stops charging STOP_CHARGE_THRESH_BAT0 = 90; # 80 and above it stops charging
}; };
}; };
# Read the Docs before Changing # Read the Docs before Changing
system.stateVersion = "23.05"; system.stateVersion = "23.05";

View file

@ -64,12 +64,16 @@ in {
imports = imports =
[ [
./hardware-configuration.nix ./hardware-configuration.nix
../default.nix
]; ];
virtualisation.libvirtd.hooks.qemu = { virtualisation.libvirtd.hooks.qemu = {
passthrough = "${passthrough}"; passthrough = "${passthrough}";
}; };
virtualisation.libvirtd.enable = true;
hardware = {
steam-hardware.enable = true;
};
networking.hostName = "malachite"; networking.hostName = "malachite";
@ -77,5 +81,4 @@ in {
# Read the Docs before Changing # Read the Docs before Changing
system.stateVersion = "23.05"; # Did you read the comment? system.stateVersion = "23.05"; # Did you read the comment?
} }

View file

@ -1,15 +0,0 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
blender
krita
#armorpaint
gimp
inkscape
#prusa slicker
];
}

View file

@ -1,66 +1,125 @@
{ config, lib, pkgs, inputs, ... }:
{ pkgs, inputs, ... }: { let
artPkgs = lib.attrVals [
imports = [ #"armorpaint"
./art.nix "blender"
#./tools.nix "gimp"
]; "inkscape"
"krita"
environment.systemPackages = with pkgs; [ #"prusa-slicer"
] pkgs;
handheldPkgs = lib.attrVals [
"chatty"
"gnome-text-editor"
"megapixels"
] pkgs;
pcPkgs = lib.attrVals [
#osu-lazer #osu-lazer
inputs.osu-nixos "dracula-theme"
pinentry "wl-clipboard"
wget "brightnessctl"
python3 "powertop"
cyrus-sasl-xoauth2 "easyeffects"
libnotify "mutt-wizard"
networkmanager-openvpn "gamescope"
eza "cyrus-sasl-xoauth2"
fd "libnotify"
git "networkmanager-openvpn"
zoxide
gnupg
brightnessctl
neofetch
wl-clipboard
glib
dracula-theme
btop
vimPlugins.nvim-lspconfig
vimPlugins.nvim-cmp
vimPlugins.cmp-nvim-lsp
vimPlugins.luasnip
vimPlugins.cmp_luasnip
vimPlugins.tokyonight-nvim
# temporary home manager things # temporary home manager things
inotify-tools "inotify-tools"
eww "eww"
jq "jq"
socat "texliveFull"
libimobiledevice "pandoc"
ifuse "img2pdf"
]; "socat"
"libimobiledevice"
"ifuse"
] pkgs ++ [ inputs.osu-nixos pkgs.wineWowPackages.stableFull ];
serverPkgs = lib.attrVals [
#"package"
] pkgs;
in
{
options = {
stitchyconf = {
form = lib.mkOption {
default = "pc";
description = "Add moar packages I don't need";
type = lib.types.enum [ "pc" "handheld" "server" ];
};
artPkgs.enable = lib.mkEnableOption "Standard Linux Creative Suite";
};
};
nixpkgs.overlays = [ config = {
(final: prev: { environment.systemPackages = (lib.attrVals [
# Because Luck Smith hasn't released in 2 years "btop"
mutt-wizard = prev.mutt-wizard.overrideAttrs (old: { "eza"
src = prev.fetchFromGitHub { "fd"
owner = "LukeSmithxyz"; "git"
repo = "mutt-wizard"; "glib"
rev = "a8863a750a360bad6759f5f2c4df5d2001b31e18"; "gnumake"
hash = "sha256-8zPkzQ1Tt9t8G+uCKybBm4yMqfF2y4L7nmuaWWz9t6s="; "gnupg"
"pinentry"
"neofetch"
"wget"
"zoxide"
] pkgs)
++ (lib.optionals config.stitchyconf.artPkgs.enable artPkgs)
++ (lib.optionals (config.stitchyconf.form == "pc") pcPkgs)
++ (lib.optionals (config.stitchyconf.form == "handheld") handheldPkgs)
++ (lib.optionals (config.stitchyconf.form == "server") serverPkgs);
# To-do figure out how to section these off
programs = {
neovim = {
enable = true;
viAlias = true;
vimAlias = true;
defaultEditor = true;
configure = {
customRC = builtins.readFile ../config/nvim/init.vim;
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
nvim-lspconfig
nvim-cmp
cmp-nvim-lsp
luasnip
cmp_luasnip
tokyonight-nvim
vim-lsp-cxx-highlight
typst-vim
];
};
}; };
}); };
}) nix-ld.enable = true;
]; virt-manager.enable = true;
zsh.enable = true;
};
fonts.packages= with pkgs; [ nixpkgs.overlays = [
noto-fonts (final: prev: {
noto-fonts-emoji # Because Luck Smith hasn't released in 2 years
liberation_ttf mutt-wizard = prev.mutt-wizard.overrideAttrs (old: {
nerdfonts src = prev.fetchFromGitHub {
ipafont owner = "LukeSmithxyz";
]; repo = "mutt-wizard";
rev = "a8863a750a360bad6759f5f2c4df5d2001b31e18";
hash = "sha256-8zPkzQ1Tt9t8G+uCKybBm4yMqfF2y4L7nmuaWWz9t6s=";
};
});
})
];
fonts.packages = lib.attrVals [
"noto-fonts"
"noto-fonts-emoji"
"liberation_ttf"
"nerdfonts"
"ipafont"
] pkgs;
};
} }

10
users/default.nix Normal file
View file

@ -0,0 +1,10 @@
{ config, ...}:
{
config = {
users = {
mutableUsers = false;
users.root.initialHashedPassword = "!";
};
};
}

View file

@ -1,6 +1,7 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
imports = [ ../default.nix ];
users.users.nyadmin = { users.users.nyadmin = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.zsh; shell = pkgs.zsh;

View file

@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
imports = [ ../default.nix ];
nixpkgs.config.allowUnfreePredicate = pkg: nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem ( lib.getName pkg) [ builtins.elem ( lib.getName pkg) [
"osu-lazer" "osu-lazer"
@ -12,15 +12,15 @@
"nvidia-settings" "nvidia-settings"
"cudatoolkit" "cudatoolkit"
]; ];
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
};
hardware.steam-hardware.enable = true;
programs = { programs = {
firefox.enable = true;
hyprland.enable = true; hyprland.enable = true;
openvpn3.enable = true; openvpn3.enable = true;
steam = {
enable = true;
remotePlay.openFirewall = true;
};
}; };
services = { services = {
@ -43,8 +43,6 @@
security.pam.services.swaylock = {}; security.pam.services.swaylock = {};
hardware.bluetooth.enable = true;
users.users.stitchynyan = { users.users.stitchynyan = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.zsh; shell = pkgs.zsh;

View file

@ -1,5 +1,3 @@
{ config, { config,
nixosConfig, nixosConfig,
pkgs, pkgs,
@ -7,139 +5,139 @@
inputs, inputs,
home-manager, home-manager,
... }: ... }:
let
handheldPkgs = lib.attrVals [
"fluffychat"
] pkgs;
pcPkgs = lib.attrVals [
"activitywatch"
"dunst"
"foot"
"grim"
"imv"
"isync"
"kitty"
"hunspell"
"hyprpaper"
"libreoffice"
"librewolf"
"lynx"
"mpv"
"msmtp"
"mupdf"
"neomutt"
"networkmanagerapplet"
"nheko"
"notmuch"
"okular"
"pavucontrol"
"pass"
"playerctl"
"prismlauncher"
"qt5ct"
"qt6ct"
"slurp"
"swaylock-effects"
"wofi"
] pkgs ++ [ pkgs.hunspellDicts.en_US ];
in
{ {
options = {
imports = [
#inputs.nix-index-db.hmModules.nix-index
];
home.packages = with pkgs; [
steam
networkmanagerapplet
activitywatch
ngspice
hugo
kicad
okular
mupdf
libreoffice
hunspell
hunspellDicts.en_US
cider
foot
prismlauncher
firefox
librewolf
neomutt
dunst
pass
isync
msmtp
notmuch
kitty
lynx
playerctl
nheko
hyprpaper
xdg-desktop-portal-hyprland
pavucontrol
slurp
grim
wofi
imv
swaylock-effects
qt5ct
qt6ct
mpv
#steamvr?
procps
usbutils
(python311.withPackages (lib.attrVals ["sympy" "matplotlib"]))
(octaveFull.withPackages (lib.attrVals ["symbolic"]))
];
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
}; };
config = {
home.packages = with pkgs; [
cider
ngspice
hugo
kicad
#steamvr?
procps
usbutils
(python311.withPackages (lib.attrVals ["sympy" "matplotlib"]))
(octaveFull.withPackages (lib.attrVals ["symbolic"]))
]
++ (lib.optionals (nixosConfig.stitchyconf.form == "handheld") handheldPkgs)
++ (lib.optionals (nixosConfig.stitchyconf.form == "pc") pcPkgs);
home.sessionVariables = { dconf.settings = {
FOO = "BAR"; "org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
}; uris = ["qemu:///system"];
#programs.hyprland.enable = true;
# hyprland.homeManagerModules.default
#wayland.windowManager.hyprland.enable = true;
home.file = {
".zshrc".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/zshrc";
};
xdg.configFile = {
"dunst" = {
source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/dunst";
recursive = true;
};
"eww" = {
source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/eww";
recursive = true;
};
"hypr" = {
source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/hypr";
recursive = true;
};
"swaylock" = {
source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/swaylock";
recursive = true;
};
};
systemd.user.services = {
mailsync = {
Unit = {
Description = "Syncs email";
After = [ "network-online.target" ];
}; };
Service = {
Type = "oneshot";
ExecStart = "${pkgs.mutt-wizard}/bin/mailsync";
Environment = [
"DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus"
"DISPLAY=:0"
"MBSYNCRC=/home/stitchynyan/.config/mbsync/config"
"PATH=$PATH:${lib.makeBinPath [ pkgs.busybox pkgs.cyrus-sasl-xoauth2 pkgs.gnupg pkgs.isync pkgs.notify pkgs.notmuch pkgs.pass pkgs.perl pkgs.python3 ]}"
"SASL_PATH=/run/current-system/sw/lib/sasl2"
"WAYLAND_DISPLAY=wayland-1"
];
};
Install.WantedBy = [ "default.target" ];
}; };
};
systemd.user.timers = { # To-Do Later
mailsync = { home.sessionVariables = {
Unit.Description = "Syncs email"; FOO = "BAR";
Timer = {
OnBootSec = "1min";
OnUnitActiveSec = "10min";
};
Install.WantedBy = [ "timers.target" ];
}; };
};
home.file = {
".zshrc".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/zshrc";
};
home.pointerCursor = { xdg.configFile = {
name = "phinger-cursors"; "dunst" = {
package = pkgs.phinger-cursors; source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/dunst";
gtk.enable = true; recursive = true;
size = 64; };
"eww" = {
source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/eww";
recursive = true;
};
"hypr" = {
source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/hypr";
recursive = true;
};
"swaylock" = {
source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/swaylock";
recursive = true;
};
};
systemd.user.services = {
mailsync = {
Unit = {
Description = "Syncs email";
After = [ "network-online.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${pkgs.mutt-wizard}/bin/mailsync";
Environment = [
"DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus"
"DISPLAY=:0"
"MBSYNCRC=/home/stitchynyan/.config/mbsync/config"
"PATH=$PATH:${lib.makeBinPath (lib.attrVals [ "busybox" "cyrus-sasl-xoauth2" "gnupg" "isync" "notify" "notmuch" "pass" "perl" "python3" ] pkgs)}"
"SASL_PATH=/run/current-system/sw/lib/sasl2"
"WAYLAND_DISPLAY=wayland-1"
];
};
Install.WantedBy = [ "default.target" ];
};
};
systemd.user.timers = {
mailsync = {
Unit.Description = "Syncs email";
Timer = {
OnBootSec = "1min";
OnUnitActiveSec = "10min";
};
Install.WantedBy = [ "timers.target" ];
};
};
home.pointerCursor = {
name = "phinger-cursors";
package = pkgs.phinger-cursors;
gtk.enable = true;
size = 64;
};
# Read the Docs before change
home.stateVersion = "23.05";
home.homeDirectory = "/home/stitchynyan";
}; };
# Read the Docs before change
home.stateVersion = "23.05";
home.homeDirectory = "/home/stitchynyan";
} }