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@{
nixpkgs,
home-manager,
hyprland,
eww,
osu-nixos,
...
} : {
@ -17,7 +15,7 @@
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
./packages/default.nix
./hosts/malachite/default.nix
./users/stitchynyan/default.nix
@ -35,7 +33,7 @@
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
./packages/default.nix
./hosts/lappy/default.nix
./users/stitchynyan/default.nix
@ -53,7 +51,7 @@
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
./packages/default.nix
./hosts/gemini/default.nix
./users/nyadmin/default.nix
@ -70,17 +68,17 @@
};
inputs = {
mobile-nixos = {
url = "github:nixos/mobile-nixos";
flake = false;
};
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "github:hyprwm/Hyprland";
eww.url = "github:elkowar/eww";
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 =
[ # Include the results of the hardware scan.
[
./hardware-configuration.nix
../default.nix
];
networking.hostName = "gemini";

View file

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

View file

@ -64,12 +64,16 @@ in {
imports =
[
./hardware-configuration.nix
../default.nix
];
virtualisation.libvirtd.hooks.qemu = {
passthrough = "${passthrough}";
};
virtualisation.libvirtd.enable = true;
hardware = {
steam-hardware.enable = true;
};
networking.hostName = "malachite";
@ -77,5 +81,4 @@ in {
# Read the Docs before Changing
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,45 +1,104 @@
{ config, lib, pkgs, inputs, ... }:
{ pkgs, inputs, ... }: {
imports = [
./art.nix
#./tools.nix
];
environment.systemPackages = with pkgs; [
let
artPkgs = lib.attrVals [
#"armorpaint"
"blender"
"gimp"
"inkscape"
"krita"
#"prusa-slicer"
] pkgs;
handheldPkgs = lib.attrVals [
"chatty"
"gnome-text-editor"
"megapixels"
] pkgs;
pcPkgs = lib.attrVals [
#osu-lazer
inputs.osu-nixos
pinentry
wget
python3
cyrus-sasl-xoauth2
libnotify
networkmanager-openvpn
eza
fd
git
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
"dracula-theme"
"wl-clipboard"
"brightnessctl"
"powertop"
"easyeffects"
"mutt-wizard"
"gamescope"
"cyrus-sasl-xoauth2"
"libnotify"
"networkmanager-openvpn"
# temporary home manager things
inotify-tools
eww
jq
socat
libimobiledevice
ifuse
"inotify-tools"
"eww"
"jq"
"texliveFull"
"pandoc"
"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";
};
};
config = {
environment.systemPackages = (lib.attrVals [
"btop"
"eza"
"fd"
"git"
"glib"
"gnumake"
"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;
};
nixpkgs.overlays = [
(final: prev: {
@ -55,12 +114,12 @@
})
];
fonts.packages= with pkgs; [
noto-fonts
noto-fonts-emoji
liberation_ttf
nerdfonts
ipafont
];
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, ... }:
{
imports = [ ../default.nix ];
users.users.nyadmin = {
isNormalUser = true;
shell = pkgs.zsh;

View file

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

View file

@ -1,5 +1,3 @@
{ config,
nixosConfig,
pkgs,
@ -7,56 +5,60 @@
inputs,
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
];
config = {
home.packages = with pkgs; [
steam
networkmanagerapplet
activitywatch
cider
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"]))
];
]
++ (lib.optionals (nixosConfig.stitchyconf.form == "handheld") handheldPkgs)
++ (lib.optionals (nixosConfig.stitchyconf.form == "pc") pcPkgs);
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
@ -65,16 +67,12 @@
};
};
# To-Do Later
home.sessionVariables = {
FOO = "BAR";
};
#programs.hyprland.enable = true;
# hyprland.homeManagerModules.default
#wayland.windowManager.hyprland.enable = true;
home.file = {
".zshrc".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/zshrc";
};
@ -111,7 +109,7 @@
"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 ]}"
"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"
];
@ -131,7 +129,6 @@
};
};
home.pointerCursor = {
name = "phinger-cursors";
package = pkgs.phinger-cursors;
@ -142,4 +139,5 @@
# Read the Docs before change
home.stateVersion = "23.05";
home.homeDirectory = "/home/stitchynyan";
};
}