Make a hosts folder for system and home, remove legacy.nix cause I never used it, change some comments

This commit is contained in:
Jimbo 2024-10-02 21:35:29 -04:00
parent 1a096662e1
commit d9469fc321
36 changed files with 380 additions and 402 deletions

View file

@ -50,44 +50,43 @@
look = import ./extras/look.nix;
ws = import ./extras/workspaces.nix;
# NixOS configuration entrypoint, use 'nixos-rebuild --flake .#your-hostname'
# NixOS config entrypoint, use 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
JimDesktop = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./system/desktop.nix
./system/hosts/JimDesktop/configuration.nix
];
};
JimServer = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./system/server.nix
./system/hosts/JimServer/configuration.nix
mailserver.nixosModule
];
};
JimPine = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./system/pinebook.nix
./system/hosts/JimPine/configuration.nix
hardware.nixosModules.pine64-pinebook-pro
];
};
JimLenovo = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./system/lenovo.nix
./system/hosts/JimLenovo/configuration.nix
];
};
};
# Standalone home-manager configuration
# Available through 'home-manager --flake .#your-username@your-hostname'
# Home-manager configuration, use 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"jimbo@JimDesktop" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/jimbo_desktop.nix
./home/hosts/JimDesktop/home.nix
nur.nixosModules.nur
];
};
@ -95,14 +94,14 @@
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/jimbo_server.nix
./home/hosts/JimServer/home.nix
];
};
"jimbo@JimPine" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.aarch64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/jimbo_pinebook.nix
./home/hosts/JimPine/home.nix
nur.nixosModules.nur
];
};
@ -110,16 +109,16 @@
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/jimbo_lenovo.nix
./home/hosts/JimLenovo/home.nix
nur.nixosModules.nur
];
};
# Derivation for ssh envrionments on other people's servers
"jimbo@SSH" = home-manager.lib.homeManagerConfiguration {
"jimbo@JimTerminal" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home/jimbo_ssh.nix
./home/hosts/JimTerminal/home.nix
];
};
};

View file

@ -0,0 +1,46 @@
{config, ...}: {
imports = [
# Common modules
./../../base.nix
./../../users/jimbo.nix
./../../utils/git.nix
# GUI Apps
./../../misc/guifiles.nix
./../../sway/sway.nix
./../../sway/swaylock.nix
./../../programs/gtk.nix
./../../programs/foot.nix
./../../programs/librewolf.nix
./../../programs/mangohud.nix
./../../programs/mpv.nix
./../../programs/obs.nix
./../../programs/pcmanfm-qt.nix
./../../programs/rofi.nix
./../../programs/swappy.nix
./../../programs/easyeffects.nix
./../../utils/ncmpcpp.nix
# Misc apps and tools
./../../misc/useful.nix
./../../misc/avtools.nix
./../../misc/filemanager.nix
./../../misc/production.nix
./../../misc/gaming.nix
./../../misc/xash3d.nix
#./../../misc/emulators.nix
#./../../misc/remotedesktop.nix
./../../misc/school.nix
./../../misc/variables.nix
# Services
./../../services/gnome-keyring.nix
./../../services/mako.nix
./../../services/udiskie.nix
];
# Symlinks
home.file = {
"VMs".source = config.lib.file.mkOutOfStoreSymlink "/etc/libvirt/VMs";
};
}

View file

@ -0,0 +1,39 @@
{
imports = [
# Common modules
./../../base.nix
./../../users/jimbo.nix
./../../utils/git.nix
# GUI Apps
./../../misc/guifiles.nix
./../../sway/sway.nix
./../../sway/swaylock.nix
./../../programs/gtk.nix
./../../programs/foot.nix
./../../programs/librewolf.nix
./../../programs/mangohud.nix
./../../programs/mpv.nix
./../../programs/obs.nix
./../../programs/pcmanfm-qt.nix
./../../programs/rofi.nix
./../../programs/swappy.nix
./../../programs/easyeffects.nix
./../../utils/ncmpcpp.nix
# Misc apps and tools
./../../misc/useful.nix
./../../misc/avtools.nix
./../../misc/filemanager.nix
./../../misc/gaming.nix
./../../misc/xash3d.nix
./../../misc/remotedesktop.nix
./../../misc/school.nix
./../../misc/variables.nix
# Services
./../../services/gnome-keyring.nix
./../../services/mako.nix
./../../services/udiskie.nix
];
}

View file

@ -0,0 +1,42 @@
{pkgs, outputs, ...}: {
imports = [
# Common modules
./../../base.nix
./../../users/jimbo.nix
./../../utils/git.nix
# GUI Apps
./../../misc/guifiles.nix
./../../sway/sway.nix
./../../sway/swaylock.nix
./../../programs/gtk.nix
./../../programs/foot.nix
./../../programs/librewolf.nix
./../../programs/mangohud.nix
./../../programs/mpv.nix
./../../programs/pcmanfm-qt.nix
./../../programs/rofi.nix
./../../programs/swappy.nix
./../../programs/easyeffects.nix
./../../utils/ncmpcpp.nix
# Misc apps and tools
./../../misc/useful.nix
./../../misc/avtools.nix
./../../misc/filemanager.nix
./../../misc/remotedesktop.nix
./../../misc/variables.nix
# Services
./../../services/gnome-keyring.nix
./../../services/mako.nix
./../../services/udiskie.nix
];
# Needed to make the speaker work
home.packages = with pkgs; [
alsa-utils
];
wayland.windowManager.sway.config.output.${outputs.displays.dI}.scale = "1.3";
}

View file

@ -0,0 +1,8 @@
{
imports = [
# Common modules
./../../base.nix
./../../users/jimbo.nix
./../../utils/git.nix
];
}

View file

@ -0,0 +1,14 @@
{
imports = [
# Common modules
./../../base.nix
./../../users/jimbo.nix
];
# Rebuild this entire system
programs.zsh = {
shellAliases = {
termswitch = "home-manager switch --flake ~/.home-manager/.#jimbo@JimTerminal --extra-experimental-features 'nix-command flakes'";
};
};
}

View file

@ -1,46 +0,0 @@
{config, ...}: {
imports = [
# Common modules
./home.nix
./users/jimbo.nix
./utils/git.nix
# GUI Apps
./misc/guifiles.nix
./sway/sway.nix
./sway/swaylock.nix
./programs/gtk.nix
./programs/foot.nix
./programs/librewolf.nix
./programs/mangohud.nix
./programs/mpv.nix
./programs/obs.nix
./programs/pcmanfm-qt.nix
./programs/rofi.nix
./programs/swappy.nix
./programs/easyeffects.nix
./utils/ncmpcpp.nix
# Misc apps and tools
./misc/useful.nix
./misc/avtools.nix
./misc/filemanager.nix
./misc/production.nix
./misc/gaming.nix
./misc/xash3d.nix
#./misc/emulators.nix
#./misc/remotedesktop.nix
./misc/school.nix
./misc/variables.nix
# Services
./services/gnome-keyring.nix
./services/mako.nix
./services/udiskie.nix
];
# Symlinks
home.file = {
"VMs".source = config.lib.file.mkOutOfStoreSymlink "/etc/libvirt/VMs";
};
}

View file

@ -1,39 +0,0 @@
{
imports = [
# Common modules
./home.nix
./users/jimbo.nix
./utils/git.nix
# GUI Apps
./misc/guifiles.nix
./sway/sway.nix
./sway/swaylock.nix
./programs/gtk.nix
./programs/foot.nix
./programs/librewolf.nix
./programs/mangohud.nix
./programs/mpv.nix
./programs/obs.nix
./programs/pcmanfm-qt.nix
./programs/rofi.nix
./programs/swappy.nix
./programs/easyeffects.nix
./utils/ncmpcpp.nix
# Misc apps and tools
./misc/useful.nix
./misc/avtools.nix
./misc/filemanager.nix
./misc/gaming.nix
./misc/xash3d.nix
./misc/remotedesktop.nix
./misc/school.nix
./misc/variables.nix
# Services
./services/gnome-keyring.nix
./services/mako.nix
./services/udiskie.nix
];
}

View file

@ -1,42 +0,0 @@
{pkgs, outputs, ...}: {
imports = [
# Common modules
./home.nix
./users/jimbo.nix
./utils/git.nix
# GUI Apps
./misc/guifiles.nix
./sway/sway.nix
./sway/swaylock.nix
./programs/gtk.nix
./programs/foot.nix
./programs/librewolf.nix
./programs/mangohud.nix
./programs/mpv.nix
./programs/pcmanfm-qt.nix
./programs/rofi.nix
./programs/swappy.nix
./programs/easyeffects.nix
./utils/ncmpcpp.nix
# Misc apps and tools
./misc/useful.nix
./misc/avtools.nix
./misc/filemanager.nix
./misc/remotedesktop.nix
./misc/variables.nix
# Services
./services/gnome-keyring.nix
./services/mako.nix
./services/udiskie.nix
];
# Needed to make the speaker work
home.packages = with pkgs; [
alsa-utils
];
wayland.windowManager.sway.config.output.${outputs.displays.dI}.scale = "1.3";
}

View file

@ -1,8 +0,0 @@
{
imports = [
# Common modules
./home.nix
./users/jimbo.nix
./utils/git.nix
];
}

View file

@ -1,14 +0,0 @@
{
imports = [
# Common modules
./home.nix
./users/jimbo.nix
];
# Rebuild this entire system
programs.zsh = {
shellAliases = {
sshswitch = "home-manager switch --flake ~/.home-manager/.#jimbo@SSH --extra-experimental-features 'nix-command flakes'";
};
};
}

View file

@ -27,6 +27,13 @@
# Hex color visualizer and color theme
nvim-colorizer-lua
vim-monokai-pro
# Discord RPC
vimsence
# Nerdtree
nerdtree
vim-nerdtree-syntax-highlight
];
extraConfig = ''
lua <<EOF
@ -96,6 +103,7 @@
nmap <C-x> :bnext<CR>
nmap <C-z> :bprev<CR>
nmap <C-w> :bd<CR>
nmap <C-a> :NERDTreeToggle
'';
};
}

View file

@ -14,10 +14,8 @@
outputs.overlays.finalprev
];
# Configure your nixpkgs instance
config = {
allowUnfree = true;
};
# Allow unfree apps
config.allowUnfree = true;
};
# Enable flakes and garbage collection

View file

@ -1,52 +0,0 @@
{
imports = [
# Base configs
./base.nix
# Import users and groups
./users/jimbo.nix
./users/groups.nix
# Desktop only
./desktop/misc.nix
./desktop/sway.nix
./desktop/greetd-sway.nix
./desktop/printing.nix
./desktop/gaming.nix
./desktop/pipewire.nix
./desktop/bluetooth.nix
./desktop/firewall.nix
./desktop/fonts.nix
./desktop/qt.nix
# Modules
./modules/security.nix
./modules/legacy.nix
# Hardware
./hardware/machines/desktop.nix
./hardware/systemdboot.nix
./hardware/opengl.nix
./hardware/filesystems.nix
./hardware/nvidia.nix
#./hardware/nouveau.nix
# Services
./services/openssh.nix
./services/gnome-keyring.nix
./services/qemukvm.nix
#./services/waydroid.nix
./services/udev.nix
./services/sunshine.nix
./services/mpd.nix
];
# Set hostname
networking.hostName = "JimDesktop";
# Force Electron to use Wayland
environment.sessionVariables.NIXOS_OZONE_WL = "1";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -1,6 +0,0 @@
{
# Forces the function keys to work right on Macbooks
boot.extraModprobeConfig = ''
options hid_apple fnmode=2
'';
}

View file

@ -0,0 +1,51 @@
{
imports = [
# Base configs
./../../base.nix
# Import users and groups
./../../users/jimbo.nix
./../../users/groups.nix
# Desktop
./../../desktop/misc.nix
./../../desktop/sway.nix
./../../desktop/greetd-sway.nix
./../../desktop/printing.nix
./../../desktop/gaming.nix
./../../desktop/pipewire.nix
./../../desktop/bluetooth.nix
./../../desktop/firewall.nix
./../../desktop/fonts.nix
./../../desktop/qt.nix
# Modules
./../../modules/security.nix
# Hardware
./hardware-configuration.nix
./../../modules/systemdboot.nix
./../../modules/opengl.nix
./../../modules/filesystems.nix
./../../modules/nvidia.nix
#./../../modules/nouveau.nix
# Services
./../../services/openssh.nix
./../../services/gnome-keyring.nix
./../../services/qemukvm.nix
./../../services/udev.nix
./../../services/sunshine.nix
./../../services/mpd.nix
#./../../services/waydroid.nix
];
# Set hostname
networking.hostName = "JimDesktop";
# Force Electron to use Wayland
environment.sessionVariables.NIXOS_OZONE_WL = "1";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,45 @@
{
imports = [
# Base configs
./../../base.nix
# Import users and groups
./../../users/jimbo.nix
./../../users/groups.nix
# Desktop
./../../desktop/misc.nix
./../../desktop/sway.nix
./../../desktop/greetd-sway.nix
./../../desktop/printing.nix
./../../desktop/gaming.nix
./../../desktop/pipewire.nix
./../../desktop/bluetooth.nix
./../../desktop/firewall.nix
./../../desktop/fonts.nix
./../../desktop/qt.nix
# Laptop/Portable only
./../../modules/wireless.nix
# Modules
./../../modules/security.nix
# Hardware
./hardware-configuration.nix
./../../modules/systemdboot.nix
./../../modules/opengl.nix
# Services
./../../services/openssh.nix
./../../services/gnome-keyring.nix
./../../services/udev.nix
./../../services/mpd.nix
];
# Set hostname
networking.hostName = "JimLenovo";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,49 @@
{lib, outputs, ...}: {
imports = [
# Base configs
./../../base.nix
# Import users and groups
./../../users/jimbo.nix
./../../users/groups.nix
# Desktop
./../../desktop/misc.nix
./../../desktop/sway.nix
./../../desktop/greetd-sway.nix
./../../desktop/printing.nix
./../../desktop/pipewire.nix
./../../desktop/bluetooth.nix
./../../desktop/firewall.nix
./../../desktop/fonts.nix
./../../desktop/qt.nix
./../../desktop/wireguard.nix
# Modules
./../../modules/security.nix
# Hardware
./hardware-configuration.nix
./../../modules/extlinux.nix
./../../modules/opengl.nix
./../../modules/filesystems.nix
./../../modules/wireless.nix
# Services
./../../services/openssh.nix
./../../services/gnome-keyring.nix
./../../services/mpd.nix
];
# Set hostname
networking.hostName = "JimPine";
# Disable 32 bit graphics
hardware.opengl.driSupport32Bit = lib.mkForce false;
# Set the VPN IP per machine
networking.wireguard.interfaces."${outputs.ips.wgInt}".ips = [ "${outputs.ips.wgSpan}.17/24" ];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,63 @@
{
imports = [
# Base configs
./../../base.nix
# Import users and groups
./../../users/jimbo.nix
./../../users/nextcloud.nix
./../../users/nginx.nix
./../../users/liquidsoap.nix
./../../users/groups.nix
# Modules
./../../modules/security.nix
# Hardware
./hardware-configuration.nix
./../../hardware/systemdboot.nix
# Services
./../../services/openssh.nix
./../../server/acme.nix
./../../server/ddclient.nix
./../../server/icecast.nix
./../../server/firewall.nix
./../../server/forgejo.nix
./../../server/mailserver.nix
./../../server/mariadb.nix
./../../server/nginx.nix
./../../server/owncast.nix
./../../server/photoprism.nix
./../../server/minecraft
./../../server/vaultwarden.nix
./../../server/transmission.nix
./../../server/wireguard.nix
./../../server/misc.nix
# File server
./../../server/nextcloud.nix
./../../server/nfs.nix
./../../server/samba.nix
# Matrix
./../../server/synapse.nix
./../../server/element.nix
./../../server/coturn.nix
./../../server/matrix-discord.nix
# Federation
./../../server/lemmy.nix
./../../server/mastodon.nix
./../../server/pixelfed.nix
];
# Set custom openssh port
services.openssh.ports = [ 2222 ];
# Set hostname
networking.hostName = "JimServer";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -1,46 +0,0 @@
{
imports = [
# Base configs
./base.nix
# Import users and groups
./users/jimbo.nix
./users/groups.nix
# Desktop only
./desktop/misc.nix
./desktop/sway.nix
./desktop/greetd-sway.nix
./desktop/printing.nix
./desktop/gaming.nix
./desktop/pipewire.nix
./desktop/bluetooth.nix
./desktop/firewall.nix
./desktop/fonts.nix
./desktop/qt.nix
# Laptop/Portable only
./hardware/wireless.nix
# Modules
./modules/security.nix
./modules/legacy.nix
# Hardware
./hardware/machines/lenovo.nix
./hardware/systemdboot.nix
./hardware/opengl.nix
# Services
./services/openssh.nix
./services/gnome-keyring.nix
./services/udev.nix
./services/mpd.nix
];
# Set hostname
networking.hostName = "JimLenovo";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -1,14 +0,0 @@
{config, inputs, lib, ...}: {
# This will add each flake input as a registry to make nix commands consistent with your flake
nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
# This will add your inputs to the system's legacy channels making legacy nix commands consistent
nix.nixPath = ["/etc/nix/path"];
environment.etc =
lib.mapAttrs'
(name: value: {
name = "nix/path/${name}";
value.source = value.flake;
})
config.nix.registry;
}

View file

@ -5,8 +5,7 @@
doas = {
enable = true;
extraRules = [
# Give wheel root access, allow persistant session
{
{ # Give wheel root access
groups = ["wheel"];
keepEnv = true;
persist = true;

View file

@ -1,52 +0,0 @@
{lib, outputs, ...}: {
imports = [
# Base configs
./base.nix
# Import users and groups
./users/jimbo.nix
./users/groups.nix
# Desktop
./desktop/misc.nix
./desktop/sway.nix
./desktop/greetd-sway.nix
./desktop/printing.nix
./desktop/pipewire.nix
./desktop/bluetooth.nix
./desktop/firewall.nix
./desktop/fonts.nix
./desktop/qt.nix
./desktop/wireguard.nix
# Laptop/Portable
./hardware/wireless.nix
# Modules
./modules/security.nix
./modules/legacy.nix
# Hardware
./hardware/machines/pinebook.nix
./hardware/extlinux.nix
./hardware/opengl.nix
./hardware/filesystems.nix
# Services
./services/openssh.nix
./services/gnome-keyring.nix
./services/mpd.nix
];
# Set hostname
networking.hostName = "JimPine";
# Disable 32 bit graphics
hardware.opengl.driSupport32Bit = lib.mkForce false;
# Set the VPN IP per machine
networking.wireguard.interfaces."${outputs.ips.wgInt}".ips = [ "${outputs.ips.wgSpan}.17/24" ];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -1,64 +0,0 @@
{
imports = [
# Base configs
./base.nix
# Import users and groups
./users/jimbo.nix
./users/nextcloud.nix
./users/nginx.nix
./users/liquidsoap.nix
./users/groups.nix
# Modules
./modules/security.nix
./modules/legacy.nix
# Hardware
./hardware/machines/server.nix
./hardware/systemdboot.nix
# Services
./services/openssh.nix
./server/acme.nix
./server/ddclient.nix
./server/icecast.nix
./server/firewall.nix
./server/forgejo.nix
./server/mailserver.nix
./server/mariadb.nix
./server/nginx.nix
./server/owncast.nix
./server/photoprism.nix
./server/minecraft
./server/vaultwarden.nix
./server/transmission.nix
./server/wireguard.nix
./server/misc.nix
# File server
./server/nextcloud.nix
./server/nfs.nix
./server/samba.nix
# Matrix
./server/synapse.nix
./server/element.nix
./server/coturn.nix
./server/matrix-discord.nix
# Federation
./server/lemmy.nix
./server/mastodon.nix
./server/pixelfed.nix
];
# Set custom openssh port
services.openssh.ports = [ 2222 ];
# Set hostname
networking.hostName = "JimServer";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}