restructured modules, toggling them, overlays
This commit is contained in:
19
modules/apps.nix
Normal file
19
modules/apps.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./apps/art.nix
|
||||
./apps/dictionaries.nix
|
||||
./apps/fonts.nix
|
||||
./apps/gaming.nix
|
||||
./apps/internet.nix
|
||||
./apps/office.nix
|
||||
];
|
||||
myArt.enable = lib.mkDefault false;
|
||||
myGameDev.enable = lib.mkDefault false;
|
||||
# myDictionaries.enable = lib.mkDefault false;
|
||||
# myFonts.enable = lib.mkDefault false;
|
||||
myGaming.enable = lib.mkDefault false;
|
||||
# myInternet.enable = lib.mkDefault false;
|
||||
# myOffice.enable = lib.mkDefault false;
|
||||
}
|
||||
25
modules/apps/art.nix
Normal file
25
modules/apps/art.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ config, pkgs, lib, unstable, ... }:
|
||||
|
||||
{
|
||||
options = {
|
||||
myArt.enable = lib.mkEnableOption "enable";
|
||||
myGameDev.enable = lib.mkEnableOption "enable";
|
||||
};
|
||||
config = lib.mkIf config.myArt.enable {
|
||||
users.users.jawz.packages = with pkgs;
|
||||
([
|
||||
gimp # the coolest bestest art program to never exist
|
||||
krita # art to your heart desire!
|
||||
mypaint # not the best art program
|
||||
mypaint-brushes # but it's got some
|
||||
mypaint-brushes1 # nice damn brushes
|
||||
# drawpile # arty party with friends!!
|
||||
pureref # create inspiration/reference boards
|
||||
blender # cgi animation and sculpting
|
||||
]) ++ (if config.myGameDev.enable then [
|
||||
godot_4 # game development
|
||||
unstable.gdtoolkit # gdscript language server
|
||||
] else
|
||||
[ ]);
|
||||
};
|
||||
}
|
||||
11
modules/apps/dictionaries.nix
Normal file
11
modules/apps/dictionaries.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
users.users.jawz.packages = with pkgs; ([
|
||||
hunspell
|
||||
hunspellDicts.it_IT
|
||||
hunspellDicts.es_MX
|
||||
hunspellDicts.es_ES
|
||||
hunspellDicts.en_CA-large
|
||||
]);
|
||||
}
|
||||
10
modules/apps/fonts.nix
Normal file
10
modules/apps/fonts.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
users.users.jawz.packages = with pkgs; ([
|
||||
(nerdfonts.override {
|
||||
fonts = [ "CascadiaCode" "ComicShannsMono" "Iosevka" ];
|
||||
})
|
||||
symbola
|
||||
]);
|
||||
}
|
||||
38
modules/apps/gaming.nix
Normal file
38
modules/apps/gaming.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
options = { myGaming.enable = lib.mkEnableOption "enable"; };
|
||||
config = lib.mkIf config.myGaming.enable {
|
||||
programs = {
|
||||
steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
};
|
||||
};
|
||||
users.users.jawz.packages = with pkgs; ([
|
||||
(lutris.override {
|
||||
extraPkgs = pkgs: [
|
||||
winetricks
|
||||
wine64Packages.stable
|
||||
wineWowPackages.stable
|
||||
];
|
||||
})
|
||||
cartridges # games launcher
|
||||
heroic # install epic games
|
||||
gamemode # optimizes linux to have better gaming performance
|
||||
# grapejuice # roblox manager
|
||||
# minecraft # minecraft official launcher
|
||||
protonup-qt # update proton-ge
|
||||
# ns-usbloader # load games into my switch
|
||||
|
||||
# emulators
|
||||
rpcs3 # ps3 emulator
|
||||
pcsx2 # ps2 emulator
|
||||
cemu # wii u emulator
|
||||
dolphin-emu # wii emulator
|
||||
citra-nightly # 3Ds emulator
|
||||
snes9x-gtk # snes emulator
|
||||
]);
|
||||
};
|
||||
}
|
||||
27
modules/apps/internet.nix
Normal file
27
modules/apps/internet.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
geary.enable = true;
|
||||
firefox = {
|
||||
enable = true;
|
||||
languagePacks = [ "en-CA" "es-MX" "it" ];
|
||||
};
|
||||
};
|
||||
services = { psd.enable = true; };
|
||||
users.users.jawz.packages = with pkgs; ([
|
||||
nextcloud-client # self-hosted google-drive alternative
|
||||
fragments # beautiful torrent client
|
||||
protonmail-bridge # bridge for protonmail
|
||||
tor-browser-bundle-bin # dark web, so dark!
|
||||
chromium # web browser with spyware included
|
||||
telegram-desktop # furry chat
|
||||
nicotine-plus # remember Ares?
|
||||
vesktop
|
||||
(pkgs.discord.override {
|
||||
withOpenASAR = true;
|
||||
# withVencord = true;
|
||||
})
|
||||
# hugo # website engine
|
||||
]);
|
||||
}
|
||||
13
modules/apps/office.nix
Normal file
13
modules/apps/office.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
users.users.jawz.packages = with pkgs; ([
|
||||
libreoffice # office, but based
|
||||
calibre # ugly af eBook library manager
|
||||
newsflash # feed reader, syncs with nextcloud
|
||||
furtherance # I packaged this one tehee track time utility
|
||||
# foliate # gtk eBook reader
|
||||
# wike # gtk wikipedia wow!
|
||||
# denaro # manage your finances
|
||||
]);
|
||||
}
|
||||
55
modules/bundles/users.nix
Normal file
55
modules/bundles/users.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ lib, config, inputs, outputs, myLib, pkgs, ... }:
|
||||
let cfg = config.myNixOS;
|
||||
in {
|
||||
options.myNixOS.home-users = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule {
|
||||
options = {
|
||||
userConfig = lib.mkOption {
|
||||
default = ./../../home-manager/work.nix;
|
||||
example = "DP-1";
|
||||
};
|
||||
userSettings = lib.mkOption {
|
||||
default = { };
|
||||
example = "{}";
|
||||
};
|
||||
};
|
||||
});
|
||||
default = { };
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.zsh.enable = true;
|
||||
|
||||
programs.hyprland.enable = cfg.sharedSettings.hyprland.enable;
|
||||
|
||||
services.xserver = lib.mkIf cfg.sharedSettings.hyprland.enable {
|
||||
displayManager = { defaultSession = "hyprland"; };
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
inherit myLib;
|
||||
outputs = inputs.self.outputs;
|
||||
};
|
||||
|
||||
users = builtins.mapAttrs (name: user:
|
||||
{ ... }: {
|
||||
imports =
|
||||
[ (import user.userConfig) outputs.homeManagerModules.default ];
|
||||
}) (config.myNixOS.home-users);
|
||||
};
|
||||
|
||||
users.users = builtins.mapAttrs (name: user:
|
||||
{
|
||||
isNormalUser = true;
|
||||
initialPassword = "12345";
|
||||
description = "";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [ "libvirtd" "networkmanager" "wheel" ];
|
||||
} // user.userSettings) (config.myNixOS.home-users);
|
||||
};
|
||||
}
|
||||
40
modules/default.nix
Normal file
40
modules/default.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{ pkgs, config, lib, inputs, outputs, myLib, ... }:
|
||||
let
|
||||
cfg = config.myNixOS;
|
||||
|
||||
features = myLib.extendModules (name: {
|
||||
extraOptions = {
|
||||
myNixOS.${name}.enable =
|
||||
lib.mkEnableOption "enable my ${name} configuration";
|
||||
};
|
||||
configExtension = config: (lib.mkIf cfg.${name}.enable config);
|
||||
}) (myLib.filesIn ./features);
|
||||
|
||||
bundles = myLib.extendModules (name: {
|
||||
extraOptions = {
|
||||
myNixOS.bundles.${name}.enable =
|
||||
lib.mkEnableOption "enable ${name} module bundle";
|
||||
};
|
||||
configExtension = config: (lib.mkIf cfg.bundles.${name}.enable config);
|
||||
}) (myLib.filesIn ./bundles);
|
||||
|
||||
services = myLib.extendModules (name: {
|
||||
extraOptions = {
|
||||
myNixOS.services.${name}.enable =
|
||||
lib.mkEnableOption "enable ${name} service";
|
||||
};
|
||||
configExtension = config: (lib.mkIf cfg.services.${name}.enable config);
|
||||
}) (myLib.filesIn ./services);
|
||||
|
||||
in {
|
||||
imports = [ inputs.home-manager.nixosModules.home-manager ] ++ features
|
||||
++ bundles ++ services;
|
||||
options.myNixOS = { sharedSettings = { }; };
|
||||
config = {
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
nixpkgs = {
|
||||
hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
8
modules/dev.nix
Normal file
8
modules/dev.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ./dev/haskell.nix ./dev/nix.nix ./dev/python.nix ];
|
||||
myHaskell.enable = lib.mkDefault false;
|
||||
myNix.enable = lib.mkDefault true;
|
||||
myPython.enable = lib.mkDefault false;
|
||||
}
|
||||
11
modules/dev/haskell.nix
Normal file
11
modules/dev/haskell.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
options = { myHaskell.enable = lib.mkEnableOption "enable"; };
|
||||
config = lib.mkIf config.myHaskell.enable {
|
||||
users.users.jawz.packages = with pkgs; ([
|
||||
ghc # compiler
|
||||
haskell-language-server # lsp
|
||||
]);
|
||||
};
|
||||
}
|
||||
13
modules/dev/nix.nix
Normal file
13
modules/dev/nix.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
options = { myNix.enable = lib.mkEnableOption "enable"; };
|
||||
config = lib.mkIf config.myNix.enable {
|
||||
users.users.jawz.packages = with pkgs; ([
|
||||
expect # keep color when nom'ing
|
||||
nix-output-monitor # autistic nix builds
|
||||
nixfmt # linting
|
||||
cachix # why spend time compiling?
|
||||
]);
|
||||
};
|
||||
}
|
||||
23
modules/dev/python.nix
Normal file
23
modules/dev/python.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
options = { myPython.enable = lib.mkEnableOption "enable"; };
|
||||
config = lib.mkIf config.myPython.enable {
|
||||
users.users.jawz.packages = with pkgs; ([
|
||||
pipenv # python development workflow for humans
|
||||
(python3.withPackages (ps:
|
||||
with ps; [
|
||||
# nose # testing and running python scripts
|
||||
# poetry # dependency management made easy
|
||||
# pytest # framework for writing tests
|
||||
black # Python code formatter
|
||||
editorconfig # follow rules of contributin
|
||||
flake8 # wraper for pyflakes, pycodestyle and mccabe
|
||||
isort # sort Python imports
|
||||
pyflakes # checks source code for errors
|
||||
pylint # bug and style checker for python
|
||||
speedtest-cli # check internet speed from the comand line
|
||||
]))
|
||||
]);
|
||||
};
|
||||
}
|
||||
18
modules/features/cachix.nix
Normal file
18
modules/features/cachix.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
nix.settings = {
|
||||
substituters = [
|
||||
"https://nix-gaming.cachix.org"
|
||||
"https://nixpkgs-python.cachix.org"
|
||||
"https://devenv.cachix.org"
|
||||
"https://cuda-maintainers.cachix.org"
|
||||
"https://ai.cachix.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
||||
"nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU="
|
||||
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
|
||||
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
|
||||
"ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="
|
||||
];
|
||||
};
|
||||
}
|
||||
47
modules/services/example.nix
Normal file
47
modules/services/example.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
with lib; {
|
||||
users.users.satisfactory = {
|
||||
home = "/var/lib/satisfactory";
|
||||
createHome = true;
|
||||
isSystemUser = true;
|
||||
group = "satisfactory";
|
||||
};
|
||||
users.groups.satisfactory = { };
|
||||
|
||||
# boot.kernel.sysctl."net.ipv6.conf.eth0.disable_ipv6" = true;
|
||||
networking.enableIPv6 = false;
|
||||
|
||||
# nixpkgs.config.allowUnfree = true;
|
||||
#
|
||||
networking = {
|
||||
firewall = {
|
||||
allowedUDPPorts = [ 15777 15000 7777 27015 ];
|
||||
allowedUDPPortRanges = [{
|
||||
from = 27031;
|
||||
to = 27036;
|
||||
}];
|
||||
allowedTCPPorts = [ 27015 27036 ];
|
||||
};
|
||||
};
|
||||
|
||||
# -beta experimental \
|
||||
systemd.services.satisfactory = {
|
||||
preStart = ''
|
||||
${pkgs.steamcmd}/bin/steamcmd \
|
||||
+force_install_dir /var/lib/satisfactory/SatisfactoryServer \
|
||||
+login anonymous \
|
||||
+app_update 1690800 \
|
||||
validate \
|
||||
+quit
|
||||
'';
|
||||
script = ''
|
||||
${pkgs.steam-run}/bin/steam-run /var/lib/satisfactory/SatisfactoryServer/FactoryServer.sh -DisablePacketRouting
|
||||
'';
|
||||
serviceConfig = {
|
||||
Nice = "-5";
|
||||
Restart = "always";
|
||||
User = "satisfactory";
|
||||
WorkingDirectory = "/var/lib/satisfactory";
|
||||
};
|
||||
};
|
||||
}
|
||||
5
modules/template.nix
Normal file
5
modules/template.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
users.users.jawz.packages = with pkgs; ([ ]);
|
||||
}
|
||||
Reference in New Issue
Block a user